Commit graph

529 commits

Author SHA1 Message Date
Tri Vo
e0fb4d0ce5 KeyMint: Add Root-of-Trust test cases
This patch is a squash of following patches:
 - aosp/2514097
 - aosp/2535086
 - aosp/2576910

Bug: 255344624
Test: VtsKeyMintAidlTargetTest
Change-Id: I8b34a94c11d7cc174821483f624fd083ca1763ac
Merged-In: I8b34a94c11d7cc174821483f624fd083ca1763ac
2023-07-20 18:05:24 -04:00
David Drysdale
3f6ab601b9 Allow extra ID attestation error codes
When deliberately testing invalid ID attestation, use the helper
function (which checks the error return code is correct) in one more
place.

Test: VtsAidlKeyMintTargetTest
Bug: 286733800
Change-Id: I6ea5bd7ee19b3b172330117bfde1b16745debba7
(cherry-picked from commit c68dc93788)
Merged-In: I6ea5bd7ee19b3b172330117bfde1b16745debba7
2023-07-12 13:58:41 +00:00
David Drysdale
b18c757eda [RESTRICT AUTOMERGE] Allow extra error code in device ID attestation
Generalize the existing helper function to allow more variants.

Manual cherry-pick of aosp/2627969 combined with aosp/2648423 to avoid
merge conflicts

Bug: 286733800
Test: VtsAidlKeyMintTargetTest
Merged-In: Ic01c53cbe79f55c2d403a66acbfd04029395c287
Merged-In: I0dcac312ac4516a078b2742721e3a19074da52b1

Change-Id: I328f7b3195d4b4dd1ed1da17377696261094ea76
2023-07-05 13:41:54 +01: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
David Drysdale
df427391cd Merge "KeyMint VTS: cope with ATTEST_KEY +/- SIGN" into tm-dev 2022-06-20 06:29:11 +00:00
Shawn Willden
e5364d7617 Read VSR level from correct property.
Bug: 235424890
Test: VtsHalKeymasterV4_0TargetTest & VtsAidlKeyMintTargetTest
Ignore-AOSP-First: Cherry-pick of aosp/2128833
Change-Id: I39109c097d129124097a303c3f108d015cb367e3
Merged-In: I39109c097d129124097a303c3f108d015cb367e3
2022-06-17 10:49:46 +09:00
David Drysdale
cdfb961585 KeyMint VTS: cope with ATTEST_KEY +/- SIGN
This change syncs aosp/master with the change in http://aosp/2117528,
allowing devices that launched with the (incorrect) version of
ATTEST_KEY VTS tests in Android S to continue to pass the test.

Bug: 197096139
Bug: 230074335
Test: VtsAidlKeyMintTargetTest
Change-Id: If88642e238e64ca9ec80303a4a72f7171c63464f
Merged-In: If88642e238e64ca9ec80303a4a72f7171c63464f
2022-06-13 12:06:41 +01:00
TreeHugger Robot
8c1586bc4f Merge "Add a README for Remote Key Provisioning." into tm-dev 2022-06-10 13:29:11 +00:00
Max Bires
c08e808a78 Add a README for Remote Key Provisioning.
This document goes a little more in depth on the motivating factors and
background mechanisms that occur with RKP, that are not appropriate for
direct inclusion in the HAL docs in the .aidl files.

Bug: 234159998
Test: Readable
Change-Id: I141fb098c536a5468b1113af64dcf6185ea7ae9f
2022-06-10 04:52:27 -07:00
TreeHugger Robot
d782e21332 Merge "Implement KeyMint2 test for VSR13" into tm-dev 2022-06-06 20:56:36 +00:00
Shawn Willden
8292bc9292 Implement KeyMint2 test for VSR13
Test: VtsAidlKeyMintTargetTest & VtsHalKeymasterV4_0TargetTest
Bug: 235099905
Ignore-AOSP-First: Cherry pick from aosp/2115214
Change-Id: Ie10b705bb06990a2a2c6223fcce28f5fde6bf3f3
Merged-In: Ie10b705bb06990a2a2c6223fcce28f5fde6bf3f3
2022-06-06 17:13:01 +00:00
Shawn Willden
0ae6bb0656 Implement alternate SE RoT provisioning
Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: Ia696d7765f316d35eba1b4e65acae6c1072987b1
2022-06-02 07:44:23 -06:00
Seth Moore
9b7f79cbf6 Clean up description of IRemotelyProvisionedComponent uniqueId
The identifier is to be used in telemetry to identify problematic
implementations. Thus, it needs to be globally consistent, at least
within a given device type.

Test: None -- doc only changes
Bug: 231495834
Change-Id: Ia55db336fa099d8e1196f6bfe2bafb6fa5ead329
Merged-In: Ia55db336fa099d8e1196f6bfe2bafb6fa5ead329
2022-05-12 15:29:22 -07:00
David Drysdale
857158ba12 KeyMint VTS: x25519 pubkey as SubjectPublicKeyInfo
The data for a key agreement operation should always send in the
SubjectPublicKeyInfo structure, not a raw key for X25519.

Test: VtsAidlKeyMintTargetTest
Bug: 231959070
Change-Id: Ib5157da6a986d957162fab60dbe927017cfdd703
Merged-In: Ib5157da6a986d957162fab60dbe927017cfdd703
2022-05-09 17:47:11 +01:00
David Drysdale
955b77be57 Merge "KeyMint VTS: skip device ID checks on GSI" into tm-dev 2022-05-09 05:15:34 +00:00
Seth Moore
1e8fc75bc0 Merge "Clean up keymint ProtectedData documentation" into tm-dev 2022-05-06 14:58:50 +00:00
David Drysdale
32a7bece10 KeyMint VTS: skip device ID checks on GSI
Bug: 229356841
Test: VtsAidlKeyMintTargetTest
Change-Id: I3182bad5584c35df7b1eeb476dabb39d19fdf12c
(cherry picked from commit 555ba00c0f)
Merged-In: I3182bad5584c35df7b1eeb476dabb39d19fdf12c
2022-05-05 05:34:59 +00:00
Seth Moore
b8f9efc5e7 Clean up keymint ProtectedData documentation
- Fix up some minor CDDL formatting issues.
- Add more definition around the BCC, hopefully clearing up partner
  confusion around how to implement it.
- Explain when BccPayload entries may be omitted in the case of a
  "Degenerate BCC"
- Add a bit more description to the DKSignature format

Bug: 227350250
Test: N/A -- doc changes only
Change-Id: I28337a80e2b49661cc37876400d7ac3b8759ba01
Merged-In: I28337a80e2b49661cc37876400d7ac3b8759ba01
2022-05-04 14:43:40 -07:00
David Drysdale
bebd9520db Merge "Run SecureElementProvision tests for KeyMint version >= 2." am: d347852bcc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2051222

Bug: 230803681
Change-Id: I42b63bdea5fa0fb6c3a79e457f8bd63c6b346111
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
(cherry picked from commit 009d595c0f)
2022-05-04 17:04:38 +00:00
Max Bires
d354a98041 Merge "Increase challenge size in tests." am: dcaa803893 am: a24527be86 am: 14bae2b195
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2066892

Change-Id: Iab5729979eef4a7e3d318f8c3fa816276442e5be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 09:39:01 +00:00
Max Bires
89c7488370 Increase challenge size in tests.
VTS tests were currently passing a challenge size of 32 in all cases.
However, the server currently sends a challenge of length 40, which may
or may not change in the future. A 64 byte upper limit provides a
standard size along with flexibility in case the challenge format
changes in the future.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I678bb915f139e4c23354180870a66ce33a9cfd8c
2022-04-20 12:23:19 +00:00
Jiyong Park
70f5837e1f Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: I61eb51c0334eb99489c6f1570110d7e18c350c99
2022-04-16 07:03:24 +09:00
David Drysdale
2c19304e56 Merge "Fix AES corrupt padding test" am: b474607b7c am: b661792d06 am: 2e449950d6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2059787

Change-Id: I1a4bf228d73452cbc718ab126165bf09e0cdf833
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-11 13:16:23 +00:00
David Drysdale
b809329dc7 Fix AES corrupt padding test
The AesEcbPkcs7PaddingCorrupted test has been incorrect since it was
originally introduced -- it was feeding the original message as input to
the decryption operation, rather than the corrupted ciphertext.  As a
result, the expected error code was also wrong -- INVALID_INPUT_LENGTH
is appropriate for a too-short cipher text (length 1 in this case),
whereas a corrupt-but-correct-length cipher text should give
INVALID_ARGUMENT.

Fix the test, and add a separate test to cover what was inadvertently
being tested before. Add a sentence to the HAL spec to describe what
expected and tested by CTS/VTS.

Bug: 194126736
Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Change-Id: Iaa5e42768814197f373797831093cf344d342b77
2022-04-11 08:35:11 +01:00
Jiyong Park
7faedf81a0 Merge changes from topic "aidl_freeze_tm" into tm-dev
* changes:
  Implement getInterfaceHash/Version for SoundTrigger
  Add -Wno-missing-permission-annotation for soundtrigger3
  V3 is the latest version of keymaster HAL interface
  Freeze AIDL APIs for TM
2022-04-02 00:15:20 +00:00
Eran Messeri
f9b12ac72a Merge "KeyMint: Device IDs attestation based on verion." am: 1b7abc43b6 am: d8fdf0b804 am: 8adaed5f62
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2028224

Change-Id: I2937358195e0218cf7337b989686f649b7e82d22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 14:53:49 +00:00
Jiyong Park
703e97920e Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394
2022-03-31 12:01:39 +09:00
Prashant Patil
88ad189036 KeyMint: Device IDs attestation based on verion.
Updated VTS testcases where Device IDs Attestation expected as optional
and made it mandatory if KeyMint version >= 2 or device first shipped
with api_level 33.

Bug: 221190197
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: I8870a9301d36abdc4fa6585b9f8d62cc1cfd3d96
2022-03-25 12:16:11 +00:00
Treehugger Robot
d31d3b8554 Merge "Updated the vts attestation tests for strongbox implementations which do not support factory attestation." am: 950b7b8026 am: cc399cf7b0 am: af1490f3f7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2027803

Change-Id: I07f19f0c03955d3931842688d8a2ee31dbf174cf
2022-03-24 17:59:41 +00:00
Treehugger Robot
950b7b8026 Merge "Updated the vts attestation tests for strongbox implementations which do not support factory attestation." 2022-03-24 16:35:47 +00:00
subrahmanyaman
7d9bc46f6f Updated the vts attestation tests for strongbox implementations which
do not support factory attestation.

Bug: b/219962281
Test: Run vts tests.
Change-Id: Ie3f3f33f773227d879e11f11e2ef0eaee33db648
2022-03-23 22:27:05 +00:00
Treehugger Robot
0286ec5699 Merge "Fix CDDL for signatures." am: 1edd38d6ee am: 3303e97603 am: 08835aaa3d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2036743

Change-Id: Iaf829618dc93488ac3db71e6c7bab37830295ea7
2022-03-22 17:41:54 +00:00
Treehugger Robot
1edd38d6ee Merge "Fix CDDL for signatures." 2022-03-22 16:50:39 +00:00
Alan Stokes
ba9f55ee69 Fix CDDL for signatures.
The signature is not CBOR-encoded, it's the raw bytes of the signature
encoded as specified for the specific algorithm.

I've made the references to PureEd25519() / ECDSA() into comments,
since I believe they're not actually legal CDDL but are aimed at
humans. And I've made the two occurrences consistent with each other.

Test: N/A
Change-Id: Ia42362ff3d0ce5458322663256cbd34d258afe76
2022-03-22 15:23:13 +00:00
David Drysdale
895ae687e6 Merge "KeyMint VTS: strict test only for v2+" am: d057fc0cb6 am: 1f0d75f1f8 am: 3056221f7c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2033925

Change-Id: I2783a11812212640bbca13a8fd0faadba57e7103
2022-03-22 10:25:29 +00:00
David Drysdale
f371c5eac7 Merge "KeyMint HAL: clarify ATTEST_KEY is like SIGN" am: afa73442b7 am: bbbc278300 am: be65672ee4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2033928

Change-Id: I49d1939007b771ad90fed66b475d3034272ff291
2022-03-22 10:25:12 +00:00
David Drysdale
d057fc0cb6 Merge "KeyMint VTS: strict test only for v2+" 2022-03-22 09:28:52 +00:00
David Drysdale
afa73442b7 Merge "KeyMint HAL: clarify ATTEST_KEY is like SIGN" 2022-03-22 09:26:41 +00:00
Max Bires
c8d296af83 Merge "More canonicalization checks and canonicalize before signing" am: cf02e97946 am: 8daddefc18 am: 59624afdce
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2029343

Change-Id: Ia1ceaa34fdbcf2d20690e1cc447321bdf3b40856
2022-03-21 17:35:21 +00:00
David Drysdale
bcb2f73475 KeyMint HAL: clarify ATTEST_KEY is like SIGN
Bug: 221280929
Test: None, comment change only (already assumed by VTS tests)
Change-Id: Ifc077c6ce1a89164b0d7c70c6e3353d941eee670
2022-03-21 17:14:59 +00:00
Max Bires
cf02e97946 Merge "More canonicalization checks and canonicalize before signing" 2022-03-21 16:33:20 +00:00
David Drysdale
50a66b8f79 KeyMint VTS: strict test only for v2+
Bug: 223537775
Bug: 197096139
Test: VtsAidlKeyMintTargetTest
Change-Id: Ib77d52e4a91233c936b3a44f5eac71f53b2af450
2022-03-21 15:29:00 +00:00
Max Bires
e74f0bc950 More canonicalization checks and canonicalize before signing
This change makes sure the DeviceInfo CBOR map is canonicalized before
the signature check instead of just separately checking the
canonicalization in a separate call. Additionally, some ASSERTs have
been changed to EXPECTs in validation of the DeviceInfo map more
generally, where it makes sense to avoid failing immediately.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I69806c887656772ea6b5e2e3f0af50957e6b05e3
2022-03-21 05:19:15 +00:00
Tri Vo
06d5f095be Merge "KeyMint VTS: Expect empty key if boot state unverfied" am: a26f8cb316 am: 39f920bae3 am: c18ed24712
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2014678

Change-Id: I877572dcb311c4c83f4effb4e0dbdec38ebee5bc
2022-03-18 18:56:57 +00:00
Tri Vo
a26f8cb316 Merge "KeyMint VTS: Expect empty key if boot state unverfied" 2022-03-18 18:14:31 +00:00
Janis Danisevskis
500f3e0436 Merge changes from topic "default_dice_hal" am: 49a1688f5e am: 0b05aae7dc am: 2c90fb249d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1896435

Change-Id: Ic00ebe42a30cfa7bff9e229d07f91bb2ec4c3698
2022-03-16 21:17:13 +00:00
Janis Danisevskis
49a1688f5e Merge changes from topic "default_dice_hal"
* changes:
  Dice HAL: Add VTS Test.
  Dice HAL: Added default implementation.
2022-03-16 20:16:15 +00:00
David Drysdale
c2387a1d5a Merge "Revert "KeyMint VTS: add TEST_MAPPING"" am: 83e3bffe66 am: 0918368cf8 am: 85b06d9590
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2028363

Change-Id: Ife7fefb8c11e694a0a36340ddab12851e34ce09d
2022-03-16 12:54:23 +00:00
David Drysdale
83e3bffe66 Merge "Revert "KeyMint VTS: add TEST_MAPPING"" 2022-03-16 11:43:55 +00:00