S22.Xmpp icon indicating copy to clipboard operation
S22.Xmpp copied to clipboard

Error in authenicating using MD5

Open pgstath opened this issue 11 years ago • 3 comments

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 avatar May 09 '14 12:05 pgstath

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 avatar May 09 '14 12:05 pgstath

After changing this the issue is solved

pgstath avatar May 09 '14 12:05 pgstath

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);

  •       string digestUri = "imap/" + fields["realm"];
    
  •        string digestUri = "xmpp/" + fields["realm"];
        string responseValue = ComputeDigestResponseValue(fields, Cnonce, digestUri,
            Username, Password);
    

pgstath avatar May 09 '14 12:05 pgstath