fix crash on unknown sasl mechanims

This commit is contained in:
Daniel Gultsch 2020-05-02 10:20:18 +02:00
parent 48163a5604
commit e4b906ebeb
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}