summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* zip_archive: Allow crc_out to be nullptr in Inflate.Narayan Kamath2017-10-301-0/+3
| | | | | | | | | | | | | Only compute the crc32 if required. In addition : - Add unit tests for Inflate that cover this addition. - Fix an inconsistency in return codes that was revealed by this new test. Bug: 35246701 Test: zip_archive_tests Test: make; zipalign. Merged-In: I31d7554378f94fc8995f707471d57cb98311e2c2 Change-Id: I05111bfa665c610f93d1c1dee987a509bf87aa65
* zip_archive: Make Inflate a public API.Narayan Kamath2017-10-261-0/+40
| | | | | | | | | For use from zipalign and androidfw::ZipUtils. Test: make Bug: 35246701 Change-Id: I1bdeff3770d0833dfc0807d8a69ba9fea525772a
* libziparchive: Use ReadAtOffset exclusivelyAdam Lesinski2017-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The use of ReadAtOffset is meant to allow concurrent access to the zip archive once it has been loaded. There were places where this was the case, and some places that did a seek + read combination, which could lead to data races. NOTE: On Windows, we are not using pread as the implementation of ReadAtOffset, therefore the guarantees on Windows are weaker. On Linux, pread allows the file descriptor to be read at a specific offset without changing the read pointer. This allows inherited fd's and duped fds to be read concurrently. On Windows, we use the ReadFile API, which allows for an atomic seek + read operation, but modifies the read pointer. This means that any mix use of ReadAtOffset and Read will have races. Just using ReadAtOffset is safe. For the Windows case, this is fine as the libziparchive code now only uses ReadAtOffset. Bug: 62184114 Bug: 62101783 Test: make ziparchive-tests (existing tests pass) Change-Id: Ia7f9a30af2216682cdd9d578d26e84bc46773bb9
* zlib is not exposed to libziparchive headersJiyong Park2017-07-031-1/+3
| | | | | | | | | | | By forward-declaring zstream, we don't need to re-export zlib headers. Bug: 37342627 Test: build Test: BOARD_VNDK_VERSION=current m -j dumpstate (or any other module using libziparchive) Change-Id: Ia69e5d459c79878d491cfe4ca21a7cc8fed4a5d8
* libziparchive headers are moved to local directoryJiyong Park2017-07-013-0/+464
libziparchive headers are moved from the global include directory (/system/core/include) to the local directory inside libziparchive. Note: /system/core/include/ziparchive still exists as a symlink to libarchive/include/ziparchive. This will be removed when there is no header-only dependency to libziparchive. Bug: 37342627 Test: build Change-Id: I3631ffc2df7be8a064d64a625d10436090c3bb0f