[openssl-commits] [openssl] master update

Paul I. Dale pauli at openssl.org
Fri Sep 7 00:05:27 UTC 2018


The branch master has been updated
       via  a6465b3f8557f69e84e7d8e097f9c45ba4479dd6 (commit)
      from  82eba370daeb6d80b01b521d9e2963451487f0cb (commit)


- Log -----------------------------------------------------------------
commit a6465b3f8557f69e84e7d8e097f9c45ba4479dd6
Author: Pauli <paul.dale at oracle.com>
Date:   Fri Sep 7 09:04:59 2018 +1000

    Avoid SEGV when giving X509_sign a NULL private key.
    
    Put a NULL check back in to avoid dereferencing the NULL pointer.
    
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/7146)

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

Summary of changes:
 crypto/evp/pmeth_lib.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c
index 6a0fc81..ef923fd 100644
--- a/crypto/evp/pmeth_lib.c
+++ b/crypto/evp/pmeth_lib.c
@@ -106,6 +106,8 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
     const EVP_PKEY_METHOD *pmeth;
 
     if (id == -1) {
+        if (pkey == NULL)
+            return 0;
         id = pkey->type;
     }
 #ifndef OPENSSL_NO_ENGINE
@@ -151,7 +153,7 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
     ret->pmeth = pmeth;
     ret->operation = EVP_PKEY_OP_UNDEFINED;
     ret->pkey = pkey;
-    if (pkey)
+    if (pkey != NULL)
         EVP_PKEY_up_ref(pkey);
 
     if (pmeth->init) {


More information about the openssl-commits mailing list