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 158816c9d9251d83697b7c1e630eb9cfccebf35a..25b360e210ebbb38e7d07e9d98dcdaae19da82ab 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;
     }