Clear the seed in crypto_sign_keypair() - Reported by the Stanford SCS group.
This commit is contained in:
parent
473e1718cc
commit
2947ea863d
@ -30,9 +30,13 @@ int crypto_sign_seed_keypair(unsigned char *pk, unsigned char *sk,
|
||||
int crypto_sign_keypair(unsigned char *pk, unsigned char *sk)
|
||||
{
|
||||
unsigned char seed[32];
|
||||
int ret;
|
||||
|
||||
randombytes(seed,32);
|
||||
return crypto_sign_seed_keypair(pk,sk,seed);
|
||||
randombytes(seed, sizeof seed);
|
||||
ret = crypto_sign_seed_keypair(pk, sk, seed);
|
||||
sodium_memzero(seed, sizeof seed);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int crypto_sign_ed25519_pk_to_curve25519(unsigned char *curve25519_pk,
|
||||
|
Loading…
Reference in New Issue
Block a user