equal
deleted
inserted
replaced
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 |