Commit Graph

712 Commits

Author SHA1 Message Date
Rajesh Nyamagoud
5283f81f64 Adding a test using second IMEI as attestation ids.
1. Using second IMEI as attestation id without using first IMEI.
       Test should generate a key using second IMEI as attestation id
       without using first IMEI as attestation id. Test should validate
       second IMEI in attesation record.

    2. Using first IMEI as well as second IMEI as attestation ids.
       Test should generate a key using first IMEI and second IMEI as
       attestation ids. Test should validate first IMEI and second IMEI
       in attestation record.

Test: atest -c VtsAidlKeyMintTargetTest
Bug: 263197083, 264979486
Change-Id: I61c3f32e15a8d478a838d14e7db9917a33682267
2023-02-20 20:40:12 +00:00
Treehugger Robot
249640be0a Merge "[dice] Adapt dice service and tests to the new DiceArtifacts trait" 2023-02-17 15:54:04 +00:00
Tommy Chiu
7cabdc10db Fix test assumption for KeyMint+RKP integration
According to the API Level definition (https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels), both 31 and 32 are belong to Android-12 (S).

Bug: 263844771
Change-Id: I92e3f9015607ad9421c02442033e9b586ae07bcb
Test: VtsAidlKeyMintTargetTest #EcdsaWithRkpAttestation
2023-02-16 09:39:25 +00:00
Alice Wang
e585065a4d [dice] Adapt dice service and tests to the new DiceArtifacts trait
The code needed to be adpated because the public fields the code
accessed previously now become private. We need to access them
via the trait now.

This cl also deletes unused dependence libdiced_open_dice_cbor in
the dice service and tests targets.

Bug: 267575445
Test: m android.hardware.security.dice-service.non-secure-software
Test: atest VtsAidlDiceTargetTest VtsAidlDiceDemoteTargetTest
Change-Id: I16e18226c0bce8a90ed764ba598e90e7c1c854ab
2023-02-15 16:34:50 +00:00
David Drysdale
bf0ae8a0f0 Merge "RKP spec: fix public key info description" 2023-02-13 16:37:49 +00:00
David Drysdale
cdf8ed3f6f RKP spec: fix public key info description
The PartyInfo for a P-256 public key is encoded as (x||y) not
(0x04||x||y).

Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Iae5dc624228d4e1e538e230968443925ec8b55fc
2023-02-13 12:07:17 +00:00
Steven Moreland
6410234d7c Merge "rkp: add keymint v1 hash into rkp v1" 2023-02-11 01:27:43 +00:00
Steven Moreland
5419c2dbe5 rkp: add keymint v1 hash into rkp v1
When we split the rkp interface, we only added one hash to rkp v1, but
on Android S devices, this interface was in keymint v1, and so it used
the keymint v1 hash.

In order for that old implementation to be recognized, we need to add the keymint v1 hash into rkp v1.

The hash added here is copied from this file:
hardware/interfaces/security/keymint/aidl/aidl_api/android.hardware.security.keymint/1/.hash

Bug: 264549860
Change-Id: I3fce46b3e9bd09d79fa8e2f203b4eb9ebb517c15
Test: vts_treble_vintf_vendor_test
2023-02-10 22:44:28 +00:00
Alice Wang
f29985ae57 Merge "[dice] Adjust the output type of make_sample_bcc_and_cdis()" 2023-02-09 15:59:16 +00:00
Alice Wang
cfb4e92217 [dice] Adjust the output type of make_sample_bcc_and_cdis()
This is part of the project of merging the two existing dice
wrapper libraries into the library libdiced_open_dice to
improve maintainability.

Bug: 267575445
Test: m android.hardware.security.dice-service.non-secure-software
Test: atest VtsAidlDiceTargetTest VtsAidlDiceDemoteTargetTest
Change-Id: If9ee66a320775897342f53d58ee11405a8e70c6f
2023-02-08 21:08:28 +00:00
Tommy Chiu
6e5736bdb8 VTS: Replace deprecated 'getService' by 'waitForService'
Bug: None
Test: Built
Change-Id: I6902612ba9c4422a071c342dde4682dc96b20a6c
2023-02-08 10:28:45 +08:00
Treehugger Robot
ec32540a84 Merge "Fix AttestKeyTest failures in KeyMint VTS" into android13-tests-dev am: c3702f8e5b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2406652

Change-Id: I2a19d5e784b2eabfffb63c3c1ceb7fed09682dcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-02-06 17:45:19 +00:00
Alice Wang
6331fd4d5a Merge "[dice] Pass InputValues to dice::execute_steps without conversion" 2023-02-02 19:57:38 +00:00
Alice Wang
c4a9ba8bd3 [dice] Pass InputValues to dice::execute_steps without conversion
Test: atest VtsAidlDiceTargetTest VtsAidlDiceDemoteTargetTest
Bug: 267575445
Change-Id: I14819bb8e1af10a2de4539077491de3fb7df9a83
2023-02-02 16:35:45 +00:00
Treehugger Robot
2831fa2bf2 Merge "Updated the digest to SHA_2_256 in key upgrade tests." 2023-02-02 16:21:13 +00:00
David Drysdale
44671d923a Merge "Skip curve25519 upgrade tests on KeyMint v1" 2023-02-01 12:44:34 +00:00
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
Benjamin Grimberg
981c9c2236 Fix AttestKeyTest failures in KeyMint VTS
Skip attestation key tests if the feature
FEATURE_KEYSTORE_APP_ATTEST_KEY is disabled on device,
as done in KeyMint CTS.

Bug: 244460948
Bug: 265740739

Test: VtsAidlKeyMintTargetTest
Change-Id: I8199e5c7570b10b71f127c7439b889c0b3327865
2023-01-31 08:12:27 -07:00
David Drysdale
b7d44a2eef Add check_feature helper
Test: VtsAidlKeyMintTargetTest
Change-Id: I4a5b2a41172c15ae29efb5b177eb86cea5527b4e
Merged-In: I4a5b2a41172c15ae29efb5b177eb86cea5527b4e
(cherry picked from commit 3d2ba0a137)
2023-01-31 08:11:33 -07:00
Eran Messeri
cd46e02439 Merge "Keystore: Attestation fix in AOSP builds" 2023-01-31 13:43:55 +00:00
David Drysdale
28b953032e RKPv2 spec clarifications
- Rename keysToCertify to keysToSign to match param name in a few
  places.
- Make clearer that P-256 is allowed in EEK.
- Make clearer that EEK curve should match that specified in
  RpcHardwareInfo.supportedEekCurve.
- Add note about AAD for AES-GCM encryption.
- Add note about format of public key data in KDF context.

Test: None, comments only
Change-Id: Ie775a453b4d3941b7d24396da66681ab91978d81
2023-01-26 06:31:02 +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
8c526e4d3e Merge "Add missing endquote and newline" 2023-01-24 16:30:59 +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
Andrew Scull
9132147d0a Merge "Allow P-384 and SHA-384 in RKP v3" 2023-01-20 20:49:14 +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
Andrew Scull
5bdc9f92bb Allow P-384 and SHA-384 in RKP v3
Following requests from partners, document P-384 and SHA-384 as
officially supported signing algorithms and hash functions in the DICE
chain.

Bug: 265455904
Test: n/a -- documentation-only change
Change-Id: Id7b5eaf81be17fda9278dc7ad5f2b441931c6b83
2023-01-19 14:18:12 +00:00
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
subrahmanyaman
a7a6f70e62 Updated the digest to SHA_2_256 in key upgrade tests.
Updated the digest to SHA_2_256 in manaul key upgrade tests
so that these tests works for StrongBox as well.

Test: VtsAidlKeyMintTargetTest
Change-Id: I971f6e13272450d39537cc44c59f8ed8dbd19bf0
2023-01-18 18:13:27 +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