[glib/glib-2-62: 2/3] gsocks5proxy: Fix SOCKS5 username/password authentication



commit eab5d7b133ee47e04bb56725a8bfc1437bed3726
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Feb 27 12:16:41 2020 +0000

    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

 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]