aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/utils
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-20 19:28:47 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-20 19:28:47 +0200
commit49b7c7779da38c215dfeb0b3ef19fbce2a6ea3e1 (patch)
treedff1dd4f4d9f62af5b9d74895f5c34db97d8e49d /src/eu/siacs/conversations/utils
parent1cf055d2fdbaa881cfc8ead6b78dc744e9dbe596 (diff)
fixes for otr file transfer
Diffstat (limited to 'src/eu/siacs/conversations/utils')
-rw-r--r--src/eu/siacs/conversations/utils/CryptoHelper.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/eu/siacs/conversations/utils/CryptoHelper.java b/src/eu/siacs/conversations/utils/CryptoHelper.java
index 408c32fe..a70b419e 100644
--- a/src/eu/siacs/conversations/utils/CryptoHelper.java
+++ b/src/eu/siacs/conversations/utils/CryptoHelper.java
@@ -5,9 +5,9 @@ import java.nio.charset.Charset;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
+import java.util.Arrays;
import eu.siacs.conversations.entities.Account;
-
import android.util.Base64;
public class CryptoHelper {
@@ -28,7 +28,11 @@ public class CryptoHelper {
}
public static byte[] hexToBytes(String hexString) {
- return new BigInteger(hexString, 16).toByteArray();
+ byte[] array = new BigInteger(hexString, 16).toByteArray();
+ if (array[0] == 0) {
+ array = Arrays.copyOfRange(array, 1, array.length);
+ }
+ return array;
}
public static String saslPlain(String username, String password) {