[openssl] master update

Dr. Paul Dale pauli at openssl.org
Fri May 22 07:25:25 UTC 2020


The branch master has been updated
       via  4d55122ee782ebd306ef492f50c9b41e41a56244 (commit)
       via  3f17066f5d3bf48d33a8481bd7a7cfdcc00ace97 (commit)
       via  e5cb3453fba01c264636d54440ca0eb81d1fcd6e (commit)
       via  084b7bec0f615f70c108dfba988ed43d544e00ed (commit)
      from  e1c6f76281473b8fe66954187e793108a0e8568c (commit)


- Log -----------------------------------------------------------------
commit 4d55122ee782ebd306ef492f50c9b41e41a56244
Author: Pauli <paul.dale at oracle.com>
Date:   Thu May 21 13:44:01 2020 +1000

    Coverity 1463571: Null pointer dereferences (FORWARD_NULL)
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    (Merged from https://github.com/openssl/openssl/pull/11892)

commit 3f17066f5d3bf48d33a8481bd7a7cfdcc00ace97
Author: Pauli <paul.dale at oracle.com>
Date:   Thu May 21 13:40:01 2020 +1000

    Coverity 1463574: Null pointer dereferences (REVERSE_INULL)
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    (Merged from https://github.com/openssl/openssl/pull/11892)

commit e5cb3453fba01c264636d54440ca0eb81d1fcd6e
Author: Pauli <paul.dale at oracle.com>
Date:   Thu May 21 13:38:35 2020 +1000

    Coverity 1463576: Error handling issues (CHECKED_RETURN)
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    (Merged from https://github.com/openssl/openssl/pull/11892)

commit 084b7bec0f615f70c108dfba988ed43d544e00ed
Author: Pauli <paul.dale at oracle.com>
Date:   Thu May 21 13:18:42 2020 +1000

    Coverity 1463258: Incorrect expression (EVALUATION_ORDER)
    
    Reviewed-by: Kurt Roeckx <kurt at roeckx.be>
    (Merged from https://github.com/openssl/openssl/pull/11892)

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

Summary of changes:
 crypto/x509/v3_ncons.c                                 | 2 +-
 providers/implementations/keymgmt/rsa_kmgmt.c          | 8 +++++---
 providers/implementations/serializers/serializer_rsa.c | 4 ++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/crypto/x509/v3_ncons.c b/crypto/x509/v3_ncons.c
index d7b82b775e..4543ec2e11 100644
--- a/crypto/x509/v3_ncons.c
+++ b/crypto/x509/v3_ncons.c
@@ -197,7 +197,7 @@ static int print_nc_ipadd(BIO *bp, ASN1_OCTET_STRING *ip)
     int len2 = ip->length - len1;
     char *ip1 = ipaddr_to_asc(ip->data, len1);
     char *ip2 = ipaddr_to_asc(ip->data + len1, len2);
-    int ret = ret = ip1 != NULL && ip2 != NULL
+    int ret = ip1 != NULL && ip2 != NULL
         && BIO_printf(bp, "IP:%s/%s", ip1, ip2) > 0;
 
     OPENSSL_free(ip1);
diff --git a/providers/implementations/keymgmt/rsa_kmgmt.c b/providers/implementations/keymgmt/rsa_kmgmt.c
index 295cdf61a4..3091c1dee0 100644
--- a/providers/implementations/keymgmt/rsa_kmgmt.c
+++ b/providers/implementations/keymgmt/rsa_kmgmt.c
@@ -411,8 +411,8 @@ static void *gen_init(void *provctx, int selection, int rsa_type)
         } else {
             gctx->nbits = 2048;
             gctx->primes = RSA_DEFAULT_PRIME_NUM;
+            gctx->rsa_type = rsa_type;
         }
-        gctx->rsa_type = rsa_type;
     }
     return gctx;
 }
@@ -496,6 +496,9 @@ static void *rsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
     RSA *rsa = NULL, *rsa_tmp = NULL;
     BN_GENCB *gencb = NULL;
 
+    if (gctx == NULL)
+        return NULL;
+
     switch (gctx->rsa_type) {
     case RSA_FLAG_TYPE_RSA:
         /* For plain RSA keys, PSS parameters must not be set */
@@ -513,8 +516,7 @@ static void *rsa_gen(void *genctx, OSSL_CALLBACK *osslcb, void *cbarg)
         return NULL;
     }
 
-    if (gctx == NULL
-        || (rsa_tmp = rsa_new_with_ctx(gctx->libctx)) == NULL)
+    if ((rsa_tmp = rsa_new_with_ctx(gctx->libctx)) == NULL)
         return NULL;
 
     gctx->cb = osslcb;
diff --git a/providers/implementations/serializers/serializer_rsa.c b/providers/implementations/serializers/serializer_rsa.c
index ac685a09f2..7cc6027636 100644
--- a/providers/implementations/serializers/serializer_rsa.c
+++ b/providers/implementations/serializers/serializer_rsa.c
@@ -215,9 +215,9 @@ int ossl_prov_prepare_rsa_params(const void *rsa, int nid,
                     break;
                 }
                 if (!DER_w_RSASSA_PSS_params(&pkt, -1, pss)
-                    || !WPACKET_finish(&pkt))
+                    || !WPACKET_finish(&pkt)
+                    || !WPACKET_get_total_written(&pkt, &str_sz))
                     goto err;
-                WPACKET_get_total_written(&pkt, &str_sz);
                 WPACKET_cleanup(&pkt);
 
                 /*


More information about the openssl-commits mailing list