summaryrefslogtreecommitdiff
path: root/src/openvpn/socks.c
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2016-05-10 17:40:25 +0200
committerAlberto Gonzalez Iniesta <agi@inittab.org>2016-05-10 17:40:25 +0200
commitffca24bed7a03d95585ad02278667abe75d8b272 (patch)
tree336f336401e5166e1009e24a6c8d40b97a97af89 /src/openvpn/socks.c
parent9653b1bffea4e96c1eb7c1814e8bed21fea62321 (diff)
Imported Upstream version 2.3.11upstream/2.3.11
Diffstat (limited to 'src/openvpn/socks.c')
-rw-r--r--src/openvpn/socks.c15
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;