From 8fcdbbe49382853938f35ebab9074deec9b7d641 Mon Sep 17 00:00:00 2001 From: igerasim Date: Wed, 14 Oct 2015 13:32:16 +0300 Subject: [PATCH] 8138589: Correct limits on unlimited cryptography Reviewed-by: mullan --- src/share/classes/com/sun/crypto/provider/PBES2Core.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/share/classes/com/sun/crypto/provider/PBES2Core.java b/src/share/classes/com/sun/crypto/provider/PBES2Core.java index 51c49b500..37873666e 100644 --- a/src/share/classes/com/sun/crypto/provider/PBES2Core.java +++ b/src/share/classes/com/sun/crypto/provider/PBES2Core.java @@ -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 @@ abstract class PBES2Core extends CipherSpi { 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, ' '); -- GitLab