mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-05 19:35:48 +03:00
Remove workaround for non-zero shared_secret array
PSA_KEY_AGREEMENT_MAX_SHARED_SECRET_SIZE is always greater than 1 so no need for the workaround on the original patch Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
This commit is contained in:
@@ -4948,13 +4948,8 @@ static psa_status_t psa_key_agreement_internal(psa_key_derivation_operation_t *o
|
|||||||
size_t peer_key_length)
|
size_t peer_key_length)
|
||||||
{
|
{
|
||||||
psa_status_t status;
|
psa_status_t status;
|
||||||
#if PSA_KEY_AGREEMENT_MAX_SHARED_SECRET_SIZE != 0
|
|
||||||
uint8_t shared_secret[PSA_KEY_AGREEMENT_MAX_SHARED_SECRET_SIZE];
|
uint8_t shared_secret[PSA_KEY_AGREEMENT_MAX_SHARED_SECRET_SIZE];
|
||||||
size_t shared_secret_length = sizeof(shared_secret);
|
|
||||||
#else
|
|
||||||
uint8_t *shared_secret = NULL;
|
|
||||||
size_t shared_secret_length = 0;
|
size_t shared_secret_length = 0;
|
||||||
#endif
|
|
||||||
psa_algorithm_t ka_alg = PSA_ALG_KEY_AGREEMENT_GET_BASE(operation->alg);
|
psa_algorithm_t ka_alg = PSA_ALG_KEY_AGREEMENT_GET_BASE(operation->alg);
|
||||||
|
|
||||||
/* Step 1: run the secret agreement algorithm to generate the shared
|
/* Step 1: run the secret agreement algorithm to generate the shared
|
||||||
@@ -4963,7 +4958,7 @@ static psa_status_t psa_key_agreement_internal(psa_key_derivation_operation_t *o
|
|||||||
private_key,
|
private_key,
|
||||||
peer_key, peer_key_length,
|
peer_key, peer_key_length,
|
||||||
shared_secret,
|
shared_secret,
|
||||||
shared_secret_length,
|
sizeof(shared_secret),
|
||||||
&shared_secret_length);
|
&shared_secret_length);
|
||||||
if (status != PSA_SUCCESS) {
|
if (status != PSA_SUCCESS) {
|
||||||
goto exit;
|
goto exit;
|
||||||
|
Reference in New Issue
Block a user