Commit Graph

14 Commits

Author SHA1 Message Date
Seungjae Yoo 460cc830f2 Merge "Improve test coverage v3-only for apkverify" 2022-06-14 00:43:46 +00:00
Seungjae Yoo 91e250a74b Improve test coverage v3-only for apkverify
APKs are brought from tools/apksig/src/test/resources/com/android/apksig
Covered test for all existing v3-only apks at there.

Bug: 233573377
Test: atest libapkverify.integration_test

Change-Id: Icdad3afa352fec2286d70a395f18a0973e6e2def
2022-06-09 09:20:50 +00:00
Andrew Scull 11d53ee9c7 idsig: Include the APK digest
Get the best APK digest from the APK and include it in the generated
idsig.

Test: atest libidsig.test
Bug: 234564414
Change-Id: If55eab3bb62131bcdb9dfeb6000b9a5ba7ab9236
2022-06-01 14:35:58 +00:00
Andrew Scull a11b83a26b apkverify: Add function to pick v4 apk digest
The v4 signing scheme includes an APK digest to match the strongest
digest available in the v3 or v2. Add a function to extract that digest
from an APK.

Test: libapkverify.test
Bug: 234564414
Change-Id: I69ce9c9c5ff6daf1f09e1bd4620ebf1ce015b5fa
2022-06-01 14:35:39 +00:00
Andrew Scull 9173eb83ba apkverify: Rank based on v4 preferences
The signing algorithms were already ranked following the order of
preference used by the v4 signing scheme, so there's no functional
change. Documentation is added to make this connection explicit and a
functions for selecting the best signed is factored out.

Test: libapkverify.test
Bug: 234564414
Change-Id: I28e25ce744cbc5854d1cb2b73fee9f966d2f8eb6
2022-06-01 14:35:34 +00:00
Andrew Scull 1c32ed1788 apkverify: Make the library available for host tools
Don't mark the tests as host supported as they will otherwise fail when
the server tries to run them as the dependencies don't get bundled
properly.

Test: presbumit
Change-Id: I8ce5a21e5a27e15df1df84ea7d682c24cd8c4d67
2022-05-24 07:39:24 +00:00
Treehugger Robot 5877e1b2c0 Merge "Revert "apkverify: Make the library available for host tools"" 2022-05-23 12:51:41 +00:00
Andrew Scull 199fbcf5e3 Revert "apkverify: Make the library available for host tools"
This reverts commit 228b71fc20.

Reason for revert: b/233588380 caused by b/204562227

Change-Id: Ia62d407fa48470569b0f89b4e880019eb599e79e
2022-05-23 12:00:27 +00:00
Treehugger Robot b26544942f Merge "apkverify: Migrate from ring to openssl crate" 2022-05-23 10:19:42 +00:00
Andrew Scull 36f326404f Merge "apkverify: Make the library available for host tools" 2022-05-23 10:09:28 +00:00
Andrew Scull c208eb4f66 apkverify: Migrate from ring to openssl crate
Switch to using the certified implementation of cryptographic
algorithms, boringssl, that's available through the openssl crate.

Add an ECDSA signed APK to the test suite to give that algorithm some
coverage.

Bug: 232676161
Test: atest libapkverify.test
Test: atest libapkverify.integration_test
Change-Id: I5f86b40e110d8aaeb22109757253950bd7824833
2022-05-23 08:24:34 +00:00
Andrew Scull 228b71fc20 apkverify: Make the library available for host tools
Test: presubmit
Change-Id: Id0f0dff9d249396f06b2eb6975c9eacd348189f9
2022-05-23 07:35:56 +00:00
Andrew Scull f3fd4c63f7 apkverify: Re-export functions rather than wrap them
The library exposes two functions that are just wrappers around the v3
implementation. Make that more clear by simply re-exporting the v3
functions. The TODO for adding v2 support remains.

The documentation is consolidated so the same information remains.

Test: atest libapkverify.test
Change-Id: Id497486dd054474516a664be1539b41732085b79
2022-05-22 15:55:31 +00:00
Jooyung Han 5f0f668e47 Move libs into libs/
Bug: N/A
Test: m
Change-Id: I50ade90dab13fa0ee83b79f17a8ec3cc012fe497
2022-02-19 00:12:32 +09:00