Commit 9b353d49 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed set of challenges and responses for DIGEST-MD5 or CRAM-MD5 mechanisms. JM-567

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3440 b35dd754-fafc-0310-a699-88a17e54d16e
parent 65df021b
...@@ -181,20 +181,22 @@ public class SASLAuthentication { ...@@ -181,20 +181,22 @@ public class SASLAuthentication {
// ok, so I move the complete mark at the begining of RESPONSE. I don't think // ok, so I move the complete mark at the begining of RESPONSE. I don't think
// a success mark is enough. In case of a failed SASL handshake, the success // a success mark is enough. In case of a failed SASL handshake, the success
// mark is false. But the handshake is done anyway. // mark is false. But the handshake is done anyway.
isComplete = true;
if (ss != null) { if (ss != null) {
boolean ssComplete = ss.isComplete();
String response = doc.getTextTrim(); String response = doc.getTextTrim();
try { try {
byte[] data = StringUtils.decodeBase64(response).getBytes(CHARSET); byte[] data = StringUtils.decodeBase64(response).getBytes(CHARSET);
if (data == null) { if (data == null) {
data = new byte[0]; data = new byte[0];
} }
byte[] challenge = ss.evaluateResponse(data);
if (ss.isComplete()) { if (ssComplete) {
authenticationSuccessful(ss.getAuthorizationID()); authenticationSuccessful(ss.getAuthorizationID());
success = true; success = true;
isComplete = true;
} }
else { else {
byte[] challenge = ss.evaluateResponse(data);
// Send the challenge // Send the challenge
sendChallenge(challenge); sendChallenge(challenge);
} }
...@@ -205,6 +207,7 @@ public class SASLAuthentication { ...@@ -205,6 +207,7 @@ public class SASLAuthentication {
} }
} }
else { else {
isComplete = true;
Log.fatal("SaslServer is null, should be valid object instead."); Log.fatal("SaslServer is null, should be valid object instead.");
authenticationFailed(); authenticationFailed();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment