* chlg64 [in] - Pointer to the input buffer.
* userp [in] - The user name.
* passdwp [in] - The user's password.
+ * service [in] - The service type such as www, smtp or pop
* outptr [in/out] - The address where a pointer to newly allocated memory
* holding the result will be stored upon completion.
* outlen [out] - The length of the output message.
const char* chlg64,
const char* userp,
const char* passwdp,
+ const char* service,
char **outptr, size_t *outlen)
{
static const char table16[] = "0123456789abcdef";
char cnonce[] = "12345678"; /* will be changed */
char method[] = "AUTHENTICATE";
char qop[] = "auth";
- char uri[128] = "smtp/";
+ char uri[128];
char response[512];
result = Curl_base64_decode(chlg64, &chlg, &chlglen);
for(i = 0; i < MD5_DIGEST_LEN; i++)
snprintf(&HA1_hex[2 * i], 3, "%02x", digest[i]);
- /* Orepare URL string, append realm to the protocol */
+ /* Prepare the URL string */
+ strcpy(uri, service);
+ strcat(uri, "/");
strcat(uri, realm);
/* Calculate H(A2) */
;
result = Curl_sasl_create_digest_md5_message(data, chlg64, conn->user,
- conn->passwd, &rplyb64, &len);
+ conn->passwd, "smtp",
+ &rplyb64, &len);
if(!result) {
if(rplyb64) {