[or-cvs] start generating version 1 style introduce cells

Roger Dingledine arma at seul.org
Thu Jan 13 20:21:14 UTC 2005


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

Modified Files:
	rendmid.c rendclient.c rendservice.c 
Log Message:
start generating version 1 style introduce cells


Index: rendmid.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendmid.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- rendmid.c	1 Dec 2004 03:48:13 -0000	1.34
+++ rendmid.c	13 Jan 2005 20:21:11 -0000	1.35
@@ -123,8 +123,7 @@
     goto err;
   }
 
-/* change MAX_NICKNAME_LEN to MAX_HEX_NICKNAME_LEN when 0.0.8.1 and
- * 0.0.9pre3-4 are obsolete. */
+  /* change to MAX_HEX_NICKNAME_LEN once 0.0.9.x is obsolete */
   if (request_len < (DIGEST_LEN+(MAX_NICKNAME_LEN+1)+REND_COOKIE_LEN+
                      DH_KEY_LEN+CIPHER_KEY_LEN+PKCS1_OAEP_PADDING_OVERHEAD)) {
     log_fn(LOG_WARN,

Index: rendclient.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendclient.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- rendclient.c	3 Jan 2005 20:51:24 -0000	1.72
+++ rendclient.c	13 Jan 2005 20:21:11 -0000	1.73
@@ -93,20 +93,11 @@
   }
 
   /* write the remaining items into tmp */
-#if 0 /* switch over when 0.0.9pre4 is obsolete */
   tmp[0] = 1; /* version 1 of the cell format */
   strncpy(tmp+1, rendcirc->build_state->chosen_exit_name, (MAX_HEX_NICKNAME_LEN+1)); /* nul pads */
   memcpy(tmp+1+MAX_HEX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN);
-#else
-  strncpy(tmp, rendcirc->build_state->chosen_exit_name, (MAX_NICKNAME_LEN+1)); /* nul pads */
-  memcpy(tmp+MAX_NICKNAME_LEN+1, rendcirc->rend_cookie, REND_COOKIE_LEN);
-#endif
   if (crypto_dh_get_public(cpath->handshake_state,
-#if 0
                            tmp+1+MAX_HEX_NICKNAME_LEN+1+REND_COOKIE_LEN,
-#else
-                           tmp+MAX_NICKNAME_LEN+1+REND_COOKIE_LEN,
-#endif
                            DH_KEY_LEN)<0) {
     log_fn(LOG_WARN, "Couldn't extract g^x");
     goto err;
@@ -115,11 +106,7 @@
   /*XXX maybe give crypto_pk_public_hybrid_encrypt a max_len arg,
    * to avoid buffer overflows? */
   r = crypto_pk_public_hybrid_encrypt(entry->parsed->pk, payload+DIGEST_LEN, tmp,
-#if 0
                            1+MAX_HEX_NICKNAME_LEN+1+REND_COOKIE_LEN+DH_KEY_LEN,
-#else
-                           MAX_NICKNAME_LEN+1+REND_COOKIE_LEN+DH_KEY_LEN,
-#endif
                                       PK_PKCS1_OAEP_PADDING, 0);
   if (r<0) {
     log_fn(LOG_WARN,"hybrid pk encrypt failed.");

Index: rendservice.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendservice.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- rendservice.c	12 Jan 2005 04:58:23 -0000	1.112
+++ rendservice.c	13 Jan 2005 20:21:11 -0000	1.113
@@ -422,8 +422,7 @@
     rp_nickname = buf;
     version = 0;
   }
-  /* XXX when 0.0.8.1 and 0.0.9pre3-4 are obsolete, change this to
-   * reject version != 1. */
+  /* XXX when 0.0.9.x is obsolete, change this to reject version != 1. */
   ptr=memchr(rp_nickname,0,nickname_field_len);
   if (!ptr || ptr == rp_nickname) {
     log_fn(LOG_WARN, "Couldn't find a null-padded nickname in INTRODUCE2 cell");



More information about the tor-commits mailing list