summaryrefslogtreecommitdiff
path: root/src/or/rendclient.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-07-26 19:05:41 +0000
committerNick Mathewson <nickm@torproject.org>2006-07-26 19:05:41 +0000
commite61d28dfb8f2936b8024f1cb4d3ad8ecf1cd25b5 (patch)
treee5e1a34aa6f63717ddcb75087bd1ec8f93939ce5 /src/or/rendclient.c
parenta88ec48a39e5531fa80a0b5d5ec42dd31f268b67 (diff)
downloadtor-e61d28dfb8f2936b8024f1cb4d3ad8ecf1cd25b5.tar.gz
tor-e61d28dfb8f2936b8024f1cb4d3ad8ecf1cd25b5.zip
r6903@Kushana: nickm | 2006-07-25 18:22:48 -0400
No circuit can be both an intro point and a rend point, so we can merge both the cookie and the pk digest into one "rend_token" field for or circuits. This saves another 20 bytes per or circuit. svn:r6904
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r--src/or/rendclient.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index e635f36f21..3445bd5c88 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -32,14 +32,14 @@ rend_client_send_establish_rendezvous(origin_circuit_t *circ)
tor_assert(circ->_base.purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND);
log_info(LD_REND, "Sending an ESTABLISH_RENDEZVOUS cell");
- if (crypto_rand(circ->_base.rend_cookie, REND_COOKIE_LEN) < 0) {
+ if (crypto_rand(circ->rend_cookie, REND_COOKIE_LEN) < 0) {
log_warn(LD_BUG, "Internal error: Couldn't produce random cookie.");
circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_AT_ORIGIN);
return -1;
}
if (connection_edge_send_command(NULL,TO_CIRCUIT(circ),
RELAY_COMMAND_ESTABLISH_RENDEZVOUS,
- circ->_base.rend_cookie, REND_COOKIE_LEN,
+ circ->rend_cookie, REND_COOKIE_LEN,
circ->cpath->prev)<0) {
/* circ is already marked for close */
log_warn(LD_GENERAL, "Couldn't send ESTABLISH_RENDEZVOUS cell");
@@ -111,14 +111,14 @@ rend_client_send_introduction(origin_circuit_t *introcirc,
klen = crypto_pk_asn1_encode(extend_info->onion_key, tmp+7+DIGEST_LEN+2,
sizeof(tmp)-(7+DIGEST_LEN+2));
set_uint16(tmp+7+DIGEST_LEN, htons(klen));
- memcpy(tmp+7+DIGEST_LEN+2+klen, rendcirc->_base.rend_cookie,
+ memcpy(tmp+7+DIGEST_LEN+2+klen, rendcirc->rend_cookie,
REND_COOKIE_LEN);
dh_offset = 7+DIGEST_LEN+2+klen+REND_COOKIE_LEN;
} else {
/* Version 0. */
strncpy(tmp, rendcirc->build_state->chosen_exit->nickname,
(MAX_NICKNAME_LEN+1)); /* nul pads */
- memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->_base.rend_cookie,
+ memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_cookie,
REND_COOKIE_LEN);
dh_offset = MAX_NICKNAME_LEN+1+REND_COOKIE_LEN;
}