summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-06-05 09:42:02 -0400
committerNick Mathewson <nickm@torproject.org>2017-06-05 15:27:33 -0400
commitec84fc1d8ecb56fde887eb01d3bca1a031bd1e89 (patch)
tree7b814e5e6b3013da1d7ec3807c5ca9fe846b6d84
parent01878fa3095a949575d922da6fc8342eeaad2afb (diff)
downloadtor-ec84fc1d8ecb56fde887eb01d3bca1a031bd1e89.tar.gz
tor-ec84fc1d8ecb56fde887eb01d3bca1a031bd1e89.zip
Improve documentation on get_{peer,own}_certificate()
Make it clear that we're returning a newly allocated copy.
-rw-r--r--src/common/tortls.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 1661b7ef53..d61cc2e58a 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -2018,7 +2018,8 @@ tor_tls_peer_has_cert(tor_tls_t *tls)
return 1;
}
-/** Return the peer certificate, or NULL if there isn't one. */
+/** Return a newly allocated copy of the peer certificate, or NULL if there
+ * isn't one. */
MOCK_IMPL(tor_x509_cert_t *,
tor_tls_get_peer_cert,(tor_tls_t *tls))
{
@@ -2030,8 +2031,8 @@ tor_tls_get_peer_cert,(tor_tls_t *tls))
return tor_x509_cert_new(cert);
}
-/** Return the cerficate we used on the connection, or NULL if somehow
- * we didn't use one. */
+/** Return a newly allocated copy of the cerficate we used on the connection,
+ * or NULL if somehow we didn't use one. */
MOCK_IMPL(tor_x509_cert_t *,
tor_tls_get_own_cert,(tor_tls_t *tls))
{