summaryrefslogtreecommitdiffhomepage
path: root/src/reqs.c
diff options
context:
space:
mode:
authorrofl0r <retnyg@gmx.net>2018-05-29 19:17:41 +0100
committerMichael Adam <obnox@samba.org>2018-05-29 21:59:11 +0200
commitc651664720d1fc21aeb36ca8dbb625a874af1d97 (patch)
tree80aff1bdb146a4817b6bce982b59341c2a68ec5f /src/reqs.c
parent0aad2f5b92c7690a25f849ffa0f7a41ee8b5ff46 (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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reqs.c b/src/reqs.c
index 202f77f..bbdcc74 100644
--- a/src/reqs.c
+++ b/src/reqs.c
@@ -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;
}
}