Skip to content

Commit

Permalink
Merge pull request #739 from ibmruntimes/openj9
Browse files Browse the repository at this point in the history
Merge jdk-11.0.22+6 and the latest openj9 changes to 0.43
  • Loading branch information
JasonFengJ9 committed Dec 7, 2023
2 parents 91ab4bb + 22b3657 commit e81be3d
Show file tree
Hide file tree
Showing 11 changed files with 381 additions and 5 deletions.
1 change: 1 addition & 0 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ $(foreach file, \
vmtest \
) \
$(patsubst %, $(OPENJ9_VM_BUILD_DIR)/$(call SHARED_LIBRARY,%), \
access \
anntests \
balloon29 \
bcuwhite \
Expand Down
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OPENJDK_TAG := jdk-11.0.22+5
OPENJDK_TAG := jdk-11.0.22+6
22 changes: 22 additions & 0 deletions make/data/cacerts/emsigneccrootcag3
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Owner: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
Issuer: CN=emSign ECC Root CA - G3, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
Serial number: 3cf607a968700eda8b84
Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043
Signature algorithm name: SHA384withECDSA
Subject Public Key Algorithm: 384-bit EC (secp384r1) key
Version: 3
-----BEGIN CERTIFICATE-----
MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQG
EwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNo
bm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g
RzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBrMQswCQYDVQQGEwJJ
TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s
b2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMw
djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0
WXTsuwYc58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xyS
fvalY8L1X44uT6EYGQIrMgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuB
zhccLikenEhjQjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq
hkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+DCBeQyh+KTOgNG3qxrdWB
CUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7jHvrZQnD
+JbNR6iC8hZVdyR+EhCVBCyj
-----END CERTIFICATE-----
29 changes: 29 additions & 0 deletions make/data/cacerts/emsignrootcag1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Owner: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
Issuer: CN=emSign Root CA - G1, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
Serial number: 31f5e4620c6c58edd6d8
Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3
-----BEGIN CERTIFICATE-----
MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYD
VQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBU
ZWNobm9sb2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBH
MTAeFw0xODAyMTgxOD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0 deletions make/data/cacerts/emsignrootcag2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Owner: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
Issuer: CN=emSign Root CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN
Serial number: 864dbf0fe35ed77d8ed8
Valid from: Sun Feb 18 18:30:00 GMT 2018 until: Wed Feb 18 18:30:00 GMT 2043
Signature algorithm name: SHA384withRSA
Subject Public Key Algorithm: 4096-bit RSA key
Version: 3
-----BEGIN CERTIFICATE-----
MIIFlTCCA32gAwIBAgILAIZNvw/jXtd9jtgwDQYJKoZIhvcNAQEMBQAwZzELMAkG
A1UEBhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEg
VGVjaG5vbG9naWVzIExpbWl0ZWQxHDAaBgNVBAMTE2VtU2lnbiBSb290IENBIC0g
RzIwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4MTgzMDAwWjBnMQswCQYDVQQGEwJJ
TjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9s
b2dpZXMgTGltaXRlZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMjCCAiIw
DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMNwGIWW2kHfHK+sXTNwxF07K+IV
ySTuyFM2r1v002wUfcdT+zs5OM5QbMYFFnedXQI6gCFLsjKrcaej48Zt37OyEb3i
aPs7CsP4kAyTwzKH9aZe6gXYHrJq40/ZVMNcQVI2PcIp40B/SAN2gUZ+ZaUtIOvV
jEx26/ebNaXRIsthlkOG/caB+QRwDw1tl7338Zlv0M2oTBUy4B3e7dGP5pgXH71M
jqHPCoNo+xv9f0NTBT+hUDa8h8wUtcGQq9CDeJTpjWcD2bP2AMdVG6oVpMAUeUzo
cCyglvtFdUMjggxBbw4qhau1HXPG8Ot9hwL7ZMi8tkTzrvUI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AkaTUfXGdEaFVtFig1EA30WzJY2X1vAQ7hVnniCjgaXAGqjsU6sklNM9n
xDx5rFCCCEtj9Kh8UHjGK2QqgP5kwgttjOApQMaCoezMfK4KD7WpOXU=
-----END CERTIFICATE-----
56 changes: 55 additions & 1 deletion src/java.base/share/classes/sun/security/ssl/JsseJce.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
* questions.
*/

/*
* ===========================================================================
* (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
* ===========================================================================
*/

package sun.security.ssl;

import java.math.BigInteger;
Expand Down Expand Up @@ -144,6 +150,26 @@ public Object run() {
*/
static final String SIGNATURE_ECDSA = "SHA1withECDSA";

/**
* JCA identifier string for ECDSA, i.e. a ECDSA with SHA224.
*/
static final String SIGNATURE_ECDSA_224 = "SHA224withECDSA";

/**
* JCA identifier string for ECDSA, i.e. a ECDSA with SHA256.
*/
static final String SIGNATURE_ECDSA_256 = "SHA256withECDSA";

/**
* JCA identifier string for ECDSA, i.e. a ECDSA with SHA384.
*/
static final String SIGNATURE_ECDSA_384 = "SHA384withECDSA";

/**
* JCA identifier string for ECDSA, i.e. a ECDSA with SHA512.
*/
static final String SIGNATURE_ECDSA_512 = "SHA512withECDSA";

/**
* JCA identifier string for Raw DSA, i.e. a DSA signature without
* hashing where the application provides the SHA-1 hash of the data.
Expand Down Expand Up @@ -393,10 +419,38 @@ private static class EcAvailability {
// Is EC crypto available?
private static final boolean isAvailable;

/**
* Checks if a particular signature algorithm is available.
*
* @param algorithm the algorithm we will attempt to instantiate to check if it is available
* @return true if the signature algorithm is found, false otherwise
*/
private static boolean isSignatureAlgorithmAvailable(String algorithm) {
try {
// Attempt to create a Cipher instance with the specified algorithm.
JsseJce.getSignature(algorithm);
return true;
} catch (NoSuchAlgorithmException e) {
return false;
}
}

static {
boolean mediator = true;
try {
JsseJce.getSignature(SIGNATURE_ECDSA);
// When running in FIPS mode, the signature "SHA1withECDSA" is not
// available by default. In this scenario we should still set EC
// availability to true since other algorithms in the ECDSA signature
// family are available for use in various ECDSA TLS ciphers. All
// FIPS solutions are expected to have an algorithm such as
// "SHA512withECDSA", "SHA384withECDSA", "SHA256withECDSA", or
// "SHA224withECDSA" available so we will also check for these algorithms.
mediator = isSignatureAlgorithmAvailable(SIGNATURE_ECDSA)
|| isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_224)
|| isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_256)
|| isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_384)
|| isSignatureAlgorithmAvailable(SIGNATURE_ECDSA_512);

JsseJce.getSignature(SIGNATURE_RAWECDSA);
JsseJce.getKeyAgreement("ECDH");
JsseJce.getKeyFactory("EC");
Expand Down
File renamed without changes.
19 changes: 19 additions & 0 deletions test/jdk/ProblemList-FIPS140_3_OpenJcePlus.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# ===========================================================================
# (c) Copyright IBM Corp. 2023, 2023 All Rights Reserved
# ===========================================================================
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# IBM designates this particular file as subject to the "Classpath" exception
# as provided by IBM in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,26 @@
* @run main/othervm -Djava.security.debug=certpath CAInterop teliarootcav2 CRL
*/

/*
* @test id=emsignrootcag1
* @bug 8319187
* @summary Interoperability tests with eMudhra Root CA G1
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
* @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop emsignrootcag1 OCSP
* @run main/othervm -Djava.security.debug=certpath CAInterop emsignrootcag1 CRL
*/

/*
* @test id=emsigneccrootcag3
* @bug 8319187
* @summary Interoperability tests with eMudhra ECC Root CA G3
* @library /test/lib
* @build jtreg.SkippedException ValidatePathWithURL CAInterop
* @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop emsigneccrootcag3 OCSP
* @run main/othervm -Djava.security.debug=certpath CAInterop emsigneccrootcag3 CRL
*/

/**
* Collection of certificate validation tests for interoperability with external CAs
*/
Expand Down Expand Up @@ -586,6 +606,13 @@ private CATestURLs getTestURLs(String alias) {
return new CATestURLs("https://validpremiumecc.affirmtrust.com",
"https://revokedpremiumecc.affirmtrust.com");

case "emsignrootcag1":
return new CATestURLs("https://testovg1.emsign.com/RootOVG1.html",
"https://testovg1r.emsign.com/RootOVG1MR.html");
case "emsigneccrootcag3":
return new CATestURLs("https://testovg3.emsign.com/RootOVG3.html",
"https://testovg3r.emsign.com/RootOVG3MR.html");

default: throw new RuntimeException("No test setup found for: " + alias);
}
}
Expand Down

0 comments on commit e81be3d

Please sign in to comment.