[openssl-commits] [openssl] master update

Dr. Stephen Henson steve at openssl.org
Mon Aug 1 18:46:13 UTC 2016


The branch master has been updated
       via  10b0b817a0abe54f5dabe3b21717d77569ad2d9b (commit)
       via  5d8d9a8efaad0ece23f6692f1b1318744230fd4d (commit)
      from  6c1f368d882846e5624f8b47be951d16be65a30c (commit)


- Log -----------------------------------------------------------------
commit 10b0b817a0abe54f5dabe3b21717d77569ad2d9b
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Mon Aug 1 18:37:48 2016 +0100

    make update
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 5d8d9a8efaad0ece23f6692f1b1318744230fd4d
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Mon Aug 1 18:37:03 2016 +0100

    Add DSA_bits() function.
    
    RT#4637
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 crypto/dsa/dsa_ameth.c  |  2 +-
 crypto/dsa/dsa_lib.c    |  5 +++++
 doc/crypto/DSA_size.pod | 16 +++++++++++-----
 include/openssl/dsa.h   |  1 +
 util/libcrypto.num      |  1 +
 5 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c
index c7573bf..f2f2cf5 100644
--- a/crypto/dsa/dsa_ameth.c
+++ b/crypto/dsa/dsa_ameth.c
@@ -254,7 +254,7 @@ static int int_dsa_size(const EVP_PKEY *pkey)
 
 static int dsa_bits(const EVP_PKEY *pkey)
 {
-    return BN_num_bits(pkey->pkey.dsa->p);
+    return DSA_bits(pkey->pkey.dsa);
 }
 
 static int dsa_security_bits(const EVP_PKEY *pkey)
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c
index 9c001d7..42324c7 100644
--- a/crypto/dsa/dsa_lib.c
+++ b/crypto/dsa/dsa_lib.c
@@ -339,3 +339,8 @@ ENGINE *DSA_get0_engine(DSA *d)
 {
     return d->engine;
 }
+
+int DSA_bits(const DSA *dsa)
+{
+    return BN_num_bits(dsa->p);
+}
diff --git a/doc/crypto/DSA_size.pod b/doc/crypto/DSA_size.pod
index 7c12146..16e6f3a 100644
--- a/doc/crypto/DSA_size.pod
+++ b/doc/crypto/DSA_size.pod
@@ -2,25 +2,31 @@
 
 =head1 NAME
 
-DSA_size - get DSA signature size
+DSA_size, DSA_bits - get DSA signature size or key bits
 
 =head1 SYNOPSIS
 
  #include <openssl/dsa.h>
 
  int DSA_size(const DSA *dsa);
+ int DSA_bits(const DSA *dsa);
 
 =head1 DESCRIPTION
 
-This function returns the size of an ASN.1 encoded DSA signature in
-bytes. It can be used to determine how much memory must be allocated
-for a DSA signature.
+DSA_size() returns the maximum size of an ASN.1 encoded DSA signature
+for key B<dsa> in bytes. It can be used to determine how much memory must
+be allocated for a DSA signature.
 
 B<dsa-E<gt>q> must not be B<NULL>.
 
+DSA_bits() returns the number of bits in key B<dsa>: this is the number
+of bits in the B<p> parameter.
+
 =head1 RETURN VALUE
 
-The size in bytes.
+DSA_size() returns the size in bytes.
+
+DSA_bits() returns the number of bits in the key.
 
 =head1 SEE ALSO
 
diff --git a/include/openssl/dsa.h b/include/openssl/dsa.h
index cbc60e1..cb5fbc2 100644
--- a/include/openssl/dsa.h
+++ b/include/openssl/dsa.h
@@ -101,6 +101,7 @@ void DSA_free(DSA *r);
 /* "up" the DSA object's reference count */
 int DSA_up_ref(DSA *r);
 int DSA_size(const DSA *);
+int DSA_bits(const DSA *d);
 int DSA_security_bits(const DSA *d);
         /* next 4 return -1 on error */
 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp);
diff --git a/util/libcrypto.num b/util/libcrypto.num
index 22f76f4..0954a48 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -4189,3 +4189,4 @@ X509_STORE_unlock                       4133	1_1_0	EXIST::FUNCTION:
 X509_STORE_lock                         4134	1_1_0	EXIST::FUNCTION:
 X509_set_proxy_pathlen                  4135	1_1_0	EXIST::FUNCTION:
 X509_get_proxy_pathlen                  4136	1_1_0	EXIST::FUNCTION:
+DSA_bits                                4137	1_1_0	EXIST::FUNCTION:DSA


More information about the openssl-commits mailing list