[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Mon Jun 27 21:32:35 UTC 2016


The branch master has been updated
       via  7a53360031a505d4bb55f3c7877ded5d165bef5a (commit)
       via  e0685d2473a88056e848900abaec3e19b8a447d3 (commit)
      from  dbbb6a87a716765f4f9ef9fe48b634c23bbe8636 (commit)


- Log -----------------------------------------------------------------
commit 7a53360031a505d4bb55f3c7877ded5d165bef5a
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Jun 26 22:00:37 2016 +0200

    engines/e_capi.c: accommodate recent DSA_SIG_[get|set]0 changes.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit e0685d2473a88056e848900abaec3e19b8a447d3
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Jun 26 21:55:03 2016 +0200

    rsa/rsa_lib.c: const-ify RSA_get0_engine().
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 crypto/rsa/rsa_lib.c  |  2 +-
 engines/e_capi.c      | 18 +++++++++---------
 include/openssl/rsa.h |  2 +-
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c
index 14750d1..48e9100 100644
--- a/crypto/rsa/rsa_lib.c
+++ b/crypto/rsa/rsa_lib.c
@@ -304,7 +304,7 @@ void RSA_set_flags(RSA *r, int flags)
     r->flags |= flags;
 }
 
-ENGINE *RSA_get0_engine(RSA *r)
+ENGINE *RSA_get0_engine(const RSA *r)
 {
     return r->engine;
 }
diff --git a/engines/e_capi.c b/engines/e_capi.c
index f2d5c3e..4923eef 100644
--- a/engines/e_capi.c
+++ b/engines/e_capi.c
@@ -1029,17 +1029,17 @@ static DSA_SIG *capi_dsa_do_sign(const unsigned char *digest, int dlen,
         capi_addlasterror();
         goto err;
     } else {
-        BIGNUM *r = NULL, *s = NULL;
-        ret = DSA_SIG_new();
-        if (ret == NULL)
-            goto err;
-        DSA_SIG_get0(&r, &s, ret);
-        if (!lend_tobn(r, csigbuf, 20)
-            || !lend_tobn(s, csigbuf + 20, 20)) {
-            DSA_SIG_free(ret);
-            ret = NULL;
+        BIGNUM *r = BN_new(), *s = BN_new();
+
+        if (r == NULL || s == NULL
+            || !lend_tobn(r, csigbuf, 20)
+            || !lend_tobn(s, csigbuf + 20, 20)
+            || (ret = DSA_SIG_new()) == NULL) {
+            BN_free(r); /* BN_free checks for BIGNUM * being NULL */
+            BN_free(s);
             goto err;
         }
+        DSA_SIG_set0(ret, r, s);
     }
 
     /* Now cleanup */
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
index cd17385..b9d14e4 100644
--- a/include/openssl/rsa.h
+++ b/include/openssl/rsa.h
@@ -187,7 +187,7 @@ void RSA_get0_crt_params(const RSA *r,
 void RSA_clear_flags(RSA *r, int flags);
 int RSA_test_flags(const RSA *r, int flags);
 void RSA_set_flags(RSA *r, int flags);
-ENGINE *RSA_get0_engine(RSA *r);
+ENGINE *RSA_get0_engine(const RSA *r);
 
 /* Deprecated version */
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void


More information about the openssl-commits mailing list