GH608: Ensure 64-bit shift no matter sizeof(long)
authorDmitry-Me <wipedout@yandex.ru>
Tue, 2 Feb 2016 06:55:06 +0000 (09:55 +0300)
committerRich Salz <rsalz@openssl.org>
Tue, 2 Feb 2016 16:22:32 +0000 (11:22 -0500)
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
crypto/evp/scrypt.c

index 158816c..25b360e 100644 (file)
@@ -228,7 +228,7 @@ int EVP_PBE_scrypt(const char *pass, size_t passlen,
      */
 
     if (16 * r <= LOG2_UINT64_MAX) {
-        if (N >= (1UL << (16 * r)))
+        if (N >= (((uint64_t)1) << (16 * r)))
             return 0;
     }