From 400cd0a2e84716b4e1065530ba99570b813fb28f Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 27 Feb 2020 12:16:41 +0000 Subject: [PATCH] gsocks5proxy: Fix SOCKS5 username/password authentication It was checking for the main SOCKS5 version number, rather than the subnegotiation version number. The username/password authentication protocol is described in https://tools.ietf.org/html/rfc1929. Spotted and diagnosed by lovetox. Signed-off-by: Philip Withnall Fixes: #1986 --- gio/gsocks5proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/gsocks5proxy.c b/gio/gsocks5proxy.c index 158254428..a6544df33 100644 --- a/gio/gsocks5proxy.c +++ b/gio/gsocks5proxy.c @@ -243,7 +243,7 @@ set_auth_msg (guint8 *msg, static gboolean check_auth_status (const guint8 *data, GError **error) { - if (data[0] != SOCKS5_VERSION + if (data[0] != SOCKS5_AUTH_VERSION || data[1] != SOCKS5_REP_SUCCEEDED) { g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED,