[or-cvs] Fix the periodic bug that would make handshaking fail.

Nick Mathewson nickm at seul.org
Sat Jun 14 01:30:55 UTC 2003


Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv3421/src/common

Modified Files:
	crypto.c 
Log Message:
Fix the periodic bug that would make handshaking fail.

The culprit: sometimes DH_calculate_key returns less than DH_KEY_LEN bytes;
we needed to check the return value.



Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- crypto.c	13 Jun 2003 21:13:37 -0000	1.21
+++ crypto.c	14 Jun 2003 01:30:53 -0000	1.22
@@ -777,7 +777,7 @@
   if (secret_len == -1)
     return -1;
 
-  return 0;
+  return secret_len;
 }
 void crypto_dh_free(crypto_dh_env_t *dh)
 {



More information about the tor-commits mailing list