Socks5: handle truncated client requests correctly
commitc4fe66e342292b45f29e9fd242b66a0ca27a7758
authorNick Mathewson <nickm@torproject.org>
Mon, 14 Dec 2020 15:14:03 +0000 (14 10:14 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 14 Dec 2020 15:14:03 +0000 (14 10:14 -0500)
tree7fe88b96244cd7618c3b5fafff1f54d1aa54e88f
parentfcae26adf710cf1fe393fde723e9a2caf6012b09
Socks5: handle truncated client requests correctly

Previously, our code would send back an error if the socks5 request
parser said anything but DONE.  But there are other non-error cases,
like TRUNCATED: we shouldn't send back errors for them.

This patch lowers the responsibility for setting the error message
into the parsing code, since the actual type of the error message
will depend on what problem was encountered.

Fixes bug 40190; bugfix on 0.3.5.1-alpha.
changes/bug40190 [new file with mode: 0644]
src/core/proto/proto_socks.c