diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-01-03 17:53:20 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-01-03 17:53:20 +0000 |
commit | fca7ba977765061731873ef36a32777f0df8ee89 (patch) | |
tree | 1daf736f4f1514112bb85c8aa5be6dfa7745d5a8 /src/common | |
parent | 59504f483157420dc2562e8a750070965a2cdc42 (diff) | |
download | tor-fca7ba977765061731873ef36a32777f0df8ee89.tar tor-fca7ba977765061731873ef36a32777f0df8ee89.tar.gz |
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.
svn:r3244
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/tortls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c index 420b1963f..86cdcec48 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -586,8 +586,10 @@ tor_tls_peer_has_cert(tor_tls *tls) 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) |