Skip to content

Commit 25668dd

Browse files
committed
zeroize OTP UDS in stm32h5 derive path
F/2594
1 parent da2c3dd commit 25668dd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

hal/stm32h5.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#elif defined(WOLFBOOT_HASH_SHA3_384)
4343
#include <wolfssl/wolfcrypt/sha3.h>
4444
#endif
45+
#include <wolfssl/wolfcrypt/memory.h>
4546
#endif
4647

4748
#define PLL_SRC_HSE 1
@@ -272,9 +273,11 @@ int hal_uds_derive_key(uint8_t *out, size_t out_len)
272273
copy_len = out_len;
273274
}
274275
memcpy(out, uds, copy_len);
276+
wc_ForceZero(uds, sizeof(uds));
275277
return 0;
276278
}
277279
}
280+
wc_ForceZero(uds, sizeof(uds));
278281
#endif
279282

280283
#ifdef WOLFBOOT_UDS_UID_FALLBACK_FORTEST

0 commit comments

Comments
 (0)