[tor-commits] [tor/maint-0.2.4] Prefer SOCKS_USER_PASS over SOCKS_NO_AUTH

nickm at torproject.org nickm at torproject.org
Thu Apr 11 05:40:12 UTC 2013


commit a264c4fedab87ce7c8cbb94632657a90e95e7a4e
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Mar 20 15:37:47 2013 -0400

    Prefer SOCKS_USER_PASS over SOCKS_NO_AUTH
---
 src/or/buffers.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/or/buffers.c b/src/or/buffers.c
index ad5ab83..4554a02 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1783,19 +1783,19 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
           return -1;
         req->replylen = 2; /* 2 bytes of response */
         req->reply[0] = 5; /* socks5 reply */
-        if (memchr(data+2, SOCKS_NO_AUTH, nummethods)) {
-          req->reply[1] = SOCKS_NO_AUTH; /* tell client to use "none" auth
-                                            method */
-          req->socks_version = 5; /* remember we've already negotiated auth */
-          log_debug(LD_APP,"socks5: accepted method 0 (no authentication)");
-          r=0;
-        } else if (memchr(data+2, SOCKS_USER_PASS, nummethods)) {
+        if (memchr(data+2, SOCKS_USER_PASS, nummethods)) {
           req->auth_type = SOCKS_USER_PASS;
           req->reply[1] = SOCKS_USER_PASS; /* tell client to use "user/pass"
                                               auth method */
           req->socks_version = 5; /* remember we've already negotiated auth */
           log_debug(LD_APP,"socks5: accepted method 2 (username/password)");
           r=0;
+        } else if (memchr(data+2, SOCKS_NO_AUTH, nummethods)) {
+          req->reply[1] = SOCKS_NO_AUTH; /* tell client to use "none" auth
+                                            method */
+          req->socks_version = 5; /* remember we've already negotiated auth */
+          log_debug(LD_APP,"socks5: accepted method 0 (no authentication)");
+          r=0;
         } else {
           log_warn(LD_APP,
                     "socks5: offered methods don't include 'no auth' or "





More information about the tor-commits mailing list