From 27126e5007a3cabb242c6f0d41981efc21945964 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Mon, 5 Apr 2004 18:22:00 +0000 Subject: [PATCH] oaep uses 42 more bytes -- stop clobbering buffers also maybe fix some constants here and there -- nick? svn:r1484 --- src/or/connection_edge.c | 6 +++--- src/or/rendclient.c | 4 ++-- src/or/rendmid.c | 2 +- src/or/rendservice.c | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 61d60271fe..36b2341847 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -757,9 +757,6 @@ circuit_get_open_circ_or_launch(connection_t *conn, return 1; /* we're happy */ } - log_fn(LOG_INFO,"No safe circuit (purpose %d) ready for edge connection; delaying.", - desired_circuit_purpose); - if(!*conn->rend_query) { /* general purpose circ */ addr = client_dns_lookup_entry(conn->socks_request->address); if(router_exit_policy_all_routers_reject(addr, conn->socks_request->port)) { @@ -804,6 +801,9 @@ circuit_get_open_circ_or_launch(connection_t *conn, strcpy(circ->rend_query, conn->rend_query); } } + if(!circ) + log_fn(LOG_INFO,"No safe circuit (purpose %d) ready for edge connection; delaying.", + desired_circuit_purpose); *circp = circ; return 0; } diff --git a/src/or/rendclient.c b/src/or/rendclient.c index e894cef5f4..fba78fa7ac 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -41,14 +41,14 @@ rend_client_send_establish_rendezvous(circuit_t *circ) return 0; } -#define LEN_REND_INTRODUCE1 204 +#define LEN_REND_INTRODUCE1 (20+20+20+16+128+42) int rend_client_send_introduction(circuit_t *introcirc, circuit_t *rendcirc) { const char *descp; int desc_len; char payload[LEN_REND_INTRODUCE1]; - char tmp[LEN_REND_INTRODUCE1-20-16]; + char tmp[20+20+128]; rend_service_descriptor_t *parsed=NULL; assert(introcirc->purpose == CIRCUIT_PURPOSE_C_INTRODUCING); diff --git a/src/or/rendmid.c b/src/or/rendmid.c index c44c994b8a..49a3ffc816 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -124,7 +124,7 @@ rend_mid_introduce(circuit_t *circ, const char *request, int request_len) goto err; } - if (request_len < 276) { + if (request_len < 246) { log_fn(LOG_WARN, "Impossibly short INTRODUCE1 cell on circuit %d; dropping.", circ->p_circ_id); diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 181c6728d9..974a71e99e 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -326,6 +326,7 @@ rend_service_introduce(circuit_t *circuit, const char *request, int request_len) return -1; } + /* XXX NM this is wrong, right? */ /* min key length plus digest length plus nickname length */ if (request_len < 148) { log_fn(LOG_WARN, "Got a truncated INTRODUCE2 cell on circ %d",