[or-cvs] refactor; start adding debugging logs to midpoint rend stuff

Nick Mathewson nickm at seul.org
Fri Apr 2 23:30:56 UTC 2004


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

Modified Files:
	crypto.c crypto.h util.c util.h 
Log Message:
refactor; start adding debugging logs to midpoint rend stuff

Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- crypto.c	1 Apr 2004 22:10:33 -0000	1.65
+++ crypto.c	2 Apr 2004 23:30:52 -0000	1.66
@@ -1403,8 +1403,6 @@
   return ret;
 }
 
-static const char BASE32_CHARS[] = "abcdefghijklmnopqrstuvwxyz012345";
-
 int
 base32_encode(char *dest, int destlen, const char *src, int srclen)
 {

Index: crypto.h
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- crypto.h	1 Apr 2004 22:10:33 -0000	1.33
+++ crypto.h	2 Apr 2004 23:30:52 -0000	1.34
@@ -77,6 +77,7 @@
 
 int base64_encode(char *dest, int destlen, const char *src, int srclen);
 int base64_decode(char *dest, int destlen, const char *src, int srclen);
+#define BASE32_CHARS "abcdefghijklmnopqrstuvwxyz012345"
 int base32_encode(char *dest, int destlen, const char *src, int srclen);
 
 /* Key negotiation */

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- util.c	31 Mar 2004 03:42:55 -0000	1.74
+++ util.c	2 Apr 2004 23:30:53 -0000	1.75
@@ -109,6 +109,17 @@
 }
 #endif
 
+void hex_encode(const char *from, int fromlen, char *to)
+{
+  const unsigned char *fp = from;
+  static const char TABLE[] = "0123456789abcdef";
+  while (fromlen) {
+    *to++ = TABLE[*fp >> 4];
+    *to++ = TABLE[*fp & 7];
+    ++fp;
+  }
+  *to = '\0';
+}
 
 /*
  * A simple smartlist interface to make an unordered list of acceptable

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- util.h	2 Apr 2004 23:00:59 -0000	1.45
+++ util.h	2 Apr 2004 23:30:53 -0000	1.46
@@ -81,6 +81,8 @@
 #endif
 #endif
 
+void hex_encode(const char *from, int fromlen, char *to);
+
 typedef struct smartlist_t {
   void **list;
   int num_used;



More information about the tor-commits mailing list