aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-03-30 22:42:26 +0000
committerNick Mathewson <nickm@torproject.org>2004-03-30 22:42:26 +0000
commitc31f5505daca8383a6738c4a2ecbc3ea38091c5a (patch)
tree1b6e0b55fffb6fecba376548581ac56d6b0b4588 /src/common
parent96a86ef14d8b4f2377e19070ae930de730efd2f8 (diff)
downloadtor-c31f5505daca8383a6738c4a2ecbc3ea38091c5a.tar
tor-c31f5505daca8383a6738c4a2ecbc3ea38091c5a.tar.gz
Jump through a hoop, suppress a warning
svn:r1398
Diffstat (limited to 'src/common')
-rw-r--r--src/common/crypto.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 53c261b14..cdf827d0d 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -664,7 +664,14 @@ int crypto_pk_asn1_encode(crypto_pk_env_t *pk, char *dest, int dest_len)
crypto_pk_env_t *crypto_pk_asn1_decode(const char *str, int len)
{
RSA *rsa;
+ /* This ifdef suppresses a type warning. Take out the first case once
+ * everybody is using openssl 0.9.7 or later.
+ */
+#if OPENSSL_VERSION_NUMBER < 0x00907000l
+ rsa = d2i_RSAPublicKey(NULL, (unsigned char**)&str, len);
+#else
rsa = d2i_RSAPublicKey(NULL, (const unsigned char**)&str, len);
+#endif
if (!rsa)
return NULL; /* XXXX log openssl error */
return _crypto_new_pk_env_rsa(rsa);