]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Treat SW_SERVER_HELLO_B as another sign of an SSL handshake
authorNick Mathewson <nickm@torproject.org>
Tue, 15 May 2012 15:13:49 +0000 (11:13 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 15 May 2012 15:15:43 +0000 (11:15 -0400)
We've been only treating SW_SERVER_HELLO_A as meaning that an SSL
handshake was happening.  But that's not right: if the initial
attempt to write a ServerHello fails, we would get a callback in
state SW_SERVER_HELLO_B instead.

(That's "instead" and not "in addition": any failed attempt to write
the hello will fail and cause the info callback not to get written.)

Fix for bug 4592; bugfix on 0.2.0.13-alpha.

changes/bug4592 [new file with mode: 0644]
src/common/tortls.c

diff --git a/changes/bug4592 b/changes/bug4592
new file mode 100644 (file)
index 0000000..31140b0
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Detect SSL handshake even when the initial attempt to write the
+      server hello fails. Fix for bug 4592; bugfix on 0.2.0.13-alpha.
index 4c9d2188d4b2ef7b0ad476941ea5e3c37b1a7d80..c54ed46f305e5b70a51447371c2fe26b94f53e6e 100644 (file)
@@ -951,7 +951,8 @@ tor_tls_server_info_callback(const SSL *ssl, int type, int val)
   (void) val;
   if (type != SSL_CB_ACCEPT_LOOP)
     return;
-  if (ssl->state != SSL3_ST_SW_SRVR_HELLO_A)
+  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);