aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/de/pixart/messenger/crypto/sasl/DigestMd5.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/sasl/DigestMd5.java b/src/main/java/de/pixart/messenger/crypto/sasl/DigestMd5.java
index e974d8cd4..2e6c43edc 100644
--- a/src/main/java/de/pixart/messenger/crypto/sasl/DigestMd5.java
+++ b/src/main/java/de/pixart/messenger/crypto/sasl/DigestMd5.java
@@ -2,7 +2,6 @@ package de.pixart.messenger.crypto.sasl;
import android.util.Base64;
-import java.math.BigInteger;
import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@@ -52,7 +51,7 @@ public class DigestMd5 extends SaslMechanism {
+ account.getPassword();
final MessageDigest md = MessageDigest.getInstance("MD5");
final byte[] y = md.digest(x.getBytes(Charset.defaultCharset()));
- final String cNonce = new BigInteger(100, rng).toString(32);
+ final String cNonce = CryptoHelper.random(100, rng);
final byte[] a1 = CryptoHelper.concatenateByteArrays(y,
(":" + nonce + ":" + cNonce).getBytes(Charset.defaultCharset()));
final String a2 = "AUTHENTICATE:" + digestUri;