mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-28 04:37:13 +09:00
Zero the stack in crypto_box_seed_keypair()
This commit is contained in:
+2
@@ -4,6 +4,7 @@
|
||||
#include "crypto_scalarmult_curve25519.h"
|
||||
#include "api.h"
|
||||
#include "randombytes.h"
|
||||
#include "utils.h"
|
||||
|
||||
int crypto_box_seed_keypair(
|
||||
unsigned char *pk,
|
||||
@@ -14,6 +15,7 @@ int crypto_box_seed_keypair(
|
||||
unsigned char hash[64];
|
||||
crypto_hash_sha512(hash,seed,32);
|
||||
memmove(sk,hash,32);
|
||||
sodium_memzero(hash, sizeof hash);
|
||||
return crypto_scalarmult_curve25519_base(pk,sk);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user