From dd7602bbecb753d302105b7e38bafa222975e11d Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 21 Sep 2005 13:27:22 +0000 Subject: [PATCH] fixed off-by-one error in DIGEST-MD5 authentication mechachnism which caused failure with some servers git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14218 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp index 835115e36e..84ebb350ab 100644 --- a/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp +++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp @@ -584,7 +584,7 @@ SMTPProtocol::Login(const char *_login, const char *password) char temp[33]; for( int i=0; i<32; ++i) temp[i] = 1+(rand()%254); - temp[33] = '\0'; + temp[32] = '\0'; BString rawCnonce(temp); BString cnonce; char* cnoncePtr = cnonce.LockBuffer(rawCnonce.Length()*2); @@ -611,7 +611,6 @@ SMTPProtocol::Login(const char *_login, const char *password) MD5Digest(hex_digest, (unsigned char*)kd.String(), kd.Length()); rawResponse << ",response=" << hex_digest; - rawResponse << ",charset=utf-8"; BString postResponse; char *resp = postResponse.LockBuffer(rawResponse.Length() * 2 + 10); baselen = ::encode_base64(resp, rawResponse.String(), rawResponse.Length(), true /* headerMode */);