summaryrefslogtreecommitdiff
path: root/src/common/tortls.c
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-03-03 16:17:39 -0800
committerRobert Ransom <rransom.8774@gmail.com>2011-03-03 16:17:39 -0800
commit74fc993b98a98f57d257d2150b0a915b47356490 (patch)
treee7b1cbff5778b6efc696a90f203bcfdb7bef71b7 /src/common/tortls.c
parentfe1137be6f0fc01d7dfda568134590ecb5627eb4 (diff)
downloadtor-74fc993b98a98f57d257d2150b0a915b47356490.tar.gz
tor-74fc993b98a98f57d257d2150b0a915b47356490.zip
Check the result of SSL_set_ex_data
Reported by piebeer.
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r--src/common/tortls.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 905ecbb708..01d3e2a314 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1065,7 +1065,14 @@ tor_tls_new(int sock, int isServer)
tor_free(result);
return NULL;
}
- SSL_set_ex_data(result->ssl, tor_tls_object_ex_data_index, result);
+ {
+ int set_worked =
+ SSL_set_ex_data(result->ssl, tor_tls_object_ex_data_index, result);
+ if (!set_worked) {
+ log_warn(LD_BUG,
+ "Couldn't set the tls for an SSL*; connection will fail");
+ }
+ }
SSL_set_bio(result->ssl, bio, bio);
tor_tls_context_incref(context);
result->context = context;