Commit graph

732 commits

Author SHA1 Message Date
Treehugger Robot
5d78414015 Merge "Update ProtectedData DKCertChain to use X.509" am: e003ed061b am: 2c2972a157
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2089226

Change-Id: Ia95b757401d196c49e8048039fbfc0152289f112
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-09 18:47:00 +00: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
a410b770e9 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
2022-05-09 17:38:35 +01:00
Treehugger Robot
0ba8531279 Merge "Updated the description on Root of Trust Binding." 2022-05-09 16:36:54 +00: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
2c6790fe53 Update ProtectedData DKCertChain to use X.509
This matches against what we're shipping in tm-dev.

Bug: 227350250
Test: N/A -- doc changes only
Change-Id: I3771c0fd45999e4204ba3964ed421641f02d6e7c
2022-05-06 10:04:15 -07:00
Seth Moore
1e8fc75bc0 Merge "Clean up keymint ProtectedData documentation" into tm-dev 2022-05-06 14:58:50 +00:00
David Drysdale
7288bce38b Merge "KeyMint VTS: skip device ID checks on GSI" am: 072c0b3ab6 am: d043e8b231
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2086983

Change-Id: I9ecbd80c5a1612ebe27fc47a08407871778d2fd1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 06:05:00 +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
David Drysdale
072c0b3ab6 Merge "KeyMint VTS: skip device ID checks on GSI" 2022-05-05 05:27:34 +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
David Drysdale
c7588303b0 Merge "Run SecureElementProvision tests for KeyMint version >= 2." am: d347852bcc am: 009d595c0f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2051222

Change-Id: I29a40ba3147873bc02a437478d257a5aa21b7699
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 10:24:39 +00:00
David Drysdale
d347852bcc Merge "Run SecureElementProvision tests for KeyMint version >= 2." 2022-05-04 09:48:48 +00:00
David Drysdale
b6e1609da1 Merge "Updated the description for APPLICATION_ID and APPLICATION_DATA" am: 6cd7c6295b am: de59134032
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2075380

Change-Id: Id72c336939ce5528d9438ba5b5b81ff9e9774b11
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 07:08:56 +00:00
David Drysdale
6cd7c6295b Merge "Updated the description for APPLICATION_ID and APPLICATION_DATA" 2022-05-04 06:03:50 +00:00
David Drysdale
555ba00c0f KeyMint VTS: skip device ID checks on GSI
Bug: 229356841
Test: VtsAidlKeyMintTargetTest
Change-Id: I3182bad5584c35df7b1eeb476dabb39d19fdf12c
2022-05-03 18:50:58 +01:00
Subrahmanyaman
5083a85141 Updated the description for APPLICATION_ID and APPLICATION_DATA
As the signature of the getKeyCharacteristics() does not
use Tag Mechanism for app_id and app_data, there is no way
to distinguish between appId / appData  values that are
absent, vs values that are present but of zero length. Due to
this limitation a key with a zero-length app_id / app_data
cannot have its key characteristics retrieved using
getKeyCharacteristics()

Test: VtsAidlKeyMintTarget
Change-Id: I145dcba878171c174d48ad42fadeb49e045b5c55
2022-05-02 23:28:12 +00:00
Seth Moore
76626c0bda Clean up keymint ProtectedData documentation am: 1d389acec8 am: 19eff513d4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2075940

Change-Id: Ic9334c1ab5fa1faadec1f399a70b86933d41ddd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-29 19:20:00 +00:00
Subrahmanyaman
0f5953556c Updated the description on Root of Trust Binding.
The root of trust consists of a bitstring that must be derived
from the public key used by Verified Boot, from the lock state
and from the Verified Boot state of the device.

Test: VtsAidlKeyMintTarget

Change-Id: Ib20bf17066f087c6fc050a498cc7ed4a4cb08ae6
2022-04-29 02:39:11 +00:00
Seth Moore
1d389acec8 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
2022-04-28 12:41:18 -07:00
Subrahmanyaman
4418984ab6 Run SecureElementProvision tests for KeyMint version >= 2.
Test: run vts -m VtsAidlKeyMintTarget
Change-Id: Icd2565170a473b539a1959042bbfa93e66947a69
2022-04-25 22:40:14 +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
Prashant Patil
60f8d4d5b2 KeyMint: Test Ecdsa key generation without curve
Added new VTS EcdsaMissingCurve to test if EC_CURVE not specified while
generating new EC Key, keyGeneration should fail.

Bug: 225135360
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: I32bbba05ed5203690292f7150d14f9644c4be6df
2022-03-31 10:26:51 +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
David Drysdale
6288f4bbb9 Revert "KeyMint VTS: add TEST_MAPPING"
This reverts commit 7e71fcf852.

Reason for revert: failing tests on git_master on aosp_x86_64-userdebug

Bug: 224951152
Bug: 224951969
Bug: 224950581
Change-Id: I86ae5e8d73cefd6d9d923138384cf98ec80a42df
2022-03-16 11:34:44 +00:00
David Drysdale
c477499208 Merge "KeyMint VTS: add TEST_MAPPING" am: 7f366ab5dd am: 4c1b6dfb23 am: 36f58e6c98
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1879916

Change-Id: Ic2d9051445575fce6e451d9919d07a4fd42d3211
2022-03-16 08:06:38 +00:00
David Drysdale
7f366ab5dd Merge "KeyMint VTS: add TEST_MAPPING" 2022-03-16 06:49:19 +00:00
Janis Danisevskis
21244fc192 Dice HAL: Add VTS Test.
This CL adds a VTS test for the DICE HAL, and a test specific for
demotion testing. Demotion testing leaves the device in a permanently
modified state untill the next reboot, which is why it needs a special
test config. The current test config restarts the device before testing,
in a followup the device also has to reboot after the test.

Bug: 198197213
Test: atest VtsAidlDiceTargetTest
      atest VtsAidlDiceDemoteTargetTest
Change-Id: I4278a1352df749da50dc8e5d118fc37336026061
2022-03-15 12:39:22 -07:00
David Drysdale
836e79fb72 Merge "Prevent test crashes if device sets invalid curve" am: ceedbb0d1a am: cd2af34d63 am: 590665c1b9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2020155

Change-Id: I21eff3e3f3af55b2041b739dc7e0d8342df25599
2022-03-15 08:53:59 +00:00
David Drysdale
ceedbb0d1a Merge "Prevent test crashes if device sets invalid curve" 2022-03-15 07:35:02 +00:00
David Drysdale
79972e7645 Merge "Key{Mint,Master} VTS: fix incremental AES tags" am: e5c2bf01fc am: 523b300da7 am: a219992eef
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2020421

Change-Id: I771b72b5f4f439c8b6eea264010b90f0efa876a8
2022-03-14 17:02:36 +00:00
David Drysdale
e5c2bf01fc Merge "Key{Mint,Master} VTS: fix incremental AES tags" 2022-03-14 15:45:28 +00:00
David Drysdale
1a637199e4 Key{Mint,Master} VTS: fix incremental AES tags
Change Id62fdce65131ee00c88e5849955a937f1c171748 split up the AES
incremental encryption tests into individual tests for each encryption
mode.  This meant that each generated key is only valid for a single
mode, which in turn means that for non-GCM mode keys it is not valid
to specify MIN_MAC_LENGTH.

Bug: 223934835
Test: VtsAidlKeyMintTargetTest
Change-Id: I38f34f60116bde3d23f203365d62e5b25d7b254b
2022-03-14 09:23:29 +00:00
Treehugger Robot
0b549805f9 Merge "remote_prov_utils: Add instance name in the JSON output" am: 3192a09b11 am: a91e17ed66 am: 6cc8d07a64
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2017795

Change-Id: I3d2764f804934140791824c2a747aced9b0199f8
2022-03-11 14:23:18 +00:00
Treehugger Robot
3192a09b11 Merge "remote_prov_utils: Add instance name in the JSON output" 2022-03-11 12:48:19 +00:00
Eran Messeri
059a030d48 Merge "Update the default KeyMint version" am: 7fc756ee1a am: e3e82c9d53 am: d6ef5852b5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2020439

Change-Id: I667fba98f44d4f2b6d8e7d7487c83fd83e78e2a9
2022-03-11 00:26:17 +00:00
Janis Danisevskis
86124738cd Dice HAL: Added default implementation.
Test: ... one ...
Bug: 198197213
Change-Id: If855e2a4a0150d80e7cecce0a078cdeca00bdb50
2022-03-10 12:23:59 -08:00
Eran Messeri
bf89c797d0 Update the default KeyMint version
As the current KeyMint version is 2 (200), reflect that in the default
XML.

Devices that ship with older KeyMint/KeyMaster version should override
the default android.hardware.hardware_keystore.xml file with the
version they support.

Test: android.keystore.cts.KeyAttestationTest#testAttestationKmVersionMatchesFeatureVersion
Bug: 222406513
Bug: 216543583
Change-Id: I6f2229019929cff747cec3907fc2a9b8ebebdcf4
2022-03-10 19:16:39 +00:00
David Drysdale
08696a7543 Prevent test crashes if device sets invalid curve
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ib623b3dcdd5a496b34314c1e0d1a310c8beeb18d
2022-03-10 10:54:37 +00:00
Tommy Chiu
cb7d3d0759 remote_prov_utils: Add instance name in the JSON output
Bug: 223509807
Test: libkeymint_remote_prov_support_test
Change-Id: I45d2ee46f6fe3c8a7da55c7cc0b04fc007ddea43
2022-03-10 12:17:39 +08:00
David Drysdale
824f48e621 KeyMint VTS: check for relevant devices am: 1585fdceb5 am: 4e3b4590c9 am: b96f3a4099
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2013077

Change-Id: I593e54aff83abc22b3749075b114595363af8e4d
2022-03-09 11:24:52 +00:00
Tri Vo
af2914162f KeyMint VTS: Expect empty key if boot state unverfied
Bug: 221128605
Test: VtsAidlKeyMintTargetTest
Change-Id: Icbf0ccf57245b2eef559a119087e15cd883239f5
2022-03-08 10:06:06 -08:00
David Drysdale
1585fdceb5 KeyMint VTS: check for relevant devices
Don't run tests if the appropriate KeyMint device is not available (e.g.
on something that only has Keymaster).  Move to use GTEST_SKIP
consistently.

Bug: 221909227
Test: VtsAidlKeyMintTargetTest
Change-Id: I5dab238519e57e6752b795f3a983681cf4337bdd
2022-03-08 08:07:02 +00:00
Treehugger Robot
04fc0c4fb2 Merge "Split AESincremental VTS test into 4 Tests(For blockmodes-ECB,CBC,GCM,CTR)" am: 90019d46c2 am: bfdd991c76 am: 8be10ddce6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2007030

Change-Id: Iffe169fcff0a11478672bf8f5895a93fcdcc9003
2022-03-04 18:50:47 +00:00
anil.hiranniah
19a4ca17ea Split AESincremental VTS test into 4 Tests(For blockmodes-ECB,CBC,GCM,CTR)
Change mentioned above is done in VTS for Keymaster4.0
and Keymint

Test: VTS tests with tradefed
Change-Id: Id62fdce65131ee00c88e5849955a937f1c171748
2022-03-03 18:02:04 +05:30
Treehugger Robot
4553efd422 Merge "Support for P256 curve in RKP for Strongbox Test: Run Rkp Vts tests." am: 55419fd935 am: 3b6c35b95e am: df05e41148
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1969799

Change-Id: I7a8bc93b7f4d8a391c86c1b9cc6f4bd88a9ee759
2022-03-02 12:53:20 +00:00
Treehugger Robot
55419fd935 Merge "Support for P256 curve in RKP for Strongbox Test: Run Rkp Vts tests." 2022-03-02 11:45:05 +00:00
David Drysdale
92ffa6384e KeyMint VTS: fix fixture setup name am: 795f758780 am: 85ce9e2530 am: 77a0eb6d63
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2003891

Change-Id: I10373d673da1d3d2e24cff7d28551b9f60eb0605
2022-03-01 17:05:16 +00:00
David Drysdale
7e71fcf852 KeyMint VTS: add TEST_MAPPING
Test: TreeHugger
Change-Id: If4e19f189a3cd58e143672a562837365d78da69d
2022-03-01 16:41:52 +00:00
David Drysdale
795f758780 KeyMint VTS: fix fixture setup name
Bug: 221909227
Test: VtsAidlKeyMintTargetTest
Change-Id: Ic0722242cee2ea21c974133e4f81b13b21e44615
2022-03-01 13:52:20 +00:00
Treehugger Robot
81c91bf2b1 Merge "Update KeyMint VINTF fragment to version 2" am: 73e15472a4 am: 02b7992b62 am: 5cc1805e43
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2002270

Change-Id: Ida4c2b5f87b26577d56b8b74ac45367dcb79dbed
2022-02-28 22:52:46 +00:00
Treehugger Robot
73e15472a4 Merge "Update KeyMint VINTF fragment to version 2" 2022-02-28 21:46:00 +00:00
Shawn Willden
ef8bdc4f1d Update KeyMint VINTF fragment to version 2
Bug: 221390931
Test: vts -m vts_treble_vintf_vendor_test
Change-Id: I62746b9b60b4b236c0cbb8d2c2edd519c61a71ac
2022-02-28 09:35:59 -07:00
Treehugger Robot
b6a79990a5 Merge "KeyMint: Test generation of asymmetric keys fails with missing parameters" am: 72358dab6a am: 9a7ab7c60b am: 140062e6fb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1895034

Change-Id: If1d224518b75ce8d90061aa243ad3959fed6b5f1
2022-02-24 17:28:58 +00:00
Treehugger Robot
72358dab6a Merge "KeyMint: Test generation of asymmetric keys fails with missing parameters" 2022-02-24 16:14:21 +00:00
Chih-hung Hsieh
34593d4e2a Merge "Add timed out test files to tidy_timeout_srcs" am: ff54f73b4f am: fa83970b3a am: 581616e658
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1992232

Change-Id: I2eac13fe3b5ab0b4f15d6ceadf376e5e74124a81
2022-02-24 01:32:09 +00:00
Chih-hung Hsieh
ff54f73b4f Merge "Add timed out test files to tidy_timeout_srcs" 2022-02-24 00:21:18 +00:00
Treehugger Robot
7cba12b70c Merge "Provide alternate SE RoT provisioning path." am: 07011d9e09 am: 11c970f706 am: b56acbc92e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1982797

Change-Id: I86a0b94d2c61d1e4268f27e0121085dbc4e17927
2022-02-23 19:22:19 +00:00
Shawn Willden
0cc617cab0 Provide alternate SE RoT provisioning path.
On some devices it is infeasible to provision the KeyMint RoT bits in
the Android Bootloader.  This provides an alternate path to provision
them from the TEE during early boot.

Bug: 219076736
Test: VtsAidlKeyMintTargetTest
Change-Id: If69f7e25e58edbf4d2190084e2c0a03a94bfa5d6
Merged-In: If69f7e25e58edbf4d2190084e2c0a03a94bfa5d6
2022-02-22 23:52:18 -07:00
subrahmanyaman
fb213d6031 Support for P256 curve in RKP for Strongbox
Test: Run Rkp Vts tests.

Change-Id: Ic38fd2318dd8749ae125f1e78d25f2722bd367e5
2022-02-23 05:02:40 +00:00
Chih-Hung Hsieh
ad1bf31b78 Add timed out test files to tidy_timeout_srcs
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
  the following settings:
    TIDY_TIMEOUT=90
    WITH_TIDY=1
    CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
  tidy_timeout_srcs files will not be compiled by clang-tidy.
  When developers build locally without TIDY_TIMEOUT,
  tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
  or disable some time consuming checks, and then
  enable clang-tidy to run within limited time.

Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
2022-02-18 17:25:41 -08:00
Treehugger Robot
999b0e3efc Merge "Fixed vts tests cases which do not support factory attestation. Test: Run keymint Vts tests." am: 0f7d419136 am: c1603e8ef5 am: 07c1601d5f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1972595

Change-Id: I27812795afb51c66ebacc735b1986bd508c71cc4
2022-02-16 16:56:12 +00:00
Treehugger Robot
0f7d419136 Merge "Fixed vts tests cases which do not support factory attestation. Test: Run keymint Vts tests." 2022-02-16 15:50:30 +00:00
Prashant Patil
6c1adf0aa1 KeyMint: Test generation of asymmetric keys fails with missing parameters
A VTS testcase is added to validate Asymmetric key generation fails if TAG_CERTIFICATE_NOT_(BEFORE/AFTER) is missing.

Also updated DeviceUniqueAttestationTest to set validity in
AuthorizationSetBuilder using .SetDefaultValidity().

Bug: 205679495
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: Ibf63a6c8e173326502c7bf1b8f3af8666ecb1caf
2022-02-14 21:29:31 +00:00
Alan Stokes
8c292be775 Merge "Allow CompOS to use DICE from C++" am: 13eaedcaec am: 66c0e03f0e am: 8ef53bb1c5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1979471

Change-Id: I2af92e1eb1ae83644f24b28aefb9d9df97a8a6e4
2022-02-14 10:26:15 +00:00
Alan Stokes
4aab4f7704 Allow CompOS to use DICE from C++
Bug: 218494522
Test: Builds
Change-Id: Ica240e1d268403ba546d83c86596d72bacec2bdf
2022-02-10 15:05:48 +00:00
Treehugger Robot
46c40cfb0b Merge "Make os_version optional for StrongBox" am: fc3fdf1a96 am: be60ee6543 am: f402fd2a55 am: fa59f35bce
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1971121

Change-Id: Ib268a21c6b06400e98400a86e0ae459de4a82603
2022-02-08 23:59:45 +00:00
Treehugger Robot
fc3fdf1a96 Merge "Make os_version optional for StrongBox" 2022-02-08 22:59:29 +00:00
subrahmanyaman
0564249f93 Fixed vts tests cases which do not support factory attestation.
Test: Run keymint Vts tests.

Change-Id: I8055fef8df5ec77e317f810f9b95a53311b23cf0
2022-02-05 07:12:33 +00:00
Max Bires
29de600965 Merge "Enforcing canonicalization of DeviceInfo." am: 4820b542fa am: 2b8301c90e am: 78e11bb6f4 am: f475c1a4c1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1968997

Change-Id: Idd38f7468e654e545eaca4abab93c89017da1679
2022-02-04 03:39:49 +00:00
Max Bires
9c28a1ed3a Make os_version optional for StrongBox
This change allows the os_version in the DeviceInfo map to be optional
for StrongBox implementations. It also adds the appropriate changes to
the VTS test to relax this requirement.

Bug: 215444522
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I1695b7c4e7a9bd884fa88c14f9c22bacd38cdbd3
2022-02-03 19:17:38 -08:00
Max Bires
4820b542fa Merge "Enforcing canonicalization of DeviceInfo." 2022-02-04 02:44:54 +00:00
Max Bires
bfd607145c Fixing spec discrepancy in MacedPublicKey am: fbc0db2cd2 am: 0b51b97a80 am: d731deda2e am: 649b0b6ba5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1971499

Change-Id: I771bae65fab08b1ba78b3626229aa66f300c7db4
2022-02-03 22:28:16 +00:00
Max Bires
fbc0db2cd2 Fixing spec discrepancy in MacedPublicKey
The algorithm choice was listed as -8 for ES256, when it should be -7.

Fixes: 217691766
Test: Everyone harmoniously agrees by +2'ing.
Change-Id: I7f73efff42ee6d2b3bfb94b74c1208170805b870
2022-02-03 18:51:56 +00:00
Treehugger Robot
1bbd78efcd Merge "Changing DeviceInfo fields to be mandatory." am: 87a6fbc5cd am: 7aba6f7c52 am: b92d700d4a am: e9faf18290
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1965502

Change-Id: I9665202053ead084c6705320440d75d6f3386837
2022-02-03 01:59:41 +00:00
Max Bires
8c255e69bf Enforcing canonicalization of DeviceInfo.
This change specifies that the DeviceInfo map returned by the IRPC HAL
implementation should be canonicalized. Additionally, it adds coverage
to the VTS tests to ensure this requirement is enforced.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I276f38497a307c407d305b62a3e9af78a403054e
2022-02-03 01:00:03 +00:00
Treehugger Robot
87a6fbc5cd Merge "Changing DeviceInfo fields to be mandatory." 2022-02-03 00:27:21 +00:00
Max Bires
8b09c50e49 Changing DeviceInfo fields to be mandatory.
This change removes the optionality ("?") from all of the device info
fields, now that DeviceIDs are mandatory. It also changes att_id_state
to the broader "fused" category. It may not convey exactly the same
meaning, but it seems better to avoid proliferating a lot of fields that
all speak to some technical detail of the factory provisioning status of
the device.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Iaf3de6a7a7a9b8af7d2e9673d7f1320858b95617
2022-02-02 14:18:36 -08:00
Treehugger Robot
1793c1eba9 Merge "Remove 'ops' field from BCC public keys." am: fefa4986db am: f2e823e672 am: c12212b6a6 am: acaf0438ca
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1964424

Change-Id: Ie823d3b88ab1379069564f95d28d907ab3ad3fa3
2022-02-02 21:46:03 +00:00
Treehugger Robot
fefa4986db Merge "Remove 'ops' field from BCC public keys." 2022-02-02 20:47:25 +00:00
Max Bires
2b5db8eae4 Remove 'ops' field from BCC public keys.
The application of ops is currently inconsistent within the spec, and
wrong where it is specified. It is mapped to an integer when it should
be mapped to an array that contains the integer value. Given that all
key usage is strictly defined within the spec itself, there is no value
currently in including the ops field. Because of this, the choice is
being made to simply remove the field.

Test: documentation change only
Change-Id: Ia3a9895c7840e3cda9c2775080b7dcb18544d417
2022-02-01 19:35:58 -08:00
Treehugger Robot
6d62e17a81 Merge "Include the CWT validation in VTS testing." am: 608099fd88 am: 769c2bf958 am: b90df9e683 am: 8b4d894f2e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1965500

Change-Id: I4c47b6217b5fa957df87ed7eb766398821521f7f
2022-02-02 03:14:41 +00:00
Treehugger Robot
608099fd88 Merge "Include the CWT validation in VTS testing." 2022-02-02 02:14:02 +00:00
Max Bires
81880284af Include the CWT validation in VTS testing.
This change modifies the VTS tests to validate the structure of the CBOR
Web Token (CWT) which contains the public key as one of several fields
in the map. It only validates the subset of fields expected to be seen
in the VTS tests. The ones related to the actual BCC will not be
present in test mode due to the security guarantees of the interface.

Additionally, the test will also now check that the first key in the BCC
array matches the public key that should be self-signed in the
certificate located in the second index of the BCC array.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I9e7769861529b8095d77ce8fee3c78222579d38c
2022-02-02 02:13:26 +00:00
Seth Moore
01035edde1 Merge changes from topic "revert-1959803-revert-1956689-add rkp to identity-default-ENFHZTRTBV-OLKYWRVSFZ" am: ff225d91c0 am: 644d624bfb am: f28bd6f68a am: 8052646705
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1960032

Change-Id: I6792c7c7800878afd5b3c8ffb62fb919d2e6fc0a
2022-01-27 19:16:55 +00:00
Seth Moore
ff225d91c0 Merge changes from topic "revert-1959803-revert-1956689-add rkp to identity-default-ENFHZTRTBV-OLKYWRVSFZ"
* changes:
  Revert^2 "Add remote key provisioning to the IC HAL"
  Revert^2 "Refactor IC support for RKP"
  Revert^2 "Log to logd in the default identity service"
  Revert^2 "Fix formatting of identity credential aidl"
2022-01-27 18:18:12 +00:00
Steven Moreland
cecd73050a Merge "-= src_available" am: c82603654a am: c84c245a91 am: 92afde25de am: 598537ff78
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1959809

Change-Id: Ie8ac98bb63d97a6cb60762f1466fe863e0c8bcd3
2022-01-27 00:43:23 +00:00
Steven Moreland
c82603654a Merge "-= src_available" 2022-01-26 23:43:03 +00:00
Seth Moore
963999f2e1 Revert "Add remote key provisioning to the IC HAL" am: be32113307 am: e8700adfef am: 77444fe8a2 am: 60422b9749
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1959805

Change-Id: I249c6357955fd5cf9a4add324bd42c15c7bfefe9
2022-01-26 00:03:48 +00:00
Steven Moreland
fe0546fe14 -= src_available
Default now. To Remove.

Bug: 215754978
Test: N/A
Change-Id: I4042a83ae624187570e7e2b2a7a1c1282906f6d0
2022-01-25 23:38:32 +00:00
Seth Moore
e8700adfef Revert "Add remote key provisioning to the IC HAL" am: be32113307
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1959805

Change-Id: I937ba21a24b8cd2c1136d0ec65cb03b1879352c2
2022-01-25 23:18:25 +00:00
Seth Moore
1bf823ce75 Revert^2 "Add remote key provisioning to the IC HAL"
be32113307

Change-Id: I55ddbddd0bc317f1f077a63b0275c4d55fd9c76f
2022-01-25 23:04:37 +00:00
Seth Moore
6278c2d241 Merge changes from topic "revert-1956689-add rkp to identity-default-ENFHZTRTBV"
* changes:
  Revert "Fix formatting of identity credential aidl"
  Revert "Log to logd in the default identity service"
  Revert "Refactor IC support for RKP"
  Revert "Add remote key provisioning to the IC HAL"
2022-01-25 23:03:24 +00:00
Seth Moore
be32113307 Revert "Add remote key provisioning to the IC HAL"
Revert "Add dependency on keymint cpp lib"

Revert "Allow default identity service to call keymint"

Revert submission 1956689-add rkp to identity-default

Reason for revert: Broke git-master. Will resubmit later.
Reverted Changes:
I96dcf3027:Add remote key provisioning to the IC HAL
Id686ac33a:Add dependency on keymint cpp lib
Ib368a2a00:Log to logd in the default identity service
I7d2906de0:Refactor IC support for RKP
Iae0f14f1c:Fix formatting of identity credential aidl
I01d086a4b:Allow default identity service to call keymint

Change-Id: I76a898c04090c5befe5fb5a5d07ec2e397fdd8b3
2022-01-25 22:44:24 +00:00
Seth Moore
63f1055bab Merge changes from topic "add rkp to identity-default" am: 79fdf4d688 am: acc7215686 am: 7897aabec2 am: 16a2b06647
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1956689

Change-Id: If0570472c1c20c7aa9886e8e1b038f51577a717b
2022-01-25 21:18:59 +00:00
Seth Moore
79fdf4d688 Merge changes from topic "add rkp to identity-default"
* changes:
  Add remote key provisioning to the IC HAL
  Refactor IC support for RKP
  Log to logd in the default identity service
  Fix formatting of identity credential aidl
2022-01-25 20:33:01 +00:00
Seth Moore
f5cb42dd20 Merge "Add uniqueId to IRemotelyProvisionedComponent" am: 3511d287ba am: 2bdc6dcb12 am: da8cfdbac0 am: 2143512f56
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1923317

Change-Id: Ie55bffa21a0b2b24f54a6b181863cf9ac28a49d3
2022-01-25 14:20:42 +00:00
Seth Moore
3511d287ba Merge "Add uniqueId to IRemotelyProvisionedComponent" 2022-01-25 13:11:34 +00:00
Seth Moore
b5b69f0e00 Add remote key provisioning to the IC HAL
The IIdentityCredentialStore can now advertise the correct
IRemotelyProvisionedComponent that is used for getting remotely
provisioned attestation keys.

IWritableIdentityCredential has a new method so it can accept remotely
provisioned keys.

Update the VTS tests to check the new RKP functionality.

Support RKP in the default identity cred service

Test: VtsHalIdentityTargetTest
Bug: 194696876
Change-Id: I96dcf3027e0f21790c35900ddf8cc0953bd3b1ca
2022-01-24 16:19:21 -08:00
Seth Moore
fc86bf4d5f Add uniqueId to IRemotelyProvisionedComponent
This id is used to differentiate between implementations of the
IRemotelyProvisionedComponent interface. This is required to track
certificates and keys for each implementation. Without an implementation
id, we would have no way to associate persisted, remote provisioning
data with the appropriate IRemotelyProvisionedComponent.

Include VTS tests for compliance.

Test: VtsHalRemotelyProvisionedComponentTargetTest
Bug: 194696876

Change-Id: Id8bca26d71ecf9e389e68a269f782a9dc5ee6f01
2022-01-24 16:19:21 -08:00
David Drysdale
704402e477 Merge changes Ibfb6a54c,Ifa0f95fd am: 4af9762ef7 am: 1eb867fc2f am: b6b6d6151c am: 5225d85341
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1939114

Change-Id: I03ab9d0df56a8e939b11d45d0401566f937a4959
2022-01-24 10:07:03 +00:00
David Drysdale
4af9762ef7 Merge changes Ibfb6a54c,Ifa0f95fd
* changes:
  KeyMint VTS: police Ed25519 msg size limit
  KeyMint VTS: test curve 25519 functionality
2022-01-24 09:06:17 +00:00
David Drysdale
feab5d932f KeyMint VTS: police Ed25519 msg size limit
Ed25519 signing operations require the secure world to accumulate the
entirety of the message; consequently, impose a limit on message size
for this operation.

Bug: 194358913
Test: VtsAidlKeyMintTargetTest
Change-Id: Ibfb6a54c1d546b5b4e51f42795d2bb4660add772
2022-01-21 07:12:23 +00:00
Treehugger Robot
26552f4974 Merge "DICE: Use fixed sized arrays for fixed sized fields." am: 9bea46c467 am: 6c960c53c0 am: 31a02c0416 am: 0d37eec8c9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1923382

Change-Id: Ic6ec379948e4864db8852c165279b31d8e654b0e
2022-01-18 20:48:39 +00:00
Treehugger Robot
9bea46c467 Merge "DICE: Use fixed sized arrays for fixed sized fields." 2022-01-18 19:32:16 +00:00
Alan Stokes
82d45061f9 Allow CompOS to use DICE am: cd938514ba am: 36be9a46b1 am: faa89ce76d am: c4f193a4c4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1952218

Change-Id: I42c5d43c9ef9dc72b5726639e1f5aeb1802f736f
2022-01-18 11:46:25 +00:00
Alan Stokes
cd938514ba Allow CompOS to use DICE
Bug: 214233409
Test: Builds
Change-Id: I1640b64fbb4b63097106dba56269fe1cac6d1679
2022-01-17 15:49:11 +00:00
David Drysdale
34288aa2ee Merge "Alter spec text for RSA-PSS to match reality" 2022-01-17 06:53:26 +00:00
Treehugger Robot
9b4d3907e2 Merge "Block cipher fixups" am: 3d98c54066 am: 1bdbe9528d am: e5ed05b059 am: ffacdad4a9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1949538

Change-Id: I297f1b3a562df834c4021cdf5bfd395fa49cbc5a
2022-01-14 22:13:49 +00:00
Brian J Murray
734c841daf Block cipher fixups
Various block cipher testing fixups. Some of these changes reflect edge
cases I encountered when running local GSC builds.

Change:
* Extend ciphertext lengths.
* Add SCOPED_TRACE() within for loops.
* Use '\t' instead of 'a' for PKCS7 padding.

Test: CTS/VTS

Signed-off-by: Brian J Murray <brianjmurray@google.com>
Change-Id: I4555519787e0133367ad3f40609d43a7bc71c36e
2022-01-14 17:41:53 +00:00
David Drysdale
ab1851e9f2 Alter spec text for RSA-PSS to match reality
The Key{Mint,Master} spec previously said that RSA-PSS mode should use
SHA-1 for the MGF1 digest, separately from whatever Tag::DIGEST gets
specified as the main digest.

However, both the reference implementation and the VTS/CTS tests
use BoringSSL's defaults, which is to re-use the main digest as the MGF1
digest if none is separately specified.

Given that this behaviour is embedded in many implementations over
several years (and given that there isn't a security implication),
change the spec to match this behaviour.  Also update the VTS test
code to make this clear/obvious.

Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Bug: 210424594
Change-Id: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
Ignore-AOSP-First: target internal master first due to merge conflict
2022-01-13 09:13:39 +00:00
David Drysdale
c6b8907a32 Alter spec text for RSA-PSS to match reality
The Key{Mint,Master} spec previously said that RSA-PSS mode should use
SHA-1 for the MGF1 digest, separately from whatever Tag::DIGEST gets
specified as the main digest.

However, both the reference implementation and the VTS/CTS tests
use BoringSSL's defaults, which is to re-use the main digest as the MGF1
digest if none is separately specified.

Given that this behaviour is embedded in many implementations over
several years (and given that there isn't a security implication),
change the spec to match this behaviour.  Also update the VTS test
code to make this clear/obvious.

Test: VtsAidlKeyMintTargetTest, VtsHalKeymasterV4_0TargetTest
Bug: 210424594
Merged-In: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
Change-Id: I4303f28d094ef4d4b9dc931d6728b1fa040de20d
2022-01-13 09:13:08 +00:00
David Drysdale
42fe189633 KeyMint VTS: test curve 25519 functionality
- Add CURVE_25519 as a supported curve for EC operations.
- Add a helper that checks whether the HAL is of a version that is
  expected to support curve 25519, and skip relevant tests if not.
- Ed25519 support
  - Update KeyMintAidlTestBase::LocalVerifyMessage to cope with a public
    key of type EVP_PKEY_ED25519.
  - Add a test key pair generated with openssl command line.
  - Key generation test
  - Key import test for raw format
  - Key import test for PKCS#8 format
  - Key import failures tests
  - Signature test
  - Check that purposes cannot be combined (Ed25519 != X25519)
  - Check that Ed25519 key can be attested to
  - Implicitly check that an Ed25519 key can be used for attestation
    (as it is in ValidCurves())
  - Force Digest::NONE for Ed25519 throughout.
- X25519 support
  - Add a test key pair generated with openssl command line.
  - Key generation test
  - Key import test for raw format
  - Key import test for PKCS#8 format
  - Key import failures tests
  - Key agreement test, including...
  - Refactoring of existing key agreement test for re-use
  - Update key agreement checks to cope with a public key of type
    EVP_PLEY_X25519.
  - Key agreement test using imported key
  - Check that purposes cannot be combined (Ed25519 != X25519)

Bug: 194358913
Test: VtsAidlKeyMintTargetTest
Change-Id: Ifa0f95fdfba4387843c8e821c2ca977da0488fa6
2022-01-12 10:58:19 +00:00
Janis Danisevskis
37f1609ed5 DICE: Use fixed sized arrays for fixed sized fields.
Bug: 210149444
Test: N/A
Change-Id: I1d4e502cb6535117f51d2d0ce008f2669fc90e96
2022-01-11 11:06:35 -08:00
Treehugger Robot
bfc8afb4b1 Merge "Verify op_ is not a nullptr" am: 2d63764c34 am: a8b92e548f am: 3284c9aec4 am: 270df536e2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1940573

Change-Id: I1f9528c2abc699b27d77b3be1ffbb6897c9f11c8
2022-01-07 07:32:06 +00:00
Brian J Murray
eabd9d6d2a Verify op_ is not a nullptr
If op_ is a nullptr, the test runner can SIGSEGV.

Test: manual, atest EncryptionOperationsTest#TripleDesCbcPkcs7PaddingCorrupted
Bug: None

Signed-off-by: Brian J Murray <brianjmurray@google.com>
Change-Id: Ibdd6139952ca8bc83ac1a82202839feee39562e1
2022-01-06 15:26:16 -08:00
TreeHugger Robot
ba0e65261a Merge "Merge "Add android.hardware.security.dice HAL interface." am: b05a7c1376 am: 1d5af3f5ec" into sc-v2-dev-plus-aosp am: 20d510ef74
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/16492969

Change-Id: I1c2c6239c7d6d84b8e0f0d030d1b32bb78b11d3e
2021-12-17 00:36:07 +00:00
TreeHugger Robot
20d510ef74 Merge "Merge "Add android.hardware.security.dice HAL interface." am: b05a7c1376 am: 1d5af3f5ec" into sc-v2-dev-plus-aosp 2021-12-17 00:22:45 +00:00
David Drysdale
9faa48aa87 Merge "KeyMint: new version number in attestation" am: 17393cbb40 am: 0a3c90f904 am: bb5882c6b3 am: 1cce1762fe
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1918628

Change-Id: Ie6b1966ff710b4fea1275c8b06b329f9b451910f
2021-12-16 23:23:19 +00:00
David Drysdale
1cce1762fe Merge "KeyMint: new version number in attestation" am: 17393cbb40 am: 0a3c90f904 am: bb5882c6b3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1918628

Change-Id: Ib930f22030769d965e1e0323cebfc4bf0344dcac
2021-12-16 22:58:36 +00:00
Treehugger Robot
4ddf8b5668 Merge "Add android.hardware.security.dice HAL interface." am: b05a7c1376 am: 1d5af3f5ec
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1883260

Change-Id: If3b724cc66bbc87aad86211c9e7e2f36719f2c33
2021-12-16 20:51:39 +00:00
David Drysdale
17393cbb40 Merge "KeyMint: new version number in attestation" 2021-12-16 09:37:15 +00:00
Treehugger Robot
b05a7c1376 Merge "Add android.hardware.security.dice HAL interface." 2021-12-16 00:16:45 +00:00
Janis Danisevskis
c3cc5a0b21 Add android.hardware.security.dice HAL interface.
The dice HAL provides access to the Dice artifacts of the running Android
instance.

Bug: 198197213
Test: VTS test comming in two ...
Change-Id: I6e84f9a9c7153e7a96c06d1d451e658b3f222586
2021-12-15 08:52:07 -08:00
David Drysdale
7dff4fc9b7 KeyMint: new version number in attestation
For the time being, allow the version number in the attestation record
to be 100 even if the AIDL version is 2, so that implementations don't
have to update both versions simultaneously.

Bug: 194358913
Test: TreeHugger, VtsAidlKeyMintTargetTest
Change-Id: I9aae69327a62014e286ce30ca2a4d91c4c280714
2021-12-15 14:31:19 +00:00
David Drysdale
54bac215fa Merge "KeyMint VTS: ATTEST_KEY has no other purpose" am: a67b0441fe am: 02c4ee0dca am: 35392ef70e am: 6e2b1afdeb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1844276

Change-Id: Idd7c93ed9a4ad0b36ce06006cef11f0990b7ffcf
2021-12-15 07:31:58 +00:00
David Drysdale
a67b0441fe Merge "KeyMint VTS: ATTEST_KEY has no other purpose" 2021-12-15 06:25:35 +00:00
Seth Moore
b568bd5790 Merge "Revert^2 "KeyMint HAL: add curve 25519, bump version"" am: 0834ba697f am: 07069c9e35 am: e41208c9b4 am: 3d160da02b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1920687

Change-Id: I3ead1f90d9a091b16eaa938e9640978c75ad9f6e
2021-12-14 19:56:59 +00:00
Seth Moore
0834ba697f Merge "Revert^2 "KeyMint HAL: add curve 25519, bump version"" 2021-12-14 18:49:58 +00:00
Steven Moreland
77b74ffc0a Merge "CHECK -> CHECK_EQ copy pasta" am: a8138bfbf6 am: dd39b5c9d0 am: f711c9d406 am: 53c7517b02
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1921302

Change-Id: I3f32bf37c1c025e82e14ee6c9f0ffde87f6bcbd6
2021-12-14 18:40:32 +00:00
Steven Moreland
ffb03995e6 CHECK -> CHECK_EQ copy pasta
Hey did I start this? We can take a little bit better errors. :)

Bug: N/A
Test: N/A
Change-Id: I0e96f7f49dae9968904333da9b8269694058c11c
2021-12-14 01:45:47 +00:00
Seth Moore
d79a0ec9ed Revert^2 "KeyMint HAL: add curve 25519, bump version"
e76045d7b0

Change-Id: Ia167fd45b6e590e34523810ee10118c5c141f538
2021-12-13 20:03:33 +00:00
David Drysdale
9758dcae18 Merge "Revert "KeyMint HAL: add curve 25519, bump version"" am: 391a772300 am: f121b2c2bb am: 4df4387267 am: 633046efb2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1918632

Change-Id: I465283c26ef3a281a07a83dbe3c33a138c2eac75
2021-12-13 17:09:42 +00:00
Eran Messeri
3ef44eb5b0 Merge "Keymint: Test that corrupting the signature for HMAC verification fails" am: 924613950c am: 309c32adb7 am: a7ee9f53ed am: 4a9da1da1a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1915101

Change-Id: Ifb396f5f61426d445dcbb20453f5b42ea42347e6
2021-12-13 17:09:17 +00:00
David Drysdale
391a772300 Merge "Revert "KeyMint HAL: add curve 25519, bump version"" 2021-12-13 16:14:16 +00:00
David Drysdale
92b51f25f7 Merge "KeyMint HAL: add curve 25519, bump version" am: f21e1a5c4a am: 5a63e3ea57 am: e373da49f8 am: e274e87d59
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1900930

Change-Id: Id2cc500639fe34fdd84fbbaa67c5092033b51267
2021-12-13 16:06:50 +00:00
David Drysdale
e76045d7b0 Revert "KeyMint HAL: add curve 25519, bump version"
Revert "Bump keystore2 AIDL API version 1->2"

Revert "Advertise support of KeyMint V2"

Revert submission 1900930-version-bump

Reason for revert: Broken build on sc-qpr1-dev-plus-aosp, b/210450339
Reverted Changes:
I42a9b854f:keystore2: cope with new curve25519 enum
I167d568d6:Bump keystore2 AIDL API version 1->2
I3a16d072e:Advertise support of KeyMint V2
Ibf2325329:KeyMint HAL: add curve 25519, bump version

Change-Id: I78d4b07c41aa6bfeb367b56a58deeac6adb6ec46
2021-12-13 16:01:21 +00:00
Eran Messeri
924613950c Merge "Keymint: Test that corrupting the signature for HMAC verification fails" 2021-12-13 15:51:33 +00:00
David Drysdale
f21e1a5c4a Merge "KeyMint HAL: add curve 25519, bump version" 2021-12-13 14:25:22 +00:00
David Drysdale
c069a75302 KeyMint HAL: add curve 25519, bump version
Marked as required for TRUSTED_ENVIRONMENT impls but not STRONGBOX.

Bump keymint HAL version 1->2 in defaults and in current compatibility
matrix.

Bug: 194358913
Test: build
Change-Id: Ibf2325329f0656a2d1fc416c2f9a74d505d0bf20
2021-12-09 14:07:51 -08:00
Prashant Patil
dec9fdc81d Keymint: Test that corrupting the signature for HMAC verification fails
A VTS test case to verify HMAC signature verification fails if data or
signature is currupted.

Bug: 209452930
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: I2177fd99cfab4ef4a347d50461db0d2e3ad8c612
2021-12-09 13:41:30 +00:00
Brian Murray
9515f38185 Merge "Avoid SIGSEGV if attest key generation fails." am: 14604af9d1 am: b07682e3db am: 7f3d007475 am: 69946003de
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1915277

Change-Id: I562a3b420110b7b1450e5d3159deacd1fe6bef31
2021-12-09 00:12:33 +00:00
Brian J Murray
aa8a75840f Avoid SIGSEGV if attest key generation fails.
Add an explicit check that `attested_key_cert_chain.size() > 0`.

Bug: 209672758
Test: atest 'PerInstance/AttestKeyTest#AllEcCurves/1_android_hardware_security_keymint_IKeyMintDevice_strongbox'

Signed-off-by: Brian J Murray <brianjmurray@google.com>
Change-Id: I4f7cb4fb1a30f26e6ef15c54714699f6ae91ba36
2021-12-08 10:59:22 -08:00
David Drysdale
3b27293bfd Merge "KeyMint VTS: option to skip BOOT_PATCHLEVEL check" am: 8aeb7ef2b4 am: 8a2977f698 am: 4f6428aada am: 8e2cc360ee
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1907696

Change-Id: I1254ed22f8ecdefccbffa0531256a18ae2089c38
2021-12-02 20:18:09 +00:00
David Drysdale
8aeb7ef2b4 Merge "KeyMint VTS: option to skip BOOT_PATCHLEVEL check" 2021-12-02 17:44:15 +00:00
David Drysdale
99f0d25bd9 Merge "Use defaults to reference current keymint version" am: ddf63247e9 am: 2fedeb5718 am: 5a903ea23a am: 8b035f0e23
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1898852

Change-Id: Id00ef73ec28418c4a2f859919c6eac3845748941
2021-12-02 10:51:40 +00:00
David Drysdale
ddf63247e9 Merge "Use defaults to reference current keymint version" 2021-12-02 07:55:03 +00:00
David Drysdale
dbbbe2ea6d KeyMint VTS: option to skip BOOT_PATCHLEVEL check
The KeyMint spec requires that all generated keys include the
BOOT_PATCHLEVEL for the device.

However, the VTS test sometimes gets run in an environment where this
is not possible; specifically the Trusty QEMU tests don't have the
bootloader -> KeyMint communication that is needed to populate this
information.

Add a command line flag that disables checks for BOOT_PATCHLEVEL to
cope with these scenarios, making sure that it defaults to having the
checks enabled.

Test: VtsAidlKeyMintTargetTest
Change-Id: I215c8a18afbd68af199d49f74b977ad7cac6b805
2021-12-02 07:52:33 +00:00
Treehugger Robot
325960671f Merge "KeyMint: Test invalid AES key sizes" am: bb0ab83af8 am: 7770509519 am: 9087d75542 am: 14a6f9e8b5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1893476

Change-Id: If84895969168bb49f1f5a22d252bfcd31a84be58
2021-12-01 15:06:40 +00:00
Treehugger Robot
bb0ab83af8 Merge "KeyMint: Test invalid AES key sizes" 2021-12-01 13:48:57 +00:00
David Drysdale
f60d8c4535 Merge "Fix flaky corrupted padding tests" am: a33f46bc2a am: 61cf943208 am: 02951d1167 am: d1c5ed5bec
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1903312

Change-Id: I803c4549b635d900934403c775886b1153b91a12
2021-11-30 07:41:54 +00:00
David Drysdale
a33f46bc2a Merge "Fix flaky corrupted padding tests" 2021-11-30 06:44:30 +00:00
David Drysdale
4c1f6ac496 Fix flaky corrupted padding tests
Transfer the fix in http://aosp/1745035 from the KeyMint VTS test back
into the keymaster VTS test.

Bug: 189261752
Test: VtsHalKeymasterV4_0TargetTest
Change-Id: I5f0a69255cfe980dd6e71fa29ff06a84cb668f6d
2021-11-29 16:17:11 +00:00
David Drysdale
49255346b4 Use defaults to reference current keymint version
The KeyMint HAL will soon be updated for a new version. To make this
process easier, add a cc_defaults and rust_defaults that references
the "current" version, and use this elsewhere. This should hopefully
mean that a future version bump only needs to happen in the defaults.

Test: TreeHugger
Change-Id: If7dd0c5778acb92177e16fd4fb4a04dcb837ad06
2021-11-22 16:13:08 +00:00
David Drysdale
060a61ac76 Merge "KeyMint VTS: don't combine ATTEST_KEY with SIGN" am: 4f51da1c9e am: bc899371f4 am: e230fd076e am: d379450115
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1877245

Change-Id: I7167e66d22d4dc3a348135d6f55a532284b1d070
2021-11-19 08:46:29 +00:00
David Drysdale
4f51da1c9e Merge "KeyMint VTS: don't combine ATTEST_KEY with SIGN" 2021-11-19 07:53:34 +00:00
Prashant Patil
d72b35175f KeyMint: Test invalid AES key sizes
Added invalid AES key sizes to be tested for Default and TEE based
Keymint implementations.

Bug: 205679497
Test: run vts -m VtsAidlKeyMintTargetTest
Change-Id: Id9044cdc0324258c15f1daa81487c7819a780fe8
2021-11-16 15:58:09 +00:00
David Drysdale
8819ea5192 Merge "KeyMint VTS: extra unique ID test" am: 7a5b3d062d am: 3a539327e3 am: f103c76afe am: 37afdad0c5 am: 6a20b8d8c2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1877242

Change-Id: Iab4f133f9ccbb5afcf04d05cd46ba316f38c03e2
2021-11-11 07:47:21 +00:00
David Drysdale
13f2a40e44 KeyMint VTS: extra unique ID test
Test that specifying RESET_SINCE_ID_ROTATION results in a different
unique ID value.

Test: VtsAidlKeyMintTargetTest
Bug: 202487002
Change-Id: I2aed96514bf9e4802f0ef756f880cac79fa09554
2021-11-10 06:26:31 +00:00
David Drysdale
22ce4c9114 Merge "Consolidate OWNERS files" am: af19de9975 am: 19d2110e4b am: 4913fa7e92 am: 5fa63fa5e0 am: 84d3c89491
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1877236

Change-Id: Ib11364cbbe62f21f5702ce1a9d9c3293782fed81
2021-11-04 10:26:02 +00:00
David Drysdale
e60248c8e7 KeyMint VTS: ATTEST_KEY has no other purpose
The KeyMint spec has always required that keys with the ATTEST_KEY
purpose "must not have any other purpose".

Add explicit tests for combined-purpose keys to be rejected.

Also expand the spec text to require a specific error code, and to
explain the rationale for single-purpose ATTEST_KEY keys.

Bug: 197096139
Test: VtsAidlKeyMintTargetTest
Change-Id: I2a2014f0ddc497128ba51bb3f43671f759789912
2021-11-03 09:58:05 +00:00
David Drysdale
b3b121493d KeyMint VTS: don't combine ATTEST_KEY with SIGN
Update the VTS tests so that attestation keys are not created with
another purpose.

Bug: 197096139
Test: VtsAidlKeyMintTargetTest
Change-Id: Ib6e4ad98cbe5c3015138854679b11fa0e683ade9
2021-11-01 17:15:51 +00:00
David Drysdale
fa36259cb2 Consolidate OWNERS files
Have a single OWNERS file for everything under
hardware/interfaces/security

Test: TreeHugger
Change-Id: I1f15296edefda447916e9a3e8211e88ed8854f90
2021-11-01 08:42:42 +00:00
David Drysdale
60d0c7f950 Merge "KeyMint VTS: check INCLUDE_UNIQUE_ID works" am: 1e3d97de43 am: 010a23aa0d am: 460d22a4da am: f6a0f5fb9d am: 44d56954a2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1853960

Change-Id: Ifb0d3669578cd75b964c74b40e9032a31c89261c
2021-10-29 15:17:53 +00:00
David Drysdale
1e3d97de43 Merge "KeyMint VTS: check INCLUDE_UNIQUE_ID works" 2021-10-29 13:49:07 +00:00
David Drysdale
565ccc70ed KeyMint VTS: check INCLUDE_UNIQUE_ID works
Bug: 202487002
Test: atest VtsAidlKeyMintTargetTest (on CF, O6)
Change-Id: I8bc674b47549aa1133f816c510289774db752e04
2021-10-29 14:39:12 +01:00
David Drysdale
e003b0c518 Merge "Specify KeyMint EC keys by curve not size" am: 153bbc9cc5 am: 0e3027ab80 am: b7633b628a am: a00cd71e26 am: 612eacf7ed
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1857515

Change-Id: Idb8657ec174d66ab7efe28526bbc912d31f65556
2021-10-29 07:06:01 +00:00
David Drysdale
153bbc9cc5 Merge "Specify KeyMint EC keys by curve not size" 2021-10-29 05:54:57 +00:00
Tommy Chiu
d6aacae29d libkeymint_support: Make it vendor accessiable am: abcf89dd53 am: 948bfe2cae am: 1f8a0ea462 am: 582686b67f am: 638f98a2f2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1870241

Change-Id: I6896d7c066b312655104d2770e74a2c9a99d59f7
2021-10-26 17:39:51 +00:00
Tommy Chiu
abcf89dd53 libkeymint_support: Make it vendor accessiable
This support function is supposed to be useable by vendor in treble.
Add "vendor_available" to reflect that.

Bug: 203481954
Test: Link by vendor successfully
Change-Id: I9709ac0ab79405c336ed8a1bc44b2ef643dd5b2d
2021-10-26 23:25:42 +08:00
David Drysdale
915ce253a8 Specify KeyMint EC keys by curve not size
Future addition of extra curves means that key size is not enough to
identify the particular EC curve required. Use the EcCurve enum instead.

Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ia6b7d86a387cfc06db05e4ba6ff8f331e9c6345f
2021-10-14 15:38:38 +01:00
David Drysdale
4357048c05 Merge "KeyMint VTS: improve ATTESTATION_ID_ tests" am: f46b2d5402 am: 0ce446e730 am: c39a694e01 am: 3867a0d821 am: 88f4b59923
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1853954

Change-Id: I081f3feb529a259ddcb8fdb4cbbdbe65667ae810
2021-10-14 14:36:17 +00:00
David Drysdale
f46b2d5402 Merge "KeyMint VTS: improve ATTESTATION_ID_ tests" 2021-10-14 13:33:41 +00:00
David Drysdale
c53b7d9da8 KeyMint VTS: improve ATTESTATION_ID_ tests
Existing comment is incorrect: the ATTESTATION_ID_* values that the test
provided are rejected because they do not match the device values, not
because the tags are specific to device-unique attestation.

Fix the test comment (and make the values more obviously wrong), and
add a separate test that includes correct values of ATTESTATION_ID_*
values.

Test: VtsAidlKeyMintTargetTest
Change-Id: I5c5f5ef6a228990c9e46f90727e0f135dfc2c528
2021-10-14 14:32:04 +01:00
David Drysdale
acb264c779 Merge "KeyMint VTS: use GTEST_SKIP for optional fn" am: c8520ad895 am: dfce78b011 am: 61180078f2 am: 4ceb5911a3 am: f76f261862
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1853955

Change-Id: Id3b3d344e9648c7c4d884f82dafe68927df1c602
2021-10-14 13:21:19 +00:00
TreeHugger Robot
c865a586c1 Merge "Keymint: Update ClearOperationsTest.TooManyOperations parameter" 2021-10-13 11:49:57 +00:00
Tommy Chiu
05698ff907 Keymint: Update ClearOperationsTest.TooManyOperations parameter
Keymint is not supposed to support public key operations.
Update the parameter to reflect that.

Bug: 202928979
Test: VtsAidlKeyMintTargetTest
Change-Id: Id746953f5c68be6730beb3a7340e075ef28039c2
2021-10-13 18:37:21 +08:00
David Drysdale
513bf12932 KeyMint VTS: use GTEST_SKIP for optional fn
When a KeyMint VTS exercises optional functionality, where possible
use GTEST_SKIP() when that functionality is absent, so the test
summary includes information about what is present and what isn't.

This should not affect the overall test result.

Test: VtsAidlKeyMintTargetTest
Change-Id: I62d244d2e4ecc67737906009575e64b50450d4c4
2021-10-12 07:22:28 +01:00
David Drysdale
4e2ca70398 Merge "KeyMint VTS: don't crash on invalid patchlevel" am: e1152b6390 am: 4e9cab823d am: 69d66e13db am: b8dfd10b9b am: 767ea5b166
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1844900

Change-Id: I50ea6e748154c6ce771af537b0d5fa43ccef28bf
2021-10-05 14:52:46 +00:00
David Drysdale
4e9cab823d Merge "KeyMint VTS: don't crash on invalid patchlevel" am: e1152b6390
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1844900

Change-Id: I76b505672b7c78b03a9c79df6473212ea5c65072
2021-10-05 14:09:00 +00:00
David Drysdale
e1152b6390 Merge "KeyMint VTS: don't crash on invalid patchlevel" 2021-10-05 13:54:09 +00:00
David Drysdale
50e567ef72 Merge "KeyMint VTS: enable patchlevel checks" am: 8fb4a1c82e am: 22a5ccd132 am: a9bedb53da am: 3d6cd17f1b am: 70da8310a1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1840175

Change-Id: Ie9893cc4775fe860e6833032b23359181d9ef4c2
2021-10-05 10:56:12 +00:00
David Drysdale
22a5ccd132 Merge "KeyMint VTS: enable patchlevel checks" am: 8fb4a1c82e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1840175

Change-Id: I8b58efc55b884da16fe1312d571f42852ce642ff
2021-10-05 10:08:25 +00:00
David Drysdale
168228a933 KeyMint VTS: don't crash on invalid patchlevel
If vendor/boot patchlevel is shorter than the expected YYYYMMDD format,
fail properly rather than crashing the VTS test process.

Bug: 201946955
Test: VtsAidlKeyMintTargetTest
Change-Id: Icf3541e1b76675871672edec8590ec1821770acf
2021-10-05 08:56:39 +01:00
TreeHugger Robot
718b3bd4de Merge "Add EncryptionOperationsTest.AesCbcZeroInputSuccess" 2021-10-05 02:53:40 +00:00
Tommy Chiu
e6f9ff6c19 Add EncryptionOperationsTest.AesCbcZeroInputSuccess
Check if the zero input data with AES-CBC-[NONE|PKCS7] padding mode
generates correct output data and length.

Bug: 200553873
Test: VtsHalKeymasterV4_0TargetTest, VtsAidlKeyMintTargetTest
Change-Id: I729c2bad65e9d8b194422032346e5ee3c4b0dce5
2021-09-29 21:08:58 +08:00
David Drysdale
f5bfa00996 KeyMint VTS: enable patchlevel checks
Believe that all KeyMint implementations are now in compliance with
the HAL specification and so we can enable the checks that all
generated keys include vendor and boot patchlevel.

Test: VtsAidlKeyMintTargetTest
Change-Id: I99741af308023fe12268e9875e252470fbaaaf9e
2021-09-27 17:30:41 +01:00
Treehugger Robot
77adb256eb Merge "Add logging to KeyCharacteristicsBasicallyValid" am: bd7df07b2a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1818914

Change-Id: Iabd387ec94991d29e59cc739ea390a7ac67a1370
2021-09-21 05:47:22 +00:00
Treehugger Robot
bd7df07b2a Merge "Add logging to KeyCharacteristicsBasicallyValid" 2021-09-21 05:32:28 +00:00
Treehugger Robot
a21ff111a5 Merge "Update the documentation to clarify about the timer in ISecureClock." am: 33ee594688
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1826532

Change-Id: I0a4c758bfeae149e13d028a89477ef95a81c0840
2021-09-16 19:44:06 +00:00
Hasini Gunasinghe
c2386f5675 Update the documentation to clarify about the timer in ISecureClock.
Bug: 197662247
Test: N/A
Change-Id: If35666b6557c432211c75063104c598602f78c87
2021-09-14 16:04:13 +00:00
David Drysdale
42909d9d6e Disable KeyMint -> IRemotelyProvisionedComponent test am: 11860f2984
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15787697

Change-Id: I4ccd90ddad225c6a0b3db4c39f0eca08c985dcb0
2021-09-08 23:23:30 +00:00
David Drysdale
6715fad7d1 Disable KeyMint -> IRemotelyProvisionedComponent test am: 0fce69d05c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1673210

Change-Id: I85e4bb88f2204d4b9c5c4ad53c03a7f9d4f692b8
2021-09-08 19:55:38 +00:00
David Drysdale
11860f2984 Disable KeyMint -> IRemotelyProvisionedComponent test
Not required yet.

Test: VtsAidlKeyMintTargetTest
Bug: 186586864
Change-Id: Ie8fecc4ea4795d7fa4fd6bcf0e6d8013c15f50e5
Merged-In: Ie8fecc4ea4795d7fa4fd6bcf0e6d8013c15f50e5
2021-09-08 11:13:56 -07:00
David Drysdale
0fce69d05c Disable KeyMint -> IRemotelyProvisionedComponent test
Not required yet.

Test: VtsAidlKeyMintTargetTest
Change-Id: Ie8fecc4ea4795d7fa4fd6bcf0e6d8013c15f50e5
Bug: 186586864
2021-09-08 17:36:17 +00:00
Seth Moore
2a9a00e385 Add logging to KeyCharacteristicsBasicallyValid
There are multiple ways this predicate can fail, so add some logging
statements when errors occur so that tests are easier to debug.

Test: VtsAidlKeyMintTargetTest
Change-Id: I49ec12271bdebeab3aa6b9c7ae5d491075b3b649
2021-09-03 10:09:20 -07:00
Max Bires
54ce425deb Change the language for SB AES key sizes am: b04c67a938
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1817585

Change-Id: I8c19f2a29486baee1723b57fb0d313199a978646
2021-09-03 07:31:26 +00:00
Max Bires
b04c67a938 Change the language for SB AES key sizes
This alters the HAL documentation to specify that StrongBox must ONLY
support AES 128 and 256 keys.

Bug: 191736606
Test: Read the documentation and confirm that it is clear.
Change-Id: I484d51700df28eb073b7928b6dc7a3b52c59caee
2021-09-01 23:24:01 -07:00
Max Bires
7db2454972 Merge "Revert "AesInvalidKeySize skip 192 on SB devices"" am: f970abe674
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1803229

Change-Id: Iba41af9658e056e59331fbf5799f21365d13723b
2021-09-01 08:34:29 +00:00
Max Bires
f970abe674 Merge "Revert "AesInvalidKeySize skip 192 on SB devices"" 2021-09-01 08:24:01 +00:00
Steven Moreland
4263d16fc6 keymint: use versions for imports am: f4562215b4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1814144

Change-Id: Ic63b7434cab87aae3768cc698dd1460019c6e89b
2021-08-31 17:09:34 +00:00
Steven Moreland
f4562215b4 keymint: use versions for imports
This makes sure that when developers add a new version of an interface,
or when interfaces are being frozen, the runtime/buildtime situation of
clients depending on those interfaces remains the same. This is required
for AIDL to continue working at scale.

Bug: 188871598
Test: build
Change-Id: I358c19c91e8b20d47967aa3b26a8aa5dd6a97ab6
2021-08-30 17:54:19 -07:00
Max Bires
f0394173a4 Merge "AesInvalidKeySize skip 192 on SB devices" into sc-dev 2021-08-20 16:15:29 +00:00
Max Bires
d067e790ab Revert "AesInvalidKeySize skip 192 on SB devices"
This reverts commit eb8b0577e8.

Reason for revert: Broke a different TEE implementation

Bug: 196922051
Change-Id: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
Merged-In: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
2021-08-20 07:30:36 +00:00
David Drysdale
5558b8ab1e KeyMint VTS: add missing purpose/algo am: ff81928532
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1799764

Change-Id: I612c9319f25432cdb66bea6afd0e81acc94246b9
2021-08-19 17:53:31 +00:00
David Drysdale
ca76a75096 KeyMint VTS: add missing purpose/algo
Test was producing an invalid set of parameters in a different way than
intended.

Bug: 197222749
Test: VtsAidlKeyMintTargetTest
Merged-In: I07f706fec81d91e8eee9c0561428142559c54f12
Change-Id: I07f706fec81d91e8eee9c0561428142559c54f12
Ignore-AOSP-First: this is a manual cross-merge
2021-08-19 17:14:18 +01:00
David Drysdale
ff81928532 KeyMint VTS: add missing purpose/algo
Test was producing an invalid set of parameters in a different way than
intended.

Bug: 197222749
Test: VtsAidlKeyMintTargetTest
Change-Id: I07f706fec81d91e8eee9c0561428142559c54f12
2021-08-19 17:07:04 +01:00
Max Bires
5b7f78d43b AesInvalidKeySize skip 192 on SB devices
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.

Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: Ic0ff19d2d19d6e18dfbc0fad4b8182264f36b2f6
2021-08-19 03:28:15 -07:00
Bill Richardson
f332d02bc6 Merge "Revert "AesInvalidKeySize skip 192 on SB devices"" into sc-dev 2021-08-18 16:54:06 +00:00
Max Bires
0224cfe3e0 Revert "AesInvalidKeySize skip 192 on SB devices"
This reverts commit eb8b0577e8.

Reason for revert: Broke a different TEE implementation

Bug: 196922051
Change-Id: I9f136d237bd06bfe2a1cc29d11bb1fbe0b8ace5e
2021-08-17 14:41:49 +00:00
Xin Li
e287df40b9 Merge sc-dev-plus-aosp-without-vendor@7634622
Merged-In: Ifa71accba7ecf2ab15980227a4413831cfceb187
Change-Id: I7fb44c6c578a51c8ad36649d20a46233fd9609ca
2021-08-14 06:30:57 +00:00
Max Bires
3828fb2214 Merge "AesInvalidKeySize skip 192 on SB devices" 2021-08-13 21:45:14 +00:00
Max Bires
f24a66f42a Merge "AesInvalidKeySize skip 192 on SB devices" into sc-dev 2021-08-13 21:45:03 +00:00
Treehugger Robot
1758d3a4b6 Merge "Fix KeyDeletionTest.DeleteAllKeys" 2021-08-12 23:54:15 +00:00
Shawn Willden
9a7410e50d Fix KeyDeletionTest.DeleteAllKeys
Test failed to set default key validity, which caused keygen to fail.
Wasn't noticed because this test is typically disarmed.

Note:  This test will destroy all user data on the device (which is
why it is typically disarmed).

Bug: 187105270
Test: VtsAidlKeyMintTargetTest --arm_deleteAllKeys
Change-Id: I67e317fdfca15c95c6420918948d1416e97de482
Merged-In: I67e317fdfca15c95c6420918948d1416e97de482
2021-08-12 22:47:34 +00:00
David Drysdale
4ef503113e Merge "keymint/aidl/OWNERS: add drysdale@" 2021-08-12 13:03:57 +00:00
David Drysdale
1cc416882f KeyMint VTS: catch empty cert chains
Explicitly detect empty cert chains returned by GenerateKey rather
than crashing when trying to dereference the first entry.

Bug: 195605180
Test: VtsAidlKeyMintTargetTest
Merged-In: Idad2703b458952ff599c6ccdd04a941aef7aedde
Change-Id: Idad2703b458952ff599c6ccdd04a941aef7aedde
Ignore-AOSP-First: already merged in aosp/master
2021-08-11 16:33:13 +01:00
Max Bires
eb8b0577e8 AesInvalidKeySize skip 192 on SB devices
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.

Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: I1a27a0d61e5247ad90c8f5b1423f2a1567016bac
2021-08-09 23:04:26 -07:00
Max Bires
86edc262af AesInvalidKeySize skip 192 on SB devices
This change clarifies the language to specify that StrongBox devices
must only support key sizes of 128 and 256. Additionally, it changes the
new AesInvalidKeySize test to only enforce against StrongBox instances
on devices that launch on S or later, not previously launched devices.

Ignore-AOSP-First: CP to AOSP
Bug: 191736606
Test: Test passes on a StrongBox enabled device
Change-Id: I1a27a0d61e5247ad90c8f5b1423f2a1567016bac
2021-08-09 23:03:53 -07:00
David Drysdale
9e1c4c1486 Merge "KeyMint VTS: catch empty cert chains" am: 38fe3c5962 am: 675972efc4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1787827

Change-Id: I72b6768cf64237d1b61781429e691698dd8d42c8
2021-08-09 06:13:15 +00:00
David Drysdale
f126c22f29 keymint/aidl/OWNERS: add drysdale@
Test: none
Change-Id: Ib38b3d4e8e8a41f8bbe3a2c2ad6e53ba10ff8dfc
2021-08-06 18:39:39 +01:00