64c64 < void base64_encode(char *s, char *d) --- > void base64_encode(unsigned char *s, unsigned char *d, int size) 66a67 > unsigned char *p; 68c69 < pad = 3 - strlen(s) % 3; --- > pad = 3 - strlen((char *) s) % 3; 70a72 > p = d; 86a89,90 > if (d - p >= size - 3) > return; 92a97,106 > void do_crypt(char *s, char *d, int size) > { > #ifdef HAVE_CRYPT > strlcpy(d, crypt(s, "el"), size); > #else > base64_encode((unsigned char *) s, (unsigned char *) d, size); > #endif > } > > 382c396 < char str[256], *ph, *ps; --- > char str[256], encrypted_passwd[32], *ph, *ps; 422,423c436,437 < base64_encode(passwd, str); < sprintf(request + strlen(request), "wpwd=%s;", str); --- > do_crypt(passwd, encrypted_passwd, sizeof(encrypted_passwd) ); > sprintf(request + strlen(request), "wpwd=%s;", encrypted_passwd); 439,440c453,454 < base64_encode(upwd, str); < sprintf(request + strlen(request), "upwd=%s;", str); --- > do_crypt(upwd, encrypted_passwd, sizeof(encrypted_passwd) ); > sprintf(request + strlen(request), "upwd=%s;", encrypted_passwd); 628c642 < char host_name[256], boundary[80], str[80], *p, *old_encoding; --- > char host_name[256], boundary[80], str[80], encrypted_passwd[32], *p, *old_encoding; 801c815 < base64_encode(upwd, str); --- > do_crypt(upwd, encrypted_passwd, sizeof(encrypted_passwd) ); 803c817 < "%s\r\nContent-Disposition: form-data; name=\"upwd\"\r\n\r\n%s\r\n", boundary, str); --- > "%s\r\nContent-Disposition: form-data; name=\"upwd\"\r\n\r\n%s\r\n", boundary, encrypted_passwd); 885,886c899,900 < base64_encode(passwd, str); < sprintf(request + strlen(request), "Cookie: wpwd=%s\r\n", str); --- > do_crypt(passwd, encrypted_passwd, sizeof(encrypted_passwd) ); > sprintf(request + strlen(request), "Cookie: wpwd=%s\r\n", encrypted_passwd);