From e4b906ebebe196dcabf2341a9f55a699aa39ca5d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 2 May 2020 10:20:18 +0200 Subject: [PATCH] fix crash on unknown sasl mechanims --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 73f58a6c8..d9a4ee9b5 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -882,7 +882,7 @@ public class XmppConnection implements Runnable { final int pinnedMechanism = account.getKeyAsInt(Account.PINNED_MECHANISM_KEY, -1); if (pinnedMechanism > saslMechanism.getPriority()) { Log.e(Config.LOGTAG, "Auth failed. Authentication mechanism " + saslMechanism.getMechanism() + - " has lower priority (" + String.valueOf(saslMechanism.getPriority()) + + " has lower priority (" + saslMechanism.getPriority() + ") than pinned priority (" + pinnedMechanism + "). Possible downgrade attack?"); throw new StateChangingException(Account.State.DOWNGRADE_ATTACK); @@ -894,7 +894,7 @@ public class XmppConnection implements Runnable { } tagWriter.writeElement(auth); } else { - Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to find SASL mechanism "+ saslMechanism.toString()); + Log.d(Config.LOGTAG,account.getJid().asBareJid()+": unable to find supported SASL mechanism in "+mechanisms); throw new StateChangingException(Account.State.INCOMPATIBLE_SERVER); } }