Ticket #8117: 8117_023_v2.patch

File 8117_023_v2.patch, 1.6 KB (added by nickm, 7 years ago)

patch for 8117 against maint-0.2.3. needs testing

  • src/or/buffers.c

    diff --git a/src/or/buffers.c b/src/or/buffers.c
    index ad5ab83..4554a02 100644
    a b parse_socks(const char *data, size_t datalen, socks_request_t *req, 
    17831783          return -1;
    17841784        req->replylen = 2; /* 2 bytes of response */
    17851785        req->reply[0] = 5; /* socks5 reply */
    1786         if (memchr(data+2, SOCKS_NO_AUTH, nummethods)) {
    1787           req->reply[1] = SOCKS_NO_AUTH; /* tell client to use "none" auth
    1788                                             method */
    1789           req->socks_version = 5; /* remember we've already negotiated auth */
    1790           log_debug(LD_APP,"socks5: accepted method 0 (no authentication)");
    1791           r=0;
    1792         } else if (memchr(data+2, SOCKS_USER_PASS, nummethods)) {
     1786        if (memchr(data+2, SOCKS_USER_PASS, nummethods)) {
    17931787          req->auth_type = SOCKS_USER_PASS;
    17941788          req->reply[1] = SOCKS_USER_PASS; /* tell client to use "user/pass"
    17951789                                              auth method */
    17961790          req->socks_version = 5; /* remember we've already negotiated auth */
    17971791          log_debug(LD_APP,"socks5: accepted method 2 (username/password)");
    17981792          r=0;
     1793        } else if (memchr(data+2, SOCKS_NO_AUTH, nummethods)) {
     1794          req->reply[1] = SOCKS_NO_AUTH; /* tell client to use "none" auth
     1795                                            method */
     1796          req->socks_version = 5; /* remember we've already negotiated auth */
     1797          log_debug(LD_APP,"socks5: accepted method 0 (no authentication)");
     1798          r=0;
    17991799        } else {
    18001800          log_warn(LD_APP,
    18011801                    "socks5: offered methods don't include 'no auth' or "