Commit Graph

688 Commits

Author SHA1 Message Date
Andrew Scull
1dc9c9f7a2 Merge "Support to get EC public key from the UdsCertchain." into stage-aosp-udc-ts-dev 2023-09-20 17:18:58 +00:00
Subrahmanyaman
d1bc0389e4 Support to get EC public key from the UdsCertchain.
Bug: 297123463
Bug: 285896470
Test: VtsHalRemotelyProvisionedComponentTargetTest
(cherry picked from https://android-review.googlesource.com/q/commit:a18883a58cc9f6b702095bb17bbd0e4e894be49c)
Merged-In: I7f829b1346feeab0fd429ad7b9714181b6668b34
Change-Id: I7f829b1346feeab0fd429ad7b9714181b6668b34
2023-09-20 12:40:33 +00:00
David Drysdale
a15d593ccd Merge "KeyMint: check missing EC_CURVE on v3+" into stage-aosp-udc-ts-dev 2023-09-20 11:08:21 +00:00
David Drysdale
24e594e05e KeyMint VTS: re-order auth failure arms
Allow for devices that claim to need external timestamps, but don't.

Test: VtsAidlKeyMintTargetTest
Bug: 300211206
(cherry picked from https://android-review.googlesource.com/q/commit:a35699cb5cfef3773afebf51c2dd38530db43bf0)
Merged-In: Ie450d9969c337d5274502f3600e14c0b481e8b34
Change-Id: Ie450d9969c337d5274502f3600e14c0b481e8b34
2023-09-15 10:46:09 +00:00
David Drysdale
e63c5bb5c3 KeyMint: check missing EC_CURVE on v3+
The original change to add this test didn't make it into the Android 13
version of the VTS test, so the version gate needs to be updated to be
v3+

Bug: 292318194
Test: VtsAidlKeyMintTargetTest --gtest_filter="*EcdsaMissingCurve*"
(cherry picked from https://android-review.googlesource.com/q/commit:9ed7d2c5bfa3958ef399567e12d84a3f67f0cb80)
Merged-In: I94bf816688e57c7c04893a23cf0399129de94229
Change-Id: I94bf816688e57c7c04893a23cf0399129de94229
2023-09-15 10:01:09 +00:00
Seth Moore
166d160b78 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
(cherry picked from https://android-review.googlesource.com/q/commit:8be875e0d0c18b8de67744c8b9629f2ff518dd60)
Merged-In: I387e5f058ada698747aac103c1745682291f2d1c
Change-Id: I387e5f058ada698747aac103c1745682291f2d1c
2023-09-06 00:03:53 +00:00
Yusuke Yoshimura
bc88f61afb Merge "Skip ATTEST_KEY using variant on waivered devices" into stage-aosp-udc-ts-dev 2023-07-14 06:25:50 +00:00
David Drysdale
4a70416566 Allow extra ID attestation error codes am: 3f6ab601b9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2646973

Change-Id: I50cb0d0bcbc65034315fef54ef5b772fb6d3d38b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-13 07:15:02 +00:00
Treehugger Robot
fcabe78a65 Merge "Strongbox may not support 1024 bit key size for RSA." into stage-aosp-udc-ts-dev 2023-07-12 20:40:47 +00:00
David Drysdale
3f6ab601b9 Allow extra ID attestation error codes
When deliberately testing invalid ID attestation, use the helper
function (which checks the error return code is correct) in one more
place.

Test: VtsAidlKeyMintTargetTest
Bug: 286733800
Change-Id: I6ea5bd7ee19b3b172330117bfde1b16745debba7
(cherry-picked from commit c68dc93788)
Merged-In: I6ea5bd7ee19b3b172330117bfde1b16745debba7
2023-07-12 13:58:41 +00:00
David Drysdale
35621098de Fix attestation error checks
Avoid the ADD_FAILURE at the end if attestion ID failure uses an allowed
return code.

Test: VtsAidlKeyMintTargetTest
Bug: 286733800
(cherry picked from https://android-review.googlesource.com/q/commit:810fbcffed8e86a3b53e8212ce4fdb64971d812f)
Change-Id: I0dcac312ac4516a078b2742721e3a19074da52b1
Merged-In: I0dcac312ac4516a078b2742721e3a19074da52b1
2023-07-06 13:02:48 +01:00
David Drysdale
94042a987c 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
(cherry picked from https://android-review.googlesource.com/q/commit:f42238c99ffe0df2e51cec84a96ed859a878b2b0)
Merged-In: Ic01c53cbe79f55c2d403a66acbfd04029395c287
Change-Id: Ic01c53cbe79f55c2d403a66acbfd04029395c287
2023-07-06 13:01:24 +01:00
David Drysdale
b18c757eda [RESTRICT AUTOMERGE] Allow extra error code in device ID attestation
Generalize the existing helper function to allow more variants.

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

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

Change-Id: I328f7b3195d4b4dd1ed1da17377696261094ea76
2023-07-05 13:41:54 +01:00
David Drysdale
997efaa191 Skip ATTEST_KEY using variant on waivered devices
Bug: 281452355
Bug: 289451966
Test: VtsAidlKeyMintTargetTest
(cherry picked from https://android-review.googlesource.com/q/commit:c3de1caf4327dc367a95f7416cba19827428bd1b)
Merged-In: Id448edae88569518deb2db4ab7bf50d16f33709a
Change-Id: Id448edae88569518deb2db4ab7bf50d16f33709a
2023-07-04 14:17:58 +00:00
Subrahmanyaman
558dbedf51 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
(cherry picked from https://android-review.googlesource.com/q/commit:ce2bebdd79cf7536b06c2d67cdee8867475a3b10)
Merged-In: I32bb28001aca9b69eedb1bd3d0bcff43052d06e4
Change-Id: I32bb28001aca9b69eedb1bd3d0bcff43052d06e4
2023-07-03 17:45:42 +00:00
Rajesh Nyamagoud
ba824fe285 KM VTS test fix - handled "null" value for imei.
Added a check to make sure IMEI is not "null".

Bug: 281676499
Test: atest VtsAidlKeyMintTargetTest
(cherry picked from https://android-review.googlesource.com/q/commit:71d19b21c30596b24ba053bfd9765528ee36901d)
Merged-In: Ia1569a30412d633eee4d4de8cd00dea077d1c23d
Change-Id: Ia1569a30412d633eee4d4de8cd00dea077d1c23d
2023-05-15 16:57:04 +00:00
Tri Vo
dbb1c89347 Test cases for attested Root-of-Trust
Add tests for verfied boot state and VBMeta digest.

Bug: 255344624
Test: VtsKeyMintAidlTargetTest
Change-Id: I4f0697e1a7cb83ca87150b6683cac3084a593864
Merged-In: I4f0697e1a7cb83ca87150b6683cac3084a593864
2023-05-11 16:30:21 -04:00
Subrahmanyaman
0e0f60cff1 Support for non-factory attestation in Strongbox.
Updated the BootLoaderStateTest for strongbox implementations which
do not support factory attestation.

Bug: 255344624
Test: vts -m VtsAidlKeyMintTarget
Change-Id: I8fe176a18fc0b9e2b2d0b012b7b63124d15c9e2f
Merged-In: I8fe176a18fc0b9e2b2d0b012b7b63124d15c9e2f
2023-05-11 16:30:14 -04: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
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
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
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
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
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
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
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
Treehugger Robot
f84593a459 Merge "Fix RKP support assumptions for keymint VTS" 2023-03-14 21:18:37 +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
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
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
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
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
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
Treehugger Robot
657934eebb Merge "Update KeyMint VTS tests to use pre-defined API level symbols" 2023-02-27 11:19:50 +00:00