aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops/crypto_rsa.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-12 17:18:41 -0400
committerNick Mathewson <nickm@torproject.org>2018-08-21 12:25:33 -0400
commit6a88d8f6b413efdac4b0176cfb78431be46ca9e0 (patch)
tree873962eaa3b6ac1f5ad4d5a2532dec8d108ec080 /src/lib/crypt_ops/crypto_rsa.c
parent1992c761308538cffea64abecc9e45cbd47b1bda (diff)
downloadtor-6a88d8f6b413efdac4b0176cfb78431be46ca9e0.tar.gz
tor-6a88d8f6b413efdac4b0176cfb78431be46ca9e0.zip
When enabling NSS, disable OpenSSL.
We used to link both libraries at once, but now that I'm working on TLS, there's nothing left to keep OpenSSL around for when NSS is enabled. Note that this patch causes a couple of places that still assumed OpenSSL to be disabled when NSS is enabled - tor-gencert - pbkdf2
Diffstat (limited to 'src/lib/crypt_ops/crypto_rsa.c')
-rw-r--r--src/lib/crypt_ops/crypto_rsa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/crypt_ops/crypto_rsa.c b/src/lib/crypt_ops/crypto_rsa.c
index 0f80bc967f..31497e6509 100644
--- a/src/lib/crypt_ops/crypto_rsa.c
+++ b/src/lib/crypt_ops/crypto_rsa.c
@@ -37,11 +37,12 @@ crypto_get_rsa_padding_overhead(int padding)
{
switch (padding)
{
- case RSA_PKCS1_OAEP_PADDING: return PKCS1_OAEP_PADDING_OVERHEAD;
+ case PK_PKCS1_OAEP_PADDING: return PKCS1_OAEP_PADDING_OVERHEAD;
default: tor_assert(0); return -1; // LCOV_EXCL_LINE
}
}
+#ifdef ENABLE_OPENSSL
/** Given a padding method <b>padding</b>, return the correct OpenSSL constant.
*/
int
@@ -53,6 +54,7 @@ crypto_get_rsa_padding(int padding)
default: tor_assert(0); return -1; // LCOV_EXCL_LINE
}
}
+#endif
/** Compare the public-key components of a and b. Return non-zero iff
* a==b. A NULL key is considered to be distinct from all non-NULL
@@ -100,7 +102,7 @@ crypto_pk_obsolete_public_hybrid_encrypt(crypto_pk_t *env,
tor_assert(to);
tor_assert(fromlen < SIZE_T_CEILING);
- overhead = crypto_get_rsa_padding_overhead(crypto_get_rsa_padding(padding));
+ overhead = crypto_get_rsa_padding_overhead(padding);
pkeylen = crypto_pk_keysize(env);
if (!force && fromlen+overhead <= pkeylen) {