Skip to content

Commit

Permalink
8179101: Improve algorithm constraints implementation
Browse files Browse the repository at this point in the history
Reviewed-by: mullan, ahgross, rhalade, igerasim
  • Loading branch information
Anthony Scarpino committed Apr 26, 2017
1 parent 6b1fb24 commit 558e2a6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ private static class KeySizeConstraint extends Constraint {
private int minSize; // the minimal available key size
private int maxSize; // the maximal available key size
private int prohibitedSize = -1; // unavailable key sizes
private int size;

public KeySizeConstraint(String algo, Operator operator, int length) {
algorithm = algo;
Expand Down Expand Up @@ -761,8 +760,9 @@ public void permits(ConstraintsParameters cp)
return;
}
throw new CertPathValidatorException(
"Algorithm constraints check failed on keysize limits. "
+ algorithm + " " + size + "bit key" + extendedMsg(cp),
"Algorithm constraints check failed on keysize limits. " +
algorithm + " " + KeyUtil.getKeySize(key) + "bit key" +
extendedMsg(cp),
null, null, -1, BasicReason.ALGORITHM_CONSTRAINED);
}
}
Expand All @@ -789,7 +789,7 @@ private boolean permitsImpl(Key key) {
return true;
}

size = KeyUtil.getKeySize(key);
int size = KeyUtil.getKeySize(key);
if (size == 0) {
return false; // we don't allow any key of size 0.
} else if (size > 0) {
Expand Down

0 comments on commit 558e2a6

Please sign in to comment.