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

[or-cvs] use the right variable when comparing hashes; maybe fix "Ha...



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv10311/src/or

Modified Files:
	rendmid.c 
Log Message:
use the right variable when comparing hashes; maybe fix "Hash of session" bug

Index: rendmid.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendmid.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- rendmid.c	5 Apr 2004 17:20:57 -0000	1.10
+++ rendmid.c	5 Apr 2004 17:36:30 -0000	1.11
@@ -53,16 +53,15 @@
   }
   hex_encode(expected_digest, 20, hexdigest);
   log_fn(LOG_INFO, "Expected digest is: %s", hexdigest);
-  hex_encode(buf+2+asn1len, 20, hexdigest);
+  hex_encode(request+2+asn1len, 20, hexdigest);
   log_fn(LOG_INFO, "Received digest is: %s", hexdigest);
-  if (memcmp(expected_digest, buf+2+asn1len, 20)) {
+  if (memcmp(expected_digest, request+2+asn1len, 20)) {
     log_fn(LOG_WARN, "Hash of session info was not as expected");
     goto err;
   }
-
   /* Rest of body: signature of previous data */
-  if (crypto_pk_public_checksig_digest(pk, buf, 22+asn1len,
-                          buf+22+asn1len, request_len-(22+asn1len))<0) {
+  if (crypto_pk_public_checksig_digest(pk, request, 22+asn1len,
+                           request+22+asn1len, request_len-(22+asn1len))<0) {
     log_fn(LOG_WARN, "Incorrect signature on ESTABLISH_INTRO cell; rejecting");
     goto err;
   }