[openssl] master update

Richard Levitte levitte at openssl.org
Tue Nov 10 09:58:22 UTC 2020


The branch master has been updated
       via  00eae3f9cf4c45f3d0c6561512a51aef74ac8b3d (commit)
       via  457856f27a282a9f7ebb3a72eaedc81268f4c5bb (commit)
      from  ecd1550be928c6bfedb01709f7fa3a6e0b07e127 (commit)


- Log -----------------------------------------------------------------
commit 00eae3f9cf4c45f3d0c6561512a51aef74ac8b3d
Author: Richard Levitte <levitte at openssl.org>
Date:   Sun Nov 8 10:25:47 2020 +0100

    PEM: Always use PEM_def_callback() when cb == NULL in pem_read_bio_key()
    
    Too many other functions depend on this being done.
    
    Fixes #13340
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/13346)

commit 457856f27a282a9f7ebb3a72eaedc81268f4c5bb
Author: Richard Levitte <levitte at openssl.org>
Date:   Sun Nov 8 10:23:54 2020 +0100

    UI: Use OPENSSL_zalloc() in general_allocate_prompt()
    
    This is to ensure that fields we don't set explicitly are always zero.
    
    Fixes #13340
    
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/13346)

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

Summary of changes:
 crypto/pem/pem_pkey.c | 7 ++-----
 crypto/ui/ui_lib.c    | 2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c
index 214fd1267c..91f6f30cf6 100644
--- a/crypto/pem/pem_pkey.c
+++ b/crypto/pem/pem_pkey.c
@@ -48,12 +48,9 @@ static EVP_PKEY *pem_read_bio_key(BIO *bp, EVP_PKEY **x,
         return NULL;
     }
 
-    if (u != NULL && cb == NULL)
-        cb = PEM_def_callback;
     if (cb == NULL)
-        ui_method = UI_null();
-    else
-        ui_method = allocated_ui_method = UI_UTIL_wrap_read_pem_callback(cb, 0);
+        cb = PEM_def_callback;
+    ui_method = allocated_ui_method = UI_UTIL_wrap_read_pem_callback(cb, 0);
     if (ui_method == NULL)
         return NULL;
 
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index 017afb7c07..af6461fb15 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -106,7 +106,7 @@ static UI_STRING *general_allocate_prompt(UI *ui, const char *prompt,
     } else if ((type == UIT_PROMPT || type == UIT_VERIFY
                 || type == UIT_BOOLEAN) && result_buf == NULL) {
         UIerr(UI_F_GENERAL_ALLOCATE_PROMPT, UI_R_NO_RESULT_BUFFER);
-    } else if ((ret = OPENSSL_malloc(sizeof(*ret))) != NULL) {
+    } else if ((ret = OPENSSL_zalloc(sizeof(*ret))) != NULL) {
         ret->out_string = prompt;
         ret->flags = prompt_freeable ? OUT_STRING_FREEABLE : 0;
         ret->input_flags = input_flags;


More information about the openssl-commits mailing list