[or-cvs] r11016: Close immediately after anything but a successful authentica (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Aug 2 01:28:40 UTC 2007


Author: nickm
Date: 2007-08-01 21:28:40 -0400 (Wed, 01 Aug 2007)
New Revision: 11016

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/control.c
Log:
 r13892 at Kushana:  nickm | 2007-08-01 18:27:13 -0700
 Close immediately after anything but a successful authentication attempt on the control port.  Backport candidate.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13892] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-08-01 16:43:44 UTC (rev 11015)
+++ tor/trunk/ChangeLog	2007-08-02 01:28:40 UTC (rev 11016)
@@ -1,4 +1,8 @@
-Changes in version 0.2.0.4-alpha - 2007-??-??
+Changes in version 0.2.0.4-alpha - 2007-08-01
+  o Major security fixes:
+    - Close immediately after missing authentication on control port;
+      do not allow multiple authentication attempts.
+
   o Major bugfixes (compilation):
     - Fix win32 compilation: apparently IN_ADDR and IN6_ADDR are already
       defined there.

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2007-08-01 16:43:44 UTC (rev 11015)
+++ tor/trunk/src/or/control.c	2007-08-02 01:28:40 UTC (rev 11016)
@@ -971,6 +971,7 @@
             "551 Invalid hexadecimal encoding.  Maybe you tried a plain text "
             "password?  If so, the standard requires that you put it in "
             "double quotes.\r\n", conn);
+      connection_mark_for_close(TO_CONN(conn));
       tor_free(password);
       return 0;
     }
@@ -981,6 +982,7 @@
     if (!get_escaped_string(body, len, &password, &password_len)) {
       connection_write_str_to_buf("551 Invalid quoted string.  You need "
             "to put the password in double quotes.\r\n", conn);
+      connection_mark_for_close(TO_CONN(conn));
       return 0;
     }
     used_quoted_string = 1;
@@ -1032,6 +1034,7 @@
     errstr = "Unknown reason.";
   connection_printf_to_buf(conn, "515 Authentication failed: %s\r\n",
                            errstr);
+  connection_mark_for_close(TO_CONN(conn));
   return 0;
  ok:
   log_info(LD_CONTROL, "Authenticated control connection (%d)", conn->_base.s);
@@ -2439,6 +2442,7 @@
   if (conn->_base.state == CONTROL_CONN_STATE_NEEDAUTH &&
       strcasecmp(conn->incoming_cmd, "AUTHENTICATE")) {
     connection_write_str_to_buf("514 Authentication required.\r\n", conn);
+    connection_mark_for_close(TO_CONN(conn));
     conn->incoming_cmd_cur_len = 0;
     goto again;
   }



More information about the tor-commits mailing list