mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 23:46:15 +01:00
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
This commit is contained in:
parent
67610c7c0f
commit
423b2bbc95
@ -229,7 +229,7 @@ set_auth_msg (guint8 *msg,
|
|||||||
static gboolean
|
static gboolean
|
||||||
check_auth_status (const guint8 *data, GError **error)
|
check_auth_status (const guint8 *data, GError **error)
|
||||||
{
|
{
|
||||||
if (data[0] != SOCKS5_VERSION
|
if (data[0] != SOCKS5_AUTH_VERSION
|
||||||
|| data[1] != SOCKS5_REP_SUCCEEDED)
|
|| data[1] != SOCKS5_REP_SUCCEEDED)
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED,
|
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_PROXY_AUTH_FAILED,
|
||||||
|
Loading…
Reference in New Issue
Block a user