summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-05 17:51:00 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-05 17:51:00 +0000
commitac84512489404f4d0cecec7353b1cc1dae1d2c69 (patch)
treed21c60190a6c77dd7ef879bc03ab1ef00f5ce5c8
parent12ede0a2c4aa45fb32ab96cb7bb02496179ae1d5 (diff)
downloadtor-ac84512489404f4d0cecec7353b1cc1dae1d2c69.tar.gz
tor-ac84512489404f4d0cecec7353b1cc1dae1d2c69.zip
complain early if we get an unrecognized nickname from
bob's rend service descriptor svn:r1482
-rw-r--r--src/or/connection_edge.c6
-rw-r--r--src/or/or.h2
-rw-r--r--src/or/rendclient.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 8c33b6cef5..cf61be1e9b 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -777,12 +777,16 @@ circuit_get_open_circ_or_launch(connection_t *conn,
if(desired_circuit_purpose == CIRCUIT_PURPOSE_C_INTRODUCING) {
/* need to pick an intro point */
- exitname = rend_get_random_intro(conn->rend_query);
+ exitname = rend_client_get_random_intro(conn->rend_query);
if(!exitname) {
log_fn(LOG_WARN,"Couldn't get an intro point for '%s'. Closing conn.",
conn->rend_query);
return -1;
}
+ if(!router_get_by_nickname(exitname)) {
+ log_fn(LOG_WARN,"Advertised intro point '%s' is not known. Closing.", exitname);
+ return -1;
+ }
log_fn(LOG_INFO,"Chose %s as intro point for %s.", exitname, conn->rend_query);
}
diff --git a/src/or/or.h b/src/or/or.h
index d74115636e..81f67c9e37 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1046,7 +1046,7 @@ int rend_client_receive_rendezvous(circuit_t *circ, const char *request, int req
void rend_client_desc_fetched(char *query, int success);
int rend_cmp_service_ids(char *one, char *two);
-char *rend_get_random_intro(char *query);
+char *rend_client_get_random_intro(char *query);
int rend_parse_rendezvous_address(char *address);
int rend_client_send_establish_rendezvous(circuit_t *circ);
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 82f3681e07..96ea145cae 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -208,7 +208,7 @@ int rend_cmp_service_ids(char *one, char *two) {
/* return a pointer to a nickname for a random introduction
* point of query. return NULL if error.
*/
-char *rend_get_random_intro(char *query) {
+char *rend_client_get_random_intro(char *query) {
const char *descp;
int desc_len;
int i;