Commit 8804cfd4 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Send a challenge when SASL PLAIN auth packet doesn't include extra info. JM-611

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3643 b35dd754-fafc-0310-a699-88a17e54d16e
parent ff524ed7
...@@ -255,10 +255,21 @@ public class SASLAuthentication { ...@@ -255,10 +255,21 @@ public class SASLAuthentication {
} }
} }
private boolean doPlainAuthentication(Element doc) { private boolean doPlainAuthentication(Element doc)
throws DocumentException, IOException, XmlPullParserException {
String username = ""; String username = "";
String password = ""; String password = "";
String response = doc.getTextTrim(); String response = doc.getTextTrim();
if (response == null || response.length() == 0) {
// No info was provided so send a challenge to get it
sendChallenge(new byte[0]);
// Get the next answer since we are not done yet
doc = reader.parseDocument().getRootElement();
if (doc != null && doc.getTextTrim().length() > 0) {
response = doc.getTextTrim();
}
}
if (response != null && response.length() > 0) { if (response != null && response.length() > 0) {
// Parse data and obtain username & password // Parse data and obtain username & password
String data = StringUtils.decodeBase64(response); String data = StringUtils.decodeBase64(response);
......
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