This commit is contained in:
Frank Denis 2017-11-25 22:18:35 +01:00
parent a7074ffc18
commit cf521f05e2

View File

@ -330,6 +330,10 @@ randombytes_salsa20_random_stir(void)
randombytes_salsa20_random_init(); randombytes_salsa20_random_init();
global.initialized = 1; global.initialized = 1;
} }
#ifdef HAVE_GETPID
global.pid = getpid();
#endif
#ifndef _WIN32 #ifndef _WIN32
# ifdef HAVE_SAFE_ARC4RANDOM # ifdef HAVE_SAFE_ARC4RANDOM
@ -361,9 +365,6 @@ randombytes_salsa20_random_stir(void)
crypto_stream_salsa20(stream.key, sizeof stream.key, crypto_stream_salsa20(stream.key, sizeof stream.key,
m0 + crypto_stream_salsa20_KEYBYTES, m0); m0 + crypto_stream_salsa20_KEYBYTES, m0);
sodium_memzero(m0, sizeof m0); sodium_memzero(m0, sizeof m0);
#ifdef HAVE_GETPID
global.pid = getpid();
#endif
stream.initialized = 1; stream.initialized = 1;
} }