aboutsummaryrefslogtreecommitdiff
path: root/tools/plink/cproxy.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-24 16:52:31 +0100
committermarha <marha@users.sourceforge.net>2012-01-24 16:52:31 +0100
commitdce7b34b9f70d28161082e6187c5cb6ea4079060 (patch)
treeb3b63b028dfc4e4853f71339390eea6fb3f6cc24 /tools/plink/cproxy.c
parent6ba4c534507676abe7d7ac415cb113cd40953925 (diff)
parent6039fd0faf73c9d6c5b2abf9d824734218ec5eee (diff)
downloadvcxsrv-dce7b34b9f70d28161082e6187c5cb6ea4079060.tar.gz
vcxsrv-dce7b34b9f70d28161082e6187c5cb6ea4079060.tar.bz2
vcxsrv-dce7b34b9f70d28161082e6187c5cb6ea4079060.zip
Merge remote-tracking branch 'origin/released'
Conflicts: tools/plink/sshbn.c
Diffstat (limited to 'tools/plink/cproxy.c')
-rw-r--r--tools/plink/cproxy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/plink/cproxy.c b/tools/plink/cproxy.c
index 5537fca80..d5049af3a 100644
--- a/tools/plink/cproxy.c
+++ b/tools/plink/cproxy.c
@@ -130,7 +130,8 @@ int proxy_socks5_handlechap (Proxy_Socket p)
outbuf[2] = 0x04; /* Response */
outbuf[3] = 0x10; /* Length */
hmacmd5_chap(data, p->chap_current_datalen,
- p->cfg.proxy_password, &outbuf[4]);
+ conf_get_str(p->conf, CONF_proxy_password),
+ &outbuf[4]);
sk_write(p->sub_socket, (char *)outbuf, 20);
break;
case 0x11:
@@ -159,7 +160,9 @@ int proxy_socks5_handlechap (Proxy_Socket p)
int proxy_socks5_selectchap(Proxy_Socket p)
{
- if (p->cfg.proxy_username[0] || p->cfg.proxy_password[0]) {
+ char *username = conf_get_str(p->conf, CONF_proxy_username);
+ char *password = conf_get_str(p->conf, CONF_proxy_password);
+ if (username[0] || password[0]) {
char chapbuf[514];
int ulen;
chapbuf[0] = '\x01'; /* Version */
@@ -169,11 +172,11 @@ int proxy_socks5_selectchap(Proxy_Socket p)
chapbuf[4] = '\x85'; /* ...and it's HMAC-MD5, the core one */
chapbuf[5] = '\x02'; /* Second attribute - username */
- ulen = strlen(p->cfg.proxy_username);
+ ulen = strlen(username);
if (ulen > 255) ulen = 255; if (ulen < 1) ulen = 1;
chapbuf[6] = ulen;
- memcpy(chapbuf+7, p->cfg.proxy_username, ulen);
+ memcpy(chapbuf+7, username, ulen);
sk_write(p->sub_socket, chapbuf, ulen + 7);
p->chap_num_attributes = 0;