hello all, the attached patch --already committed-- fixes a small bug in the list command handler; removes commented out code as well trace/debugging statements pertaining to passwords.
2006-05-20 Raif S. Naffah <[EMAIL PROTECTED]> * tools/gnu/classpath/tools/keytool/ListCmd.java (rfc): Increased visibility. (setup): Do not trace/log passwords. (parsed): Was not setting correct (rfc) field; fixed. (print1Chain): Formatting. * tools/gnu/classpath/tools/keytool/DeleteCmd.java (setup): Do not trace/log passwords. * tools/gnu/classpath/tools/keytool/ExportCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/GenKeyCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/IdentityDBCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/KeyCloneCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/StorePasswdCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/ImportCmd.java (setup): Likewise. (orderChain): Added FIXME. * tools/gnu/classpath/tools/keytool/CertReqCmd.java (setup): Do not trace/log passwords. Removed commented out code. * tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/SelfCertCmd.java (setup): Likewise. * tools/gnu/classpath/tools/keytool/Command.java (doCommand): Formatting. (setKeystoreURLParam): Likewise. (setKeystorePasswordParam): Do not trace/log passwords. (saveKeyStore): Likewise. cheers; rsn
Index: CertReqCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/CertReqCmd.java,v retrieving revision 1.2 diff -u -r1.2 CertReqCmd.java --- CertReqCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ CertReqCmd.java 20 May 2006 01:17:58 -0000 @@ -258,16 +258,13 @@ setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL); setAliasParam(_alias); setKeyPasswordNoPrompt(_password); -// setSignatureAlgorithm(_sigAlgorithm); log.finer("-certreq handler will use the following options:"); //$NON-NLS-1$ log.finer(" -alias=" + alias); //$NON-NLS-1$ log.finer(" -sigalg=" + _sigAlgorithm); //$NON-NLS-1$ log.finer(" -file=" + _certReqFileName); //$NON-NLS-1$ - log.finer(" -keypass=" + _password); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ log.finer(" -attributes=" + nullAttributes); //$NON-NLS-1$ Index: Command.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/Command.java,v retrieving revision 1.3 diff -u -r1.3 Command.java --- Command.java 14 May 2006 08:20:18 -0000 1.3 +++ Command.java 20 May 2006 01:19:00 -0000 @@ -194,14 +194,14 @@ public void doCommand() throws Exception { try - { - setup(); - start(); - } + { + setup(); + start(); + } finally - { - teardown(); - } + { + teardown(); + } } /** @@ -500,7 +500,6 @@ storePasswordChars = pcb.getPassword(); pcb.clearPassword(); } - log.finest("storePasswordChars = [" + String.valueOf(storePasswordChars)+ "]"); //$NON-NLS-1$ //$NON-NLS-2$ } /** @@ -589,7 +588,7 @@ catch (IOException x) { log.fine("Exception while closing the key store input stream: " + x //$NON-NLS-1$ - + ". Ignore"); //$NON-NLS-1$ + + ". Ignore"); //$NON-NLS-1$ } } @@ -984,7 +983,7 @@ protected void saveKeyStore(char[] password) throws IOException, KeyStoreException, NoSuchAlgorithmException, CertificateException { - log.entering(this.getClass().getName(), "saveKeyStore", String.valueOf(password)); //$NON-NLS-1$ + log.entering(this.getClass().getName(), "saveKeyStore"); //$NON-NLS-1$ URLConnection con = storeURL.openConnection(); con.setDoOutput(true); Index: DeleteCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/DeleteCmd.java,v retrieving revision 1.2 diff -u -r1.2 DeleteCmd.java --- DeleteCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ DeleteCmd.java 20 May 2006 01:19:26 -0000 @@ -163,7 +163,6 @@ log.finer(" -alias=" + alias); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } Index: ExportCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/ExportCmd.java,v retrieving revision 1.3 diff -u -r1.3 ExportCmd.java --- ExportCmd.java 14 May 2006 08:20:18 -0000 1.3 +++ ExportCmd.java 20 May 2006 01:19:53 -0000 @@ -194,7 +194,6 @@ log.finer(" -file=" + _certFileName); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -rfc=" + rfc); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ Index: GenKeyCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/GenKeyCmd.java,v retrieving revision 1.2 diff -u -r1.2 GenKeyCmd.java --- GenKeyCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ GenKeyCmd.java 20 May 2006 01:20:22 -0000 @@ -316,11 +316,9 @@ log.finer(" -keysize=" + keySize); //$NON-NLS-1$ log.finer(" -sigalg=" + signatureAlgorithm.getAlgorithm()); //$NON-NLS-1$ log.finer(" -dname=" + distinguishedName); //$NON-NLS-1$ - log.finer(" -keypass=" + String.valueOf(keyPasswordChars)); //$NON-NLS-1$ log.finer(" -validity=" + validityInDays); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } Index: IdentityDBCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/IdentityDBCmd.java,v retrieving revision 1.2 diff -u -r1.2 IdentityDBCmd.java --- IdentityDBCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ IdentityDBCmd.java 20 May 2006 01:20:48 -0000 @@ -154,7 +154,6 @@ log.finer(" -file=" + _idbFileName); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + new String(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } Index: ImportCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/ImportCmd.java,v retrieving revision 1.2 diff -u -r1.2 ImportCmd.java --- ImportCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ ImportCmd.java 20 May 2006 01:21:13 -0000 @@ -274,12 +274,10 @@ log.finer("-import handler will use the following options:"); //$NON-NLS-1$ log.finer(" -alias=" + alias); //$NON-NLS-1$ log.finer(" -file=" + _certFileName); //$NON-NLS-1$ - log.finer(" -keypass=" + _password); //$NON-NLS-1$ log.finer(" -noprompt=" + noPrompt); //$NON-NLS-1$ log.finer(" -trustcacerts=" + trustCACerts); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } @@ -675,7 +673,7 @@ log.entering(this.getClass().getName(), "orderChain"); //$NON-NLS-1$ LinkedList result = new LinkedList(); - + // FIXME: really order it! log.entering(this.getClass().getName(), "orderChain", result); //$NON-NLS-1$ return result; Index: KeyCloneCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/KeyCloneCmd.java,v retrieving revision 1.2 diff -u -r1.2 KeyCloneCmd.java --- KeyCloneCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ KeyCloneCmd.java 20 May 2006 01:21:44 -0000 @@ -209,16 +209,12 @@ setAliasParam(_alias); setKeyPasswordNoPrompt(_password); setDestinationAlias(_destAlias); -// setNewKeyPassword(_newPassword); log.finer("-keyclone handler will use the following options:"); //$NON-NLS-1$ log.finer(" -alias=" + alias); //$NON-NLS-1$ log.finer(" -dest=" + destinationAlias); //$NON-NLS-1$ - log.finer(" -keypass=" + _password); //$NON-NLS-1$ - log.finer(" -new=" + _newPassword); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } Index: KeyPasswdCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/KeyPasswdCmd.java,v retrieving revision 1.2 diff -u -r1.2 KeyPasswdCmd.java --- KeyPasswdCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ KeyPasswdCmd.java 20 May 2006 01:22:13 -0000 @@ -195,15 +195,12 @@ setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL); setAliasParam(_alias); setKeyPasswordNoPrompt(_password); -// setNewKeyPassword(_newPassword); log.finer("-keypasswd handler will use the following options:"); //$NON-NLS-1$ log.finer(" -alias=" + alias); //$NON-NLS-1$ - log.finer(" -keypass=" + _password); //$NON-NLS-1$ log.finer(" -new=" + _newPassword); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } Index: ListCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/ListCmd.java,v retrieving revision 1.2 diff -u -r1.2 ListCmd.java --- ListCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ ListCmd.java 20 May 2006 01:22:38 -0000 @@ -123,7 +123,7 @@ protected String _ksURL; protected String _ksPassword; protected String _providerClassName; - private boolean rfc; + protected boolean rfc; private boolean all; // default 0-arguments constructor @@ -190,7 +190,6 @@ log.finer(" -alias=" + alias); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ log.finer(" -rfc=" + rfc); //$NON-NLS-1$ @@ -292,7 +291,7 @@ { public void parsed(String argument) throws OptionException { - verbose = true; + rfc = true; } }); result.add(options); @@ -359,7 +358,7 @@ private void print1Chain(Certificate[] chain, PrintWriter writer) throws CertificateEncodingException { - if (!verbose && !rfc) + if (! verbose && ! rfc) fingerprint(chain[0], writer); else { Index: SelfCertCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/SelfCertCmd.java,v retrieving revision 1.2 diff -u -r1.2 SelfCertCmd.java --- SelfCertCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ SelfCertCmd.java 20 May 2006 01:23:04 -0000 @@ -263,19 +263,15 @@ setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL); setAliasParam(_alias); setKeyPasswordNoPrompt(_password); -// setDName(_dName); setValidityParam(_validityStr); -// setSignatureAlgorithm(_sigAlgorithm); log.finer("-selfcert handler will use the following options:"); //$NON-NLS-1$ log.finer(" -alias=" + alias); //$NON-NLS-1$ log.finer(" -sigalg=" + _sigAlgorithm); //$NON-NLS-1$ log.finer(" -dname=" + _dName); //$NON-NLS-1$ - log.finer(" -keypass=" + _password); //$NON-NLS-1$ log.finer(" -validity=" + validityInDays); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ } Index: StorePasswdCmd.java =================================================================== RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/keytool/StorePasswdCmd.java,v retrieving revision 1.2 diff -u -r1.2 StorePasswdCmd.java --- StorePasswdCmd.java 14 May 2006 08:20:18 -0000 1.2 +++ StorePasswdCmd.java 20 May 2006 01:23:27 -0000 @@ -161,10 +161,8 @@ setNewKeystorePassword(_newPassword); log.finer("-storepasswd handler will use the following options:"); //$NON-NLS-1$ - log.finer(" -new=" + String.valueOf(newStorePasswordChars)); //$NON-NLS-1$ log.finer(" -storetype=" + storeType); //$NON-NLS-1$ log.finer(" -keystore=" + storeURL); //$NON-NLS-1$ - log.finer(" -storepass=" + String.valueOf(storePasswordChars)); //$NON-NLS-1$ log.finer(" -provider=" + provider); //$NON-NLS-1$ log.finer(" -v=" + verbose); //$NON-NLS-1$ }
pgpNTFQNFdDF3.pgp
Description: PGP signature