Skip to content

Commit 1cd4dd7

Browse files
committed
zero pk on failure
Signed-off-by: Jake Massimo <[email protected]>
1 parent 0f055f1 commit 1cd4dd7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mldsa/src/sign.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,7 @@ int crypto_sign_pk_from_sk(uint8_t pk[CRYPTO_PUBLICKEYBYTES],
12131213
if (res != 0)
12141214
{
12151215
res = -1;
1216+
mld_zeroize(pk, CRYPTO_PUBLICKEYBYTES);
12161217
goto cleanup;
12171218
}
12181219

@@ -1223,6 +1224,7 @@ int crypto_sign_pk_from_sk(uint8_t pk[CRYPTO_PUBLICKEYBYTES],
12231224
if (res != 0)
12241225
{
12251226
res = -1;
1227+
mld_zeroize(pk, CRYPTO_PUBLICKEYBYTES);
12261228
goto cleanup;
12271229
}
12281230

0 commit comments

Comments
 (0)