[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] make changes that ben laurie suggested



Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/common

Modified Files:
	crypto.c 
Log Message:
make changes that ben laurie suggested
(ben, was this what you had in mind?)


Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- crypto.c	31 Mar 2004 02:04:06 -0000	1.61
+++ crypto.c	31 Mar 2004 22:41:25 -0000	1.62
@@ -674,16 +674,17 @@
 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)