code review request: 7174351: test/sun/security/tools/keytool/standard.sh failed after new Hashtable

Weijun Wang weijun.wang at oracle.com
Tue Jun 5 07:52:30 PDT 2012


Hi Xuelei

Can you take a look at this?

   http://cr.openjdk.java.net/~weijun/7174351/webrev.00

In the test, I try to import a JCEKS keystore into a JKS one. The JCEKS 
one includes 4 entries:

    s1, Jun 5, 2012, SecretKeyEntry,
    s2, Jun 5, 2012, SecretKeyEntry,
    c1, Jun 5, 2012, trustedCertEntry,
    p1, Jun 5, 2012, PrivateKeyEntry,

Since you cannot store a SecretKeyEntry inside a JKS, there will be a 
warning like

    Entry for alias s1 not imported.
    Do you want to quit the import process? [no]:

If you enter "no" (or simply press ENTER) the import will go on with the 
next entry, with "yes", it terminates immediately.

So in the webrev you can see me calling the exact same commands twice. 
First give it "\n\n" to ignore warnings for both s1 and s2. Second give 
it a "yes\n" to terminate the import. Both should be consumed by the 
command correctly, and no keystroke is left in buffer.

However, the test has a bug that before the 2nd importstore, the x.jks 
file already exists. Before Mike introduced the new hash feature, it 
still works because s1 is always the first to import, so a single "yes" 
terminates the command nicely. Now, the order is random, and if you 
happen to see c1 comes first, another kind of prompt would show:

    Existing entry alias c1 exists, overwrite? [no]:

Here a single "yes" won't complete the command and the test fails.

Now I remove the x.jks before the 2nd call.

Thanks
Max


-------- Original Message --------
7174351: test/sun/security/tools/keytool/standard.sh failed after new 
Hashtable

=== *Description* 
============================================================
sun/security/tools/keytool/standard.sh

test/sun/security/tools/keytool/standard.sh failed since 7118743 : 
Alternative Hashing for String with Hash-based Maps. The test mistakenly 
assumes a certain order of aliases in a keystore, stored in a Hashtable.





More information about the security-dev mailing list