summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-05-13 11:29:33 -0400
committerNick Mathewson <nickm@torproject.org>2015-05-13 11:34:10 -0400
commit34451c7a453564f16194cf060444785fea2f971e (patch)
treeaa8762ef1db10e355dc461ba31f69fde68ce8505 /src
parent22da5001b5c1fbd3230176d389fab12cb86a69bc (diff)
downloadtor-34451c7a453564f16194cf060444785fea2f971e.tar.gz
tor-34451c7a453564f16194cf060444785fea2f971e.zip
Use SSL_state() to inspect the state of SSL objects.
Diffstat (limited to 'src')
-rw-r--r--src/common/tortls.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 6093286637..edb744f33c 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -1682,14 +1682,17 @@ static void
tor_tls_server_info_callback(const SSL *ssl, int type, int val)
{
tor_tls_t *tls;
+ int ssl_state;
(void) val;
tor_tls_debug_state_callback(ssl, type, val);
if (type != SSL_CB_ACCEPT_LOOP)
return;
- if ((ssl->state != SSL3_ST_SW_SRVR_HELLO_A) &&
- (ssl->state != SSL3_ST_SW_SRVR_HELLO_B))
+
+ ssl_state = SSL_state(ssl);
+ if ((ssl_state != SSL3_ST_SW_SRVR_HELLO_A) &&
+ (ssl_state != SSL3_ST_SW_SRVR_HELLO_B))
return;
tls = tor_tls_get_by_ssl(ssl);
@@ -2194,7 +2197,7 @@ tor_tls_handshake(tor_tls_t *tls)
tor_assert(tls->ssl);
tor_assert(tls->state == TOR_TLS_ST_HANDSHAKE);
check_no_tls_errors();
- oldstate = tls->ssl->state;
+ oldstate = SSL_state(tls->ssl);
if (tls->isServer) {
log_debug(LD_HANDSHAKE, "About to call SSL_accept on %p (%s)", tls,
SSL_state_string_long(tls->ssl));
@@ -2204,7 +2207,7 @@ tor_tls_handshake(tor_tls_t *tls)
SSL_state_string_long(tls->ssl));
r = SSL_connect(tls->ssl);
}
- if (oldstate != tls->ssl->state)
+ if (oldstate != SSL_state(tls->ssl))
log_debug(LD_HANDSHAKE, "After call, %p was in state %s",
tls, SSL_state_string_long(tls->ssl));
/* We need to call this here and not earlier, since OpenSSL has a penchant