aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/crypto/sasl
diff options
context:
space:
mode:
authorSam Whited <sam@samwhited.com>2014-11-15 21:09:51 -0500
committerSam Whited <sam@samwhited.com>2014-11-15 21:11:14 -0500
commitcfdda5f8fde8d480334b136bdf2317d66eb5e497 (patch)
treeadab6547eec5b976a49f14d8d64fe35bda6922a8 /src/main/java/eu/siacs/conversations/crypto/sasl
parent2067b9bd8dcbace4b5d029a8266e9d195a3d573d (diff)
Don't escape passwords in SASL
Fixes #671
Diffstat (limited to 'src/main/java/eu/siacs/conversations/crypto/sasl')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java
index f5765cf1..10cd3167 100644
--- a/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java
+++ b/src/main/java/eu/siacs/conversations/crypto/sasl/ScramSha1.java
@@ -52,7 +52,7 @@ public class ScramSha1 extends SaslMechanism {
final String[] kparts = k.split(",", 4);
try {
final byte[] saltedPassword, serverKey, clientKey;
- saltedPassword = hi(CryptoHelper.saslPrep(CryptoHelper.hexToString(kparts[1])).getBytes(),
+ saltedPassword = hi(CryptoHelper.hexToString(kparts[1]).getBytes(),
Base64.decode(CryptoHelper.hexToString(kparts[2]), Base64.DEFAULT), Integer.valueOf(kparts[3]));
serverKey = hmac(saltedPassword, SERVER_KEY_BYTES);
clientKey = hmac(saltedPassword, CLIENT_KEY_BYTES);
@@ -88,7 +88,7 @@ public class ScramSha1 extends SaslMechanism {
@Override
public String getClientFirstMessage() {
if (clientFirstMessageBare.isEmpty() && state == State.INITIAL) {
- clientFirstMessageBare = "n=" + CryptoHelper.saslPrep(account.getUsername()) +
+ clientFirstMessageBare = "n=" + CryptoHelper.saslEscape(CryptoHelper.saslPrep(account.getUsername())) +
",r=" + this.clientNonce;
state = State.AUTH_TEXT_SENT;
}