aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-08-03 09:26:54 +0200
committerChristian Schneppe <christian@pix-art.de>2017-08-03 09:26:54 +0200
commitda14f7745c4f24251683294971d09bb7e96af229 (patch)
treea4af526fd249c558fae19fd40827827df7886736 /src/main/java/de
parentaffb3c4254aa25e99e0682b5c0e96b4c7dd174fb (diff)
use random string generator instead of BigInteger in DigestMd5
Diffstat (limited to 'src/main/java/de')
-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;