fix 231133 only parse the current response line for auth capapility, not the whole response text, patch by ch.ey@gmx.net, r/sr=me

This commit is contained in:
bienvenu%nventure.com 2004-02-05 19:59:09 +00:00
parent 9d35d88349
commit baa4febec9

View File

@ -677,26 +677,26 @@ PRInt32 nsSmtpProtocol::SendEhloResponse(nsIInputStream * inputStream, PRUint32
} }
else if (responseLine.Compare("AUTH", PR_TRUE, 4) == 0) else if (responseLine.Compare("AUTH", PR_TRUE, 4) == 0)
{ {
if (m_responseText.Find("PLAIN", PR_TRUE, 5) >= 0) if (responseLine.Find("PLAIN", PR_TRUE, 5) >= 0)
SetFlag(SMTP_AUTH_PLAIN_ENABLED); SetFlag(SMTP_AUTH_PLAIN_ENABLED);
if (m_responseText.Find("LOGIN", PR_TRUE, 5) >= 0) if (responseLine.Find("LOGIN", PR_TRUE, 5) >= 0)
SetFlag(SMTP_AUTH_LOGIN_ENABLED); SetFlag(SMTP_AUTH_LOGIN_ENABLED);
if (m_responseText.Find("EXTERNAL", PR_TRUE, 5) >= 0) if (responseLine.Find("EXTERNAL", PR_TRUE, 5) >= 0)
SetFlag(SMTP_AUTH_EXTERNAL_ENABLED); SetFlag(SMTP_AUTH_EXTERNAL_ENABLED);
if(m_prefTrySecAuth) if(m_prefTrySecAuth)
{ {
nsresult rv; nsresult rv;
nsCOMPtr<nsISignatureVerifier> verifier = do_GetService(SIGNATURE_VERIFIER_CONTRACTID, &rv); nsCOMPtr<nsISignatureVerifier> verifier = do_GetService(SIGNATURE_VERIFIER_CONTRACTID, &rv);
// this checks if psm is installed... // this checks if psm is installed...
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
{ {
if (m_responseText.Find("CRAM-MD5", PR_TRUE, 5) >= 0) if (responseLine.Find("CRAM-MD5", PR_TRUE, 5) >= 0)
SetFlag(SMTP_AUTH_CRAM_MD5_ENABLED); SetFlag(SMTP_AUTH_CRAM_MD5_ENABLED);
if (m_responseText.Find("NTLM", PR_TRUE, 5) >= 0) if (responseLine.Find("NTLM", PR_TRUE, 5) >= 0)
SetFlag(SMTP_AUTH_NTLM_ENABLED); SetFlag(SMTP_AUTH_NTLM_ENABLED);
} }
} }