[tor-commits] [tor/master] If we negotiate authentication, require it.

nickm at torproject.org nickm at torproject.org
Wed Jul 13 16:13:21 UTC 2011


commit 204bce7e3ca0f60cfec1d8be700848309f605abd
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Jun 29 12:16:09 2011 -0400

    If we negotiate authentication, require it.
---
 src/or/buffers.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/or/buffers.c b/src/or/buffers.c
index bbd60c4..7b212a7 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1716,6 +1716,11 @@ parse_socks(const char *data, size_t datalen, socks_request_t *req,
 
         return r;
       }
+      if (req->auth_type != SOCKS_NO_AUTH && !req->got_auth) {
+        log_warn(LD_APP,
+                 "socks5: negotiated authentication, but none provided");
+        return -1;
+      }
       /* we know the method; read in the request */
       log_debug(LD_APP,"socks5: checking request");
       if (datalen < 8) {/* basic info plus >=2 for addr plus 2 for port */





More information about the tor-commits mailing list