summaryrefslogtreecommitdiff
path: root/src/common/tortls.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-11-17 11:55:52 -0500
committerNick Mathewson <nickm@torproject.org>2017-11-17 12:01:30 -0500
commit2f086888b14be3998421b29bfc81d037b8073202 (patch)
tree93184bf0a071011fb3aa01dfb9cdf11e365fe172 /src/common/tortls.h
parent94db8f32e46925c3a64def751e5d2efbddbdf417 (diff)
downloadtor-2f086888b14be3998421b29bfc81d037b8073202.tar.gz
tor-2f086888b14be3998421b29bfc81d037b8073202.zip
Make all the crypto free() functions macros that clear their targets
Diffstat (limited to 'src/common/tortls.h')
-rw-r--r--src/common/tortls.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tortls.h b/src/common/tortls.h
index 6145f7dbc9..b293ce20e4 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -216,7 +216,8 @@ void tor_tls_set_renegotiate_callback(tor_tls_t *tls,
void (*cb)(tor_tls_t *, void *arg),
void *arg);
int tor_tls_is_server(tor_tls_t *tls);
-void tor_tls_free(tor_tls_t *tls);
+void tor_tls_free_(tor_tls_t *tls);
+#define tor_tls_free(tls) FREE_AND_NULL(tor_tls, (tls))
int tor_tls_peer_has_cert(tor_tls_t *tls);
MOCK_DECL(tor_x509_cert_t *,tor_tls_get_peer_cert,(tor_tls_t *tls));
MOCK_DECL(tor_x509_cert_t *,tor_tls_get_own_cert,(tor_tls_t *tls));
@@ -263,7 +264,8 @@ void check_no_tls_errors_(const char *fname, int line);
void tor_tls_log_one_error(tor_tls_t *tls, unsigned long err,
int severity, int domain, const char *doing);
-void tor_x509_cert_free(tor_x509_cert_t *cert);
+void tor_x509_cert_free_(tor_x509_cert_t *cert);
+#define tor_x509_cert_free(c) FREE_AND_NULL(tor_x509_cert, (c))
tor_x509_cert_t *tor_x509_cert_decode(const uint8_t *certificate,
size_t certificate_len);
void tor_x509_cert_get_der(const tor_x509_cert_t *cert,