diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-03-18 08:20:16 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-03-18 08:20:16 -0400 |
commit | 84f57b69f31bf47cbc902d853040cb099256ec6d (patch) | |
tree | daabaa149bdb46a18a6c44c89bf73dfec1b3ae71 /src/lib/crypt_ops | |
parent | e0d68ce84fe4536142d7f5e8987a08d9e93ac626 (diff) | |
parent | 758deaa472b879645828c1ee585eb6ce8b8a9a50 (diff) | |
download | tor-84f57b69f31bf47cbc902d853040cb099256ec6d.tar.gz tor-84f57b69f31bf47cbc902d853040cb099256ec6d.zip |
Merge branch 'maint-0.4.2' into maint-0.4.3
Diffstat (limited to 'src/lib/crypt_ops')
-rw-r--r-- | src/lib/crypt_ops/crypto_rsa_openssl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/crypt_ops/crypto_rsa_openssl.c b/src/lib/crypt_ops/crypto_rsa_openssl.c index 9d674fa883..d54db43b92 100644 --- a/src/lib/crypt_ops/crypto_rsa_openssl.c +++ b/src/lib/crypt_ops/crypto_rsa_openssl.c @@ -573,6 +573,8 @@ rsa_private_key_too_long(RSA *rsa, int max_bits) { const BIGNUM *n, *e, *p, *q, *d, *dmp1, *dmq1, *iqmp; #ifdef OPENSSL_1_1_API + +#if OPENSSL_VERSION_NUMBER >= OPENSSL_V_SERIES(1,1,1) n = RSA_get0_n(rsa); e = RSA_get0_e(rsa); p = RSA_get0_p(rsa); @@ -581,6 +583,11 @@ rsa_private_key_too_long(RSA *rsa, int max_bits) dmp1 = RSA_get0_dmp1(rsa); dmq1 = RSA_get0_dmq1(rsa); iqmp = RSA_get0_iqmp(rsa); +#else + /* The accessors above did not exist in openssl 1.1.0. */ + p = q = dmp1 = dmq1 = iqmp = NULL; + RSA_get0_key(rsa, &n, &e, &d); +#endif if (RSA_bits(rsa) > max_bits) return true; |