]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/CipherInfo.java
Fix: Give cipher info it's .equals
[gigi.git] / src / org / cacert / gigi / util / CipherInfo.java
index 2508fae738a5e400722ec874c0635996002355f7..975b3c38772bee0c0eb6da31be4bd140620c5a23 100644 (file)
@@ -256,7 +256,7 @@ public class CipherInfo implements Comparable<CipherInfo> {
         }
         boolean mySHA = macName.startsWith("SHA");
         boolean oSHA = o.macName.startsWith("SHA");
-        if (mySHA && !oSHA) {
+        if ( !mySHA && oSHA) {
             return -1;
         }
         if (mySHA && !oSHA) {
@@ -272,6 +272,15 @@ public class CipherInfo implements Comparable<CipherInfo> {
         return suiteName.compareTo(o.suiteName);
     }
 
+    @Override
+    public boolean equals(Object o) {
+        if (o instanceof CipherInfo) {
+            return 0 == this.compareTo((CipherInfo) o);
+        }
+
+        return false;
+    }
+
     static String[] cipherRanking = null;
 
     public static String[] getCompleteRanking() {