-
Notifications
You must be signed in to change notification settings - Fork 10
/
README.chromium
61 lines (55 loc) · 3.14 KB
/
README.chromium
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
The README below was taken from a snapshot of the Chromium project at:
svn - Revision 122769: /trunk/src/chrome/installer/mac/third_party/bsdiff
For information specific to the fork as implemented in this project, see the
main README file.
---
Name: BSDiff
URL: http://www.daemonology.net/bsdiff/
Source URL: http://www.daemonology.net/bsdiff/bsdiff-4.3.tar.gz
Version: 4.3
License: BSD
License File: LICENSE
Description:
Binary diff/patch utility. There are other copies of BSDiff in the Chromium
repository, but they're all different. The other copies are based on Mozilla's
fork of BSDiff, which serves a different set of needs. Relative to upstream
BSDiff, Mozilla's version removes all compression, adds a CRC-32 check of the
original file, replaces the custom off_t encoding with signed 32-bit
big-endian integers, and contains a total reorganization of the code. The
version in this directory contains no Mozilla code and builds directly on the
upstream version. It retains and enhances the compression, uses SHA1 to check
both the original file and the patched file, uses a different off_t encoding
more compatible with the original, and involves minimal changes to the
original code.
Theoretically, a hash of the original file should be enough to guarantee data
integrity, but in the event of algorithmic or programming bugs or other
unexpected conditions, a hash of the patched file provides a better guarantee.
This implementation now checks the integrity of both the original and the
patched files. SHA1, rather than CRC-32, is used to minimize the likelihood
that an original file that has been intentionally tampered with will produce
an altered patched file without being detected.
Local Modifications:
- Added LICENSE file by copying the license block from bsdiff.c and
bspatch.c.
- The following modifications are relative to the original unpatched version,
checked in to the Chromium repository at r49280.
- Created goobsdiff.gyp for GYP build system integration.
- Renamed bsdiff.c to goobsdiff.c and bspatch.c to goobspatch.c.
- Added sha1_adapter.cc, sha1_adapter.h, and empty.cc to facilitate hashing.
- Added #include <sys/types.h> to goobspatch.c so that it compiles. (Oops!)
- Changed the magic number in the header from BSDIFF40 to BSDIFF4G.
- Expanded the header to include SHA1 hashes of the original and new files,
and added hash checks to the patcher.
- Expanded the header to include the lengths of the control, diff, and extra
blocks in the patch file, and added patch file length validation to the
patcher.
- Replaced custom off_t encoding with signed 64-bit little-endian integers.
- The control, diff, and extra blocks can be compressed with bzip2, gzip, or
xz/lzma2, or left uncompressed, independently of one another, depending on
which is smallest. This often results in a net reduction in patch size of
about 3%-5%.
- Error messages in the patcher are slightly more descriptive.
- The patcher treats a few more unexpected read cases as errors than it did
previously. This will theoretically cause it to exit with an error instead
of sitting in a busy loop or crashing when certain malformatted patch files
are provided.