JDK-6202915 : keytool cannot change keypasswd twice
  • Type: Bug
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2004-12-02
  • Updated: 2010-11-04
  • Resolved: 2004-12-02
Related Reports
Duplicate :  
Description
The Error:

create a new keystore with:
$ keytool -genkey -alias a
*do not* use storepass when prompting keypass.
then, try to change the keypass with:
$ keytool -keypasswd -alias a
type the key you give, exception thrown.

this error does not appear in 1.4, but on 1.5 for Solaris and Win32


Comments
EVALUATION in sun.security.tools.KeyTool.java, we have private Object[] recoverPrivateKey(String alias, char[] storePass, char[] keyPass) throws Exception { ...... // line omited if (keyPass == null) { // Try to recover the key using the keystore password try { key = keyStore.getKey(alias, storePass); keyPass = storePass; } catch (UnrecoverableKeyException e) { // Did not work out, so prompt user for key password if (!token) { keyPass = getKeyPasswd(alias, null, null); key = keyStore.getKey(alias, keyPass); } throw e; //*what's this* } } else { i don't know why re-throw e again. this is clearly wrong. ###@###.### 2004-12-02 04:36:22 GMT See 6178366 ###@###.### 2004-12-02 19:14:46 GMT
02-12-2004