Commit Graph

11 Commits

Author SHA1 Message Date
Andrew Walbran 117cd5e0e6 Clean up imports, formatting and tests.
Bug: n/a
Test: atest libapkverify.test libapkverify.integration_test
Change-Id: I39686d17927741297aa3feb02ed6043ee770933b
2021-08-17 10:07:30 +09:00
Joel Galenson 5817c77734 Merge "Fix build error." 2021-08-16 18:03:59 +00:00
Jooyung Han cee6de6bd4 apkverify: add tests for invalid zip format
Bug: n/a
Test: atest --test-mapping .
Change-Id: I286d497dee2ae65b2e0c5f6e48f17122543dc7a3
2021-08-12 14:50:20 +09:00
Joel Galenson 834b177681 Fix build error.
This is required for the recent {der,x509}-parser upgrade.

Test: Build
Change-Id: I880eab2da243dff2f149f279f44d62bcc225eeff
2021-08-11 07:57:10 -07:00
Jooyung Han 543e7122e9 apkverify: verify cert/public key match
Bug: 190343842
Test: atest libapkverify.integration_test
Change-Id: If7da64ea6ff3f5fc25d204cbcf30d22122ee45c7
2021-08-11 11:18:03 +09:00
Jooyung Han d821a04c4d libapkverify: Add TEST_MAPPING
Bug: n/a
Test: atest libapkverify.test libapkverify.integration_test
Test: atest --test-mapping p/m/V
  runs libapkverify.test
Change-Id: Id440c9771a1f0974fb3c3bbe83dece74f014611a
2021-08-11 11:18:03 +09:00
Jooyung Han d839785658 apkverify: verify content digest
Bug: 190343842
Test: MicrodroidHostTestCases
Change-Id: I370aaf6bf88e7267f5a03b7a2da32c87d49552db
2021-08-11 11:18:03 +09:00
Jooyung Han 5b4c70ec35 apkverify: signature verification over signed data
Bug: 190343842
Test: MicrodroidHostTestCases
Change-Id: I130daa50995f30b3a2315a46d8d2f743d20ed0f2
2021-08-10 17:26:58 +09:00
Jooyung Han 19c1d6c70e microdroid_manager: verify APK/APEXes
Even though libapkverify doesn't do much verification for now, having
it in use would make CI detect errors in the future.

TODO:
- zipfuse should wait until APK is verified.
- boot should abort when verification fails.

Bug: 190343842
Test: MicrodroidHostTestCases
Change-Id: I221be1c7d9a0bfcd312593d3958f950311b67af5
2021-08-10 03:11:35 +09:00
Jooyung Han 5d94bfcd79 apkverify: add ziputil
apkverify doesn't need all zip features. ziputil provides zip_sections()
to discover the layout of a zip file.

Bug: 190343842
Test: cargo test
Change-Id: Ib6354828cebe819fd3f48265089815ccf29f18ea
2021-08-10 03:11:30 +09:00
Jooyung Han 12a0b70ca6 add apkverify lib to verify APK/APEX signatures
`verify(apk)` is an entry for a Signature Verification of APK/APEX.

For now, it only parses signing block and does barely no verification
yet. Verification will be implemented in follow-up changes.

Cargo.toml is added for `cargo test`, but will be removed when
Android.bp is added.

Bug: 190343842
Test: cargo test
Change-Id: Ib95128e021e8da50a015d302c9c394a8b5a98957
2021-08-10 02:19:15 +09:00