diff options
author | Steve Holme <steve_holme@hotmail.com> | 2012-05-31 22:58:07 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2012-05-31 22:58:07 +0100 |
commit | cb3d0ce2cb5097d906c9e7b9d5bb1de2eb4bbb93 (patch) | |
tree | f1ef1080a9a5707e52d05f0f3f6d99d1f4f4427c /lib | |
parent | f86432b119a73cef751c9d217b73bc63aed2b5d7 (diff) |
smtp.c: Reworked message encoding in smtp_state_authpasswd_resp()
Rather than encoding the password message itself the
smtp_state_authpasswd_resp() function now delegates the work to the same
function that smtp_state_authlogin_resp() and smtp_authenticate() use
when constructing the encoded user name.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/smtp.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index d2b02bd62..f202fd6a7 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -708,7 +708,6 @@ static CURLcode smtp_state_authpasswd_resp(struct connectdata *conn, { CURLcode result = CURLE_OK; struct SessionHandle *data = conn->data; - size_t plen; size_t len = 0; char *authpasswd = NULL; @@ -719,22 +718,16 @@ static CURLcode smtp_state_authpasswd_resp(struct connectdata *conn, result = CURLE_LOGIN_DENIED; } else { - plen = strlen(conn->passwd); + result = smtp_auth_login(conn, conn->passwd, &authpasswd, &len); - if(!plen) - result = Curl_pp_sendf(&conn->proto.smtpc.pp, "="); - else { - result = Curl_base64_encode(data, conn->passwd, plen, &authpasswd, &len); - - if(!result) { - if(authpasswd) { - result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authpasswd); + if(!result) { + if(authpasswd) { + result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authpasswd); - if(!result) - state(conn, SMTP_AUTH); - } - Curl_safefree(authpasswd); + if(!result) + state(conn, SMTP_AUTH); } + Curl_safefree(authpasswd); } } |