Commit Graph

680 Commits

Author SHA1 Message Date
Treehugger Robot
ed2054123f Merge "Check for failures in base SetUp()" 2023-01-19 10:39:57 +00:00
Treehugger Robot
fa44e8e809 Merge "Add owners for the security HALs" 2023-01-19 10:20:42 +00:00
Treehugger Robot
2524ba06a2 Merge "Adjust for library rename" 2023-01-18 21:54:46 +00:00
Andrew Scull
18008afa5d Add owners for the security HALs
Test: n/a
Change-Id: Ie5e4856bd80e901262fe53a9edd5d7d70d1e77b4
2023-01-18 21:54:42 +00:00
Treehugger Robot
8e8f82502b Merge "Use libcert_request_validator to check DICE chain" 2023-01-18 00:03:04 +00:00
Seth Moore
b2f7bf2a38 Merge "Drop minimum RKP challenge size to 16 bytes" 2023-01-17 15:45:33 +00:00
Eran Messeri
a720d56824 Merge "2nd IMEI attestation: Clarify tag usage." 2023-01-17 11:39:42 +00:00
Andrew Scull
c54f43300d Adjust for library rename
libcert_request_validator is now called libhwtrust so update the
references to match.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I3c73e2749996ef684da4567a3c86daf8b9c0fd09
2023-01-15 21:51:44 +00:00
Andrew Scull
9a8c945682 Use libcert_request_validator to check DICE chain
Remove one of the DICE chain validation implementations and replace it
with a call to the libcert_request_validator library which has the most
complete validation and is planned to be the only implementation we
support.

VTS will now check both degenerate and proper DICE chain more completely
and will be consistent with other tools like `bcc_validator`. P-384 will
become a supported key type in the DICE chain.

The whole static library is included so that clients that statically
link remote_prov_utils don't need to be aware of the dependency.

Bug: 254510672
Bug: 265455904
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I067f7e8710e379a4b404ef9d2c04fe6410f73dc4
2023-01-15 21:51:41 +00:00
Eran Messeri
36594490fd 2nd IMEI attestation: Clarify tag usage.
Clarify that the tag for the 2nd IMEI must denote an IMEI different to
the tag used for the first IMEI, and may be used independently of it.

Bug: 264979486
Test: N/A
Change-Id: I45a46d1052e45a965c8be391d11157cc4481545b
2023-01-15 10:39:22 +00:00
Seth Moore
8a0f18051d Drop minimum RKP challenge size to 16 bytes
The current RKP server produces challenges smaller than 32 bytes.
As existing devices in the field may have some length limitations
due to this, let's not start sending larger challenges to those
devices. Instead, drop the challenge to 16 bytes to maintain compat.
There should be plenty of entropy in 16 bytes.

Test: n/a
Change-Id: I1dfd9b4b06131df907683207e4b6bfb2d1c93d65
2023-01-13 15:37:33 -08:00
Daniel Angell
1f5ab0d6f8 Make libkeymint_remote_prov_support a static dep
This made it easier to run libkeymint_remote_prov_support_test.

Bug: 264302050
Test: atest libkeymint_remote_prov_support_test
Change-Id: Ided4e9bb442274ea7711d283bc947c35f34ebc35
2023-01-13 18:30:40 +00:00
Daniel Angell
eacb1c16f1 Add ro.serialno sysprop to JSON output
To help with error reporting on the RKP servers in the future it
will be helpful to be able to address CSRs by serial number when
possible.

Bug: 264302050
Test: libkeymint_remote_prov_support_test and sent JSON to server
Change-Id: I2808441c200d0679e618580abc464cd3c71c220e
2023-01-13 18:30:38 +00:00
David Drysdale
3d2ba0a137 Add check_feature helper
Test: VtsAidlKeyMintTargetTest
Change-Id: I4a5b2a41172c15ae29efb5b177eb86cea5527b4e
2023-01-11 13:27:30 +00:00
Treehugger Robot
7a15fa5005 Merge "Add more clarity about integer encoding for keys" 2023-01-07 00:36:40 +00:00
Hasini Gunasinghe
eb3e5d16cf Merge "Fix VtsRemotelyProvisionedComponentTests for IRPC V3" 2023-01-06 22:13:16 +00:00
Seth Moore
1386742e52 Add more clarity about integer encoding for keys
Add references to appropriate documentation, as well.

Test: N/A
Bug: 251687782
Change-Id: I93adb940406c924879606137bb813d7735d9aee2
2023-01-06 09:56:27 -08:00
Hasini Gunasinghe
666b2717e4 Fix VtsRemotelyProvisionedComponentTests for IRPC V3
This updates the test: supportsValidCurve, for IRPC implementations
that supports only V3+.

Bug: 239476788
Test: atest VtsRemotelyProvisionedComponentTests with IRPC V3
implementation

Change-Id: Ic0f1223b30e31dc537155e19e800b3001ce0fc01
2023-01-05 21:35:51 +00:00
Tommy Chiu
88a0fd42c8 Correct some descriptions of IRemotelyProvisionedComponent
- STATUS_TEST_KEY_IN_PRODUCTION_REQUEST is still required for V3
- PubKeyEcdhP256 & PubKeyX25519 are unused in V3
- SignedDataSigStruct and DiceChainEntryInput should be an cbor array
  when being the input of PureEd25519/ECDSA

Bug: 243454124
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ice400bb15413eac164f2630cc2fbb66e6d3624b1
2023-01-05 10:37:22 +08:00
Seth Moore
bbee0080d9 Fix test assumption for KeyMint+RKP integration
It's not enough to verify that the system is running KeyMint 2+. We
also need to verify that the vendor partition has RKP support.

Since VSR 13+ requires KeyMint 2+, change the test assumption so that
we don't run the test against systems that may have shipped with an
older VSR chipset (which won't support RKP).

Bug: 263844771
Test: VtsAidlKeyMintTargetTest (on old and new device)
Change-Id: Iac15f69db1152851f5a92d3929cb258b1b1a6b02
2023-01-03 14:19:16 -08:00
David Drysdale
3d40abfec8 Merge "KeyMint manual key upgrade tests" 2023-01-03 14:19:04 +00:00
Andrew Scull
1bcb602b85 Check for failures in base SetUp()
If the base set up fails, the RKP version number might not be valid so
we shouldn't try to work out whether the test should be skipped based on
the version.

Assert that there weren't any fatal errors from the base set up rather
than reporting that the test should be skipped as that can be a bit
confusing.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Icaf946ef4cf6b31dcfe7187131538b9eb3892798
2022-12-27 10:52:17 +00:00
Eran Messeri
576a5d4b2d Merge "Enforce KeyMint v3 for VSR level 14" 2022-12-21 10:55:15 +00:00
David Drysdale
9f5c0c5734 KeyMint manual key upgrade tests
Test: VtsAidlKeyMintTargetTest
Change-Id: I95d74cec80e94da316dab02b7a88b855742c877c
2022-12-19 15:52:52 +00:00
Eran Messeri
b9346f5146 Enforce KeyMint v3 for VSR level 14
Enforce that devices shipped with VSR-14 chipsets have KeyMint 3.

Bug: 251242992
Bug: 251510880
Test: atest VtsAidlKeyMintTargetTest
Change-Id: I21716ce02772266ce414c213a199c838cb2ef28a
2022-12-15 14:59:52 +00:00
Max Bires
a9b3bb96b2 Add VSR enforcement testing for IRPC versioning.
Check the VSR API level for the device under test and ensure that the
appropriate HAL version for the IRemotelyProvisionedComponent interface
is present. E.g. a VSR 13 chipset should have IRPC v2 or newer.

Bug: 251185719
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I136cac27953d1d5acaa45510ad9efec2a75d8038
2022-12-14 15:16:35 -08:00
Seth Moore
34d856e8f7 Add RKP-specific owners file
Test: N/A
Change-Id: I844f3e88b2b89337d843f63e63c9dcbcbb921b77
2022-12-13 13:26:41 -08:00
Seth Moore
7dc1fda7a4 Enable RKP+KeyMint integration test
This integration was technically a requirement on keymint v2, but we
weren't enforcing it with a test. So realistically we are only able
to start enforcing the test with keymint v3.

Test: atest VtsAidlKeyMintTargetTest
Change-Id: Ia4feb8ce4b7fd1e47a5c6c9b06ddb12276a9c5ee
2022-12-13 13:25:32 -08:00
Seth Moore
8f810b1303 Move remotely provisioned component tests to rkp directory
Now that the RKP HAL AIDL has been moved to it's own directory, we
should keep the tests with the AIDL.

Test: atest VtsAidlKeyMintTargetTest
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ia87d3ea0a1b9e6704f0dea8f98b0bbaa049472fe
2022-12-13 11:03:59 -08:00
Eran Messeri
b0f54da729 Update the KeyMint feature version to 300
As we've updated the KeyMint version to 3, update the default feature
version to 300. That allows external developers to tell which KeyMint
version is running on the device.

Bug: 244732345
Test: atest android.keystore.cts.DeviceOwnerKeyManagementTest
Change-Id: I9b333eeb77a62a79e8e664d40b5564767643aa3d
2022-12-07 13:06:17 +00:00
Shaquille Johnson
a8ceb15747 Merge "Update keymint latest aidl for cpp version code" 2022-12-06 17:46:46 +00:00
Shaquille Johnson
b692c60e2a Update keymint latest aidl for cpp version code
This add a cpp default so that the latest cpp code can be
used across the codebase. When this is changed we dont
need to bump versions across multiple files and can just
change it in this one file.

Test: Run and tested using `atest keystore2_test` for Rust test and CTS test with `atest CtsKeystoreTestCases`
Bug: 244730020
Change-Id: Ifae1c5f2403210c2dec1bc337553fbbde73ed4c8
2022-12-01 17:49:04 +00:00
Tri Vo
b0b8acc849 Make IRPC v3 optionally backwards compatible
Specifically, we want IRPC v3 to be able to serve old v2 clients. This
way we can ship parts IRPC v3 stack incrementally.

To that end, allow IRPC v3 to implement v2 behavior of
generateCertificateRequest and testMode.

Bug: 260920864
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I9e47697bd948c8fd6b82147165d0c67bdef9fbd3
2022-11-30 16:30:31 -08:00
Max Bires
1589c401e0 Merge "Fix overly relaxed Device ID Test." 2022-11-28 20:15:13 +00:00
Treehugger Robot
4ad2bb150e Merge "Document changes and clean up spec" 2022-11-22 21:15:18 +00:00
Max Bires
a97ec69e4b Fix overly relaxed Device ID Test.
Previous versions of VTS had to allow a Device ID attestation failure
to return INVALID_TAG even though this is inconsistent with the KeyMint
spec. This was due to previous KM implementations returning this before
the test was added to validate the precise error code being returned
from Device ID attestation.

For VSR-14 and newer devices, the test will now enforce that only
CANNOT_ATTEST_IDS is returned from a failed device ID attestation call.

Test: atest VtsAidlKeyMintTargetTest
Change-Id: I6acff3fd32f3f251f946e3603283535f36d99a5d
2022-11-22 12:33:50 -08:00
Max Bires
8d046265b8 Document changes and clean up spec
This change clarifies some more items that have changed between v2 and
v3 of the IRPC spec, along with fixing and clarifying some more
messaging in the .aidl documentation.

Test: Someone else can intelligibly read what was written
Change-Id: Ia9fa1595a72c818f93ce6fb31ea38c97d997488b
2022-11-22 10:45:55 -08:00
Seth Moore
9d52a3579e Merge "Allow rkpd mainline module to link rkp aidl bits" 2022-11-22 16:54:13 +00:00
Seth Moore
557a1dbd03 Allow rkpd mainline module to link rkp aidl bits
Test: Build
Change-Id: Ide8b4ec4b8994368d035f79054818542aba306e5
2022-11-21 17:15:37 -08:00
Eran Messeri
b9d71d3e09 ID attestation: update docs for a second IMEI
Update the comment describing the attestation record:
* KeyMint version bump to V3
* Inclusion of the 2nd IMEI.

Bug: 244732345
Test: That it builds
Change-Id: I19f89bc9936b747647dc690d4702c60d2bbe92c5
2022-11-21 15:53:37 +00:00
Tri Vo
2ac5066335 Merge "Add an implementation defined limit on number of keys in CSR" 2022-11-16 03:44:22 +00:00
Tri Vo
9cab73c8bd Add an implementation defined limit on number of keys in CSR
Rationale here is that many IRPC implementations are memory constrained.
We add a way for implementations to report the maximum number of
supported keys. This way we can guarantee consistent behavior across
different devices.

For implementation of IRPC version 3 and later we define the lowest
number of keys supported to be 20. This specific value was chosen
because the current implementation of RemoteProvisioner already combines
keys into batches of exactly 20.

Bug: 254137722
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ib6fb6d6ec7c74004524a5505a37aa82c9e44ef91
2022-11-15 14:19:55 -08:00
Andrew Scull
5eeb73beb7 Merge changes from topic "rkp-csrv3-updates"
* changes:
  Update the VTS test for CSRv3 updates
  Adjust CSRv3 CDDL after implementation experience
2022-11-14 22:01:53 +00:00
Tommy Chiu
7d22f60924 KeyMint VTS: Police key validity from v2 HAL
The key validity can be ignored when generatKey on Android-12 (S).

Bug: 257445538
Test: Pass on S builds
Change-Id: Iafd8d080f324c7d8d6affbb9d28d4f265f13e2ab
2022-11-14 21:03:44 +08:00
Andrew Scull
fb49ad2f3c Update the VTS test for CSRv3 updates
Conform to the latest CDDL changes. Organize parsing to observe the
AuthenticatedRequest structure.

Return the deserialized CSR payload rather than the DICE chain keys
because it simplified the return types.  The return value is only used
by one VTS test that checks sequential CSRs consist of the same request.
The test was incomplete before and it now only looks as the CSR payload
whereas it previously only look at the DICE chain keys.

Bug: 250910137
Test: atest libkeymint_remote_prov_support_test librkp_factory_extraction_test
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I1ba2e0cec22e25312fb890923a4c93043e9046cd
2022-11-11 15:24:38 +00:00
Andrew Scull
9aa150cee7 Adjust CSRv3 CDDL after implementation experience
Rename from AuthenticatedMessage to AuthenticatedRequest in order to
make the direction of the message clear.

Move the challenge out of the endpoint-specific message and up into the
common authentication wrapper as it is uesd in the authentication
protocol.

Simplify the versioning by having the CSR version continue sequentially,
making the current version 3. Have the AuthenticatedMessage version
start from 1 as it's value isn't used to distinguish v2 and v3 CSRs
anyway and it will avoid confusion with the CSR version which has
already moved beyond this value.

Bug: 250910137
Test: n/a -- comments only
Change-Id: I13836e90fa76b1b22cb6627f3d987828ffeb0adc
2022-11-10 21:50:55 +00:00
Tri Vo
85ee679e2e Merge "Add VtsAidlKeyMintTargetTest to presubmit" 2022-11-10 20:41:55 +00:00
Seth Moore
75dd6a15d2 Merge changes from topic "cherry-pick-rkp-hal-split"
* changes:
  Update the RKP aidl dependency
  Update README and CHANGELOG for RKP
  Split rkp from keymint
2022-11-10 19:32:31 +00:00
Seth Moore
20b3262727 Merge changes from topic "cherry-pick-rkp-hal-split"
* changes:
  Add missing dependency on RKP HAL
  ID attestation: Define tag for a second IMEI
2022-11-10 19:32:31 +00:00
Treehugger Robot
9d99ac49a1 Merge "Fix a couple of regular expressions." 2022-11-10 07:12:12 +00:00