]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Jump through a hoop, suppress a warning
authorNick Mathewson <nickm@torproject.org>
Tue, 30 Mar 2004 22:42:26 +0000 (22:42 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 30 Mar 2004 22:42:26 +0000 (22:42 +0000)
svn:r1398

src/common/crypto.c

index 53c261b1427da3656f26f33cbacf1f0064e5da9e..cdf827d0dd3d4b80038ee35543346a32bacef09a 100644 (file)
@@ -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);