[openssl] master update

matthias.st.pierre at ncp-e.com matthias.st.pierre at ncp-e.com
Sun Feb 20 11:56:55 UTC 2022


The branch master has been updated
       via  78c5f1266fdd859df04b0ce89e4dd849d9b590d7 (commit)
      from  4a4f446008938775c2bea3001c4c8e7a674992ad (commit)


- Log -----------------------------------------------------------------
commit 78c5f1266fdd859df04b0ce89e4dd849d9b590d7
Author: Jiasheng Jiang <jiasheng at iscas.ac.cn>
Date:   Fri Feb 18 09:15:50 2022 +0800

    test/mdc2test.c: Add check for OSSL_PROVIDER_load
    
    Since the potential failure of the OSSL_PROVIDER_load(),
    for example there is no lock, the provider could fail to
    be loaded into the library context.
    Therefore, it should be better to check it and return error
    if fails.
    Also, in order to avoid free unknown pointer, 'c' should be
    initialized as NULL.
    
    Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
    
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Shane Lontis <shane.lontis at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/17729)

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

Summary of changes:
 test/mdc2test.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/mdc2test.c b/test/mdc2test.c
index 619574fb04..c40e4b26ba 100644
--- a/test/mdc2test.c
+++ b/test/mdc2test.c
@@ -48,7 +48,7 @@ static int test_mdc2(void)
     int testresult = 0;
     unsigned int pad_type = 2;
     unsigned char md[MDC2_DIGEST_LENGTH];
-    EVP_MD_CTX *c;
+    EVP_MD_CTX *c = NULL;
     static char text[] = "Now is the time for all ";
     size_t tlen = strlen(text), i = 0;
     OSSL_PROVIDER *prov = NULL;
@@ -59,6 +59,9 @@ static int test_mdc2(void)
     params[i++] = OSSL_PARAM_construct_end();
 
     prov = OSSL_PROVIDER_load(NULL, "legacy");
+    if (!TEST_ptr(prov))
+        goto end;
+
 # ifdef CHARSET_EBCDIC
     ebcdic2ascii(text, text, tlen);
 # endif


More information about the openssl-commits mailing list