Commit graph

526 commits

Author SHA1 Message Date
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
David Drysdale
a038695b21 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
Change-Id: Idad2703b458952ff599c6ccdd04a941aef7aedde
2021-08-05 09:03:20 +01:00
Jiyong Park
48131c0ace Merge "Remove ndk_platform backend. Use the ndk backend." am: 2346a4c6b9 am: 4ef9aa49dc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1778908

Change-Id: Ib35b7b0ddc0bebd0714d290b1ac2fab8d5a1893e
2021-07-28 12:39:05 +00:00
Jiyong Park
2346a4c6b9 Merge "Remove ndk_platform backend. Use the ndk backend." 2021-07-28 12:10:05 +00:00
Seth Moore
8ba6aebbfc Allow uninstantiated remote provisioning tests am: 8aee4a857c
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15404613

Change-Id: I06163220ac87ddca7e851ab17e43cb6945534a5b
2021-07-27 23:33:39 +00:00
Seth Moore
6305e23cd8 Allow uninstantiated remote provisioning tests
Not all devices have an IRemotelyProvisionedComponent HAL, so on those
devices 0 of the tests in VtsRemotelyProvisionedComponentTests will be
run.

Bug: 194770385
Test: Ran tests on two devices: one with and one without the HAL.
Change-Id: I8624096158f29058189dfab7cd876804ae178e60
Merged-In: I8624096158f29058189dfab7cd876804ae178e60
2021-07-27 14:51:10 -07:00
Seth Moore
8aee4a857c Allow uninstantiated remote provisioning tests
Not all devices have an IRemotelyProvisionedComponent HAL, so on those
devices 0 of the tests in VtsRemotelyProvisionedComponentTests will be
run.

Fixes: 194770385
Test: Ran tests on two devices: one with and one without the HAL.
Change-Id: I8624096158f29058189dfab7cd876804ae178e60
2021-07-27 14:20:17 -07:00
Jiyong Park
27f77fefd7 Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same 'ndk' backend.

Bug: 161456198
Test: m
Change-Id: Ibe8beeaf0d1b33968fb782f1f70c17ae9e9bf871
2021-07-27 14:44:47 +09:00
Seth Moore
b9b87ab1c9 Add VtsRemotelyProvisionedComponentTests config
VtsHalRemotelyProvisionedComponentTargetTest was picking up the same
config file (AndroidTest.xml) as VtsAidlKeyMintTargetTest. When atest or
TF was used to run VtsHalRemotelyProvisionedComponentTargetTest, it
actually ran VtsAidlKeyMintTargetTest.

Add a separate test config file so that we run the correct test binary.

Test: atest VtsAidlKeyMintTargetTest
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Bug: 192824779
Change-Id: I7ba0f8d364690209722f9a06c6c0ce2957781beb
Merged-In: I7ba0f8d364690209722f9a06c6c0ce2957781beb
2021-07-21 09:26:34 -07:00
Seth Moore
a0130911dc Add VtsRemotelyProvisionedComponentTests config am: 643a794172
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15340045

Change-Id: I52c8625b1c9bcf503fa149265957ee509ca8a16a
2021-07-21 00:30:56 +00:00
Seth Moore
643a794172 Add VtsRemotelyProvisionedComponentTests config
VtsHalRemotelyProvisionedComponentTargetTest was picking up the same
config file (AndroidTest.xml) as VtsAidlKeyMintTargetTest. When atest or
TF was used to run VtsHalRemotelyProvisionedComponentTargetTest, it
actually ran VtsAidlKeyMintTargetTest.

Add a separate test config file so that we run the correct test binary.

Test: atest VtsAidlKeyMintTargetTest
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Fixes: 192824779
Change-Id: I7ba0f8d364690209722f9a06c6c0ce2957781beb
2021-07-20 15:47:03 -07:00
Seth Moore
b393b089c1 Don't fail if TAG_ALLOW_WHILE_ON_BODY is missing
The TAG_ALLOW_WHILE_ON_BODY authorization is not required to be
supported, and if it is not supported it's a noop. Don't expect the tag
to fail with UNSUPPORTED_TAG on devices that don't support it.

Test: VtsAidlKeyMintTargetTest
Bug: 192222727
Change-Id: I2e80ca59151e79f595a65cae94ac966b4ba7020d
Merged-In: I2e80ca59151e79f595a65cae94ac966b4ba7020d
2021-07-13 11:18:36 -07:00
TreeHugger Robot
d00211cd3e Merge "Don't fail if TAG_ALLOW_WHILE_ON_BODY is missing" into sc-dev am: eca569897a
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15263335

Change-Id: I3eed0c51d932524b9d374af5ae786cddf184b8a4
2021-07-13 17:49:45 +00:00
TreeHugger Robot
eca569897a Merge "Don't fail if TAG_ALLOW_WHILE_ON_BODY is missing" into sc-dev 2021-07-13 17:35:10 +00:00
TreeHugger Robot
f58618f851 Merge "KeyMint: Fix device-unique attestation chain specification" into sc-dev 2021-07-13 15:24:53 +00:00
Seth Moore
3dbdaa9717 Don't fail if TAG_ALLOW_WHILE_ON_BODY is missing
The TAG_ALLOW_WHILE_ON_BODY authorization is not required to be
supported, and if it is not supported it's a noop. Don't expect the tag
to fail with UNSUPPORTED_TAG on devices that don't support it.

Test: VtsAidlKeyMintTargetTest
Bug: 192222727
Change-Id: I2e80ca59151e79f595a65cae94ac966b4ba7020d
2021-07-12 15:10:40 -07:00
Seth Moore
19acbe9f66 Update KeyMint VTS tests with prod GEEK
Now that we have the production Google Endpoint Encryption Key, we can
update the tests to use the correct GEEK cert chain where applicable.

Test: VtsHalRemotelyProvisionedComponentTargetTest
Test: VtsAidlKeyMintTargetTest
Bug: 191301285
Change-Id: I84b557c6bad34741ffe6671fc941d9e266b73241
Merged-In: I84b557c6bad34741ffe6671fc941d9e266b73241
2021-07-09 13:17:24 -07:00
Seth Moore
aad945fce4 Update KeyMint VTS tests with prod GEEK am: 87eb1dd928
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15080864

Change-Id: Id79cf3bd491f66f22adfb34dfaee5881659197c6
2021-07-09 17:20:25 +00:00
Seth Moore
87eb1dd928 Update KeyMint VTS tests with prod GEEK
Now that we have the production Google Endpoint Encryption Key, we can
update the tests to use the correct GEEK cert chain where applicable.

Ignore-AOSP-First: No merge path to aosp, will manually merge
Test: VtsHalRemotelyProvisionedComponentTargetTest
Test: VtsAidlKeyMintTargetTest
Bug: 191301285
Change-Id: I84b557c6bad34741ffe6671fc941d9e266b73241
2021-07-09 08:47:54 -07:00
Eran Messeri
3e6c2ef9c8 KeyMint: Fix device-unique attestation chain specification
Fix the device-unique attestation chain specification: The chain should
have two or three certificates.
In case of two certificates, the device-unique key should be used for
the self-signed root.
In case of three certificates, the device-unique key should be certified
by another key (ideally shared by all StrongBox instances from the same
manufacturer, to ease validation).

Adjust the device-unique attestation tests to accept two or three
certificates in the chain.

Additionally, the current StrongBox KeyMint implementation can not yet
generate fully-valid chains (with matching subjects and issuers), so
relax that check.

Bug: 191361618
Test: m VtsAidlKeyMintTargetTest
Merged-In: I6e6bca33ebb4af67cac8e41a39e9c305d0f1345f
Change-Id: Iebefafe72148c919d10308eff7a19fc1bc40c619
2021-07-09 09:08:17 +01:00
Seth Moore
a62785d479 Merge "Add Attestation IDs State to DeviceInfo" into sc-dev am: e35b1427e6
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15098340

Change-Id: I1fa8d138ad6b9aa93d3b908e8b842aecc68b0b44
2021-07-08 23:19:05 +00:00
Seth Moore
6a1223f227 Add Attestation IDs State to DeviceInfo
We will use the 'Attestation IDs State' field in DeviceInfo to
determine whether a device is still provisionable or not. Once a
production device has left the factory, certain attestated device ids
should be fixed, and 'Attestation IDs State' should reflect this
by reporting "locked".

Remove stale, duplicated DeviceInfo description from ProtectedData.aidl

Test: None, just a doc change
Bug: 192017485
Change-Id: I4e0a840a8f415b3b410801805a158c46be30ec6a
Merged-In: I4e0a840a8f415b3b410801805a158c46be30ec6a
2021-07-08 16:05:41 -07:00
Seth Moore
e35b1427e6 Merge "Add Attestation IDs State to DeviceInfo" into sc-dev 2021-07-08 23:04:37 +00:00
Seth Moore
f594fce5dd Add Attestation IDs State to DeviceInfo
We will use the 'Attestation IDs State' field in DeviceInfo to
determine whether a device is still provisionable or not. Once a
production device has left the factory, certain attestated device ids
should be fixed, and 'Attestation IDs State' should reflect this
by reporting "locked".

Remove stale, duplicated DeviceInfo description from ProtectedData.aidl

Test: None, just a doc change
Bug: 192017485
Change-Id: I4e0a840a8f415b3b410801805a158c46be30ec6a
2021-07-08 12:47:42 -07:00
TreeHugger Robot
1e3ab5940f Merge "Add test ensuring that BCC keys not unique ids" into sc-dev 2021-07-08 17:15:27 +00:00
Seth Moore
17587b0183 Add test ensuring that BCC keys not unique ids
Get two test BCCs, then ensure that no repeated keys are found.

Ignore-AOSP-First: No merge path to AOSP, will manually port.
Bug: 192687735
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I48f86e7dfa9ab4bc6303a8d1b64ac7ca6ac76bbf
2021-07-08 15:54:52 +00:00
TreeHugger Robot
acce5d3c68 Merge "Use TagType constants" into sc-dev 2021-07-08 15:32:25 +00:00
Eran Messeri
befeda6b00 Use TagType constants
Now that the aidl compiler supports it, use constants from TagType to
indicate the type of each tag, rather than duplicating the values of
the constants.

Test: atest VtsAidlKeyMintTargetTest
Bug: 183737811
Merged-In: Ie8af1f00d04fa05c59cfc72692caecbcf2fae483
Change-Id: Ie62b6ee8a8ced05a870711073bb3be16931f3d4d
2021-07-08 10:45:10 +01:00
Eran Messeri
12ee28322d Annotate some TODOs
There are two tags that cannot be currently removed but should be
removed in KeyMint V2. Mark them as deprecated and point to the bug
for deletion.

Bug: 183737811
Test: That it compiles.
Change-Id: I98b96cc8c49eb339a998d0abed9216aa57f6b19f
Merged-In: I80ccaedeb777fdb249a8cb021db6628da32d6029
2021-07-08 10:42:13 +01:00
Eran Messeri
7050121408 Merge "KeyMint: Fix device-unique attestation chain specification" am: 9c3bd29cab am: e52c1bb007
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1757172

Change-Id: I39a7f8fea450bb6d3ba9020d9955de52e6c8ca45
2021-07-06 16:13:34 +00:00
Eran Messeri
9c3bd29cab Merge "KeyMint: Fix device-unique attestation chain specification" 2021-07-06 15:38:16 +00:00
Eran Messeri
3c8c7cdfa2 Merge "Annotate some TODOs" am: 302d29eb9b am: 0185ac7270
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1749641

Change-Id: Iec657494ec02a6eb8f9697161798e0fde206100e
2021-07-06 14:08:59 +00:00
Eran Messeri
302d29eb9b Merge "Annotate some TODOs" 2021-07-06 13:40:53 +00:00
Eran Messeri
03d7a1a4f3 KeyMint: Fix device-unique attestation chain specification
Fix the device-unique attestation chain specification: The chain should
have two or three certificates.
In case of two certificates, the device-unique key should be used for
the self-signed root.
In case of three certificates, the device-unique key should be certified
by another key (ideally shared by all StrongBox instances from the same
manufacturer, to ease validation).

Adjust the device-unique attestation tests to accept two or three
certificates in the chain.

Additionally, the current StrongBox KeyMint implementation can not yet
generate fully-valid chains (with matching subjects and issuers), so
relax that check.

Bug: 191361618
Test: m VtsAidlKeyMintTargetTest
Change-Id: I6e6bca33ebb4af67cac8e41a39e9c305d0f1345f
2021-07-06 14:32:16 +01:00
Eran Messeri
7c046786b8 Annotate some TODOs
There are two tags that cannot be currently removed but should be
removed in KeyMint V2. Mark them as deprecated and point to the bug
for deletion.

Bug: 183737811
Test: That it compiles.
Change-Id: I80ccaedeb777fdb249a8cb021db6628da32d6029
2021-07-06 10:46:57 +01:00
Seth Moore
9c59da828b Add ensuring that test BCC keys not unique ids am: 42c1133fed am: ea113e83c9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1755320

Change-Id: I4965a2f30f3bbe4a86089808965c49fd443b8a5c
2021-07-06 07:04:58 +00:00
Seth Moore
42c1133fed Add ensuring that test BCC keys not unique ids
Get two test BCCs, then ensure that no repeated keys are found.

Bug: 192687735
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I48f86e7dfa9ab4bc6303a8d1b64ac7ca6ac76bbf
Merged-In: I48f86e7dfa9ab4bc6303a8d1b64ac7ca6ac76bbf
2021-07-02 15:58:26 -07:00
Seth Moore
8b78dc5031 Correct the description for getKeyCharacteristics
The description should note that keystore-enforced tags are not to be
returned. This is done so that the keymint implementation doesn't have
to bother keeping track of tags it's not repsonsible for dealing with.

Fixes: 192575557
Test: none (it's just a comment change)
Change-Id: I3ff94201c262a5071d271b150dbbf21888d678aa
Merged-In: I3ff94201c262a5071d271b150dbbf21888d678aa
2021-07-01 11:39:13 -07:00
Seth Moore
f4c8ff9bef Add a utility to JSON-format a CSR with build info
We need both the build fingerprint as well as the CSR when uploading
data to the APFE provisioning server. Add a utility function to format
the output as a JSON blob so that it may be easily collected in the
factory in a serialized data format, then later uploaded.

Test: libkeymint_remote_prov_support_test
Test: VtsAidlKeyMintTargetTest
Test: VtsHalRemotelyProvisionedComponentTargetTest
Bug: 191301285
Change-Id: I751c5461876d83251869539f1a395ba13cb5cf84
2021-07-01 10:17:28 -07:00
Treehugger Robot
0ab5ef3ff7 Merge changes from topic "rkp-factory-tool"
* changes:
  Add real GEEK for RKP factory enrollment
  Add a unit test for remote_prov_utils
2021-06-30 20:39:53 +00:00
Seth Moore
0611028bc4 Add a utility to JSON-format a CSR with build info am: 23f624599f
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15115450

Change-Id: I591dc34a4850ca8f40aa13026af1c62e421619ba
2021-06-30 19:29:28 +00:00
Seth Moore
23f624599f Add a utility to JSON-format a CSR with build info
We need both the build fingerprint as well as the CSR when uploading
data to the APFE provisioning server. Add a utility function to format
the output as a JSON blob so that it may be easily collected in the
factory in a serialized data format, then later uploaded.

Test: libkeymint_remote_prov_support_test
Test: VtsAidlKeyMintTargetTest
Test: VtsHalRemotelyProvisionedComponentTargetTest
Bug: 191301285
Change-Id: I751c5461876d83251869539f1a395ba13cb5cf84
2021-06-30 09:32:08 -07:00
David Drysdale
8e8698913a Merge "KeyMint VTS: allow for stricter SharedSecret impls" into sc-dev 2021-06-29 05:49:21 +00:00
David Drysdale
cb02ff3548 Merge "KeyMint HAL: clarify spec text" am: 17a0526b1e am: 575246020d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1749620

Change-Id: I94c443b5e9cd495ccf1a95867cc19cc996b1307b
2021-06-28 17:33:09 +00:00
David Drysdale
56cdfbde56 Merge "KeyMint VTS: allow for stricter SharedSecret impls" am: f854cde530 am: a01b8259e3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1749644

Change-Id: I840e0d5199e1735d25b52d584ef0187d34346d97
2021-06-28 17:32:53 +00:00
David Drysdale
382e34835d KeyMint HAL: clarify spec text
- Make clear that CERTIFICATE_NOT_{BEFORE,AFTER} must be specified for
   generating/importing asymmetric keys.
 - Fix enforcement level of Tag::UNLOCKED_DEVICE_REQUIRED.
 - Fix reference to exportKey() for Tag::STORAGE_KEY to mention
   convertStorageKeyToEphemeral instead.
 - Mark Tag::CONFIRMATION_TOKEN as deprecated.

Test: none, comment change
Bug: 188672564
Merged-In: I68727b024f6b6743403941763aefca64e3eb091a
Change-Id: I68727b024f6b6743403941763aefca64e3eb091a
Ignore-AOSP-First: already merged in aosp/master
2021-06-28 18:15:14 +01:00
David Drysdale
17a0526b1e Merge "KeyMint HAL: clarify spec text" 2021-06-28 17:14:23 +00:00
David Drysdale
62272fc2f5 KeyMint VTS: allow for stricter SharedSecret impls
Bug: 192223752
Test: VtsAidlSharedSecretTargetTest
Merged-Ind: Iccf2d0fe2a2d10ad12269dfecf78ea1d831c3ad4
Change-Id: Iccf2d0fe2a2d10ad12269dfecf78ea1d831c3ad4
Ignore-AOSP-First: already merged in aosp/master
2021-06-28 18:02:36 +01:00
David Drysdale
f854cde530 Merge "KeyMint VTS: allow for stricter SharedSecret impls" 2021-06-28 17:01:22 +00:00
David Drysdale
d46d61efec KeyMint VTS: allow for stricter SharedSecret impls
Bug: 192223752
Test: VtsAidlSharedSecretTargetTest
Change-Id: Iccf2d0fe2a2d10ad12269dfecf78ea1d831c3ad4
2021-06-28 14:58:28 +01:00
David Drysdale
5cf4a11c01 KeyMint HAL: clarify spec text
- Make clear that CERTIFICATE_NOT_{BEFORE,AFTER} must be specified for
   generating/importing asymmetric keys.
 - Fix enforcement level of Tag::UNLOCKED_DEVICE_REQUIRED.
 - Fix reference to exportKey() for Tag::STORAGE_KEY to mention
   convertStorageKeyToEphemeral instead.
 - Mark Tag::CONFIRMATION_TOKEN as deprecated.

Test: none, comment change
Bug: 188672564
Change-Id: I68727b024f6b6743403941763aefca64e3eb091a
2021-06-28 12:43:10 +01:00
Seth Moore
50d62b0b15 Add real GEEK for RKP factory enrollment
Include a unit test to verify the GEEK cert chain is valid.

Test: libkeymint_remote_prov_support_test
Bug: 191301285
Change-Id: Icf9cfa165fbccb24b36b03ff3ce729a7e9c44cfd
Merged-In: Icf9cfa165fbccb24b36b03ff3ce729a7e9c44cfd
2021-06-25 10:48:49 -07:00
Seth Moore
42a2f6b6e2 Add a unit test for remote_prov_utils
This functionality will be used for the factory tooling, so we should
test it. Additionally, some new functionality will soon be added, and
it also needs to be tested.

Test: libkeymint_remote_prov_support_test
Bug: 191301285
Change-Id: I6a8798fc4b09fff1e829185a4b9e471921e5d2a9
Merged-In: I6a8798fc4b09fff1e829185a4b9e471921e5d2a9
2021-06-25 10:48:33 -07:00
Seth Moore
6d716dafec Add real GEEK for RKP factory enrollment am: 415f0ce4fe
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15071133

Change-Id: I8e25143efcbf531d2a850df6366f85c81058f0eb
2021-06-25 16:10:11 +00:00
Seth Moore
3a6cb24f82 Add a unit test for remote_prov_utils am: 7a55bb5cf8
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15071132

Change-Id: I3ec55bda354af4cc3dd1deca74c38c734a1801d0
2021-06-25 16:10:10 +00:00
Treehugger Robot
3e00e71055 Merge "Fix flaky corrupted padding tests" am: b54aebc2d8 am: 03a6cfdc15
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1745035

Change-Id: I9e6d25ea0313c650c1c01bcb8254e97545ca5964
2021-06-24 21:36:54 +00:00
Treehugger Robot
b54aebc2d8 Merge "Fix flaky corrupted padding tests" 2021-06-24 21:17:33 +00:00
Seth Moore
7a55ae3ddc Fix flaky corrupted padding tests
It's possible that corrupted ciphertext decrypts just fine. e.g. the
output ends with "0x01".

However, the chances of this happening are relatively low
(roughly 1/256). Corrupt the ciphertext up to 8 times, ensuring that
the likelihood of multiple successful decryptions is so miniscule that
it's effectively impossible.

Test: Ran *PaddingCorrupted tests 50000 times
Change-Id: If40ecd7817819921c020ea9b86ada18c4c77ea55
2021-06-24 12:45:23 -07:00
Seth Moore
415f0ce4fe Add real GEEK for RKP factory enrollment
Include a unit test to verify the GEEK cert chain is valid.

Test: libkeymint_remote_prov_support_test
Ignore-AOSP-First: No merge path to aosp, will manually merge
Bug: 191301285
Change-Id: Icf9cfa165fbccb24b36b03ff3ce729a7e9c44cfd
2021-06-23 13:05:59 -07:00
Seth Moore
798188aba0 Remove ignoreSignature for cose signature checks
This flag is never used anywhere, so just remove it. When used, it would
bypass signature checks. This is something we generally don't want to
do, even in testing. So remove the flag so there's no temptation to use
it.

Bug: 190942528
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I0433c1eedc08e9a5a5ad71347154867dba61689e
Merged-In: I0433c1eedc08e9a5a5ad71347154867dba61689e
2021-06-22 18:32:56 -07:00
Seth Moore
7a55bb5cf8 Add a unit test for remote_prov_utils
This functionality will be used for the factory tooling, so we should
test it. Additionally, some new functionality will soon be added, and
it also needs to be tested.

Ignore-AOSP-First: No merge path to aosp, will manually merge
Test: libkeymint_remote_prov_support_test
Bug: 191301285
Change-Id: I6a8798fc4b09fff1e829185a4b9e471921e5d2a9
2021-06-22 17:54:34 -07:00
TreeHugger Robot
2105f08415 Merge "Remove ignoreSignature for cose signature checks" into sc-dev am: 1aa95b63d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15016110

Change-Id: I893a697010077fdc99c225a8178665d94e5c0ffb
2021-06-22 17:44:38 +00:00
TreeHugger Robot
1aa95b63d0 Merge "Remove ignoreSignature for cose signature checks" into sc-dev 2021-06-22 17:21:13 +00:00
Alan Stokes
adb7159de8 Merge "Allow CompOS APEX to access Keystore AIDL." am: fd7eeeaa1d am: 2a77df8a86
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1741123

Change-Id: Ic575adc36112cccc34bc3f5d959c401a9513aedf
2021-06-22 08:39:19 +00:00
Alan Stokes
fd7eeeaa1d Merge "Allow CompOS APEX to access Keystore AIDL." 2021-06-22 08:13:11 +00:00
David Drysdale
308916bfaf KeyMint VTS: require curve for ECDSA keys
The KeyMint AIDL spec requires that "Tag::EC_CURVE must be provided to
generate an ECDSA key". Move the VTS tests to always create ECDSA keys
by curve not key size.

Bug: 188672564
Test: VtsAidlKeyMintTargetTest
Merged-In: I33036387c243b21ab0ecd49221b7e7757598913e
Change-Id: I33036387c243b21ab0ecd49221b7e7757598913e
Ignore-AOSP-First: already merged in aosp/master
2021-06-21 07:14:05 +01:00
David Drysdale
924643748b KeyMint VTS: more attestation info tests
Try all tags in attestion extension one by one

Test: VtsAidlKeyMintTargetTest on CF
Bug: 186735514
Merged-In: I63ca8d298d2d16f707f2437ab48aaa69c1d7563d
Change-Id: I63ca8d298d2d16f707f2437ab48aaa69c1d7563d
Ignore-AOSP-First: already merged in aosp/master
2021-06-21 07:13:45 +01:00
David Drysdale
dfff9c74f1 Merge changes I33036387,I63ca8d29 am: aedb92d5af am: 5455f2dc13
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1740893

Change-Id: I64708a3f57a27daa694722d6019419371be22101
2021-06-21 05:53:21 +00:00
David Drysdale
aedb92d5af Merge changes I33036387,I63ca8d29
* changes:
  KeyMint VTS: require curve for ECDSA keys
  KeyMint VTS: more attestation info tests
2021-06-21 05:30:10 +00:00
Max Bires
2f87ec175f Merge "Updating CDDL schemas to match the finalized spec." into sc-dev 2021-06-21 02:11:39 +00:00
Treehugger Robot
82bbebdd13 Merge "Updating CDDL schemas to match the finalized spec." am: 11854c2d82 am: b8cf151c98
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1720450

Change-Id: I45e601192b1f05c794dea2cf61fa2668942a32a5
2021-06-18 14:56:06 +00:00
Treehugger Robot
11854c2d82 Merge "Updating CDDL schemas to match the finalized spec." 2021-06-18 14:32:25 +00:00
Eran Messeri
d26ffeca38 Merge "Remove KeyMint TODOs" am: 45e16a09ca am: 4d2be4b6a5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1741125

Change-Id: I906ccb9f8d121af9235c4d8398e9170b4e19c581
2021-06-18 13:56:57 +00:00
Eran Messeri
45e16a09ca Merge "Remove KeyMint TODOs" 2021-06-18 13:28:25 +00:00
Eran Messeri
241295940e Merge "KeyMint: Document KeyCharacteristics" am: 30a6b0e7f0 am: cd489e35d3
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1736773

Change-Id: I0cf6aed6e658184e2a6c86a75c7ea96d74c2ef30
2021-06-18 13:04:59 +00:00
David Drysdale
df09e54ef3 KeyMint VTS: require curve for ECDSA keys
The KeyMint AIDL spec requires that "Tag::EC_CURVE must be provided to
generate an ECDSA key". Move the VTS tests to always create ECDSA keys
by curve not key size.

Bug: 188672564
Test: VtsAidlKeyMintTargetTest
Change-Id: I33036387c243b21ab0ecd49221b7e7757598913e
2021-06-18 13:52:47 +01:00
Eran Messeri
30a6b0e7f0 Merge "KeyMint: Document KeyCharacteristics" 2021-06-18 12:41:00 +00:00
Eran Messeri
2950654d44 Remove KeyMint TODOs
Remove TODOs from the KeyMint specification that were not concrete
enough or did not have enough context to act upon.

Bug: 183737811
Test: That it compiles.
Change-Id: I01899be5e65e9943053aa796a2ab23f1a783a1aa
2021-06-18 13:03:30 +01:00
Eran Messeri
58c8e39110 KeyMint: Document KeyCharacteristics
Document the various fields in KeyCharacteristics.

Bug: 183737811
Test: That it compiles.
Change-Id: I629001a3f5ac5d1e61ae6ffaa2702e3d32f56e52
2021-06-18 12:28:09 +01:00
Alan Stokes
e75851712b Allow CompOS APEX to access Keystore AIDL.
Makes the AIDL (and its dependencies) available to allow client code
to build against it.

Fixes: 190995136
Test: Client code (in progress) builds.
Change-Id: I06e7486463bca93ed25377c0dca30484a6bbf656
2021-06-18 10:21:36 +01:00
David Drysdale
37af4b3656 KeyMint VTS: more attestation info tests
Try all tags in attestion extension one by one

Test: VtsAidlKeyMintTargetTest on CF
Bug: 186735514
Change-Id: I63ca8d298d2d16f707f2437ab48aaa69c1d7563d
2021-06-18 07:45:27 +01:00
Seth Moore
474eee3351 Remove ignoreSignature for cose signature checks
This flag is never used anywhere, so just remove it. When used, it would
bypass signature checks. This is something we generally don't want to
do, even in testing. So remove the flag so there's no temptation to use
it.

Ignore-AOSP-First: Will cherry-pick to AOSP
Bug: 190942528
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I0433c1eedc08e9a5a5ad71347154867dba61689e
2021-06-17 12:41:39 -07:00
David Drysdale
4b8360b45a KeyMint VTS: improve attestation tests am: 03346e175e
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/14964378

Change-Id: I5ab0bd80eab05bbd65d0ed9e6c4b580aaed80d49
2021-06-17 17:36:39 +00:00
David Drysdale
a676c3b4ef KeyMint VTS: improve attestation tests
Check that the various ATTESTATION_ID_* tags are included if they
have the correct value, and that keygen fails if they have an invalid
value.

Also update attestation tags to include vendor/boot patchlevel if
they're available. (They always should be, but fixing that is a
separate task.)

Bug: 190757200
Test: VtsAidlKeyMintTargetTest
Merged-In: Ibaed7364c6d08c0982e2a9fb6cb864ae42cf39fe
Change-Id: Ibaed7364c6d08c0982e2a9fb6cb864ae42cf39fe
2021-06-17 16:43:37 +01:00
David Drysdale
03346e175e KeyMint VTS: improve attestation tests
Check that the various ATTESTATION_ID_* tags are included if they
have the correct value, and that keygen fails if they have an invalid
value.

Also update attestation tags to include vendor/boot patchlevel if
they're available. (They always should be, but fixing that is a
separate task.)

Bug: 190757200
Test: VtsAidlKeyMintTargetTest
Change-Id: Ibaed7364c6d08c0982e2a9fb6cb864ae42cf39fe
2021-06-17 16:33:20 +01:00
Eran Messeri
afe9af040d Merge "Improve unique attestation docs & tests" into sc-dev 2021-06-17 15:00:15 +00:00
Eran Messeri
a9ce01cfed Improve unique attestation docs & tests
Improve the documentation and tests related to device-unique
attestation on StrongBox KeyMint devices:
* Test that the chain produced is exactly of length 2.
* Document how the chain needs to be structured.
* Explain the trust properties of the key used for the
  self-signed root.

Test: atest VtsAidlKeyMintTargetTest
Bug: 187803288
Ignore-AOSP-First: Already merged in AOSP
Merged-In: I09bb16d6938b567c114485d2df00bde9d3e1ccf9
Change-Id: Ib7efdd428ce5a2e14c281077e3a77048c9721702
2021-06-16 14:41:18 +01:00
David Drysdale
c14f322159 VTS tests: check size of byte strings
Bug: 181883620
Test: VtsAidlSecureClockTargetTest, VtsAidlSharedSecretTargetTest
Merged-In: I9ea8687e0c9e89140bcddfefcc2a6177c99b2e4d
Change-Id: I9ea8687e0c9e89140bcddfefcc2a6177c99b2e4d
Ignore-AOSP-First: already present in aosp/master
2021-06-16 08:59:50 +01:00
David Drysdale
f164c06afb KeyMint VTS: extract full vendor patchlevel
The vendor patchlevel is YYYYMMDD not YYYYMM

Bug: 188672564
Bug: 186735514
Test: VtsAidlKeyMintTargetTest
Merged-In: Ia641f8eef84a85aec8f2a0551c192b6874301126
Change-Id: Ia641f8eef84a85aec8f2a0551c192b6874301126
Ignore-AOSP-First: already present in aosp/master
2021-06-16 08:58:54 +01:00
David Drysdale
de24c1f82d Merge "VTS tests: check size of byte strings" am: 98949afb70 am: f0f6682ab5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1736653

Change-Id: I624f43d3877cbd4f56b4512d83d789f1af076b0d
2021-06-16 07:49:54 +00:00
David Drysdale
511d9bcc28 Merge "KeyMint VTS: extract full vendor patchlevel" am: 52ce52fb1e am: 24babae302
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1719301

Change-Id: I336baca3387a2ee1329760b0d22a8912b7373786
2021-06-16 07:49:45 +00:00
David Drysdale
98949afb70 Merge "VTS tests: check size of byte strings" 2021-06-16 07:17:53 +00:00
David Drysdale
52ce52fb1e Merge "KeyMint VTS: extract full vendor patchlevel" 2021-06-16 07:17:27 +00:00
Eran Messeri
a40b84b49a Merge "Use TagType constants" am: 1e6730acec am: b2178bc9c9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1737653

Change-Id: I7de0a984ee4f7d8c3a88eaf87fec594afc7902a2
2021-06-15 15:51:51 +00:00
Eran Messeri
a5047720f0 Use TagType constants
Now that the aidl compiler supports it, use constants from TagType to
indicate the type of each tag, rather than duplicating the values of
the constants.

Test: atest VtsAidlKeyMintTargetTest
Bug: 183737811
Change-Id: Ie8af1f00d04fa05c59cfc72692caecbcf2fae483
2021-06-15 14:26:59 +01:00
David Drysdale
9c7fae7e81 KeyMint VTS: extract full vendor patchlevel
The vendor patchlevel is YYYYMMDD not YYYYMM

Bug: 188672564
Bug: 186735514
Test: VtsAidlKeyMintTargetTest
Change-Id: Ia641f8eef84a85aec8f2a0551c192b6874301126
2021-06-15 13:12:07 +01:00
David Drysdale
fd1b38dc66 VTS tests: check size of byte strings
Bug: 181883620
Test: VtsAidlSecureClockTargetTest, VtsAidlSharedSecretTargetTest
Change-Id: I9ea8687e0c9e89140bcddfefcc2a6177c99b2e4d
2021-06-14 09:52:48 +01:00
David Drysdale
fd5b1a6da8 KeyMint: sync all attestation tags
Get description of ASN.1 schema in HAL and the keymint support library
in sync with each other.  Change code to always list tags in the same
order (by numeric tag).

Bug: 188672564
Bug: 186735514
Test: VtsAidlKeyMintTargetTest
Merged-In: I620f54ba4a265ea69d174f6f44765a8508bfe803
Change-Id: I620f54ba4a265ea69d174f6f44765a8508bfe803
Ignore-AOSP-First: already merged into aosp/master
2021-06-09 09:10:33 +01:00
David Drysdale
a5af95bff3 Merge "KeyMint: sync all attestation tags" am: ba8e44599c am: 16d7e387a1
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1719302

Change-Id: I75004dbf0512fafea3396a2884f803faa7fd0828
2021-06-09 06:18:30 +00:00
David Drysdale
ba8e44599c Merge "KeyMint: sync all attestation tags" 2021-06-09 05:49:33 +00:00
David Drysdale
eaab0f2816 KeyMint VTS: better early boot key tests
Add a check that the TAG_EARLY_BOOT_ONLY is included in the returned key
characteristics.

Bug: 188672564
Test: VtsAidlKeyMintTargetTest
Merged-In: I200c61f34888c720c47f6289d79cd21d78436b58
Change-Id: I200c61f34888c720c47f6289d79cd21d78436b58
Ignore-AOSP-First: already merged in aosp/master
2021-06-08 12:04:45 +01:00
David Drysdale
5cbbb6d580 Merge "KeyMint VTS: better early boot key tests" am: f3374d4237 am: 83b0b9a2fc
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1719303

Change-Id: I2814959563c2ea2f6cd9a4561e9504d1570c90ca
2021-06-07 16:43:19 +00:00
David Drysdale
96ad2036b2 KeyMint VTS: test getKeyCharacteristics()
Bug: 186685601
Bug: 188855306
Test: VtsAidlKeyMintTargetTest
Merged-In: Icf400533b0ded98b9338f2d782d95d90c7efbff4
Change-Id: Icf400533b0ded98b9338f2d782d95d90c7efbff4
Ignore-AOSP-First: already merged in aosp/master
2021-06-07 17:27:36 +01:00
David Drysdale
f3374d4237 Merge "KeyMint VTS: better early boot key tests" 2021-06-07 16:05:23 +00:00
David Drysdale
93c72cef92 KeyMint: sync all attestation tags
Get description of ASN.1 schema in HAL and the keymint support library
in sync with each other.  Change code to always list tags in the same
order (by numeric tag).

Bug: 188672564
Bug: 186735514
Test: VtsAidlKeyMintTargetTest
Change-Id: I620f54ba4a265ea69d174f6f44765a8508bfe803
2021-06-07 13:46:49 +01:00
Treehugger Robot
8e928b5b0f Merge "Improve unique attestation docs & tests" am: 0872e42bec am: f5eb250c29
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1719304

Change-Id: I94ee1b03e81fe308166446ed5a9c77f4f4fecdd5
2021-06-07 11:49:11 +00:00
Treehugger Robot
0872e42bec Merge "Improve unique attestation docs & tests" 2021-06-07 11:22:48 +00:00