]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Add some temporary log calls to try to debug the "Hash of session info was not as...
authorNick Mathewson <nickm@torproject.org>
Mon, 5 Apr 2004 17:20:57 +0000 (17:20 +0000)
committerNick Mathewson <nickm@torproject.org>
Mon, 5 Apr 2004 17:20:57 +0000 (17:20 +0000)
svn:r1479

src/or/rendmid.c
src/or/rendservice.c

index fd3ee54b0a71da1576ff355ed8773795882f2fc5..aea65f47f2fa7d4b3315466b2c5e500f0a62e365 100644 (file)
@@ -17,6 +17,7 @@ rend_mid_establish_intro(circuit_t *circ, const char *request, int request_len)
   int asn1len;
   circuit_t *c;
   char hexid[9];
+  char hexdigest[20*2+1];
 
   log_fn(LOG_INFO,
          "Received an ESTABLISH_INTRO request on circuit %d", circ->p_circ_id);
@@ -39,6 +40,10 @@ rend_mid_establish_intro(circuit_t *circ, const char *request, int request_len)
     goto err;
   }
 
+  /* XXX remove after debuggin */
+  hex_encode(circ->handshake_digest, 20, hexdigest);
+  log_fn(LOG_INFO, "Handshake information is: %s", hexdigest);
+
   /* Next 20 bytes: Hash of handshake_digest | "INTRODUCE" */
   memcpy(buf, circ->handshake_digest, 20);
   memcpy(buf+20, "INTRODUCE", 9);
@@ -46,6 +51,10 @@ rend_mid_establish_intro(circuit_t *circ, const char *request, int request_len)
     log_fn(LOG_WARN, "Error computing digest");
     goto err;
   }
+  hex_encode(expected_digest, 20, hexdigest);
+  log_fn(LOG_INFO, "Expected digest is: %s", hexdigest);
+  hex_encode(buf+2+asn1len, 20, hexdigest);
+  log_fn(LOG_INFO, "Received digest is: %s", hexdigest);
   if (memcmp(expected_digest, buf+2+asn1len, 20)) {
     log_fn(LOG_WARN, "Hash of session info was not as expected");
     goto err;
index 31f0c8c5dc4ab0ac2b1009d51572a3a0e3e2a87a..65e9a5a8c2c8b54cdbb923b5161d08ff71c54f34 100644 (file)
@@ -458,6 +458,7 @@ rend_service_intro_is_ready(circuit_t *circuit)
   char buf[RELAY_PAYLOAD_SIZE];
   char auth[DIGEST_LEN + 10];
   char hexid[9];
+  char hexdigest[DIGEST_LEN*2+1];
 
   assert(circuit->purpose == CIRCUIT_PURPOSE_S_ESTABLISH_INTRO);
   assert(circuit->cpath);
@@ -480,9 +481,15 @@ rend_service_intro_is_ready(circuit_t *circuit)
   set_uint16(buf, len);
   len += 2;
   memcpy(auth, circuit->cpath->prev->handshake_digest, DIGEST_LEN);
+  /* XXXX remove me once we've debugged this; this info should not be logged.
+   */
+  hex_encode(circuit->cpath->prev->handshake_digest, DIGEST_LEN, hexdigest);
+  log_fn(LOG_INFO,"Handshake information is: %s", hexdigest);
   memcpy(auth+DIGEST_LEN, "INTRODUCE", 9);
   if (crypto_digest(auth, DIGEST_LEN+9, buf+len))
     goto err;
+  hex_encode(buf+len, DIGEST_LEN, hexdigest);
+  log_fn(LOG_INFO,"Authentication is: %s", hexdigest);
   len += 20;
   r = crypto_pk_private_sign_digest(service->private_key, buf, len, buf+len);
   if (r<0) {