mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-08 06:40:16 -04:00
Check output allocated before randomising
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
parent
3c0c6b1c4b
commit
26d1c43821
@ -5332,7 +5332,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