Commit Graph

615 Commits

Author SHA1 Message Date
David Drysdale
9ea96ddd9d Skip curve25519 upgrade tests on KeyMint v1
Bug: 266010760
Test: VtsAidlKeyMintTargetTest
Change-Id: Ib65e8209477251cce15161b2502c893f9983da42
2023-02-01 07:44:43 +00:00
Eran Messeri
506089a8e9 Merge "Extending AttestKeyTest#EcdsaAttestationID test to use IMEI as attestation id." 2023-01-24 16:48:26 +00:00
David Drysdale
9c99dc9a39 Add missing endquote and newline
Test: tsAidlKeyMintTargetTest --gtest_filter="*KeyBlobUpgradeTest*After*default"  --keyblob_dir /data/local/tmp/keymint-blobs
Change-Id: I6f1d2778637cf4603e1ab896d63df936fbf82a38
2023-01-24 12:21:21 +00:00
Rajesh Nyamagoud
eb644cfcbe Extending AttestKeyTest#EcdsaAttestationID test to use IMEI as
attestation id.

Get IMEI value from Telephony Service and use it as attestation id.

Bug: 261847629
Test: atest VtsAidlKeyMintTargetTest
Change-Id: I0212def48d761a45f514161e5576a954bf388c56
2023-01-20 20:32:05 +00:00
Treehugger Robot
2524ba06a2 Merge "Adjust for library rename" 2023-01-18 21:54:46 +00:00
Treehugger Robot
8e8f82502b Merge "Use libcert_request_validator to check DICE chain" 2023-01-18 00:03:04 +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
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
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
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
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
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
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
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
Treehugger Robot
a30c39330f Merge "benchmark: updated benchmark tests for strongbox" 2022-11-10 05:32:17 +00:00
Seth Moore
41e97f0bbf Update the RKP aidl dependency
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: I86f864003e38224936375930891abb38f7d55d3d
Change-Id: I86f864003e38224936375930891abb38f7d55d3d
2022-11-10 01:57:10 +00:00
Seth Moore
f479b4b902 Update README and CHANGELOG for RKP
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: Ib66fcbdbaadda3f32cd8423f61bd31d5f43dc44b
Change-Id: Ib66fcbdbaadda3f32cd8423f61bd31d5f43dc44b
2022-11-10 01:56:49 +00:00
Seth Moore
3a810627e0 Split rkp from keymint
Bug: 254112961
Test: vts_treble_vintf_vendor_test
Merged-In: I3734bd7647cbb7b33ef654ba2fb40fe8a648689e
Change-Id: I3734bd7647cbb7b33ef654ba2fb40fe8a648689e
2022-11-10 01:56:41 +00:00
Seth Moore
5937f07a69 Add missing dependency on RKP HAL
Bug: 258288484
Test: libkeymint_remote_prov_support_test
Merged-In: I032d30e5f46aa3fc0dd7b95373180b9653ccbf23
Change-Id: I032d30e5f46aa3fc0dd7b95373180b9653ccbf23
2022-11-10 01:56:25 +00:00
Eran Messeri
210d3ea87b ID attestation: Define tag for a second IMEI
Define a KeyMint tag for a second IMEI to be included in the attestation
record.

Also clarify that the IMEI tag is meant to include one, and only one,
IMEI.

Bug: 244732345
Test: android.keystore.cts.DeviceOwnerKeyManagementTest
Merged-In: I70ecbb0245ba2e517e5d0db0cfdce4525846f3e5
Change-Id: I70ecbb0245ba2e517e5d0db0cfdce4525846f3e5
2022-11-10 01:54:21 +00:00
Elliott Hughes
be36da4c2b Fix a couple of regular expressions.
Our old NetBSD regex implementation didn't care, but the current NetBSD
implementation rejects unquoted `{` and `}`s that aren't actually part
of a repetition. glibc shares this behavior.

Interestingly, the new NetBSD code was itself an sync with FreeBSD, so
although macOS right now allows this (as Android did), they may well
switch too.

Anyway, this way of writing the regular expressions is strictly correct,
so regardless of whether or not we can actually land this change to the
regex implementation without causing app compat chaos, we should fix
this test.

Bug: http://b/258469149
Test: treehugger
Change-Id: I85bf5d8f557a4fe5ac5ebeea565892d36da30b55
2022-11-09 22:07:11 +00:00
Treehugger Robot
080af0a493 Merge "Fix typo in property name" 2022-11-08 20:23:28 +00:00
Tri Vo
799e4353c2 Fix typo in property name
Test: VtsAidlKeyMintTargetTest
Change-Id: I9c42f14a468ae907d4c47df8af4e3b9b16cd5d96
2022-11-07 17:23:53 -08:00
Tri Vo
6529ceff1b Add VtsAidlKeyMintTargetTest to presubmit
Bug: 224515306
Test: presubmit
Change-Id: Ia90761c5109b217ad0628f621f5952a1c4e07471
2022-11-07 15:53:33 -08:00
Devin Moore
7556e51ce8 Mark keymint as unfrozen to manage keystore2's imports
We are now checking the imports of frozen versions of interfaces and
need mark keystore2 as `frozen: false` so the aidl_interfaces that
import it will import the latest unfrozen version.

Test: hal_implementation_test
Bug: 257338648
Change-Id: Ibcb151abd2fc13e3f7dfbcf515d0f62839d1caf9
2022-11-04 15:31:23 +00:00
avinashhedage
8d8d788cff benchmark: updated benchmark tests for strongbox
Execute only relevant benchmark tests for StrongBox.

Bug: b/229819550
Test: run VtsAidlKeyMintBenchmarkTest in the adb shell

Change-Id: I3bf95dc5d4bcd1da027e09b1bbde7e6173749481
2022-11-03 05:28:46 +00:00
Tri Vo
73cb8af65e Merge "Add TEST_MAPPING config" 2022-10-28 19:03:57 +00:00
Tri Vo
269057bd78 Add TEST_MAPPING config
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ia190f6c91a4312cc06a525fcbe0e2c5ba6975013
2022-10-27 15:10:17 -07:00
Tommy Chiu
4fdcccc7c0 KeyMint VTS: Use a strongbox must support DIGEST for importKey
"ImportWrappedKeyTest.WrongDigest" tried to wrap a keyBlob by one digest
type and unwrap it by another digest type.

It's been OK for KeyMint implementations to allow unsupported
parameters/characteristics at key generation time, and only police their
use, at begin() time. However if an implementation wants to secure it at
the key generation/importing time the first digest type must be
supported by all implementation.

Bug: 249276913
Test: VtsAidlKeyMintTargetTest
Change-Id: I6bc000026e9e4aec0aa82078a98c75e2d7c56847
2022-10-25 21:22:57 +08:00