aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-01 11:06:11 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-01 11:06:11 +0200
commita5e5b03b11c52d8b2a8cc4a3845bba5eb4f2a4cd (patch)
tree5b70290fb3f7be246ec885703dfc872e0b28c8c9 /src
parent4a8df17311f2e937840f71b3c1590bbe06fe2393 (diff)
fixed auth
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/sasl/ScramMechanism.java16
1 files changed, 8 insertions, 8 deletions
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) {