Skip to content

Commit 7339689

Browse files
committed
nrf_security: Fix error code check in Cracen PSA
In one case inside the KMU Cracen driver a call to get a random value was not checked, this check is now added. Signed-off-by: Georgios Vasilakis <[email protected]>
1 parent 3694388 commit 7339689

File tree

1 file changed

+3
-0
lines changed
  • subsys/nrf_security/src/drivers/cracen/cracenpsa/src

1 file changed

+3
-0
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/kmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ static psa_status_t cracen_kmu_encrypt(const uint8_t *key, size_t key_length,
151151

152152
if (encrypted_buffer_size > CRACEN_KMU_SLOT_KEY_SIZE) {
153153
psa_status = cracen_get_random(NULL, encrypted_buffer, CRACEN_KMU_SLOT_KEY_SIZE);
154+
if (psa_status != PSA_SUCCESS) {
155+
return psa_status;
156+
}
154157
} else {
155158
return PSA_ERROR_GENERIC_ERROR;
156159
}

0 commit comments

Comments
 (0)