From 435d1ef5bd8bcde9ed8f757edb4dbff2052e8fd1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 5 Nov 2017 16:21:59 +0100 Subject: [PATCH] SASL: don't prefer PLAIN auth over DIGEST-MD5 for nimbuzz.com --- .../siacs/conversations/ui/widget/ZeroWidthSpan.java | 10 ++++++++++ .../eu/siacs/conversations/xmpp/XmppConnection.java | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/main/java/eu/siacs/conversations/ui/widget/ZeroWidthSpan.java diff --git a/src/main/java/eu/siacs/conversations/ui/widget/ZeroWidthSpan.java b/src/main/java/eu/siacs/conversations/ui/widget/ZeroWidthSpan.java new file mode 100644 index 000000000..48eaa3360 --- /dev/null +++ b/src/main/java/eu/siacs/conversations/ui/widget/ZeroWidthSpan.java @@ -0,0 +1,10 @@ +package eu.siacs.conversations.ui.widget; + +import android.text.style.ReplacementSpan; + +/** + * Created by daniel on 11/4/17. + */ + +public class ZeroWidthSpan extends ReplacementSpan { +} diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 8ea03d75a..9a06206e5 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -896,7 +896,7 @@ public class XmppConnection implements Runnable { saslMechanism = new ScramSha256(tagWriter, account, mXmppConnectionService.getRNG()); } else if (mechanisms.contains("SCRAM-SHA-1")) { saslMechanism = new ScramSha1(tagWriter, account, mXmppConnectionService.getRNG()); - } else if (mechanisms.contains("PLAIN")) { + } else if (mechanisms.contains("PLAIN") && !account.getJid().getDomainpart().equals("nimbuzz.com")) { saslMechanism = new Plain(tagWriter, account); } else if (mechanisms.contains("DIGEST-MD5")) { saslMechanism = new DigestMd5(tagWriter, account, mXmppConnectionService.getRNG());