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 | 4ad3f17c26166b898cd768a6e1835fad2ef67005 (patch) | |
tree | f3529bbbb32d5b7af8a4234338cf7d15f1c0ebc0 | |
parent | 57b1d0848e9b42670d6f33e37a2095740726e2b1 (diff) | |
parent | 0526801ed4caba4393942e62def2cb35f0f298b3 (diff) | |
download | tor-4ad3f17c26166b898cd768a6e1835fad2ef67005.tar.gz tor-4ad3f17c26166b898cd768a6e1835fad2ef67005.zip |
Merge branch 'maint-0.3.5' into maint-0.4.1
-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 6f3ac6fde6..17eae24cc2 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; |