[or-cvs] Resolve task 42: find where 19-char nicknames were getting ...

Nick Mathewson nickm at seul.org
Mon Jan 3 17:53:22 UTC 2005


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

Modified Files:
	tortls.c 
Log Message:
Resolve task 42: find where 19-char nicknames were getting truncated when read from certs, and fix it.  Also audit use of MAX_NICKNAME_LEN; no other badness found, but some docs/code cleaned up a touch.

Index: tortls.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- tortls.c	7 Dec 2004 07:47:57 -0000	1.82
+++ tortls.c	3 Jan 2005 17:53:20 -0000	1.83
@@ -586,8 +586,10 @@
   return 1;
 }
 
-/** Return the nickname (if any) that the peer connected on <b>tls</b>
- * claims to have.
+/** Write the nickname (if any) that the peer connected on <b>tls</b>
+ * claims to have into the first <b>buflen</b> characters of <b>buf</b>.
+ * Truncate the nickname if it is longer than buflen-1 characters.  Always
+ * NUL-terminate.  Return 0 on success, -1 on failure.
  */
 int
 tor_tls_get_peer_cert_nickname(tor_tls *tls, char *buf, size_t buflen)



More information about the tor-commits mailing list