diff options
author | rofl0r <retnyg@gmx.net> | 2018-05-29 19:17:41 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2018-05-29 21:59:11 +0200 |
commit | c651664720d1fc21aeb36ca8dbb625a874af1d97 (patch) | |
tree | 80aff1bdb146a4817b6bce982b59341c2a68ec5f /src/reqs.c | |
parent | 0aad2f5b92c7690a25f849ffa0f7a41ee8b5ff46 (diff) |
fix socks5 upstream user/pass subnegotiation check
RFC 1929 specifies that the user/pass auth subnegotation repurposes the version
field for the version of that specification, which is 1, not 5.
however there's quite a good deal of software out there which got it wrong and
replies with version 5 to a successful authentication, so let's just accept both
forms - other socks5 client programs like curl do the same.
closes #172
Diffstat (limited to 'src/reqs.c')
-rw-r--r-- | src/reqs.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1350,7 +1350,7 @@ connect_to_upstream_proxy(struct conn_s *connptr, struct request_s *request) if(2 != safe_read(connptr->server_fd, in, 2)) return -1; - if(in[0] != 5 || in[1] != 0) { + if(in[1] != 0 || !(in[0] == 5 || in[0] == 1)) { return -1; } } |