Skip to content

Commit

Permalink
Merge pull request #294 from ibmruntimes/openj9
Browse files Browse the repository at this point in the history
Merge jdk-17.0.10+6 and the latest openj9 changes to 0.43
  • Loading branch information
JasonFengJ9 authored Dec 7, 2023
2 parents 988f297 + 5495408 commit 1ca15a6
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 3 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-17.0.10+5
OPENJDK_TAG := jdk-17.0.10+6
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 @@ -90,6 +96,26 @@ final class JsseJce {
*/
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 for EdDSA signatures.
*/
Expand Down Expand Up @@ -163,10 +189,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.
Signature.getInstance(algorithm);
return true;
} catch (NoSuchAlgorithmException e) {
return false;
}
}

static {
boolean mediator = true;
try {
Signature.getInstance(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);

Signature.getInstance(SIGNATURE_RAWECDSA);
KeyAgreement.getInstance("ECDH");
KeyFactory.getInstance("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/>.
# ===========================================================================
2 changes: 1 addition & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ java/lang/StringCoding/CheckEncodings.sh 7008363 generic-
java/lang/ProcessHandle/InfoTest.java 8211847 aix-ppc64
java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java 8151492 generic-all
java/lang/invoke/LFCaching/LFGarbageCollectedTest.java 8078602 generic-all
java/lang/invoke/lambda/LambdaFileEncodingSerialization.java 8249079 linux-x64
java/lang/invoke/lambda/LambdaFileEncodingSerialization.java 8249079 linux-all

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

Expand Down

0 comments on commit 1ca15a6

Please sign in to comment.