summaryrefslogtreecommitdiff
path: root/src/or/rendmid.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-05 17:36:30 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-05 17:36:30 +0000
commit12ede0a2c4aa45fb32ab96cb7bb02496179ae1d5 (patch)
tree69b96e0ba1a7b661cc78fc7b0c7a23de2c705301 /src/or/rendmid.c
parent41387bea08a34b7bb7fc231a01d8c754f988a5bd (diff)
downloadtor-12ede0a2c4aa45fb32ab96cb7bb02496179ae1d5.tar.gz
tor-12ede0a2c4aa45fb32ab96cb7bb02496179ae1d5.zip
use the right variable when comparing hashes; maybe fix "Hash of session" bug
svn:r1481
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r--src/or/rendmid.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index aea65f47f2..c44c994b8a 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -53,16 +53,15 @@ rend_mid_establish_intro(circuit_t *circ, const char *request, int request_len)
}
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;
}