[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] complain early if we get an unrecognized nickname from



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection_edge.c or.h rendclient.c 
Log Message:
complain early if we get an unrecognized nickname from
bob's rend service descriptor


Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -d -r1.138 -r1.139
--- connection_edge.c	5 Apr 2004 15:24:03 -0000	1.138
+++ connection_edge.c	5 Apr 2004 17:50:59 -0000	1.139
@@ -777,12 +777,16 @@
 
     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);
     }
 

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.297
retrieving revision 1.298
diff -u -d -r1.297 -r1.298
--- or.h	5 Apr 2004 07:41:31 -0000	1.297
+++ or.h	5 Apr 2004 17:50:59 -0000	1.298
@@ -1046,7 +1046,7 @@
 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);

Index: rendclient.c
===================================================================
RCS file: /home/or/cvsroot/src/or/rendclient.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- rendclient.c	5 Apr 2004 15:17:34 -0000	1.10
+++ rendclient.c	5 Apr 2004 17:51:00 -0000	1.11
@@ -208,7 +208,7 @@
 /* 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;