8138589: Correct limits on unlimited cryptography
authorvinnie
Wed, 07 Oct 2015 18:04:06 +0100
changeset 35285 c8e399b7825b
parent 35284 36b96625b545
child 35286 6dc8e176c81e
8138589: Correct limits on unlimited cryptography Reviewed-by: mullan
jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java	Tue Sep 08 08:34:35 2015 +0200
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java	Wed Oct 07 18:04:06 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -263,7 +263,7 @@
             passwdChars[i] = (char) (passwdBytes[i] & 0x7f);
 
         PBEKeySpec pbeSpec =
-            new PBEKeySpec(passwdChars, salt, iCount, blkSize * 8);
+            new PBEKeySpec(passwdChars, salt, iCount, keyLength);
             // password char[] was cloned in PBEKeySpec constructor,
             // so we can zero it out here
         java.util.Arrays.fill(passwdChars, ' ');