Skip to content

Commit 8dbc7d6

Browse files
committed
dice: scrub non-IAK UDS buffer
F/2592
1 parent 84562a4 commit 8dbc7d6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/dice/dice.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -679,10 +679,13 @@ static int wolfboot_attest_get_private_key(ecc_key *key,
679679
return ret;
680680
}
681681
#else
682-
if (hal_uds_derive_key(uds, uds_len) != 0) {
683-
return -1;
682+
int ret = -1;
683+
684+
if (hal_uds_derive_key(uds, uds_len) == 0) {
685+
ret = wolfboot_dice_derive_attestation_key(key, uds, uds_len, claims);
684686
}
685-
return wolfboot_dice_derive_attestation_key(key, uds, uds_len, claims);
687+
wc_ForceZero(uds, sizeof(uds));
688+
return ret;
686689
#endif
687690
}
688691

0 commit comments

Comments
 (0)