mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
make changes that ben laurie suggested
(ben, was this what you had in mind?) svn:r1415
This commit is contained in:
parent
f8ac1a6714
commit
d7cb4d0ae6
@ -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)
|
crypto_pk_env_t *crypto_pk_asn1_decode(const char *str, int len)
|
||||||
{
|
{
|
||||||
RSA *rsa;
|
RSA *rsa;
|
||||||
unsigned char *buf, *bufp;
|
unsigned char *buf;
|
||||||
bufp = buf = (unsigned char *)tor_malloc(len);
|
const unsigned char *bufp;
|
||||||
|
bufp = buf = tor_malloc(len);
|
||||||
memcpy(buf,str,len);
|
memcpy(buf,str,len);
|
||||||
/* This ifdef suppresses a type warning. Take out the first case once
|
/* This ifdef suppresses a type warning. Take out the first case once
|
||||||
* everybody is using openssl 0.9.7 or later.
|
* everybody is using openssl 0.9.7 or later.
|
||||||
*/
|
*/
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x00907000l
|
#if OPENSSL_VERSION_NUMBER < 0x00907000l
|
||||||
rsa = d2i_RSAPublicKey(NULL, &bufp, len);
|
rsa = d2i_RSAPublicKey(NULL, &buf, len);
|
||||||
#else
|
#else
|
||||||
rsa = d2i_RSAPublicKey(NULL, (const unsigned char **)&bufp, len);
|
rsa = d2i_RSAPublicKey(NULL, &bufp, len);
|
||||||
#endif
|
#endif
|
||||||
tor_free(buf);
|
tor_free(buf);
|
||||||
if (!rsa)
|
if (!rsa)
|
||||||
|
Loading…
Reference in New Issue
Block a user