Issue #1556 - A timing channel in Password.java.
Fixed comparison logic, doh.
This commit is contained in:
parent
042f325f1c
commit
f3751d7078
|
@ -84,9 +84,9 @@ public abstract class Credential implements Serializable
|
|||
return true;
|
||||
if (s1 == null || s2 == null || s1.length() != s2.length())
|
||||
return false;
|
||||
boolean result = false;
|
||||
boolean result = true;
|
||||
for (int i = 0; i < s1.length(); i++)
|
||||
result |= s1.charAt(i) == s2.charAt(i);
|
||||
result &= s1.charAt(i) == s2.charAt(i);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -103,9 +103,9 @@ public abstract class Credential implements Serializable
|
|||
return true;
|
||||
if (b1 == null || b2 == null || b1.length != b2.length)
|
||||
return false;
|
||||
boolean result = false;
|
||||
boolean result = true;
|
||||
for (int i = 0; i < b1.length; i++)
|
||||
result |= b1[i] == b2[i];
|
||||
result &= b1[i] == b2[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue