From 1239d70870e1e73a9b921e8a71b654adf2978f1a Mon Sep 17 00:00:00 2001 From: Janos Follath Date: Thu, 8 Aug 2019 10:33:26 +0100 Subject: [PATCH] Remove calls to psa_allocate_key In PSA 1.0 keys are allocated implicitly by other functions (like psa_import_key) and psa_allocate_key is not needed and does not exist anymore. --- library/ssl_cli.c | 6 ------ library/ssl_tls.c | 3 --- 2 files changed, 9 deletions(-) diff --git a/library/ssl_cli.c b/library/ssl_cli.c index 3675443cc..4a466ea35 100644 --- a/library/ssl_cli.c +++ b/library/ssl_cli.c @@ -3249,12 +3249,6 @@ static int ssl_write_client_key_exchange( mbedtls_ssl_context *ssl ) * Generate EC private key for ECDHE exchange. */ - /* Allocate a new key slot for the private key. */ - - status = psa_allocate_key( &handshake->ecdh_psa_privkey ); - if( status != PSA_SUCCESS ) - return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); - /* The master secret is obtained from the shared ECDH secret by * applying the TLS 1.2 PRF with a specific salt and label. While * the PSA Crypto API encourages combining key agreement schemes diff --git a/library/ssl_tls.c b/library/ssl_tls.c index bf402757b..d6024778a 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -635,9 +635,6 @@ static int tls_prf_generic( mbedtls_md_type_t md_type, psa_key_derivation_operation_t generator = PSA_KEY_DERIVATION_OPERATION_INIT; - if( ( status = psa_allocate_key( &master_slot ) ) != PSA_SUCCESS ) - return( MBEDTLS_ERR_SSL_HW_ACCEL_FAILED ); - if( md_type == MBEDTLS_MD_SHA384 ) alg = PSA_ALG_TLS12_PRF(PSA_ALG_SHA_384); else