summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-09-17 00:42:41 -0400
committerNick Mathewson <nickm@torproject.org>2009-09-17 00:42:41 -0400
commit4b10ba484b7ca0d04293112a2c6c3c2f4ac72ebd (patch)
tree0b80d60592050f5540225e34508f11e435a6df8a
parentcb78602379c336f40cf4e880d45ba4e766fb8c31 (diff)
parent9c38941195309c3d9a8620536f7f7246c780b9c7 (diff)
downloadtor-4b10ba484b7ca0d04293112a2c6c3c2f4ac72ebd.tar.gz
tor-4b10ba484b7ca0d04293112a2c6c3c2f4ac72ebd.zip
Merge commit 'origin/maint-0.2.1'
-rw-r--r--ChangeLog3
-rw-r--r--src/common/tortls.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2510257424..72c9dfd55f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -170,6 +170,9 @@ Changes in version 0.2.1.20 - 2009-??-??
- Avoid segfault in rare cases when finishing an introduction circuit
as a client and finding out that we don't have an introduction key
for it. Fixes bug 1073. Reported by Aaron Swartz.
+ - Work around a small memory leak in some versions of OpenSSL that
+ stopped the memory used by the hostname TLS extension from being
+ freed.
o Minor features:
- Add a "getinfo status/accepted-server-descriptor" controller
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 541cdb6403..a43c4ea0a3 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -828,6 +828,9 @@ tor_tls_new(int sock, int isServer)
if (!SSL_set_cipher_list(result->ssl,
isServer ? SERVER_CIPHER_LIST : CLIENT_CIPHER_LIST)) {
tls_log_errors(NULL, LOG_WARN, "setting ciphers");
+#ifdef SSL_set_tlsext_host_name
+ SSL_set_tlsext_host_name(result->ssl, NULL);
+#endif
SSL_free(result->ssl);
tor_free(result);
return NULL;
@@ -838,6 +841,9 @@ tor_tls_new(int sock, int isServer)
bio = BIO_new_socket(sock, BIO_NOCLOSE);
if (! bio) {
tls_log_errors(NULL, LOG_WARN, "opening BIO");
+#ifdef SSL_set_tlsext_host_name
+ SSL_set_tlsext_host_name(result->ssl, NULL);
+#endif
SSL_free(result->ssl);
tor_free(result);
return NULL;
@@ -918,6 +924,9 @@ tor_tls_free(tor_tls_t *tls)
if (!removed) {
log_warn(LD_BUG, "Freeing a TLS that was not in the ssl->tls map.");
}
+#ifdef SSL_set_tlsext_host_name
+ SSL_set_tlsext_host_name(tls->ssl, NULL);
+#endif
SSL_free(tls->ssl);
tls->ssl = NULL;
tls->negotiated_callback = NULL;