Bug 721129 - Incorrect BigInteger comparison in JPakeCrypto. r=dchan
authorRichard Newman <rnewman@mozilla.com>
Wed, 25 Jan 2012 17:20:00 -0800
changeset 86572 dc81a55caf181b40a1003b9d3728fa1fd372f4c5
parent 86571 0d2c99684564d6bfb3aef6913d575471a4c2bd39
child 86573 817dbb7ee947058e3c3d81d8cb3f8b624d9e4f28
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdchan
bugs721129
milestone12.0a1
Bug 721129 - Incorrect BigInteger comparison in JPakeCrypto. r=dchan
mobile/android/base/sync/jpake/JPakeCrypto.java
--- a/mobile/android/base/sync/jpake/JPakeCrypto.java
+++ b/mobile/android/base/sync/jpake/JPakeCrypto.java
@@ -133,17 +133,17 @@ public class JPakeCrypto {
    * @throws Gx4IsOneException
    * @throws IncorrectZkpException
    */
   public static void round2(String secret, JPakeParty jp,
       JPakeNumGenerator gen) throws Gx4IsOneException, IncorrectZkpException {
 
     Log.d(LOG_TAG, "round2 started.");
 
-    if (jp.gx4 == BigInteger.ONE) {
+    if (BigInteger.ONE.compareTo(jp.gx4) == 0) {
       throw new Gx4IsOneException();
     }
 
     // Check ZKP.
     checkZkp(G, jp.gx3, jp.zkp3);
     checkZkp(G, jp.gx4, jp.zkp4);
 
     // Compute a = g^[(x1+x3+x4)*(x2*secret)].