From: Richard Levitte Date: Mon, 13 Jan 2020 11:28:05 +0000 (+0100) Subject: DSA: Move DSA_security_bits() and DSA_bits() X-Git-Tag: openssl-3.0.0-alpha1~653 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=806253f31f663594c70e10862f0743530a75e094;p=oweals%2Fopenssl.git DSA: Move DSA_security_bits() and DSA_bits() ... to make them accessible from the FIPS provider module. Reviewed-by: Nicola Tuveri (Merged from https://github.com/openssl/openssl/pull/10778) --- diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c index 10e88c16bf..976eb622aa 100644 --- a/crypto/dsa/dsa_lib.c +++ b/crypto/dsa/dsa_lib.c @@ -29,13 +29,6 @@ void *DSA_get_ex_data(DSA *d, int idx) return CRYPTO_get_ex_data(&d->ex_data, idx); } -int DSA_security_bits(const DSA *d) -{ - if (d->p && d->q) - return BN_security_bits(BN_num_bits(d->p), BN_num_bits(d->q)); - return -1; -} - #ifndef OPENSSL_NO_DH DH *DSA_dup_DH(const DSA *r) { @@ -139,11 +132,6 @@ ENGINE *DSA_get0_engine(DSA *d) return d->engine; } -int DSA_bits(const DSA *dsa) -{ - return BN_num_bits(dsa->p); -} - int DSA_set_method(DSA *dsa, const DSA_METHOD *meth) { /* @@ -351,3 +339,14 @@ int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) return 1; } +int DSA_security_bits(const DSA *d) +{ + if (d->p && d->q) + return BN_security_bits(BN_num_bits(d->p), BN_num_bits(d->q)); + return -1; +} + +int DSA_bits(const DSA *dsa) +{ + return BN_num_bits(dsa->p); +}