diff options
author | Philip Withnall <withnall@endlessm.com> | 2020-02-27 12:16:41 +0000 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2020-03-10 15:22:29 +0000 |
commit | eab5d7b133ee47e04bb56725a8bfc1437bed3726 (patch) | |
tree | f46034061897b816e576fa69fc7b7b0ed00fbb68 | |
parent | 5e280256505b1fc5a48b8081845f1556b5f45518 (diff) | |
download | glib-eab5d7b133ee47e04bb56725a8bfc1437bed3726.tar.gz |
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 <withnall@endlessm.com>
Fixes: #1986
-rw-r--r-- | gio/gsocks5proxy.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |