smiley22 / S22.Xmpp

S22.Xmpp is an easy-to-use and well-documented .NET assembly for communicating with an XMPP server. It supports basic Instant Messaging and Presence funtionality as well as a variety of XMPP extensions.
MIT License
54 stars 91 forks source link

Error in authenicating using MD5 #1

Open pgstath opened 10 years ago

pgstath commented 10 years ago

When authentication against a digest-md5 XMPP server, authentication is not successful, a not authenticated message is returned. Configuration ans setup: example.xml simple client, against a Firebird server,

pgstath commented 10 years ago

Resolving the error is quite simple, on the https://github.com/smiley22/S22.Xmpp/blob/master/Core/Sasl/Mechanisms/SaslDigestMd5.cs file, on line 154, we have

string digestUri = "imap/" + fields["realm"];

it should be replaced with

string digestUri = "xmpp/" + fields["realm"];

I can prepare a patch later on

pgstath commented 10 years ago

After changing this the issue is solved

pgstath commented 10 years ago

diff --git a/Core/Sasl/Mechanisms/SaslDigestMd5.cs b/Core/Sasl/Mechanisms/SaslDigestMd5.cs index 536aa36..381e823 100644 --- a/Core/Sasl/Mechanisms/SaslDigestMd5.cs +++ b/Core/Sasl/Mechanisms/SaslDigestMd5.cs @@ -151,7 +151,7 @@ namespace S22.Xmpp.Core.Sasl.Mechanisms { // Parse the challenge-string and construct the "response-value" from it. string decoded = Encoding.ASCII.GetString(challenge); NameValueCollection fields = ParseDigestChallenge(decoded);