diff options
author | Roger Dingledine <arma@torproject.org> | 2007-11-29 15:25:04 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-11-29 15:25:04 +0000 |
commit | aaf35cccf7ac60c17dac687127ec82c612232836 (patch) | |
tree | c382f9c21bb2812178fe1eb85147432c65e73b0c /src/or/rendmid.c | |
parent | 0f22c584cdc797e20f4aef74e5312ebda76d05fa (diff) | |
download | tor-aaf35cccf7ac60c17dac687127ec82c612232836.tar.gz tor-aaf35cccf7ac60c17dac687127ec82c612232836.zip |
karsten's second refactoring patch
svn:r12607
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r-- | src/or/rendmid.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c index c0fbf09c3d..16dc2ceee1 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -24,7 +24,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const char *request, char pk_digest[DIGEST_LEN]; size_t asn1len; or_circuit_t *c; - char serviceid[REND_SERVICE_ID_LEN+1]; + char serviceid[REND_SERVICE_ID_LEN_BASE32+1]; int reason = END_CIRC_REASON_INTERNAL; log_info(LD_REND, @@ -84,7 +84,8 @@ rend_mid_establish_intro(or_circuit_t *circ, const char *request, crypto_free_pk_env(pk); /* don't need it anymore */ pk = NULL; /* so we don't free it again if err */ - base32_encode(serviceid, REND_SERVICE_ID_LEN+1, pk_digest,10); + base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32+1, + pk_digest, REND_SERVICE_ID_LEN); /* Close any other intro circuits with the same pk. */ c = NULL; @@ -129,7 +130,7 @@ int rend_mid_introduce(or_circuit_t *circ, const char *request, size_t request_len) { or_circuit_t *intro_circ; - char serviceid[REND_SERVICE_ID_LEN+1]; + char serviceid[REND_SERVICE_ID_LEN_BASE32+1]; char nak_body[1]; log_info(LD_REND, "Received an INTRODUCE1 request on circuit %d", @@ -154,7 +155,8 @@ rend_mid_introduce(or_circuit_t *circ, const char *request, size_t request_len) goto err; } - base32_encode(serviceid, REND_SERVICE_ID_LEN+1, request,10); + base32_encode(serviceid, REND_SERVICE_ID_LEN_BASE32+1, + request, REND_SERVICE_ID_LEN); /* The first 20 bytes are all we look at: they have a hash of Bob's PK. */ intro_circ = circuit_get_intro_point(request); |