aboutsummaryrefslogtreecommitdiff
path: root/src/lib/tls/tortls_nss.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-23 10:13:32 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-04 14:52:35 -0400
commit52d5f4da12cf4a9647a896395209121cbf9483c4 (patch)
treee51464ec07f43c6fe37ccf1aeb6cf25bf641892c /src/lib/tls/tortls_nss.c
parentdd04fc35c665976f9fc9ff586cbf7fe34d9cc241 (diff)
downloadtor-52d5f4da12cf4a9647a896395209121cbf9483c4.tar.gz
tor-52d5f4da12cf4a9647a896395209121cbf9483c4.zip
Avoid spurious error logs when using NSS
The tls_log_errors() function now behaves differently for NSS than it did for OpenSSL, so we need to tweak it a bit.
Diffstat (limited to 'src/lib/tls/tortls_nss.c')
-rw-r--r--src/lib/tls/tortls_nss.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/tls/tortls_nss.c b/src/lib/tls/tortls_nss.c
index 671c018471..40a98dd87e 100644
--- a/src/lib/tls/tortls_nss.c
+++ b/src/lib/tls/tortls_nss.c
@@ -323,8 +323,10 @@ void
tls_log_errors(tor_tls_t *tls, int severity, int domain,
const char *doing)
{
- /* XXXX This implementation isn't right for NSS -- it logs the last error
- whether anything actually failed or not. */
+ /* This implementation is a little different for NSS than it is for OpenSSL
+ -- it logs the last error whether anything actually failed or not. So we
+ have to only call it when something has gone wrong and we have a real
+ error to report. */
(void)tls;
PRErrorCode code = PORT_GetError();