Correct the "Out of memory" EVP tests
authorRichard Levitte <levitte@openssl.org>
Tue, 7 Sep 2021 05:27:01 +0000 (07:27 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 7 Sep 2021 08:55:04 +0000 (10:55 +0200)
This affects test/recipes/30-test_evp_data/evpkdf_scrypt.txt and
test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt, where the "Out
of memory" stanza weren't up to the task, as they didn't hit the
default scrypt memory limit like they did in OpenSSL 1.1.1.

We solve this by setting the |n| value to the next power of two, and
correcting the expected result.

Fixes #16519

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16521)

test/recipes/30-test_evp_data/evpkdf_scrypt.txt
test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt

index 64176091fc089ab88b9c765dfff7dfbccf0250e0..29ae89b5bebf77503dd4350774449484c8f26680 100644 (file)
@@ -57,7 +57,7 @@ Output = 7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d543295
 KDF = id-scrypt
 Ctrl.pass = pass:pleaseletmein
 Ctrl.salt = salt:SodiumChloride
-Ctrl.N = n:1048576
+Ctrl.N = n:2097152
 Ctrl.r = r:8
 Ctrl.p = p:1
-Result = KDF_MISMATCH
+Result = KDF_DERIVE_ERROR
index 1f7c06c6d4f2e743274bf28b18514a330e904429..c9c7f3ca7835966373ae26bdad6b2ed1d2a3ff63 100644 (file)
@@ -57,7 +57,7 @@ Output = 7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d543295
 PKEYKDF = scrypt
 Ctrl.pass = pass:pleaseletmein
 Ctrl.salt = salt:SodiumChloride
-Ctrl.N = N:1048576
+Ctrl.N = n:2097152
 Ctrl.r = r:8
 Ctrl.p = p:1
-Result = KDF_MISMATCH
+Result = KDF_DERIVE_ERROR