Commit 50ef6008 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Do not offer other SASL mechanisms than EXTERNAL to remote servers. JM-794

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4769 b35dd754-fafc-0310-a699-88a17e54d16e
parent ad6a4e8e
...@@ -116,9 +116,12 @@ public class SASLAuthentication { ...@@ -116,9 +116,12 @@ public class SASLAuthentication {
} }
StringBuilder sb = new StringBuilder(195); StringBuilder sb = new StringBuilder(195);
sb.append("<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">"); sb.append("<mechanisms xmlns=\"urn:ietf:params:xml:ns:xmpp-sasl\">");
if (session.getConnection().isSecure() && session instanceof IncomingServerSession) { if (session instanceof IncomingServerSession) {
// Server connections dont follow the same rules as clients // Server connections dont follow the same rules as clients
sb.append("<mechanism>EXTERNAL</mechanism>"); if (session.getConnection().isSecure()) {
// Offer SASL EXTERNAL only if TLS has already been negotiated
sb.append("<mechanism>EXTERNAL</mechanism>");
}
} }
else { else {
for (String mech : getSupportedMechanisms()) { for (String mech : getSupportedMechanisms()) {
......
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