diff options
author | Richard Levitte <levitte@openssl.org> | 2020-01-13 12:28:05 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-01-17 09:04:42 +0100 |
commit | 806253f31f663594c70e10862f0743530a75e094 (patch) | |
tree | 10d393fa7f8e28defabd1421ad77989030ed6df0 /crypto | |
parent | f17268d0d05add0240dcfdbb91d522aa7b10c790 (diff) |
DSA: Move DSA_security_bits() and DSA_bits()
... to make them accessible from the FIPS provider module.
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10778)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/dsa/dsa_lib.c | 23 |
1 files changed, 11 insertions, 12 deletions
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); +} |