scrypt: increase default memory limit. The default memory maximum exists to protect clients who call scrypt with untrusted paramters. However, the old default is now too low for recommended scrypt parameters so this change increases it to cover that case. Change-Id: I2d38cba0924267bde09b72113e1bdbf0d7413325 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/74007 Reviewed-by: David Benjamin <davidben@google.com> Auto-Submit: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com>
diff --git a/crypto/evp/scrypt.cc b/crypto/evp/scrypt.cc index e11cce5..4853761 100644 --- a/crypto/evp/scrypt.cc +++ b/crypto/evp/scrypt.cc
@@ -140,7 +140,7 @@ // SCRYPT_MAX_MEM is the default maximum memory that may be allocated by // |EVP_PBE_scrypt|. -#define SCRYPT_MAX_MEM (1024 * 1024 * 32) +#define SCRYPT_MAX_MEM (1024 * 1024 * 65) int EVP_PBE_scrypt(const char *password, size_t password_len, const uint8_t *salt, size_t salt_len, uint64_t N, uint64_t r,