[openssl] master update

bernd.edlinger at hotmail.de bernd.edlinger at hotmail.de
Sat Aug 28 14:46:58 UTC 2021


The branch master has been updated
       via  cce935b23ce2f7942e2ef4368dd93b60e21d3d83 (commit)
      from  20b39175b59b5ae83223bbb9f743c73ae822d681 (commit)


- Log -----------------------------------------------------------------
commit cce935b23ce2f7942e2ef4368dd93b60e21d3d83
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Fri Aug 27 13:11:39 2021 +0200

    Fix the "Out of memory" EVP KDF scrypt test
    
    This test did not really execute, since usually
    the OPENSSL_malloc(0) will fail and prevent the
    execution of the KDF.
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/16444)

-----------------------------------------------------------------------

Summary of changes:
 test/evp_test.c                                      | 4 ++--
 test/recipes/30-test_evp_data/evpkdf_scrypt.txt      | 2 +-
 test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/evp_test.c b/test/evp_test.c
index 0009cae442..075abc5ad9 100644
--- a/test/evp_test.c
+++ b/test/evp_test.c
@@ -2664,7 +2664,7 @@ static int kdf_test_run(EVP_TEST *t)
         t->err = "KDF_CTRL_ERROR";
         return 1;
     }
-    if (!TEST_ptr(got = OPENSSL_malloc(got_len))) {
+    if (!TEST_ptr(got = OPENSSL_malloc(got_len == 0 ? 1 : got_len))) {
         t->err = "INTERNAL_ERROR";
         goto err;
     }
@@ -2760,7 +2760,7 @@ static int pkey_kdf_test_run(EVP_TEST *t)
     unsigned char *got = NULL;
     size_t got_len = expected->output_len;
 
-    if (!TEST_ptr(got = OPENSSL_malloc(got_len))) {
+    if (!TEST_ptr(got = OPENSSL_malloc(got_len == 0 ? 1 : got_len))) {
         t->err = "INTERNAL_ERROR";
         goto err;
     }
diff --git a/test/recipes/30-test_evp_data/evpkdf_scrypt.txt b/test/recipes/30-test_evp_data/evpkdf_scrypt.txt
index 7aba716246..64176091fc 100644
--- a/test/recipes/30-test_evp_data/evpkdf_scrypt.txt
+++ b/test/recipes/30-test_evp_data/evpkdf_scrypt.txt
@@ -60,4 +60,4 @@ Ctrl.salt = salt:SodiumChloride
 Ctrl.N = n:1048576
 Ctrl.r = r:8
 Ctrl.p = p:1
-Result = INTERNAL_ERROR
+Result = KDF_MISMATCH
diff --git a/test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt b/test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt
index 086451a44c..1f7c06c6d4 100644
--- a/test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt
+++ b/test/recipes/30-test_evp_data/evppkey_kdf_scrypt.txt
@@ -60,4 +60,4 @@ Ctrl.salt = salt:SodiumChloride
 Ctrl.N = N:1048576
 Ctrl.r = r:8
 Ctrl.p = p:1
-Result = INTERNAL_ERROR
+Result = KDF_MISMATCH


More information about the openssl-commits mailing list