Skip to content

Commit

Permalink
8342002: sun/security/tools/keytool/GenKeyPairSigner.java failed due …
Browse files Browse the repository at this point in the history
…to missing certificate output

Reviewed-by: mullan
  • Loading branch information
wangweij committed Oct 14, 2024
1 parent f56a154 commit 9e262df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 0 additions & 2 deletions test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,6 @@ sun/security/provider/PolicyParser/PrincipalExpansionError.java 8039280 generic-

sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8316183 linux-ppc64le

sun/security/tools/keytool/GenKeyPairSigner.java 8342002 generic-all

############################################################################

# jdk_sound
Expand Down
14 changes: 7 additions & 7 deletions test/jdk/sun/security/tools/keytool/GenKeyPairSigner.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -84,7 +84,7 @@ static void testSignerPKCS12() throws Exception {
System.out.println("Generating an XDH cert with -signer option");
SecurityTools.keytool("-keystore ks -storepass changeit " +
"-genkeypair -keyalg XDH -alias e1 -dname CN=E1 -signer ca")
.shouldContain("Generating 255 bit XDH key pair and a certificate (Ed25519) issued by <ca> with a validity of 90 days")
.shouldContain("Generating 255 bit X25519 key pair and a certificate (Ed25519) issued by <ca> with a validity of 90 days")
.shouldContain("for: CN=E1")
.shouldHaveExitValue(0);

Expand Down Expand Up @@ -118,7 +118,7 @@ static void testSignerPKCS12() throws Exception {
.shouldContain("Alias name: e1")
.shouldContain("Certificate chain length: 2")
.shouldContain("Signature algorithm name: Ed25519")
.shouldContain("Subject Public Key Algorithm: 255-bit XDH key")
.shouldContain("Subject Public Key Algorithm: 255-bit X25519 key")
.shouldHaveExitValue(0);

// check to make sure that cert's AKID is created from the SKID of the signing cert
Expand Down Expand Up @@ -150,7 +150,7 @@ static void testSignerPKCS12() throws Exception {
System.out.println("Generating an X448 cert with -signer option");
SecurityTools.keytool("-keystore ks -storepass changeit " +
"-genkeypair -keyalg X448 -alias e2 -dname CN=E2 -sigalg SHA384withRSA -signer ca2")
.shouldContain("Generating 448 bit XDH key pair and a certificate (SHA384withRSA) issued by <ca2> with a validity of 90 days")
.shouldContain("Generating 448 bit X448 key pair and a certificate (SHA384withRSA) issued by <ca2> with a validity of 90 days")
.shouldContain("for: CN=E2")
.shouldHaveExitValue(0);

Expand All @@ -177,7 +177,7 @@ static void testSignerPKCS12() throws Exception {
"-list -v")
.shouldContain("Alias name: e2")
.shouldContain("Signature algorithm name: SHA384withRSA")
.shouldContain("Subject Public Key Algorithm: 448-bit XDH key")
.shouldContain("Subject Public Key Algorithm: 448-bit X448 key")
.shouldHaveExitValue(0);

kt("-genkeypair -keyalg DSA -alias ca3 -dname CN=CA3 -ext bc:c ",
Expand Down Expand Up @@ -249,7 +249,7 @@ static void testSignerJKS() throws Exception {
SecurityTools.keytool("-keystore ksjks -storepass changeit -storetype jks " +
"-genkeypair -keyalg XDH -alias e1 -dname CN=E1 " +
"-keypass e1keypass -signer ca1 -signerkeypass ca1keypass")
.shouldContain("Generating 255 bit XDH key pair and a certificate (SHA256withDSA) issued by <ca1> with a validity of 90 days")
.shouldContain("Generating 255 bit X25519 key pair and a certificate (SHA256withDSA) issued by <ca1> with a validity of 90 days")
.shouldContain("for: CN=E1")
.shouldContain("The generated certificate #2 of 3 uses a 1024-bit DSA key which is considered a security risk")
.shouldContain("The generated certificate #3 of 3 uses a 1024-bit RSA key which is considered a security risk")
Expand Down Expand Up @@ -285,7 +285,7 @@ static void testSignerJKS() throws Exception {
.shouldContain("Alias name: e1")
.shouldContain("Certificate chain length: 3")
.shouldContain("Signature algorithm name: SHA256withDSA")
.shouldContain("Subject Public Key Algorithm: 255-bit XDH key")
.shouldContain("Subject Public Key Algorithm: 255-bit X25519 key")
.shouldHaveExitValue(0);
}

Expand Down

1 comment on commit 9e262df

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.