Skip to content

Commit b36261c

Browse files
frkvanangl
authored andcommitted
[nrf noup]: Fix unset key bits for nrf_cc3xx v0.9.14
-The runtime library expects key-bits to be set when it is not for cipher and ECDSA, this is fixed here. This may be an issue either in Mbed TLS or in nrf_cc3xx v0.9.14. Hence setting as a noup ref: NCSDK-13857 Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
1 parent a4cdd6b commit b36261c

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

library/cipher.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx,
316316
/* mbedtls_psa_translate_cipher_operation( operation ); */
317317
PSA_KEY_USAGE_ENCRYPT | PSA_KEY_USAGE_DECRYPT );
318318
psa_set_key_algorithm( &attributes, cipher_psa->alg );
319+
psa_set_key_bits( &attributes, (size_t) key_bitlen );
319320

320321
status = psa_import_key( &attributes, key, key_bytelen,
321322
&cipher_psa->slot );

library/pk_wrap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ static int ecdsa_verify_wrap( void *ctx_arg, mbedtls_md_type_t md_alg,
589589
psa_set_key_type( &attributes, PSA_KEY_TYPE_ECC_PUBLIC_KEY( curve ) );
590590
psa_set_key_usage_flags( &attributes, PSA_KEY_USAGE_VERIFY_HASH );
591591
psa_set_key_algorithm( &attributes, psa_sig_md );
592+
psa_set_key_bits( &attributes, curve_bits );
592593

593594
status = psa_import_key( &attributes,
594595
buf + sizeof( buf ) - key_len, key_len,

0 commit comments

Comments
 (0)