Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f160506f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7506386 from 8e869891 to sc-d1-release

Change-Id: Ie766cb894ec36919dcbace3875a28603064a751c
parents 82f6bdcb 8e869891
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -277,6 +277,10 @@ interface IKeyMintDevice {
     *   must return ErrorCode::INVALID_ARGUMENT.  The values 3 and 65537 must be supported.  It is
     *   recommended to support all prime values up to 2^64.
     *
     * o Tag::CERTIFICATE_NOT_BEFORE and Tag::CERTIFICATE_NOT_AFTER specify the valid date range for
     *   the returned X.509 certificate holding the public key. If omitted, generateKey must return
     *   ErrorCode::MISSING_NOT_BEFORE or ErrorCode::MISSING_NOT_AFTER.
     *
     * The following parameters are not necessary to generate a usable RSA key, but generateKey must
     * not return an error if they are omitted:
     *
@@ -297,6 +301,10 @@ interface IKeyMintDevice {
     * Tag::EC_CURVE must be provided to generate an ECDSA key.  If it is not provided, generateKey
     * must return ErrorCode::UNSUPPORTED_KEY_SIZE. TEE IKeyMintDevice implementations must support
     * all curves.  StrongBox implementations must support P_256.

     * Tag::CERTIFICATE_NOT_BEFORE and Tag::CERTIFICATE_NOT_AFTER must be provided to specify the
     * valid date range for the returned X.509 certificate holding the public key. If omitted,
     * generateKey must return ErrorCode::MISSING_NOT_BEFORE or ErrorCode::MISSING_NOT_AFTER.
     *
     * == AES Keys ==
     *
+14 −12
Original line number Diff line number Diff line
@@ -484,11 +484,11 @@ enum Tag {
    /**
     * Tag::TRUSTED_CONFIRMATION_REQUIRED is only applicable to keys with KeyPurpose SIGN, and
     * specifies that this key must not be usable unless the user provides confirmation of the data
     *  to be signed.  Confirmation is proven to keyMint via an approval token.  See
     *  CONFIRMATION_TOKEN, as well as the ConfirmationUI HAL.
     * to be signed.  Confirmation is proven to keyMint via an approval token.  See the authToken
     * parameter of begin(), as well as the ConfirmationUI HAL.
     *
     * If an attempt to use a key with this tag does not have a cryptographically valid
     * CONFIRMATION_TOKEN provided to finish() or if the data provided to update()/finish() does not
     * token provided to finish() or if the data provided to update()/finish() does not
     * match the data described in the token, keyMint must return NO_USER_CONFIRMATION.
     *
     * Must be hardware-enforced.
@@ -497,9 +497,11 @@ enum Tag {

    /**
     * Tag::UNLOCKED_DEVICE_REQUIRED specifies that the key may only be used when the device is
     * unlocked.
     * unlocked, as reported to KeyMint via authToken operation parameter and the
     * IKeyMintDevice::deviceLocked() method
     *
     * Must be software-enforced.
     * Must be hardware-enforced (but is also keystore-enforced on a per-user basis: see the
     * deviceLocked() documentation).
     */
    UNLOCKED_DEVICE_REQUIRED = (7 << 28) /* TagType:BOOL */ | 509,

@@ -870,8 +872,9 @@ enum Tag {
     *
     * STORAGE_KEY is used to denote that a key generated or imported is a key used for storage
     * encryption. Keys of this type can either be generated or imported or secure imported using
     * keyMint. exportKey() can be used to re-wrap storage key with a per-boot ephemeral key
     * wrapped key once the key characteristics are enforced.
     * keyMint. The convertStorageKeyToEphemeral() method of IKeyMintDevice can be used to re-wrap
     * storage key with a per-boot ephemeral key wrapped key once the key characteristics are
     * enforced.
     *
     * Keys with this tag cannot be used for any operation within keyMint.
     * ErrorCode::INVALID_OPERATION is returned when a key with Tag::STORAGE_KEY is provided to
@@ -919,11 +922,10 @@ enum Tag {
    RESET_SINCE_ID_ROTATION = (7 << 28) /* TagType:BOOL */ | 1004,

    /**
     * Tag::CONFIRMATION_TOKEN is used to deliver a cryptographic token proving that the user
     * confirmed a signing request.  The content is a full-length HMAC-SHA256 value.  See the
     * ConfirmationUI HAL for details of token computation.
     * OBSOLETE: Do not use. See the authToken parameter for IKeyMintDevice::begin and for
     * IKeyMintOperation methods instead.
     *
     * Must never appear in KeyCharacteristics.
     * TODO(b/191738660): Delete when keystore1 is deleted.
     */
    CONFIRMATION_TOKEN = (9 << 28) /* TagType:BYTES */ | 1005,

+20 −8
Original line number Diff line number Diff line
@@ -268,10 +268,16 @@ TEST_F(SharedSecretAidlTest, ComputeSharedSecretShortNonce) {
                    << "Shared secret service that provided tweaked param should fail to compute "
                       "shared secret";
        } else {
            EXPECT_EQ(ErrorCode::OK, responses[i].error) << "Others should succeed";
            // Other services *may* succeed, or may notice the invalid size for the nonce.
            // However, if another service completes the computation, it should get the 'wrong'
            // answer.
            if (responses[i].error == ErrorCode::OK) {
                EXPECT_NE(correct_response, responses[i].sharing_check)
                        << "Others should calculate a different shared secret, due to the tweaked "
                           "nonce.";
            } else {
                EXPECT_EQ(ErrorCode::INVALID_ARGUMENT, responses[i].error);
            }
        }
    }
}
@@ -348,10 +354,16 @@ TEST_F(SharedSecretAidlTest, ComputeSharedSecretShortSeed) {
                    << "Shared secret service that provided tweaked param should fail to compute "
                       "shared secret";
        } else {
            EXPECT_EQ(ErrorCode::OK, responses[i].error) << "Others should succeed";
            // Other services *may* succeed, or may notice the invalid size for the seed.
            // However, if another service completes the computation, it should get the 'wrong'
            // answer.
            if (responses[i].error == ErrorCode::OK) {
                EXPECT_NE(correct_response, responses[i].sharing_check)
                        << "Others should calculate a different shared secret, due to the tweaked "
                       "nonce.";
                           "seed.";
            } else {
                EXPECT_EQ(ErrorCode::INVALID_ARGUMENT, responses[i].error);
            }
        }
    }
}