From 5641fe41414a0b8d7e95d45425628a268284d068 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Wed, 3 Jun 2020 17:27:58 -0400 Subject: Identity: Update requirements about SessionTranscript CBOR and provisioning challenge. Bug: 156911917 Bug: 158107945 Test: atest VtsHalIdentityTargetTest Test: atest android.security.identity.cts Change-Id: Iacdf89744bbd30c5a10d6cba873147e424ddb01b --- .../security/identity/IdentityCredential.java | 27 +++++++--------------- .../identity/WritableIdentityCredential.java | 8 +++---- 2 files changed, 12 insertions(+), 23 deletions(-) (limited to 'identity') diff --git a/identity/java/android/security/identity/IdentityCredential.java b/identity/java/android/security/identity/IdentityCredential.java index b351b3d77430..493c85a930be 100644 --- a/identity/java/android/security/identity/IdentityCredential.java +++ b/identity/java/android/security/identity/IdentityCredential.java @@ -167,25 +167,14 @@ public abstract class IdentityCredential { * IntentToRetain = bool * * - *

If the {@code sessionTranscript} parameter is not {@code null}, it must contain CBOR - * data conforming to the following CDDL schema: - * - *

-     *   SessionTranscript = [
-     *     DeviceEngagementBytes,
-     *     EReaderKeyBytes
-     *   ]
-     *
-     *   DeviceEngagementBytes = #6.24(bstr .cbor DeviceEngagement)  ; Bytes of DeviceEngagement
-     *   EReaderKeyBytes = #6.24(bstr .cbor EReaderKey.Pub)  ; Bytes of EReaderKey.pub
-     *
-     *   EReaderKey.Pub = COSE_Key    ; Ephemeral public key provided by reader
-     * 
- * - *

where a {@code COSE_Key} structure for the public part of the key-pair previously - * generated by {@link #createEphemeralKeyPair()} must appear somewhere in - * {@code DeviceEngagement} and the X and Y coordinates must both be present - * in uncompressed form. + *

If the {@code sessionTranscript} parameter is not {@code null}, the X and Y coordinates + * of the public part of the key-pair previously generated by {@link #createEphemeralKeyPair()} + * must appear somewhere in the bytes of the CBOR. Each of these coordinates must appear + * encoded with the most significant bits first and use the exact amount of bits indicated by + * the key size of the ephemeral keys. For example, if the ephemeral key is using the P-256 + * curve then the 32 bytes for the X coordinate encoded with the most significant bits first + * must appear somewhere in {@code sessionTranscript} and ditto for the 32 bytes for the Y + * coordinate. * *

If {@code readerAuth} is not {@code null} it must be the bytes of a {@code COSE_Sign1} * structure as defined in RFC 8152. For the payload nil shall be used and the diff --git a/identity/java/android/security/identity/WritableIdentityCredential.java b/identity/java/android/security/identity/WritableIdentityCredential.java index c7aa32855abc..305d0ead0652 100644 --- a/identity/java/android/security/identity/WritableIdentityCredential.java +++ b/identity/java/android/security/identity/WritableIdentityCredential.java @@ -56,10 +56,10 @@ public abstract class WritableIdentityCredential { * authority doesn't care about the nature of the security hardware. If called, however, this * method must be called before {@link #personalize(PersonalizationData)}. * - * @param challenge is a byte array whose contents should be unique, fresh and provided by - * the issuing authority. The value provided is embedded in the attestation - * extension and enables the issuing authority to verify that the attestation - * certificate is fresh. + * @param challenge is a non-empty byte array whose contents should be unique, fresh and + * provided by the issuing authority. The value provided is embedded in the + * attestation extension and enables the issuing authority to verify that the + * attestation certificate is fresh. * @return the X.509 certificate for this credential's CredentialKey. */ public abstract @NonNull Collection getCredentialKeyCertificateChain( -- cgit v1.2.3