From a5e5b03b11c52d8b2a8cc4a3845bba5eb4f2a4cd Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Mon, 1 Oct 2018 11:06:11 +0200 Subject: fixed auth --- .../de/pixart/messenger/crypto/sasl/ScramMechanism.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/main/java/de/pixart') diff --git a/src/main/java/de/pixart/messenger/crypto/sasl/ScramMechanism.java b/src/main/java/de/pixart/messenger/crypto/sasl/ScramMechanism.java index a7a063409..e1a153ef6 100644 --- a/src/main/java/de/pixart/messenger/crypto/sasl/ScramMechanism.java +++ b/src/main/java/de/pixart/messenger/crypto/sasl/ScramMechanism.java @@ -34,7 +34,7 @@ abstract class ScramMechanism extends SaslMechanism { // Map keys are "bytesToHex(JID),bytesToHex(password),bytesToHex(salt),iterations,SASL-Mechanism". // Changing any of these values forces a cache miss. `CryptoHelper.bytesToHex()' // is applied to prevent commas in the strings breaking things. - final String[] kparts = k.split(",", 4); + final String[] kparts = k.split(",", 5); try { final byte[] saltedPassword, serverKey, clientKey; saltedPassword = hi(CryptoHelper.hexToString(kparts[1]).getBytes(), @@ -145,12 +145,12 @@ abstract class ScramMechanism extends SaslMechanism { break; case 'm': /* - * RFC 5802: - * m: This attribute is reserved for future extensibility. In this - * version of SCRAM, its presence in a client or a server message - * MUST cause authentication failure when the attribute is parsed by - * the other end. - */ + * RFC 5802: + * m: This attribute is reserved for future extensibility. In this + * version of SCRAM, its presence in a client or a server message + * MUST cause authentication failure when the attribute is parsed by + * the other end. + */ throw new AuthenticationException("Server sent reserved token: `m'"); } } @@ -176,7 +176,7 @@ abstract class ScramMechanism extends SaslMechanism { CryptoHelper.bytesToHex(account.getJid().asBareJid().toString().getBytes()) + "," + CryptoHelper.bytesToHex(account.getPassword().getBytes()) + "," + CryptoHelper.bytesToHex(salt.getBytes()) + "," - + String.valueOf(iterationCount) + + String.valueOf(iterationCount) + "," + getMechanism() ); if (keys == null) { -- cgit v1.2.3