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

[or-cvs] put our fingerprint into the descriptor, so we can match a



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

Modified Files:
	router.c 
Log Message:
put our fingerprint into the descriptor, so we can match a
desc to a running-routers entry


Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- router.c	22 Jul 2004 06:04:54 -0000	1.75
+++ router.c	22 Jul 2004 06:22:04 -0000	1.76
@@ -573,6 +573,7 @@
   char digest[20];
   char signature[128];
   char published[32];
+  char fingerprint[FINGERPRINT_LEN+1];
   struct in_addr in;
   int onion_pkeylen, identity_pkeylen;
   int written;
@@ -590,6 +591,12 @@
     return -1;
   }
 
+  /* record our fingerprint, so we can include it in the descriptor */
+  if (crypto_pk_get_fingerprint(router->identity_pkey, fingerprint)<0) {
+    log_fn(LOG_ERR, "Error computing fingerprint");
+    return -1;
+  }
+
   /* PEM-encode the onion key */
   if(crypto_pk_write_public_key_to_string(router->onion_pkey,
                                           &onion_pkey,&onion_pkeylen)<0) {
@@ -613,6 +620,7 @@
                     "router %s %s %d %d %d\n"
                     "platform %s\n"
                     "published %s\n"
+                    "opt fingerprint %s\n"
                     "opt uptime %ld\n"
                     "bandwidth %d %d %d\n"
                     "onion-key\n%s"
@@ -627,6 +635,7 @@
     router->is_trusted_dir ? router->dir_port : 0,
     router->platform,
     published,
+    fingerprint,
     stats_n_seconds_uptime,
     (int) router->bandwidthrate,
     (int) router->bandwidthburst,