Skip to content

Commit 0703517

Browse files
amjoul01adeaarm
authored andcommitted
cc3xx: don't check if the builtin key is valid
The KMU key ID validity is checked by cc3xx_aes_external_key_loader.c, thus it's redundant to have additional checks which complicates the opaque key flow. Change-Id: I22c5cf4385c0d6c75ec81045f5865076618e2b18 Signed-off-by: Amjad Ouled-Ameur <amjad.ouled-ameur@arm.com>
1 parent 0468ee2 commit 0703517

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

platform/ext/target/arm/drivers/cc3xx/psa_driver_api/src/cc3xx_internal_cipher.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ static psa_status_t cc3xx_internal_aes_setup(
6666
#ifdef CC3XX_CRYPTO_OPAQUE_KEYS
6767
if (CC3XX_IS_OPAQUE_KEY(attributes)) {
6868
key_id = (cc3xx_aes_key_id_t)(((uint32_t *)key_buffer)[0]);
69-
70-
if (CC3XX_IS_OPAQUE_KEY_INVALID(key_id)) {
71-
return PSA_ERROR_INVALID_ARGUMENT;
72-
}
7369
}
7470
#endif /* CC3XX_CRYPTO_OPAQUE_KEYS */
7571

platform/ext/target/arm/drivers/cc3xx/psa_driver_api/src/cc3xx_psa_mac.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ static psa_status_t cmac_compute(const psa_key_attributes_t *attributes,
5454
#ifdef CC3XX_CRYPTO_OPAQUE_KEYS
5555
if (CC3XX_IS_OPAQUE_KEY(attributes)) {
5656
key_id = (cc3xx_aes_key_id_t)(((uint32_t *)key_buffer)[0]);
57-
58-
if (CC3XX_IS_OPAQUE_KEY_INVALID(key_id)) {
59-
return PSA_ERROR_INVALID_ARGUMENT;
60-
}
6157
}
6258
#endif /* CC3XX_CRYPTO_OPAQUE_KEYS */
6359

@@ -117,10 +113,6 @@ static psa_status_t cmac_setup(struct cc3xx_aes_state_t *state,
117113
#ifdef CC3XX_CRYPTO_OPAQUE_KEYS
118114
if (CC3XX_IS_OPAQUE_KEY(attributes)) {
119115
key_id = (cc3xx_aes_key_id_t)(((uint32_t *)key_buffer)[0]);
120-
121-
if (CC3XX_IS_OPAQUE_KEY_INVALID(key_id)) {
122-
return PSA_ERROR_INVALID_ARGUMENT;
123-
}
124116
}
125117
#endif /* CC3XX_CRYPTO_OPAQUE_KEYS */
126118

0 commit comments

Comments
 (0)