diff options
author | Roger Dingledine <arma@torproject.org> | 2004-03-31 22:41:25 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-03-31 22:41:25 +0000 |
commit | d7cb4d0ae6fe805df21ba12e65561dcc98e03d29 (patch) | |
tree | f34e446a1837c0802525f56ea8a4752c754d82cc | |
parent | f8ac1a67140df936ea699ab31ed72bfb7b409154 (diff) | |
download | tor-d7cb4d0ae6fe805df21ba12e65561dcc98e03d29.tar tor-d7cb4d0ae6fe805df21ba12e65561dcc98e03d29.tar.gz |
make changes that ben laurie suggested
(ben, was this what you had in mind?)
svn:r1415
-rw-r--r-- | src/common/crypto.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 086848976..4a63394c4 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -674,16 +674,17 @@ 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; - unsigned char *buf, *bufp; - bufp = buf = (unsigned char *)tor_malloc(len); + unsigned char *buf; + const unsigned char *bufp; + bufp = buf = tor_malloc(len); memcpy(buf,str,len); /* 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, &bufp, len); + rsa = d2i_RSAPublicKey(NULL, &buf, len); #else - rsa = d2i_RSAPublicKey(NULL, (const unsigned char **)&bufp, len); + rsa = d2i_RSAPublicKey(NULL, &bufp, len); #endif tor_free(buf); if (!rsa) |