Commit graph

1026 commits

Author SHA1 Message Date
Istvan Nador
8f28f8b8ea Enable the keymaster logger in the default Keymint
This solution was adopted from Cuttlefish's host side Keymint
implementation: I22bde00aed311c6774f83acc08a2c21e6e75141f.

Bug: 296983430
Test: Tested with Cuttlefish that the logs are present in logcat.
Change-Id: I942b0200bb164a2a865b255c6f26d628cbd345a4
2023-09-04 12:05:58 +00:00
David Drysdale
1d5b2daffe Summarize security HALs
Test: nope
Change-Id: Ie222c457a7637aa41bafbdb6c875624fbb82a397
2023-09-04 13:04:45 +01:00
Treehugger Robot
76c929f01e Merge "Move CDDL into separate CDDL files" into main am: f9e524c5b1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2727995

Change-Id: Iedd1e8b48ba470d4c16d4306e0f9dc05008b25d7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-01 23:08:44 +00:00
Treehugger Robot
f9e524c5b1 Merge "Move CDDL into separate CDDL files" into main 2023-09-01 22:20:54 +00:00
Andrew Scull
f8d5b437b1 Merge "Test the format of patch level device info" into main am: 92bd93934a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2736075

Change-Id: I0901620654d311c76880dd3856ef55bf7ae17cea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-01 21:28:37 +00:00
Paul Crowley
6aae9b6432 Move CDDL into separate CDDL files
Move CDDL out of comments and into files, per-method
generateCertificateRequest.cddl
generateCertificateRequestV2.cddl

This makes it easier to read and it means tools can parse it.

Test: Treehugger
Change-Id: I9b71b094d128a5a4566a4d352aaa11d1c9b595ff
2023-09-01 19:27:57 +00:00
Andrew Scull
e780dbf0d0 Test the format of patch level device info
On top of checking that the patch level are a UINT, also check that they
follow the YYYYMM or YYYYMMDD format in the CSR v3 as is required by the
server validation logic. This check is not applied in the factory as the
value might not yet be correctly provisioned.

Bug: 269813991
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I5c62ba176dae390ea0a387bba6cb975226e3873a
2023-09-01 17:42:31 +00:00
Tri Vo
075ff6faf0 Merge "keymint: Clarify usage of certificate tags with importWrappedKey" into main am: d284817690
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2693003

Change-Id: Iea46167531e74c6eaffc663adeeb32ffcc4ccb19
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-30 16:03:20 +00:00
Tri Vo
d284817690 Merge "keymint: Clarify usage of certificate tags with importWrappedKey" into main 2023-08-30 15:12:13 +00:00
Xin Li
879960bdce Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I7b6fffac2ada0e039f79bad8cc9b4d954e9c3460
Change-Id: I9466127d8d0fa38df36ca99f704853b2db871e67
2023-08-25 13:29:30 -07:00
Treehugger Robot
7bed173e4c Merge "Only require RKP on T+ chipsets" into main 2023-08-25 19:08:06 +00:00
Seth Moore
8be875e0d0 Only require RKP on T+ chipsets
It turns out we had a bug (b/263844771) in how RKP support was
detected, and that was fixed. However, due to this bug, some S chipests
shipped without RKP support which is now required by the tests.

This change drops the RKP requirement from S chipsets. There should be
no new S chipsets, so this effectively grandfathers in the previous
ones that were skipped by the RKP VTS tests.

T+ tests (both VTS and other suites) will verify that RKP support is
there, so there is no gap introduced by this change.

Bug: 297139913
Test: VtsAidlKeyMintTargetTest
Change-Id: I387e5f058ada698747aac103c1745682291f2d1c
2023-08-25 11:13:41 -07:00
Alice Wang
d6281e7d82 Make android.hardware.security.rkp-rust available for virt apex
Bug: 274881098
Test: atest MicrodroidHostTests
Change-Id: I5791bc8f0aa4dd5938871edb8b67f4d0d1ee2599
2023-08-25 12:06:08 +00:00
Treehugger Robot
ee6590ef2d Merge "Fix typo in CDDL" into main 2023-08-25 09:52:42 +00:00
David Drysdale
41bbc573f7 Merge "KeyMint: fix auth test HAT" into main 2023-08-25 09:45:42 +00:00
Alan Stokes
5004b8b5ae Fix typo in CDDL
Test: N/A
Change-Id: Iba25acb24306d36c97be07987857237363654bb5
2023-08-25 09:34:35 +01:00
David Drysdale
97272d8d5f KeyMint: fix auth test HAT
The test case for an auth-per-operation HAT with an invalid HMAC
is wrong -- it is re-using the previous HAT, which fails for a
different reason (has an old challenge).

Fix the test to use the HAT that's wrong in the intended way.

Bug: 297333975
Test: VtsAidlKeyMintTargetTest
Change-Id: I15fe9b0c1b53452df0f67dd44534fdb80a6c2a9c
2023-08-25 07:30:12 +01:00
Tomasz Wasilczyk
5c8abe9cc2 Use String8/16 c_str [security]
Bug: 295394788
Test: make checkbuild
Change-Id: I4dd1a43c314af087c4f8ecad3570613ed841589c
2023-08-23 18:51:57 +00:00
Tri Vo
77f4bced2e keymint: Clarify usage of certificate tags with importWrappedKey
Bug: 292534977
Test: atest android.keystore.cts.ImportWrappedKeyTest
Change-Id: I2cb65bc27e4f6b64c331bae4e4a8242ff1d91e43
2023-08-18 14:54:20 -04:00
Andrew Scull
2332583ad1 Reference definition of the Android Profile for DICE
Remove the inline definition of the Android Profile for DICE and instead
reference the definition that exists alongside the Open Profile for DICE
and is now the source of truth for the profile.

Test: n/a
Change-Id: Ia71a674234be13542ad0ce4db0b764e8ee0c7a62
2023-08-18 12:39:39 +00:00
David Drysdale
ae8c281824 Merge "KeyMint: allow extra error code" into main 2023-08-16 10:20:21 +00:00
Treehugger Robot
a2441d9090 Merge "Add VSR annotation to KeyMint tests" into main 2023-08-15 14:17:24 +00:00
Treehugger Robot
1452142a46 Merge "Whenever generateKey fails updated AttestKeyTests to abort instead of continuing the execution of the test." into main 2023-08-15 11:30:45 +00:00
David Drysdale
84b685adf5 KeyMint: allow extra error code
Bug: 295055603
Test: VtsAidlKeyMintTargetTest
Change-Id: Ifbd4a899364c38bb6ad63bb5b5a683c69edfb5b7
2023-08-11 16:00:32 +01:00
Treehugger Robot
d99d7730b8 Merge "Update the TimeoutAuthenticationMultiSid test" into main 2023-08-09 14:25:05 +00:00
Subrahmanya Manikanta Venkateswarlu Bhamidipati Kameswara Sri
07c7d28a84 Update the TimeoutAuthenticationMultiSid test
Update TimeoutAuthenticationMultiSid test to support
generateKey for Strongbox implementations without
factory attestation.

Bug: 293211157
Test: run vts -m VtsAidlKeyMintTarget
Change-Id: I27bf08d2fd2d9e0217a90ee8ccb789adfd9d5f7f
2023-08-08 22:33:37 +00:00
David Drysdale
0215cb3d3e KeyMint: use a smaller invalid IMEI value
The invalid value used for the second IMEI attestation test is
potentially wrong in two ways:
- It doesn't match the provisioned value.
- It's not a valid IMEI, not least because it is longer than 16 bytes.

Make the test value shorter so the second failure doesn't apply and
the test can reliably expect CANNOT_ATTEST_IDS.

Bug: 292959871
Test: VtsAidlKeyMintTargetTest
Change-Id: If8c6b9e08b48e6caf5c767578e1ac43964214619
2023-08-07 11:53:46 +01:00
Eran Messeri
5fe06ea215 Add VSR annotation to KeyMint tests
Add VSR annotations for the KeyMint v2 and KeyMint v3 requirements.

Bug: 251242992
Test: N/a
Change-Id: I0cf5eff86fe18df6f567b30d697af01bc8cdbb4e
2023-08-02 22:34:24 +01:00
Rajesh Nyamagoud
45b478f32e Whenever generateKey fails updated AttestKeyTests to abort instead of
continuing the execution of the test.

If generateKey fails and execution continues then it leads to issues
while verifying the attest records and causing the crash.

Test: atest VtsAidlKeyMintTargetTest
Bug: 292300030
Change-Id: I66bd650423e9e5bbbfe8411a1455c4ea5846f1ff
2023-07-26 04:49:36 +00:00
Max Bires
fe9355f3c6 Merge "Slight documentation tweak" into main 2023-07-19 20:52:56 +00:00
Max Bires
5c0f7234b6 Slight documentation tweak
Specify that DICE-based RKP implementations may also allow a ROM
extension to manage the UDS public key.

Test: The words are semantically parseable
Change-Id: I8f9c6efb01fc76318220cf1bc4a0eb3a3ad42f87
2023-07-18 20:26:33 -07:00
Treehugger Robot
03b140d2fb Merge "Enabled attest-id tests to run on GSI builds as well." into main 2023-07-18 16:39:32 +00:00
Subrahmanya Manikanta Venkateswarlu Bhamidipati Kameswara Sri
2ce542d3f9 Skip known VTS failures on vendor code till U
Some of the SE Javacard OS implementations does not fulfill all of the
expectations as to when cipher text is to be generated. However, the
implementations are compliant with Javacard Specifications. This patch
skips the known VTS failures till U.

Bug: 290850651
Test: run vts -m VtsAidlKeyMintTarget
Change-Id: Id3746adc7385b41f4b4b2ebc8e7583972769134d
2023-07-12 19:54:21 +00:00
Rajesh Nyamagoud
c41ed964f0 Enabled attest-id tests to run on GSI builds as well.
Removed the check to skip the attest-id tests on GSI, modified the
attest-id tests to support this.

Bug: 290643623
Test: atest VtsAidlKeyMintTargetTest
Change-Id: Id79d7fb4c70ed94ed76bc57f3d66ce47e9b67b48
2023-07-12 00:12:38 +00:00
David Drysdale
c68dc93788 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
2023-07-06 10:23:55 +01:00
David Drysdale
82f86a1d4b Merge "Fix attestation error checks" 2023-07-05 05:20:29 +00:00
David Drysdale
c3de1caf43 Skip ATTEST_KEY using variant on waivered devices
Bug: 281452355
Bug: 289451966
Test: VtsAidlKeyMintTargetTest
Change-Id: Id448edae88569518deb2db4ab7bf50d16f33709a
2023-07-04 13:23:04 +01:00
David Drysdale
810fbcffed Fix attestation error checks
Avoid the ADD_FAILURE at the end if attestion ID failure uses an allowed
return code.

Test: VtsAidlKeyMintTargetTest
Bug: 286733800
Change-Id: I0dcac312ac4516a078b2742721e3a19074da52b1
2023-07-04 13:14:12 +01:00
Treehugger Robot
2e46e91864 Merge "Validating key characteristics of generated/imported keys." 2023-06-29 17:34:26 +00:00
Eran Messeri
4a7c3810fc Merge "Update default KeyMint version to 3" 2023-06-29 16:37:48 +00:00
Rajesh Nyamagoud
7b9ae3c485 Validating key characteristics of generated/imported keys.
Updated VTS tests to verify mgf-digests in key characteristics of
RSA-OAEP keys. Added new tests to import RSA-OAEP keys with
mgf-digests and verified imported key characteristics.

Bug: 279721313
Test: atest VtsAidlKeyMintTargetTest
Change-Id: I06474a85c9e77fded264031ff5636f2c35bee6b4
2023-06-26 18:40:53 +00:00
Treehugger Robot
efb4b9397a Merge "Check for MGF1 digests in key characteristics." 2023-06-26 17:22:09 +00:00
David Drysdale
5f7d0654be Merge "Allow extra error code in device ID attestation" am: 1d7447e5d3 am: 013030d9a4 am: 36a30021e6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2627969

Change-Id: I7b6fffac2ada0e039f79bad8cc9b4d954e9c3460
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-22 08:08:43 +00:00
David Drysdale
1d7447e5d3 Merge "Allow extra error code in device ID attestation" 2023-06-22 05:58:57 +00:00
Eran Messeri
8417708fe4 Update default KeyMint version to 3
Update the default KeyMint version to v3.
Note this affects the pure software implementation of KeyMint that is
not used for anything that tests currently run against.

Bug: 275982952
Test: m (that it builds)
Change-Id: I6ab10329af590bd2a045710dfff47c6e78740464
2023-06-21 16:11:25 +01:00
David Drysdale
f42238c99f Allow extra error code in device ID attestation
Generalize the existing helper function to allow more variants.

Remove a couple of pointless invocations of the existing helper.

Bug: 286733800
Test: VtsAidlKeyMintTargetTest
Change-Id: Ic01c53cbe79f55c2d403a66acbfd04029395c287
2023-06-15 09:43:18 +01:00
Treehugger Robot
d87f909dc3 Merge "Support to get EC public key from the UdsCertchain." am: 1acca5c139 am: 8426045977 am: 7bfabde3fc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2615472

Change-Id: I4416b43432519db134e1f26e759bfc74e566c1f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-14 20:04:25 +00:00
Treehugger Robot
1acca5c139 Merge "Support to get EC public key from the UdsCertchain." 2023-06-14 17:38:22 +00:00
Subrahmanyaman
a18883a58c Support to get EC public key from the UdsCertchain.
Bug: 285896470
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I7f829b1346feeab0fd429ad7b9714181b6668b34
2023-06-12 17:29:38 +00:00
David Drysdale
6a7f8f3320 Merge "Use RAII to ensure KeyMint keyblobs deleted" am: 462eccaa3b am: 15bc932a09 am: 8eac8ba511
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2617612

Change-Id: I70a7a9ddfd5e62cd674f9d202dbb098224a439e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-08 12:02:16 +00:00
David Drysdale
1b9febc5ca Use RAII to ensure KeyMint keyblobs deleted
If some check in a VTS test case fails, the test function may exit early
and not call CheckedDeleteKey(&some_keyblob), thus "leaking" a key blob.

This isn't normally an issue, but if the key blob happens to use a
feature that uses some secure storage (e.g. ROLLBACK_RESISTANCE or
USAGE_COUNT_LIMIT=1) then this may leak some scarse resource.

To avoid the chance of this, use an RAII holder to ensure that
manually-managed keyblobs (i.e. key blobs that are not held in the
key_blob_ member of the base test class) are always deleted.

Bug: 262212842
Test: VtsAidlKeyMintTargetTest
Change-Id: Ie8806095e249870484b9875eb660070607f339a3
2023-06-07 15:46:42 +01:00
David Drysdale
3aff152024 Merge "KeyMint: more authentication tests" am: 130e32ad5f am: 524f7607df am: b32416e8c8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2615470

Change-Id: Id07e2638aed619eee8037c6852b9c4785d4de69d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-06 11:55:39 +00:00
David Drysdale
de2a493b9a KeyMint: more authentication tests
- Test key with multiple allowed SIDs
- Test invalid timestamp token

Test: VtsAidlKeyMintTargetTest
Change-Id: Ieb18d43d8c2db821d32857a332a0a68917b1eba4
2023-06-05 15:02:30 +01:00
Treehugger Robot
74634c2db5 Merge "Extend QC SPU waiver to VSR-S devices." am: 3258884207 am: f25e3b2bcb am: 2415be97e3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2609268

Change-Id: I41cbb8d74e4fb5e3a09fce966b63a63c0da4625a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-01 21:59:04 +00:00
Treehugger Robot
7589384303 Merge "Rewrite RKP readme in terms of DICE" am: 139b663e38 am: e8821b0fd6 am: aae23ac225
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2597060

Change-Id: I18230a5dc04380215a65db99f49ca8ce8ba3b26e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-01 21:57:56 +00:00
Treehugger Robot
3258884207 Merge "Extend QC SPU waiver to VSR-S devices." 2023-06-01 19:39:19 +00:00
Shawn Willden
0f1b257f96 Extend QC SPU waiver to VSR-S devices.
Bug: 281452355
Test: VtsAidlKeyMintTargetTest
Change-Id: I9fc1d1f9a3b5b29cfee3ad325bc1c4ef72c44c13
2023-05-31 10:22:54 -06:00
Andrew Scull
99cba0640d Rewrite RKP readme in terms of DICE
Update the RKP readme to match contemporary philosophy about the design.
This includes replacing discussion if the obsolete term `BCC` with a
description of the Android Profile for DICE.

The privacy concerns are relaxed to match updates to the HAL which
remove the superencryption of the DICE chain.

Test: n/a
Fix: 281755202
Change-Id: I3a6fd2cd12599c5843b5dce0044eb16c2afbffa2
2023-05-23 21:08:29 +00:00
Andrew Scull
d49d16a7f3 Merge "Require the config hash" am: 122b4986d4 am: a45d765922 am: e204f73890
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2587808

Change-Id: Ib06a2441034b42f2126bf282856331729aa8eb08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 00:18:28 +00:00
Andrew Scull
122b4986d4 Merge "Require the config hash" 2023-05-16 21:19:24 +00:00
Andrew Scull
790b5d23dd Merge "Add security version to config descriptor" am: 1d23120bad am: abf2969751 am: 411d1dcc5d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2587032

Change-Id: I90070b3a444e6d25b45e4362b45240da6cd5669c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-16 00:20:41 +00:00
Andrew Scull
1d23120bad Merge "Add security version to config descriptor" 2023-05-15 22:43:39 +00:00
Treehugger Robot
f7ca2c881d Merge "VTS: Test specifying --expect_upgrade {yes,no}" am: 434a0cc160 am: 9715eb7117 am: 239b468f30
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2588687

Change-Id: I0d2c43aaf6ac295f7f1f824efe5045c886b29beb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-15 11:19:42 +00:00
Treehugger Robot
434a0cc160 Merge "VTS: Test specifying --expect_upgrade {yes,no}" 2023-05-15 09:11:41 +00:00
Tommy Chiu
025f3c5acd VTS: Test specifying --expect_upgrade {yes,no}
It should definitely be the case that a different SPL triggers key
requires upgrade, but the converse isn't true -- if no SPL change, it's
OK for the device to request upgrade anyhow.

Bug: 281604435
Change-Id: Ic03ce51fb4b18ff669595ab430f9fccd1da48997
2023-05-15 07:23:27 +00:00
Andrew Scull
b804354851 Require the config hash
Align with the Open Profile for DICE by requiring that the configuration
hash be included because the configuration input is a hash of the
specified configuration desscriptor.

Test: n/a
Change-Id: I9d2ef560dc8e6f567b5b8d1a244f5138c45ae420
2023-05-14 23:24:25 +00:00
Andrew Scull
0d520e8e17 Add security version to config descriptor
Introduce a field to the configuration descriptor that provides a
standard semantically-defined version number rather than the
vendor-defined component version which acts more like a build ID.

Test: n/a
Bug: 282205139
Change-Id: Idb0c991ab12ae75687236f2489e639e4422a0225
2023-05-13 21:17:07 +00:00
Treehugger Robot
6b9a329637 Merge "Remove recommentation of non-normal mode" am: a0f28846c4 am: fbc43248ed am: 763b04373a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2586968

Change-Id: I1af977dfb7a19222bfbb6b1729ad07f84f6b2a4a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-13 00:03:19 +00:00
Treehugger Robot
a0f28846c4 Merge "Remove recommentation of non-normal mode" 2023-05-12 22:21:51 +00:00
Andrew Scull
9da6cf1319 Remove recommentation of non-normal mode
Only specify the requirements for `normal` DICE mode and allow vendors
to choose the non-normal mode that fits their need per the ope-dice
specification.

Add a note that RKP required `normal` mode in the DICE chain in order to
trust the device.

Test: n/a
Bug: 263144485
Change-Id: Iaaa3799c53234de61a51ebc855822b93ab3e5bb8
2023-05-12 19:36:22 +00:00
Treehugger Robot
ef1d68d6b1 Merge "KM VTS test fix - handled "null" value for imei." am: 95ec2cdd2f am: 6b4a8807a5 am: 64369644bb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2584850

Change-Id: Ic35998f7b4ed7e445012d4ed71cd377bb5a95724
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 04:18:02 +00:00
Treehugger Robot
95ec2cdd2f Merge "KM VTS test fix - handled "null" value for imei." 2023-05-12 02:44:22 +00:00
Andrew Scull
464f6fba31 Merge "Document expectations of DICE mode" am: ebcdcdbc03 am: ad2adbcb6f am: c71526cd1c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2583537

Change-Id: I38cd7ee77039cd53e6f5ea448ecdcea28fb3ad99
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-10 03:00:53 +00:00
Andrew Scull
ebcdcdbc03 Merge "Document expectations of DICE mode" 2023-05-10 00:53:08 +00:00
Andrew Scull
ed74a681eb Document expectations of DICE mode
The Open Profile for DICE give possible guidelines on the requirements
for the DICE mode but Android needs those to be strictly specified.

Fix: 263144485
Test: n/a
Change-Id: Ia5fc937654504199cabf4709f1c15484242e0161
2023-05-09 18:34:11 +00:00
Rajesh Nyamagoud
71d19b21c3 KM VTS test fix - handled "null" value for imei.
Added a check to make sure IMEI is not "null".

Bug: 281676499
Test: atest VtsAidlKeyMintTargetTest
Change-Id: Ia1569a30412d633eee4d4de8cd00dea077d1c23d
2023-05-09 17:23:02 +00:00
Tri Vo
9aad35fa97 Merge "Test cases for attested Root-of-Trust" am: 67567baf94 am: de5d2be299 am: a483e7bd70
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2576910

Change-Id: Id0a3de5ac79f2947c756ff8a9c36bc56d09082c0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-05 19:11:54 +00:00
Tri Vo
67567baf94 Merge "Test cases for attested Root-of-Trust" 2023-05-05 17:07:39 +00:00
Tri Vo
520a95bc31 Test cases for attested Root-of-Trust
Add tests for verfied boot state and VBMeta digest.

Bug: 255344624
Test: VtsKeyMintAidlTargetTest
Change-Id: I4f0697e1a7cb83ca87150b6683cac3084a593864
2023-05-05 10:04:39 -07:00
Hasini Gunasinghe
4d14f24928 Merge "Challenge is expected in timestamp token in case 2" am: 51471dcfce am: aa54976ba4 am: 86a83243ec
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2574790

Change-Id: I36b53c635b8c3a288c20fd16e31df808ce837e73
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-04 17:32:03 +00:00
Hasini Gunasinghe
51471dcfce Merge "Challenge is expected in timestamp token in case 2" 2023-05-04 15:21:15 +00:00
Hasini Gunasinghe
77819bb988 Challenge is expected in timestamp token in case 2
In the second case out of the two cases of authorization enforcement
described for update(), it seems like the challenge is expected in
the timestamp token.

Test: N/A
Change-Id: I33e1b84bf8218335665b31ca144b3b4ecb342328
2023-05-03 22:33:30 +00:00
Max Bires
929c88fd70 Merge "Support for non-factory attestation in Strongbox." am: c4f05e81e0 am: 41f750ff37 am: 0ca0cd5c87
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2553970

Change-Id: I680f41959d83d5569b60b5f74930b8c85505bd73
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 18:22:49 +00:00
Max Bires
c4f05e81e0 Merge "Support for non-factory attestation in Strongbox." 2023-05-03 16:05:49 +00:00
Treehugger Robot
7f17abc28a Merge "Strongbox may not support 1024 bit key size for RSA." am: 453ec12115 am: cde000ed4b am: 9949e31f36
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2573531

Change-Id: I47e0856e0ab557075abaa8be335fef728a6092f2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-02 17:48:09 +00:00
Treehugger Robot
453ec12115 Merge "Strongbox may not support 1024 bit key size for RSA." 2023-05-02 15:39:50 +00:00
Subrahmanyaman
ce2bebdd79 Strongbox may not support 1024 bit key size for RSA.
Strongbox may not support 1024 bit key size for RSA.
So in NoUserConfirmation test updated the key size to
2048 so that the test works for both TEE and Strongbox.

Bug: 280117495
Test: run VtsAidlKeyMintTarget
Change-Id: I32bb28001aca9b69eedb1bd3d0bcff43052d06e4
2023-04-28 23:37:02 +00:00
Seth Moore
82c8f1f895 Merge "Add VSR annotations for RKP DICE" am: 5fc0168163 am: 68af3d71f8 am: 802a456489
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2568770

Change-Id: I25f29ea8963f558924da0d84f38d2cfd6971049d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-28 00:56:57 +00:00
Seth Moore
5fc0168163 Merge "Add VSR annotations for RKP DICE" 2023-04-27 22:05:36 +00:00
Seth Moore
ac1639f227 Add VSR annotations for RKP DICE
Bug: 277965670
Test: n/a (comment changes only)
Change-Id: I64e34c1f9865811f0967148cad914f7ef77f9448
2023-04-27 11:15:28 -07:00
Subrahmanyaman
50fcf7d066 Support for non-factory attestation in Strongbox.
Updated the BootLoaderStateTest for strongbox implementations which
do not support factory attestation.

Test: vts -m VtsAidlKeyMintTarget
Change-Id: I8fe176a18fc0b9e2b2d0b012b7b63124d15c9e2f
2023-04-26 18:58:03 +00:00
Andrew Scull
d029c3cc70 Merge "Strictly deprecate IRPC test mode key generation" am: 29b1d626ba am: 67b98a3a24 am: 6a4ab98db1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2559010

Change-Id: I6806f9c75ee1a0378d9a43379745e188f08dfb50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 14:41:50 +00:00
Andrew Scull
f2ae193680 Strictly deprecate IRPC test mode key generation
It's already documented that IRPC v3 doesn't make use of test mode keys
however VTS still required support for their generation. Fix this and
simplify implementation of the v3 HAL by expecting an error in all cases
that the deprecated test mode keys are seen.

IRPC v3 also fully deprecated the EEK meaning a v3 implementation must
unconditionally report CURVE_NONE for supportedEekCurve.

The VTS tests are enhanced with contextual version constants rather than
reusing constants with seemingly unrelated names.

Bug: 278013975
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I5709a0b1cd77eb28e677f64bb781fad58d91570a
2023-04-24 20:23:48 +00:00
Shawn Willden
207322654a Check for MGF1 digests in key characteristics.
A bug in the Trusty HAL service caused it to replace MGF1 digest tags
with Tag::INVALID.  This tests that MGF1 tags are returned properly in
the MGF1 success test, and verifies that Tag::INVALID is never
returned by any test.

Bug: 278157584
Test: adb shell /data/nativetest/VtsAidlKeyMintTargetTest/VtsAidlKeyMintTargetTest
Change-Id: I5d391310795c99f37acf3c48310c127a7a31fac3
2023-04-21 16:51:33 -06:00
Treehugger Robot
3e925253ad Merge "Add checks for different size of challenge" am: a95f69da2e am: 15ffcaf669 am: 6b32036b41
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2495456

Change-Id: Iab818789f86cf498e40a4e6fb2f592b7be7d9822
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-17 05:43:33 +00:00
Treehugger Robot
a95f69da2e Merge "Add checks for different size of challenge" 2023-04-17 04:20:54 +00:00
Treehugger Robot
9d9af1049a Merge "Allow uninstantiated BootloaderStateTest" am: d83eed2fe3 am: cfc708d3ef am: d5663b9625
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2535086

Change-Id: I43e8c83658920718a9a7588ea8ab195cdd6d6f0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-14 23:04:26 +00:00
Tri Vo
78e07d5dff Allow uninstantiated BootloaderStateTest
No tests are instantiated if KeyMint is present on the the device.
Explicitly allow that.

Bug: 277975776
Test: VtsAidlKeyMintTargetTest
Change-Id: I88f1c0a81f36d198dabcb1420b62a00bacdbb6e7
2023-04-14 11:01:22 -07:00
Tri Vo
dc91a4dbf4 Merge "Test for bootloader state" am: eb94a4f9ef am: e1c1abb059 am: cd06c1740a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2514097

Change-Id: I96df03008dc42ad6c251b8d6f22f115a9480a680
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 17:54:36 +00:00
Tri Vo
eb94a4f9ef Merge "Test for bootloader state" 2023-04-12 16:20:51 +00:00
Alex Buynytskyy
ec1198d941 UpsideDownCake is now 34
Ignore-AOSP-First: UpsideDownCake Finalization
Bug: 275409981
Test: build
Change-Id: I832ab7a8b5445ba85e27bbcf5be64906bfa0e5be
2023-04-07 23:41:20 +00:00
Andrew Scull
37ce42ae95 Merge "Document that the component version can be a string" am: de49fca027 am: f82e894f01 am: 35b6a90035
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2513920

Change-Id: I2c535f073f752bc145d8a8f8770b23a5bfa0962d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-07 22:53:13 +00:00
Andrew Scull
de49fca027 Merge "Document that the component version can be a string" 2023-04-07 20:57:25 +00:00
Treehugger Robot
0da122adb4 Merge "VTS: Restore 2nd-IMEI tests" am: a3bc09e02a am: d0c6ea094d am: d1d3192505
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2517335

Change-Id: I1f95571497b6c28b2e0ffb01515090ad7a274ba6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-06 07:05:43 +00:00
Treehugger Robot
a3bc09e02a Merge "VTS: Restore 2nd-IMEI tests" 2023-04-06 05:58:35 +00:00
Tommy Chiu
728336ffa3 VTS: Restore 2nd-IMEI tests
Enable some tests that are bypassed on strongbox implementation.

Bug: 262255219
Test: VtsAidlKeyMintTargetTest
Change-Id: I548bddcd16c0a1ee1c1cb8266d4d99dbdff3d39b
2023-04-06 02:09:22 +00:00
Tri Vo
bf75a4070d Test for bootloader state
Bug: 255344624
Test: VtsKeyMintAidlTargetTest
Change-Id: I8b34a94c11d7cc174821483f624fd083ca1763ac
2023-03-30 15:45:16 -07:00
Andrew Scull
17894fc62b Merge "Use VSR to tell libhwtrust_cxx how to validate" am: c71a8d0ef1 am: 4110edd04f am: f737da6e6e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2513919

Change-Id: Ia84791a71605b76ba9a3771d03c811f3398efced
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-30 19:16:44 +00:00
David Drysdale
b521af19e9 Merge "Test specifying CERTIFICATE_NOT_{BEFORE,AFTER}" am: a2f63439c7 am: 4b6c4784be am: b06defead3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2509815

Change-Id: I56d5673c075a71990f984aede4505c89474748b2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-30 19:16:25 +00:00
Andrew Scull
c71a8d0ef1 Merge "Use VSR to tell libhwtrust_cxx how to validate" 2023-03-30 09:36:31 +00:00
David Drysdale
a2f63439c7 Merge "Test specifying CERTIFICATE_NOT_{BEFORE,AFTER}" 2023-03-30 06:21:09 +00:00
Andrew Scull
65a514dcf6 Document that the component version can be a string
Following feedback from partners, allow the component version in the
configuration descriptor to be either an int or a string.

Bug: 273552826
Test: n/a
Change-Id: Iecc9889592a2e634a3b9e40f14347b231b703c60
2023-03-29 17:56:31 +00:00
Andrew Scull
2b1e5d9fc8 Use VSR to tell libhwtrust_cxx how to validate
The DICE chain specification changes slightly between VSR versions so
the VSR is used to select the set of validation rules that should be
applied.

Test: TH
Change-Id: I3697279d9348705a0279736c61e8333720321214
2023-03-29 17:53:14 +00:00
Andrew Scull
aae2f5adde Merge "Deprecate CSR v1 and v2 in IRPC v3" am: 74a699c4d8 am: eb06c44f4f am: 2379f9b037
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2510195

Change-Id: I65fbce13aa8cae31acc1f0eb01794de09fff0caa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 15:41:45 +00:00
Tommy Chiu
d53bedb5bd Correct the expection of DeviceInfo size am: 72abbbd36d am: 015b828def am: 9258bfe861
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2513015

Change-Id: I05a77f78a2f23ec29a9d58254cad077e5607c105
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-29 14:41:13 +00:00
Andrew Scull
74a699c4d8 Merge "Deprecate CSR v1 and v2 in IRPC v3" 2023-03-29 14:18:51 +00:00
David Drysdale
ad785f53dc Test specifying CERTIFICATE_NOT_{BEFORE,AFTER}
Bug: 275363977
Test: VtsAidlKeyMintTargetTest
Change-Id: I69c0577a73eabda42c8ccffce5af0e5fa45e9320
2023-03-29 14:29:35 +01:00
Tommy Chiu
72abbbd36d Correct the expection of DeviceInfo size
Bug: 275645815
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I24187be5b7b34285aa53ddaa420b871826a3b825
2023-03-29 07:11:23 +00:00
Andrew Scull
95b3131370 Deprecate CSR v1 and v2 in IRPC v3
Deprecate the CSR format from v1 and v2 of the HAL, again. The older CSR
versions were allowed in order to ease migration from the
RemoteProvisioner app over to rkpd and that has now been completed.

Bug: 260920864
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I4d16eb64e4ffe602b4b252159202a4ddb56d63d7
2023-03-28 18:17:34 +00:00
Tommy Chiu
fde3ad1db5 Add checks for different size of challenge
RKP allows 0 ~ 64 byte challenge to be provided.
Test it by several different size inputs.

Bug: 272392463
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I488c75745dc68778ff6d862506a5beeec82f7ac1
2023-03-28 00:57:43 +00:00
Seth Moore
c6e81d24dc Merge "Do not require StrongBox to implement RKP" am: fc746fb1aa am: d3d5e859f9 am: 4e433f800d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2507901

Change-Id: Ibaadf0b8e891abc1eca9300615926d680bba9149
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-24 23:04:29 +00:00
Seth Moore
5a0320fbda Do not require StrongBox to implement RKP
Detect if there is an IRemotelyProvisionedComponent for strongbox, and
if so run the associated keymint tests. Else, allow strongbox to skip
the test as it's not required to implement the IRPC HAL.

Bug: 271948302
Test: VtsAidlKeyMintTargetTest
Change-Id: Ibf98e594e725d6ad14c0ff189ab9fbcc25b51f80
2023-03-24 12:29:31 -07:00
Max Bires
e8bf31b5a4 Merge "Strictly enforce DeviceInfo entries." am: 6f135a7a19 am: 52ac82b75d am: bf7fc8196d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2503517

Change-Id: I4730de5fe33f607827f70899a646ab52b5a2a15b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-24 18:10:20 +00:00
Max Bires
60c53aeb7e Strictly enforce DeviceInfo entries.
Ensure that v3 HALs have exactly the expected number of entries present
when returning DeviceInfo inside of the Certificate Signing Request. Do
not allow for additional or fewer entries.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I8ea628335d5eed35ca2b65e22980e13fc9806738
2023-03-23 20:04:27 -07:00
Seth Moore
bc1363bb5c Merge "Note the relationship of patchlevels with keymint" am: 58686e5882 am: 0eaa396dc0 am: e68cc7b3e8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2496162

Change-Id: I02a90a63169115344a1ec8e98b60360071de3cbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-20 20:56:33 +00:00
Seth Moore
33d654b693 Merge "Add old DeviceInfo version documentation" am: d0c02789ad am: ec275b18d7 am: a6f398aa75
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2494236

Change-Id: I41f460d25f4992a895ae7c9d6c833b27afe5e799
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-17 22:49:57 +00:00
Seth Moore
192c575ffb Note the relationship of patchlevels with keymint
Some of the DeviceInfo must match existing tags in KeyMint, but this
was not documented.

Test: n/a
Change-Id: I7733e2a4b0c08b0b89ece41390c0ce0711459d82
2023-03-17 15:36:11 -07:00
Seth Moore
d0c02789ad Merge "Add old DeviceInfo version documentation" 2023-03-17 20:48:35 +00:00
Seth Moore
47194fa089 Add old DeviceInfo version documentation
Since comments are stripped from the stable AIDL snapshots, the CDDL
describing the DeviceInfo contents is lost for the older versions. Add
the comments from older DeviceInfo versions as a reference for
maintainers of older HAL implementations.

Test: n/a
Change-Id: I7dd3d285b3d8422a6df4228ad0cf5797e78609c1
2023-03-16 16:24:57 -07:00
Steven Moreland
18fc2fe524 rkp: add keymint v2 hash into rkp v2 am: 184f64bcee am: 817bdea5fc am: 80513bcab3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2492259

Change-Id: Ib24ebeae1d897b092011f6e8347201a85c7c9c95
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-15 23:12:02 +00:00
Steven Moreland
184f64bcee rkp: add keymint v2 hash into rkp v2
When we split the rkp interface, we only added one hash to rkp v2, but
on Android S devices, this interface was in keymint v2, and so it used
the keymint v2 hash.

In order for that old implementation to be recognized, we need to add the hash in specifically.

Note: v1 was missed in b/264549860, but this was v2.

Fixes: 271513408
Test: vts_treble_vintf_vendor_test
Change-Id: I58c7c41633000df933261a147edd3477afd09a36
2023-03-15 19:48:45 +00:00
Treehugger Robot
a6b6bb18e2 Merge "Fix RKP support assumptions for keymint VTS" am: f84593a459 am: 298a35f967 am: 82710086e6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2469486

Change-Id: Id471cffc96d7995f5b585d186ee374e0d524c31a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-14 23:02:45 +00:00
Treehugger Robot
f84593a459 Merge "Fix RKP support assumptions for keymint VTS" 2023-03-14 21:18:37 +00:00
Andrew Scull
314f40bf24 Merge "Validate DICE chain based on context" am: e5a5610018 am: e02b80a11f am: 022a26ffa2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2485115

Change-Id: I028a7a12cb6e249ac7102961159a8b509da474fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-14 16:50:55 +00:00
Seth Moore
a12ac74603 Fix RKP support assumptions for keymint VTS
The support level for strongbox is different from the tee
implementation. Additionally, we were incorrectly checking the keymint
aidl version. KeyMint 1.0 supported ATTEST_KEY, so it's unclear why we
were ever checking for KeyMint 2.0.

Test: VtsAidlKeyMintTargetTest
Bug: 263844771
Change-Id: I750367902fec90204d71c1e158404b2421f9ad87
2023-03-14 15:48:08 +00:00
Andrew Scull
e5a5610018 Merge "Validate DICE chain based on context" 2023-03-14 15:15:06 +00:00
Tri Vo
0250a08493 Merge "Remove KM dependency on RemoteProvisioner" am: 230ee1c79c am: c26a57f974 am: f850aba3b3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2486035

Change-Id: I6587bac67b968c7783d5c145fe09dd33d8b3d304
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-14 01:00:07 +00:00
Tri Vo
d5d9b02219 Remove KM dependency on RemoteProvisioner
HAL implementation shouldn't require an app.

Bug: 273325840
Test: m
Change-Id: I920d29c582d288959e639f4e755d48cd4788d223
2023-03-13 13:59:00 -07:00
Andrew Scull
a601d07478 Validate DICE chain based on context
The DICE chain in the ProtectedData objects are evaluated against the
specification from v1 and v2 of the HAL whereas the chain in
AuthenticatedMessage objects are evaluated against the specification
from v3.

There are only small differences with v3 aligning to the standards where
there was previously more leniency.

Fix: 262599829
Test: TH
Change-Id: Ied14362b5530485eb6c2302a0ae0f21da9cdb33f
2023-03-13 16:52:40 +00:00
Treehugger Robot
dd6b73684c Merge "Updated to enforce leaf certificate containing attestation record to not to hold the CRL Distribution Points extension in it." am: adff54caf4 am: 3e619b8cc5 am: 8b5cf88af1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2427795

Change-Id: I6819590e2e6281db97cccde3115a538d9475ce4b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-13 12:32:59 +00:00
Treehugger Robot
adff54caf4 Merge "Updated to enforce leaf certificate containing attestation record to not to hold the CRL Distribution Points extension in it." 2023-03-11 22:25:35 +00:00
Cole Faust
f437e65d60 Merge "Baseline NewApi issues" into udc-dev 2023-03-10 18:33:57 +00:00
David Drysdale
475bb11af0 Merge "Re-order skip checks for attestation tests" 2023-03-10 07:11:56 +00:00
Tri Vo
1be04ec2d2 Merge "Update challenge size check" 2023-03-09 22:47:12 +00:00
Cole Faust
e76cbec982 Baseline NewApi issues
NewApi was recently updated to support linting methods in
the system, module_lib, and system_server sdks, and was
demoted to a warning due to the new issues it finds.
Baseline all the new issues that NewApi can be made an error
again.

These cls were generated automatically by a script that
copied the NewApi issues from the reference baselines.

Bug: 268261262
Test: m lint-check
Change-Id: I22f3b3575b6ea00d72d143019d9eed028aa98b56
2023-03-09 14:20:10 -08:00
Tri Vo
2fcd4b6bc3 Update challenge size check
aosp/2480181 changed minimum challenge size to 16.

Bug: 272392463
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I420f230651192e8fd67aab2ceff916a9c8b6db92
2023-03-09 13:23:09 -08:00
Seth Moore
ceeb357048 Merge "Fix minimum size description of challenge" 2023-03-09 20:58:22 +00:00
Seth Moore
3182cc00a3 Fix minimum size description of challenge
The server-provided challenge is almost always smaller than 32 bytes,
so we cannot enforce that as a minimum. I fixed up the CDDL a while
back, but missed one mention of the 32 byte minimum in the description.

Test: n/a (it's a comment)
Bug: 272392463
Change-Id: Ia5994e2b7cf107ab131c6b028bee7881d0e657ac
2023-03-09 12:54:08 -08:00
David Drysdale
5b94874691 Re-order skip checks for attestation tests
Put the test arm that just involves checking a property
first, so that tests which involve a round trip to the Package
Manager are only executed when they're needed.

Test: VtsAidlKeyMintTargetTest
Bug: 271026714
Change-Id: I4caad6243a3b9d511a32717fd95f58864b857eeb
2023-03-09 11:03:10 +00:00
David Drysdale
4cbe215e34 Allow for 32-bit VTS builds
In 32-bit builds a `long` may be 32 bits, but the `long` values on an
AIDL interface are 64 bits.  Therefore need to use `int64_t` for the
corresponding C++ type, not `long`.

Bug: 271056044
Test: VtsAidlKeyMintTargetTest --gtest_filter="*AuthTest*" (32-b)
Change-Id: I19f5a1d825dfcc45087534bbd4239a13cdfec3f7
2023-03-07 14:47:11 +00:00
Rajesh Nyamagoud
e98263ec55 Updated to enforce leaf certificate containing attestation record
to not to hold the CRL Distribution Points extension in it.

Bug: 260332189
Test: atest VtsAidlKeyMintTargetTest
Change-Id: I7b191b4351984ce82db0e9440027ddbfc14b1c3a
2023-03-03 16:48:28 +00:00
Yi Kong
bd5d365d82 Fix return-stack-address warning
hardware/interfaces/security/keymint/aidl/vts/performance/KeyMintBenchmark.cpp:79:26: error: reference to stack memory associated with local variable 'message' returned [-Werror,-Wreturn-stack-address]
return std::move(message);
^~~~~~~

Test: presubmit
Change-Id: I4298b4a25ccb809a7ae180bb218e673a7f1aa623
2023-03-01 16:19:43 +09:00
Alice Wang
6fdd6b000b Merge "[dice] Remove unused service android.hardware.security.dice" 2023-02-28 08:22:40 +00:00
Treehugger Robot
657934eebb Merge "Update KeyMint VTS tests to use pre-defined API level symbols" 2023-02-27 11:19:50 +00:00
Tri Vo
20bb427427 Merge "Add test for IRPC DeviceInfo" 2023-02-24 18:02:14 +00:00
Alice Wang
acc1a5bd38 [dice] Remove unused service android.hardware.security.dice
This cl removes the unused service android.hardware.security.dice
together with all its usages (all of them are tests), because the
service is incomplete and not used anywhere for now and in the
near future.

The cl also removes dice from the compat matrix.

This helps us reduce some maintainance burden for the Rust dice
wrapper libraries such as libdiced_open_dice[_nostd],
libdiced_sample_inputs, libdiced_utils and their tests.

Test: atest diced_utils_test diced_sample_inputs_test \
diced_open_dice_cbor_test \
libdiced_open_dice_nostd.integration_test \
libdiced_open_dice.integration_test diced_open_dice_cbor_test
Test: m pvmfw_img microdroid_manager
Bug: 267575445
Bug: 270511529

Change-Id: I3d2497d2e8d3f88c49cae9ae80a6b4f7b652cc4a
2023-02-24 09:03:11 +00:00
Tri Vo
ec50ee162a Add test for IRPC DeviceInfo
Bug: 243148852
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: If873996f0d756662808d785d2ef57118737a5aab
2023-02-23 20:01:31 -08:00
Treehugger Robot
53faa27ace Merge "Correct AttestKey test that checks Qualcomm's SPU waiver." 2023-02-23 20:43:12 +00:00
David Drysdale
e85498a968 Merge "Add Gatekeeper-based auth tests" 2023-02-23 11:44:43 +00:00
Shawn Willden
1a545db363 Update KeyMint VTS tests to use pre-defined API level symbols
Test: VtsKeyMintAidlTargetTest
Change-Id: I11ccd0c4959a2b3504009fdd95f4a313a5d6d5f6
2023-02-22 16:06:19 -07:00
Shawn Willden
3a4a3a95b8 Correct AttestKey test that checks Qualcomm's SPU waiver.
The test exempted KeyMint on the affected chips from having to implement
ATTEST_KEY if they have StrongBox in all Android releases from Android S
onwards, but the waiver was given only for Android S and T.  This CL
changes the test to reinstate the requirement after Android T.

Test: VtsAidlKeyMintTargetTest
Change-Id: I8481ae31de34aae220af7e7188632edcc2d391f0
2023-02-22 16:06:19 -07:00
David Drysdale
28fa931f00 Add Gatekeeper-based auth tests
Add tests that directly exercise Gatekeeper to get auth tokens for use
with auth-bound keys.

Test: VtsAidlKeyMintTargetTest
Change-Id: Ie668674d81ca487e8bbc18fdd9f36610bcab4c8c
2023-02-22 07:14:25 +00:00
Treehugger Robot
efd4cf71e5 Merge "Enforce boot and vendor patch level format always" 2023-02-21 18:36:50 +00:00
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
Tri Vo
b21e6df7c2 Enforce boot and vendor patch level format always
Test: atest VtsAidlKeyMintTargetTest
Change-Id: I80bc96a6aee62474b33b015b6d04de7527fe757c
2023-02-17 14:55:51 -08: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