changeset 1721:1f6558de9c57

8179101: Improve algorithm constraints implementation Reviewed-by: mullan, ahgross, rhalade, igerasim
author igerasim
date Wed, 26 Apr 2017 19:20:55 -0700
parents 7cb359c0e53c
children a2d20542b60b
files src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Thu Mar 23 08:44:17 2017 -0700
+++ b/src/share/classes/sun/security/util/DisabledAlgorithmConstraints.java	Wed Apr 26 19:20:55 2017 -0700
@@ -686,7 +686,6 @@
         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;
@@ -744,8 +743,9 @@
                     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));
             }
         }
 
@@ -770,7 +770,7 @@
                 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) {