[openssl] master update

tmraz at fedoraproject.org tmraz at fedoraproject.org
Sat Dec 19 10:33:41 UTC 2020


The branch master has been updated
       via  a5f2782ceca7af2480c86562e8952b2980251e4e (commit)
      from  5faec149c6af2e4269bc7e0b381c466619ed19a7 (commit)


- Log -----------------------------------------------------------------
commit a5f2782ceca7af2480c86562e8952b2980251e4e
Author: Petr Gotthard <petr.gotthard at centrum.cz>
Date:   Thu Dec 17 20:13:00 2020 +0100

    Fix OSSL_PARAM creation in OSSL_STORE_open_ex
    
    The params[0].data is set to a non-NULL value, but params[0].data_size
    is always zero. This confuses get_string_internal, which creates 1 byte
    string with uninitialized content.
    
    When OSSL_PARAM_construct_utf8_string is used, the data_size is set
    correctly.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Tomas Mraz <tmraz at fedoraproject.org>
    (Merged from https://github.com/openssl/openssl/pull/13699)

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

Summary of changes:
 crypto/store/store_lib.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/crypto/store/store_lib.c b/crypto/store/store_lib.c
index c59c508be1..5d0b3e7397 100644
--- a/crypto/store/store_lib.c
+++ b/crypto/store/store_lib.c
@@ -103,13 +103,12 @@ OSSL_STORE_open_ex(const char *uri, OSSL_LIB_CTX *libctx, const char *propq,
                 OSSL_STORE_LOADER_free(fetched_loader);
                 fetched_loader = NULL;
             } else if (propq != NULL) {
-                OSSL_PARAM params[] = {
-                    OSSL_PARAM_utf8_string(OSSL_STORE_PARAM_PROPERTIES,
-                                           NULL, 0),
-                    OSSL_PARAM_END
-                };
+                OSSL_PARAM params[2];
+
+                params[0] = OSSL_PARAM_construct_utf8_string(
+                                OSSL_STORE_PARAM_PROPERTIES, (char *)propq, 0);
+                params[1] = OSSL_PARAM_construct_end();
 
-                params[0].data = (void *)propq;
                 if (!fetched_loader->p_set_ctx_params(loader_ctx, params)) {
                     (void)fetched_loader->p_close(loader_ctx);
                     OSSL_STORE_LOADER_free(fetched_loader);


More information about the openssl-commits mailing list