Add DSA_bits and DH_bits.

More OpenSSL compatibility functions.

Change-Id: I8e9429fcbc3e285f4c4ad9bdf4c1d9d3c73c3064
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53925
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Reviewed-by: Adam Langley <agl@google.com>
Commit-Queue: Adam Langley <agl@google.com>
chromium-5359
David Benjamin 2 years ago committed by Boringssl LUCI CQ
parent adaa322b63
commit ce65c1daf8
  1. 2
      crypto/dsa/dsa.c
  2. 2
      crypto/fipsmodule/dh/dh.c
  3. 3
      include/openssl/dh.h
  4. 3
      include/openssl/dsa.h

@ -130,6 +130,8 @@ int DSA_up_ref(DSA *dsa) {
return 1;
}
unsigned DSA_bits(const DSA *dsa) { return BN_num_bits(dsa->p); }
const BIGNUM *DSA_get0_pub_key(const DSA *dsa) { return dsa->pub_key; }
const BIGNUM *DSA_get0_priv_key(const DSA *dsa) { return dsa->priv_key; }

@ -111,6 +111,8 @@ void DH_free(DH *dh) {
OPENSSL_free(dh);
}
unsigned DH_bits(const DH *dh) { return BN_num_bits(dh->p); }
const BIGNUM *DH_get0_pub_key(const DH *dh) { return dh->pub_key; }
const BIGNUM *DH_get0_priv_key(const DH *dh) { return dh->priv_key; }

@ -89,6 +89,9 @@ OPENSSL_EXPORT int DH_up_ref(DH *dh);
// Properties.
// DH_bits returns the size of |dh|'s group modulus, in bits.
OPENSSL_EXPORT unsigned DH_bits(const DH *dh);
// DH_get0_pub_key returns |dh|'s public key.
OPENSSL_EXPORT const BIGNUM *DH_get0_pub_key(const DH *dh);

@ -94,6 +94,9 @@ OPENSSL_EXPORT int DSA_up_ref(DSA *dsa);
// Properties.
// DSA_bits returns the size of |dsa|'s group modulus, in bits.
OPENSSL_EXPORT unsigned DSA_bits(const DSA *dsa);
// DSA_get0_pub_key returns |dsa|'s public key.
OPENSSL_EXPORT const BIGNUM *DSA_get0_pub_key(const DSA *dsa);

Loading…
Cancel
Save