mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-15 19:20:55 +00:00
Check output allocated before randomising
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
parent
50f58fc3e4
commit
d997e7ad9a
@ -7429,7 +7429,7 @@ psa_status_t psa_raw_key_agreement(psa_algorithm_t alg,
|
||||
output_length);
|
||||
|
||||
exit:
|
||||
if (status != PSA_SUCCESS) {
|
||||
if (status != PSA_SUCCESS && output != NULL) {
|
||||
/* If an error happens and is not handled properly, the output
|
||||
* may be used as a key to protect sensitive data. Arrange for such
|
||||
* a key to be random, which is likely to result in decryption or
|
||||
|
Loading…
x
Reference in New Issue
Block a user