summaryrefslogtreecommitdiff
path: root/libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c')
-rw-r--r--libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c b/libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
index 9b81377ad4..eea04da8cb 100644
--- a/libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
+++ b/libs/libsodium/src/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt-common.c
@@ -24,6 +24,7 @@
#include "crypto_pwhash_scryptsalsa208sha256.h"
#include "crypto_scrypt.h"
#include "private/common.h"
+#include "randombytes.h"
#include "runtime.h"
#include "utils.h"
@@ -150,6 +151,10 @@ escrypt_r(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen,
uint32_t r;
uint32_t p;
+ if (buf != NULL) {
+ randombytes_buf(buf, buflen);
+ }
+
src = escrypt_parse_setting(setting, &N_log2, &r, &p);
if (!src) {
return NULL;