mirror of
https://github.com/jedisct1/minisign.git
synced 2025-04-04 19:37:48 +03:00
Zeroize seckey_struct early
This commit is contained in:
parent
12fd90b6fe
commit
ee46615226
1 changed files with 1 additions and 1 deletions
|
@ -677,9 +677,9 @@ generate(const char *pk_file, const char *sk_file, const char *comment, int forc
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
abort_on_existing_key_files(pk_file, sk_file, force);
|
abort_on_existing_key_files(pk_file, sk_file, force);
|
||||||
|
memset(seckey_struct, 0, sizeof(SeckeyStruct));
|
||||||
randombytes_buf(seckey_struct->keynum_sk.keynum, sizeof seckey_struct->keynum_sk.keynum);
|
randombytes_buf(seckey_struct->keynum_sk.keynum, sizeof seckey_struct->keynum_sk.keynum);
|
||||||
crypto_sign_keypair(pubkey_struct->keynum_pk.pk, seckey_struct->keynum_sk.sk);
|
crypto_sign_keypair(pubkey_struct->keynum_pk.pk, seckey_struct->keynum_sk.sk);
|
||||||
memset(seckey_struct, 0, sizeof(SeckeyStruct));
|
|
||||||
memcpy(seckey_struct->sig_alg, SIGALG, sizeof seckey_struct->sig_alg);
|
memcpy(seckey_struct->sig_alg, SIGALG, sizeof seckey_struct->sig_alg);
|
||||||
memcpy(seckey_struct->kdf_alg, unencrypted_key ? KDFNONE : KDFALG,
|
memcpy(seckey_struct->kdf_alg, unencrypted_key ? KDFNONE : KDFALG,
|
||||||
sizeof seckey_struct->kdf_alg);
|
sizeof seckey_struct->kdf_alg);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue