[openssl-commits] [openssl] master update

Rich Salz rsalz at openssl.org
Fri Feb 26 16:16:44 UTC 2016


The branch master has been updated
       via  219f3ca61c2902425047974441d953e6042250ec (commit)
       via  4f25aecd7599842205b135c0731b20a3c2c5d97b (commit)
       via  2c91b3f5bf01de198ca45d49fcba3d6c24e8c7f6 (commit)
      from  2d51c28ff749f8b5f133bea0f7ba2160ecc0598b (commit)


- Log -----------------------------------------------------------------
commit 219f3ca61c2902425047974441d953e6042250ec
Author: J Mohan Rao Arisankala <mohan at barracuda.com>
Date:   Wed Feb 24 06:06:24 2016 +0530

    check with NULL
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 4f25aecd7599842205b135c0731b20a3c2c5d97b
Author: J Mohan Rao Arisankala <mohan at barracuda.com>
Date:   Wed Feb 24 06:00:48 2016 +0530

    explicit check for NULL
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 2c91b3f5bf01de198ca45d49fcba3d6c24e8c7f6
Author: J Mohan Rao Arisankala <mohan at barracuda.com>
Date:   Tue Feb 23 22:33:28 2016 +0530

    Check method before access and release ctx in error paths
    
    - In error paths, EVP_MD_CTX allocated by the callee is not released.
    - Checking method before accessing
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 crypto/asn1/a_sign.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/crypto/asn1/a_sign.c b/crypto/asn1/a_sign.c
index 99124c1..2abbe77 100644
--- a/crypto/asn1/a_sign.c
+++ b/crypto/asn1/a_sign.c
@@ -243,9 +243,14 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
     type = EVP_MD_CTX_md(ctx);
     pkey = EVP_PKEY_CTX_get0_pkey(EVP_MD_CTX_pkey_ctx(ctx));
 
-    if (!type || !pkey) {
+    if (type == NULL || pkey == NULL) {
         ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_CONTEXT_NOT_INITIALISED);
-        return 0;
+        goto err;
+    }
+
+    if (pkey->ameth == NULL) {
+        ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
+        goto err;
     }
 
     if (pkey->ameth->item_sign) {
@@ -267,13 +272,12 @@ int ASN1_item_sign_ctx(const ASN1_ITEM *it,
         rv = 2;
 
     if (rv == 2) {
-        if (!pkey->ameth ||
-            !OBJ_find_sigid_by_algs(&signid,
+        if (!OBJ_find_sigid_by_algs(&signid,
                                     EVP_MD_nid(type),
                                     pkey->ameth->pkey_id)) {
             ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX,
                     ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED);
-            return 0;
+            goto err;
         }
 
         if (pkey->ameth->pkey_flags & ASN1_PKEY_SIGPARAM_NULL)


More information about the openssl-commits mailing list