From 758bbd70f5f57707561d78d084fde6887d120fe1 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 21 Sep 2015 12:05:59 +0200 Subject: [PATCH 1/2] use symlinks to provide alternate folders for Hebrew and Indonesian These two languages must be included twice (iw/he and id/in) For a full discussion of why, see: https://gitlab.com/fdroid/fdroidclient/issues/139 https://stackoverflow.com/questions/5074769/cyanogenmod-translate-a-project/8470980#8470980 https://stackoverflow.com/questions/8393771/android-not-using-finding-my-hebrew-localization --- res/values-he | 1 + res/values-id | 1 + 2 files changed, 2 insertions(+) create mode 120000 res/values-he create mode 120000 res/values-id diff --git a/res/values-he b/res/values-he new file mode 120000 index 000000000..6fe8b4958 --- /dev/null +++ b/res/values-he @@ -0,0 +1 @@ +values-iw \ No newline at end of file diff --git a/res/values-id b/res/values-id new file mode 120000 index 000000000..9ea8dda4b --- /dev/null +++ b/res/values-id @@ -0,0 +1 @@ +values-in \ No newline at end of file From 66bfcbe350deb509625b1778cbe54cfd928afc37 Mon Sep 17 00:00:00 2001 From: Danny van Heumen Date: Thu, 14 Jan 2016 00:04:47 +0100 Subject: [PATCH 2/2] Fixed bad comparisons for 'checkGroupElem' and 'checkExpon' basic verification methods for parameters in SMP. The methods 'checkGroupElem' and 'checkExpon' are basic methods that are used to verify parameters of SMP. These methods used bad boundary conditions when checking values. As a result, some valid values were flagged as invalid parameters while others were wrongly accepted. A number of tests are included that check values next to the boundaries to ensure that verification is executed correctly. As part of looking into these errors, I have verified the other methods of SM.java. Apart from 'checkGroupElem' and 'checkExpon' all methods match their counterparts in java-otr and libotr. (AFAICT) --- src/net/java/otr4j/crypto/SM.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net/java/otr4j/crypto/SM.java b/src/net/java/otr4j/crypto/SM.java index c91447185..af20ada2b 100644 --- a/src/net/java/otr4j/crypto/SM.java +++ b/src/net/java/otr4j/crypto/SM.java @@ -183,7 +183,7 @@ public static BigInteger[] unserialize(byte[] bytes) throws SMException { * element */ public static boolean checkGroupElem(BigInteger g) { - return !(g.compareTo(BigInteger.valueOf(2)) > 0 && g.compareTo(SM.MODULUS_MINUS_2) < 0); + return g.compareTo(BigInteger.valueOf(2)) < 0 || g.compareTo(SM.MODULUS_MINUS_2) > 0; } /** @@ -191,7 +191,7 @@ public static boolean checkGroupElem(BigInteger g) { * exponent */ public static boolean checkExpon(BigInteger x) { - return !(x.compareTo(BigInteger.ONE) > 0 && x.compareTo(SM.ORDER_S) <= 0); + return x.compareTo(BigInteger.ONE) < 0 || x.compareTo(SM.ORDER_S) >= 0; } /**