dc5d7972899ec1ab38a3b3a2aa424802b05ea4b1 |
|
02-Mar-2018 |
Amin Hassani <ahassani@google.com> |
Add missing invalid distance check In the puffin spec, we defined the distance on the wire to be zero based ([1..32768] on deflate RFC). But I missed it in the implementation and stored non-zero based distances. However, this is not a bug and since we have not shipped it yet, it is possible to change. Another change include, adding proper checks for finding invalid copy length or distance. Also more unittests for invalid copy length/distance values are added. Lack of these checks were found by running puffin_fuzzer on cluster fuzz. Bug: crbug.com/817733 Bug: crbug.com/817686 Test: unittests Test: test_corpus.py Change-Id: I38bf630904d7996a3c4f15919960517d26520987
/external/puffin/src/puff_io_unittest.cc
|
7074da6508f1ab7cb860342e2434c5f5804bafbf |
|
01-Oct-2017 |
Amin Hassani <ahassani@google.com> |
puffin: Introduce deflate bit addressing This CL changes the addressing scheme of deflate blocks from Byte to Bit. This CL allows breaking a given deflate stream into its subblocks. A proper function is added to located the deflate subblocks from a deflate stream. Proper unittests is added to check for new functionality and its corner cases. BUG=chromium:768505 TEST=unittests pass; brillo_update_payload {generate|verify} pass; Change-Id: I9e953d0b7cafca417c09ec56a49ea2e93f027304 Reviewed-on: https://chromium-review.googlesource.com/703681 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
/external/puffin/src/puff_io_unittest.cc
|
26bcfdd46ee56055b61b6e8f23f0ff57626a95a7 |
|
30-Sep-2017 |
Amin Hassani <ahassani@google.com> |
puffin: Use empty puff writer There was a piece of code (Puffer.Puff) that was only being used in puffdiff but it was also being shipped with puffpatch too. That code figures out the size of the puff by puffing into a buffer, There was two problem with that. First, the code shouldn't have been mixed with the client code, and second, it needs retry of the Puffer.PuffDeflate to do the puffing again if the buffer size was small. This patch fixes that problem by removing that function and adding checks in the Puffer.PuffDeflate to not check for boundary or write into the buffer if the given buffer size was nullptr. This way we can create a PuffWriter with null buffer that can count the number of bytes needed for a puff buffer. Along with, all PuffDeflate and HuffDeflate functions based on the byte array buffer where removed and equivalent functions based on BitReader/BitWriter/PuffReader/PuffWriter were made public. Additionally this CL, adds a new function for finding the location of Puffs using the aforementioned functionality in the utils.cc (which will only be in used in puffdiff). Furthermore, this CL fixes a long undiscovered bug, for when the length of the literals was exactly 127. The PuffWriter would write a wrong value to the output and this would cause problem. The unittests for this bug was also added. Since this bug was in PuffWriter.cc and most of the changes are in PuffWriter.cc this was a good candidate for fixing this bug. BUG=chromium:768505 TEST=unittests pass; brillo_update_payload {generate|verify} pass; Change-Id: Ie5eb12dc637623b8f3ed08709590a323d9f830f8 Reviewed-on: https://chromium-review.googlesource.com/703680 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
/external/puffin/src/puff_io_unittest.cc
|
92f667a14a8183e0efcc98a2ed347830dce71710 |
|
13-Oct-2017 |
Amin Hassani <ahassani@google.com> |
puffin: Fix asan build errors This CL fixes some memory sanitizer bugs in puffin. BUG=chromium:774609 TEST='USE="asan" FEATURES="test" emerge-amd64-generic puffin' Change-Id: Icbb758025b0f56e846522d7384ef1ae8c5d1f4a7 Reviewed-on: https://chromium-review.googlesource.com/719386 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
/external/puffin/src/puff_io_unittest.cc
|
ec69c2b78e2359774678d084510c575cbc593471 |
|
25-Sep-2017 |
Amin Hassani <ahassani@google.com> |
puffin: End puffing and huffing based on the input size. End Puff and Huff operations based on the size of the input instead of looking if the final block bit is set. This way we can break the deflate blocks into smaller blocks that are on a byte alignment. BUG=chromium:768505 TEST=unittests pass. Change-Id: Iab7ff961b37a15a237b21d20778f70429e432e18 Reviewed-on: https://chromium-review.googlesource.com/691117 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Ben Chan <benchan@chromium.org>
/external/puffin/src/puff_io_unittest.cc
|
c3e6b533aa435516b788ae353a43602c57936afd |
|
08-Mar-2017 |
Amin Hassani <ahassani@google.com> |
Puffin: Deterministic patching tool for deflate streams. This is a deterministic semi-recompression based patching tool for deflate streams. Its main purpose is to provide necessary tools for updating the squashfs Android container which is gzipped (deflate base). For more details refer to go/puffin-recompression. BUG=chromium:717785 TEST=cros_workon_make --board=amd64-generic puffin --test CQ-DEPEND=CL:451881 Change-Id: I6f644bf078bedb809d14fba821a12ddf9849712a Reviewed-on: https://chromium-review.googlesource.com/451861 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Andrew de los Reyes <adlr@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
/external/puffin/src/puff_io_unittest.cc
|