From 5f74196b0f70e2af16cb610fb22da21effee1bdf Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 19 Jun 2015 18:55:41 +0200 Subject: [PATCH] scrypt extra parameters checks --- .../nosse/pwhash_scryptsalsa208sha256_nosse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c index a9eec746..4786e5bf 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c @@ -279,6 +279,10 @@ escrypt_kdf_nosse(escrypt_local_t * local, errno = EFBIG; return -1; } + if (N > UINT32_MAX) { + errno = EFBIG; + return -1; + } if (((N & (N - 1)) != 0) || (N < 2)) { errno = EINVAL; return -1;