Commit d6193a0d authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed sequence of stream headers after TLS was negotiated. JM-997

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@7446 b35dd754-fafc-0310-a699-88a17e54d16e
parent aa9fb866
......@@ -42,6 +42,9 @@ public abstract class StanzaHandler {
// DANIELE: Indicate if a session is already created
private boolean sessionCreated = false;
// Flag that indicates that the client requested to use TLS and TLS has been negotiated. Once the
// client sent a new initial stream header the value will return to false.
private boolean startedTLS = false;
// Flag that indicates that the client requested to be authenticated. Once the
// authentication process is over the value will return to false.
private boolean startedSASL = false;
......@@ -94,6 +97,9 @@ public abstract class StanzaHandler {
MXParser parser = reader.getXPPParser();
parser.setInput(new StringReader(stanza));
createSession(parser);
} else if (startedTLS) {
startedTLS = false;
tlsNegotiated();
} else if (startedSASL && saslStatus == SASLAuthentication.Status.authenticated) {
startedSASL = false;
saslSuccessful();
......@@ -123,7 +129,7 @@ public abstract class StanzaHandler {
if ("starttls".equals(tag)) {
// Negotiate TLS
if (negotiateTLS()) {
tlsNegotiated();
startedTLS= true;
} else {
connection.close();
session = null;
......
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