Commit Graph

572 Commits

Author SHA1 Message Date
Eran Messeri
210d3ea87b ID attestation: Define tag for a second IMEI
Define a KeyMint tag for a second IMEI to be included in the attestation
record.

Also clarify that the IMEI tag is meant to include one, and only one,
IMEI.

Bug: 244732345
Test: android.keystore.cts.DeviceOwnerKeyManagementTest
Merged-In: I70ecbb0245ba2e517e5d0db0cfdce4525846f3e5
Change-Id: I70ecbb0245ba2e517e5d0db0cfdce4525846f3e5
2022-11-10 01:54:21 +00:00
Treehugger Robot
080af0a493 Merge "Fix typo in property name" 2022-11-08 20:23:28 +00:00
Tri Vo
799e4353c2 Fix typo in property name
Test: VtsAidlKeyMintTargetTest
Change-Id: I9c42f14a468ae907d4c47df8af4e3b9b16cd5d96
2022-11-07 17:23:53 -08:00
Devin Moore
7556e51ce8 Mark keymint as unfrozen to manage keystore2's imports
We are now checking the imports of frozen versions of interfaces and
need mark keystore2 as `frozen: false` so the aidl_interfaces that
import it will import the latest unfrozen version.

Test: hal_implementation_test
Bug: 257338648
Change-Id: Ibcb151abd2fc13e3f7dfbcf515d0f62839d1caf9
2022-11-04 15:31:23 +00:00
Tri Vo
73cb8af65e Merge "Add TEST_MAPPING config" 2022-10-28 19:03:57 +00:00
Tri Vo
269057bd78 Add TEST_MAPPING config
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: Ia190f6c91a4312cc06a525fcbe0e2c5ba6975013
2022-10-27 15:10:17 -07:00
Tommy Chiu
4fdcccc7c0 KeyMint VTS: Use a strongbox must support DIGEST for importKey
"ImportWrappedKeyTest.WrongDigest" tried to wrap a keyBlob by one digest
type and unwrap it by another digest type.

It's been OK for KeyMint implementations to allow unsupported
parameters/characteristics at key generation time, and only police their
use, at begin() time. However if an implementation wants to secure it at
the key generation/importing time the first digest type must be
supported by all implementation.

Bug: 249276913
Test: VtsAidlKeyMintTargetTest
Change-Id: I6bc000026e9e4aec0aa82078a98c75e2d7c56847
2022-10-25 21:22:57 +08:00
Tri Vo
0d6204e2b7 Update VtsHalRemotelyProvisionedComponentTargetTest to v3
Bug: 235265072
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I01e387a0784c3548a4661a73d7bd3d5bec9fb42e
2022-10-17 17:04:19 -07:00
Tri Vo
f48a2a7bbf Bump Identity and KM AIDL API versions
Imported interfaces are versioned, i.e. bumping an interface version
necessiates bumping the version of importing interfaces.

Keystore and Identity import KM. We are uprevving KM, so all three need
to be bumped at the same time.

Test: m
Change-Id: I46b253e72f2f245bd628ed2ae1f2f4e0572827e7
2022-10-17 15:04:59 -07:00
Tri Vo
dd12c487d2 IRPC test: use version from RpcHardwareInfo
Check against version of the interface reported by the HAL rather than
the one from generated code.

AIDL interface are meant to be backwards compatible. Having the HAL
report its version dynamically makes it easier to maintain legacy
behavior while evolving the interface, e.g. we bump IRPC to v3
across our codebase, but devices that already shipped may still behave
as v1/2 devices.

Bug: 235265072
Test: VtsHalRemotelyProvisionedComponentTargetTest

Change-Id: I49e3a09723590ac1a7c432b11450c1438563c787
2022-10-12 22:41:33 +00:00
Treehugger Robot
ff8f1d6edd Merge "Generalize RKP CDDL schema beyond CSRs" 2022-10-07 18:21:25 +00:00
David Drysdale
0192979809 Merge "RKP HAL: fix typos" 2022-10-06 05:57:28 +00:00
Andrew Scull
bff2cae4f8 Generalize RKP CDDL schema beyond CSRs
The certificate signing request (CSR) CDDL schema comprises and
authentication wrapper and an inner payload containing details of the
request. Seperate these two parts more clearly in the schema with a view
to reusing the authentication wrapper for other messages.

The change of Csr to be defined in terms of the AuthenticatedMessage
generic type has no effective change on the schema.

A version field is added to CsrPayload, formerly SignedDataPayload, so
that the AuthenticatedMessage and CsrPayload schemas can evolve
independently.

The cert_type field of DeviceInfo is moved up a level into CsrPayload.
This means DeviceInfo only contains device information and not other
fields related to the CSR.

The payload of AuthenticatedMessage is not self-describing. The expected
schema of the payload will be inferred from context, for example the
server endpoint the message is sent to.

Bug: 250910137
Test: n/a - comments only
Change-Id: I2c981ec8fe63995779ce119168ad3d9b40d5b8c5
2022-10-05 10:00:52 +00:00
David Drysdale
e6fe69b75d Merge "KeyMint HAL: clarify time-based auth behaviour" 2022-10-05 06:09:40 +00:00
Andrew Scull
a4c4a18dc7 Tweak RKP HAL comments
Change the cert_type field from an enum of strings to a tstr type with
the known types documented in comments. The types are part of the
protocol between the HAL implementation and the provisioning server that
is opaque to the Android platform, so there's not need to bump the HAL
version in order to add new certificate types.

Replace the undefined Dcc type/acronym with the term "DICE chain" for
smoother reading.

Make the behaviour of generateCertificateRequest() in the v3 HAL more
explicit by explaining that a ServiceSpecificException should be raised
with the same error code that is currently documented.

Bug: 240312857
Test: n/a - comments only
Change-Id: If5acc388b25fa24d240c936ddefd08943fc6dd8d
2022-10-04 13:12:22 +00:00
David Drysdale
a867bc1eb3 KeyMint HAL: clarify time-based auth behaviour
Changes:
- correct the sign of the timestamp comparison text
- make updateAad() and finish() refer to the auth text in begin()
- describe auth flows for keys with AUTH_TIMEOUT on devices without
  a secure time source

Test: none, comment change only
Change-Id: Ia60a4a949e030a7a96772406e3b0f7b3211a0915
2022-09-29 15:56:25 +01:00
Seth Moore
2fc6f83df6 Move verifyProtectedData into remote_prov_utils
This way, rkp_factory_extraction_tool can reuse the code to perform a
test on the factory line if a partner so chooses.

Test: rkp_factory_extraction_tool --self_test
Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Bug: 239839050
Change-Id: I3989ba606750be77f1945a50fe2307a631d19d11
2022-09-16 16:05:29 -07:00
David Drysdale
77f66a3ccc RKP HAL: fix typos
Test: None, comment change only
Change-Id: I74ddad8ccf9f7e2d6ff2237dac32b94957a9161c
2022-09-14 15:39:40 +01:00
Seth Moore
f1f6215c09 Move the device info validation to a helper library
rkp_factory_extraction_tool now reuses the VTS logic for validating the
DeviceInfo. This way, partners doing RKP testing can see locally if they
are getting bad DeviceInfo before they try to upload the data to the
google service.

Test: atest VtsHalRemotelyProvisionedComponentTargetTest
Test: rkp_factory_extraction_tool
Bug: 239838563
Change-Id: I80fba3e624e1f5ab6da7aac889a0168f7cb8dbe4
2022-09-13 12:00:50 -07:00
Max Bires
0068fccb41 Merge "Clarify error message in DeviceInfo check." 2022-09-09 23:40:17 +00:00
Max Bires
757ed42e2c Clarify error message in DeviceInfo check.
This change gives additional context to the device info checks while.
Currently, an unprovisioned device will generate a massive spam of
failures which may be WAI for an early hardware revision device that
was not provisioned with attestation IDs.

Test: atest VtsHalRemotelyProvisionedComponentTest
Change-Id: I16069dba841a90aa55781148d3c268ced635e006
2022-09-08 18:19:26 -07:00
Max Bires
137ffac4c5 Update IRemotelyProvisionedComponent HAL to v3
This change makes all of the changes to the HAL AIDL files, along with
corresponding documentation edits, to facilitate the definition for
version 3 of IRemotelyProvisionedComponent HAL.

The bulk of the changes are described within the RKP_CHANGELOG.md file
and will therefore not be discussed here within the commit message.

Bug: 240312857
Test: It is human readable and also builds.
Change-Id: I920550bdfe5a8f9ba677c4a4f67e975bcd3672ab
2022-09-02 10:20:28 -07:00
David Drysdale
7ea97a310a KeyMint HAL: reinstate tags in extension schema
Commit 93c72cef92 ("KeyMint: sync all attestation tags",
http://aosp/1719302) removed various tags from the attestation that are
only applicable to symmetric keys, on the assumption that these are
irrelevant for the attestation extension that is generated for the
certificate holding asymmetric public keys.

However, that change did not take into account the fact that the
AuthorizationList ASN.1 schema is re-used elsewhere in the KeyMint API,
specifically as a way of describing the characteristics associated with
a key that is being securely imported via
IKeyMintDevice::importWrappedKey.

That import process may be used for symmetrics keys, and so the tags
that are specific to symmetric keys still need to be included in
AuthorizationList.

Similarly, USER_SECURE_ID values are never included in attestation
extensions because they have no meaning off-device, but they may be
needed as part of the import of a wrapped key.

Test: TreeHugger, comment change only
Bug: 244693617
Change-Id: Iaa941e120e3641a6e6c369b7c6a51f10b44df78a
2022-09-02 17:08:04 +01:00
David Drysdale
4683a5383f KeyMint HAL: clarify obsolete tags
The tag enum names can't be removed due to AIDL back-compatibility
requirements, and also it's useful to have the values present to avoid
inadvertent reuse.

Update the tag comment text to indicate that these tags are obsolete.

Bug: 191738660
Test: TreeHugger, comment change only
Change-Id: Icbd4c9cd0313f93bc491b49eb9077766d0f44e34
2022-09-02 17:07:41 +01:00
Xin Li
28cde8fd22 Merge "DO NOT MERGE - Merge Android 13" 2022-08-16 19:11:03 +00:00
David Drysdale
b97121d8a5 KeyMint VTS: use SCOPED_TRACE on all loops
Also add a couple of nullptr checks

Test: VtsAidlKeyMintTargetTest
Change-Id: Ic95b16fc6307f3b97cc54dbf08f5726641a761d9
2022-08-12 11:54:46 +01:00
David Drysdale
e76000e09b Merge "Docs: return EARLY_BOOT_ENDED instead of INVALID_KEY_BLOB." am: 6796c8b5aa
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2160639

Change-Id: I038bf7c4590425e88e4611dd36f4f6f3a0e35c4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 05:11:57 +00:00
David Drysdale
6796c8b5aa Merge "Docs: return EARLY_BOOT_ENDED instead of INVALID_KEY_BLOB." 2022-07-21 04:52:46 +00:00
Subrahmanyaman
0b9c196214 Docs: return EARLY_BOOT_ENDED instead of INVALID_KEY_BLOB.
All attempts to use an EARLY_BOOT_ONLY key after earlyBootEnded()
is called must fail with Error::EARLY_BOOT_ENDED.

Test: run vts -m VtsAidlKeyMintTarget
Change-Id: Ic3d028ceb7f71e6e266993ec4e877770cd8e5c4a
2022-07-20 17:26:12 +00:00
David Drysdale
ac42d60136 Merge "KeyMint HAL: clarify leaf cert requirements" am: 824c5d8f60
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2154073

Change-Id: Iaf833a5d576accb0fa104ce0e235e1c96b33c398
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 14:01:23 +00:00
David Drysdale
824c5d8f60 Merge "KeyMint HAL: clarify leaf cert requirements" 2022-07-15 13:37:19 +00:00
David Drysdale
26fd684e20 Merge "KeyMint: Test size requirements for ciphers" am: 96ed41b2e2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2147675

Change-Id: I029f366281a868e0f92173a6f71afe8fe846adf9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-15 12:28:23 +00:00
David Drysdale
96ed41b2e2 Merge "KeyMint: Test size requirements for ciphers" 2022-07-15 12:10:10 +00:00
David Drysdale
9daf7c70a8 KeyMint HAL: clarify leaf cert requirements
Bug: 237624131
Bug: 238037309
Test: None, comment change
Change-Id: I7426deda8b0735f1ca34a22fc21ec0121a0fcca8
2022-07-14 17:39:42 +01:00
Prashant Patil
dd5f7f0e8d KeyMint: Test size requirements for ciphers
Test size requirements for symmetric (Stream and Block) ciphers.
These tests are similar to CTS tests of symmetric ciphers.
For reference CTS test BlockCipherTestBase#testKatEncryptOneByteAtATime
for all its derived classes eg. AES128CBCNoPaddingCipherTest,
AES128CBCPKCS7PaddingCipherTest etc.

Bug: 226899425
Test: run vts -m VtsAidlKeyMintTargetTest

Change-Id: I78408071fbf5a360d89c5bbae479faffd7c6d935
2022-07-13 12:36:22 +00:00
David Drysdale
0fdf10c4de Merge "KeyMint VTS: test default MGF_DIGEST behaviour" am: 5d88e95b36
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1888675

Change-Id: I3463a8111ccf186734cc325b7589fe688fb3b269
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 07:23:37 +00:00
David Drysdale
ae3727bf45 KeyMint VTS: test default MGF_DIGEST behaviour
KeyMint supports the specification of a separate MGF digest when
performing RSA-OAEP decryption, with a default value of SHA-1.

Test the expected behaviour here:
 - SHA-1 is used if nothing specified in key characteristics.
 - If something is specified in key characteristics, the operation
   parameter value has to be one of those values.

Bug: 203688354
Test: VtsAidlKeyMintTargetTest
Change-Id: Ic2dd3641be732a273724faa20cf4edf8a1752506
2022-07-06 12:26:37 +01:00
Xin Li
30f27895e3 Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: I2bddc0d13a4de6a5766de85fdf432fd05d84a581
Change-Id: I3f77dda59ac4ff05d0d59de68c7f0f96f5b61712
2022-06-28 21:23:27 +00:00
Treehugger Robot
a5468b5127 Merge "Verify that imported keys have the correct characteristics." 2022-06-27 20:58:16 +00:00
David Drysdale
46f99f4e9a Merge "KeyMint HALs: clarifications" 2022-06-27 12:01:14 +00:00
Seth Moore
2f2db81f7d Merge "Add an IRPC changelog." 2022-06-24 22:49:32 +00:00
Max Bires
9dce048421 Add an IRPC changelog.
This document is meant to provide a clear summation for vendors looking
for a reference of what has changed from release to release, as well as
documentation for those working on developing the
IRemotelyProvisionedComponent interface.

Bug: 227266513
Test: The document is readable.
Change-Id: I909e22a31a88856af911a80a52ec7eda263693db
2022-06-24 20:54:11 +00:00
David Drysdale
e9e12405f5 Merge "KeyMint VTS: cope with ATTEST_KEY +/- SIGN" am: 11cb564913 am: cbaede3f72
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2123433

Change-Id: I0b032b1072607db7fb1092d972c8c8b77bcc1a9b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 02:12:14 +00:00
Shawn Willden
fbb4cf383a Read VSR level from correct property. am: 35db349596 am: 4e97ec021e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2128833

Change-Id: Ibd849ae5d7e2e40072f68e1f49446fe558fdf6a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-20 02:12:05 +00:00
Jooyung Han
c3f8861bb8 Merge "Remove AIDL-libs from VNDK" 2022-06-20 01:15:09 +00:00
David Drysdale
8d925aee2d KeyMint HALs: clarifications
- Remove KeyPurpose comments that refer to public key operations.
 - Clarify/fix description of RSA_OAEP_MGF_DIGEST.
 - Describe HMAC key requirements.
 - Clarify RSA_PSS key length requirement
 - Clarify when shared secret should change (on restart)
 - Padding::NONE is not deprecated
 - Fix typos

Test: none, just comment changes
Change-Id: If58e8d8644aac926a990e50f7a873dca74cd4896
2022-06-17 09:25:32 +01:00
David Drysdale
11cb564913 Merge "KeyMint VTS: cope with ATTEST_KEY +/- SIGN" 2022-06-17 06:05:13 +00:00
Shawn Willden
35db349596 Read VSR level from correct property.
Bug: 235424890
Test: VtsHalKeymasterV4_0TargetTest & VtsAidlKeyMintTargetTest
Change-Id: I39109c097d129124097a303c3f108d015cb367e3
2022-06-17 10:49:29 +09:00
Treehugger Robot
ddc1e4c82d Merge "Add a README for Remote Key Provisioning." 2022-06-15 13:32:46 +00:00
Max Bires
82ed7a42c0 Add a README for Remote Key Provisioning.
This document goes a little more in depth on the motivating factors and
background mechanisms that occur with RKP, that are not appropriate for
direct inclusion in the HAL docs in the .aidl files.

Fixes: 234159998
Test: Readable
Merged-In: I141fb098c536a5468b1113af64dcf6185ea7ae9f
Change-Id: I141fb098c536a5468b1113af64dcf6185ea7ae9f
2022-06-15 05:29:22 -07:00