jdk/src/java.base/share/classes/com/sun/crypto/provider/PBES2Core.java
changeset 35285 c8e399b7825b
parent 25859 3317bb8137f4
equal deleted inserted replaced
35284:36b96625b545 35285:c8e399b7825b
     1 /*
     1 /*
     2  * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   261 
   261 
   262         for (int i=0; i<passwdChars.length; i++)
   262         for (int i=0; i<passwdChars.length; i++)
   263             passwdChars[i] = (char) (passwdBytes[i] & 0x7f);
   263             passwdChars[i] = (char) (passwdBytes[i] & 0x7f);
   264 
   264 
   265         PBEKeySpec pbeSpec =
   265         PBEKeySpec pbeSpec =
   266             new PBEKeySpec(passwdChars, salt, iCount, blkSize * 8);
   266             new PBEKeySpec(passwdChars, salt, iCount, keyLength);
   267             // password char[] was cloned in PBEKeySpec constructor,
   267             // password char[] was cloned in PBEKeySpec constructor,
   268             // so we can zero it out here
   268             // so we can zero it out here
   269         java.util.Arrays.fill(passwdChars, ' ');
   269         java.util.Arrays.fill(passwdChars, ' ');
   270         java.util.Arrays.fill(passwdBytes, (byte)0x00);
   270         java.util.Arrays.fill(passwdBytes, (byte)0x00);
   271 
   271