[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r14096: Forward-port bug 622 fix as diagnosed by lodger. (in tor/trunk: . src/common)



Author: nickm
Date: 2008-03-18 10:53:41 -0400 (Tue, 18 Mar 2008)
New Revision: 14096

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/common/tortls.c
Log:
 r18919@catbus:  nickm | 2008-03-18 10:53:38 -0400
 Forward-port bug 622 fix as diagnosed by lodger.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r18919] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-03-18 14:48:30 UTC (rev 14095)
+++ tor/trunk/ChangeLog	2008-03-18 14:53:41 UTC (rev 14096)
@@ -28,6 +28,9 @@
   o Major bugfixes:
     - Make sure servers always request certificates from clients during
       TLS renegotiation. Reported by lodger; bugfix on 0.2.0.20-rc.
+    - Do not enter a CPU-eating loop when a connection is closed in the middle
+      of client-side TLS renegotiation.  Fixes bug 622.  Bug diagnosed by
+      lodger.
 
   o Minor bugfixes (on 0.1.2.x):
     - Generate "STATUS_SERVER" events rather than misspelled

Modified: tor/trunk/src/common/tortls.c
===================================================================
--- tor/trunk/src/common/tortls.c	2008-03-18 14:48:30 UTC (rev 14095)
+++ tor/trunk/src/common/tortls.c	2008-03-18 14:53:41 UTC (rev 14096)
@@ -992,8 +992,7 @@
   if (tls->state != TOR_TLS_ST_RENEGOTIATE) {
     int r = SSL_renegotiate(tls->ssl);
     if (r <= 0) {
-      return tor_tls_get_error(tls, r, CATCH_SYSCALL|CATCH_ZERO,
-                               "renegotiating", LOG_WARN);
+      return tor_tls_get_error(tls, r, 0, "renegotiating", LOG_WARN);
     }
     tls->state = TOR_TLS_ST_RENEGOTIATE;
   }
@@ -1002,8 +1001,7 @@
     tls->state = TOR_TLS_ST_OPEN;
     return TOR_TLS_DONE;
   } else
-    return tor_tls_get_error(tls, r, CATCH_SYSCALL|CATCH_ZERO,
-                             "renegotiating handshake", LOG_INFO);
+    return tor_tls_get_error(tls, r, 0, "renegotiating handshake", LOG_INFO);
 }
 
 /** Shut down an open tls connection <b>tls</b>.  When finished, returns