aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendcommon.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-05 00:47:48 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-05 00:47:48 +0000
commit7793078dffae64d8d4574a37c6ffa40fb54637c9 (patch)
treeb988080813729ccd28d572bce44e032398bec00a /src/or/rendcommon.c
parenta9813f0210bbf723e19b24c73fb93ecc436efcfb (diff)
downloadtor-7793078dffae64d8d4574a37c6ffa40fb54637c9.tar.gz
tor-7793078dffae64d8d4574a37c6ffa40fb54637c9.zip
alice can now look up bob's service descriptor,
choose an intro point, connect to it, choose a rend point, connect to it and establish a cookie, get an ack from the rendezvous point, and know when both circs are ready for her. APConns don't use conn->purpose anymore don't initiate a renddesc lookup if one is already in progress also fix a buffer overflow in nickname parsing (only exploitable by the operator though) svn:r1471
Diffstat (limited to 'src/or/rendcommon.c')
-rw-r--r--src/or/rendcommon.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index 878e83e3bd..0bb2fe295d 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -61,6 +61,8 @@ rend_encode_service_descriptor(rend_service_descriptor_t *desc,
return 0;
}
+/* malloc a service_descriptor_t and return it.
+ * return NULL if invalid descriptor or error */
rend_service_descriptor_t *rend_parse_service_descriptor(
const char *str, int len)
{
@@ -83,6 +85,10 @@ rend_service_descriptor_t *rend_parse_service_descriptor(
cp += 4;
if (end-cp < 2) goto truncated;
result->n_intro_points = get_uint16(cp);
+ if(result->n_intro_points < 1) {
+ log_fn(LOG_WARN,"Service descriptor listed no intro points.");
+ goto error;
+ }
result->intro_points = tor_malloc_zero(sizeof(char*)*result->n_intro_points);
cp += 2;
for (i=0;i<result->n_intro_points;++i) {
@@ -282,8 +288,7 @@ void rend_process_relay_cell(circuit_t *circ, int command, int length,
r = rend_service_intro_established(circ,payload,length);
break;
case RELAY_COMMAND_RENDEZVOUS_ESTABLISHED:
- /* r = rend_client_rendezvous_established(circ,payload,length); */
- log_fn(LOG_NOTICE, "Ignoring a rendezvous_established cell");
+ r = rend_client_rendezvous_acked(circ,payload,length);
break;
default:
assert(0);