diff options
Diffstat (limited to 'src/openvpn/socks.c')
-rw-r--r-- | src/openvpn/socks.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/openvpn/socks.c b/src/openvpn/socks.c index 2f051ec..57dc02a 100644 --- a/src/openvpn/socks.c +++ b/src/openvpn/socks.c @@ -105,10 +105,13 @@ socks_username_password_auth (struct socks_proxy_info *p, ssize_t size; creds.defined = 0; - get_user_pass (&creds, p->authfile, UP_TYPE_SOCKS, GET_USER_PASS_MANAGEMENT); + if (!get_user_pass (&creds, p->authfile, UP_TYPE_SOCKS, GET_USER_PASS_MANAGEMENT)) + { + msg (M_NONFATAL, "SOCKS failed to get username/password."); + return false; + } - if( !creds.username || (strlen(creds.username) > 255) - || !creds.password || (strlen(creds.password) > 255) ) { + if( (strlen(creds.username) > 255) || (strlen(creds.password) > 255) ) { msg (M_NONFATAL, "SOCKS username and/or password exceeds 255 characters. " "Authentication not possible."); @@ -133,7 +136,7 @@ socks_username_password_auth (struct socks_proxy_info *p, char c; FD_ZERO (&reads); - FD_SET (sd, &reads); + openvpn_fd_set (sd, &reads); tv.tv_sec = timeout_sec; tv.tv_usec = 0; @@ -212,7 +215,7 @@ socks_handshake (struct socks_proxy_info *p, char c; FD_ZERO (&reads); - FD_SET (sd, &reads); + openvpn_fd_set (sd, &reads); tv.tv_sec = timeout_sec; tv.tv_usec = 0; @@ -318,7 +321,7 @@ recv_socks_reply (socket_descriptor_t sd, char c; FD_ZERO (&reads); - FD_SET (sd, &reads); + openvpn_fd_set (sd, &reads); tv.tv_sec = timeout_sec; tv.tv_usec = 0; |