X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=cproxy.c;h=934ce3dc228d6f26f5f66d9074e6b11327afd6ca;hb=20aabc3059ad962eccca47166ccbe92ea64f0e02;hp=7efcc234b446d6fbda1e4a5fde34a2d9ce917b0d;hpb=3af7d333401755a7decbb74c23037fc07017002c;p=PuTTY.git diff --git a/cproxy.c b/cproxy.c index 7efcc234..934ce3dc 100644 --- a/cproxy.c +++ b/cproxy.c @@ -130,8 +130,9 @@ 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]); - sk_write(p->sub_socket, outbuf, 20); + conf_get_str(p->conf, CONF_proxy_password), + &outbuf[4]); + sk_write(p->sub_socket, (char *)outbuf, 20); break; case 0x11: /* Chose a protocol */ @@ -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;