Skip to content

Commit

Permalink
Merge pull request #689 from JasonFengJ9/mergetmp
Browse files Browse the repository at this point in the history
Merge master jdk-11.0.21+1 into openj9-staging
  • Loading branch information
keithc-ca committed Aug 4, 2023
2 parents 7ef5802 + b2dcc8d commit b7d53f4
Show file tree
Hide file tree
Showing 591 changed files with 21,484 additions and 8,269 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,17 @@ jobs:
# 'false' otherwise.
# arg $1: platform name or names to look for
function check_platform() {
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
echo 'false'
return
fi
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
input='${{ github.event.inputs.platforms }}'
elif [[ $GITHUB_EVENT_NAME == push ]]; then
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
else
echo 'Internal error in GHA'
exit 1
if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
# If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
>&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
echo 'false'
return
else
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
fi
fi
normalized_input="$(echo ,$input, | tr -d ' ')"
Expand Down
2 changes: 1 addition & 1 deletion .jcheck/conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
project=jdk-updates
jbs=JDK
version=11.0.20
version=11.0.21

[checks]
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace
Expand Down
2 changes: 1 addition & 1 deletion closed/custom/copy/Copy-java.base.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ifneq ($(OPENSSL_BUNDLE_LIB_PATH), )
# OpenSSL 1.1.1 on AIX has switched to use archive library files (natural way)
# instead of 'libcrypto.so' files.
# See https://github.com/openssl/openssl/pull/6487.
LIBCRYPTO_NAMES := libcrypto.so.3 libcrypto.so.1.1 libcrypto.so.1.0.0 libcrypto.a
LIBCRYPTO_NAMES := libcrypto64.so.3 libcrypto.so.3 libcrypto.so.1.1 libcrypto.so.1.0.0
else
LIBCRYPTO_NAMES := libcrypto.so
endif
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.20+8
OPENJDK_TAG := jdk-11.0.21+1
26 changes: 21 additions & 5 deletions closed/src/java.base/aix/native/libjncrypto/NativeCrypto_md.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2019, 2022 All Rights Reserved
* (c) Copyright IBM Corp. 2019, 2023 All Rights Reserved
* ===========================================================================
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -32,18 +32,34 @@
/* Load the crypto library (return NULL on error) */
void * load_crypto_library(jboolean traceEnabled) {
void * result = NULL;
const char *libname3_a_64 = "libcrypto.a(libcrypto64.so.3)";
const char *libname3_64 = "libcrypto64.so.3";
const char *libname3_a = "libcrypto.a(libcrypto.so.3)";
const char *libname3 = "libcrypto.so.3";
const char *libname111 = "libcrypto.a(libcrypto64.so.1.1)";
const char *libname110 = "libcrypto.so.1.1";
const char *libname102 = "libcrypto.so.1.0.0";
const char *symlink = "libcrypto.a(libcrypto64.so)";

result = dlopen (libname111, RTLD_NOW | RTLD_MEMBER);
result = dlopen (libname3_a_64, RTLD_NOW | RTLD_MEMBER);
if (result == NULL) {
result = dlopen (libname110, RTLD_NOW);
result = dlopen (libname3_64, RTLD_NOW);
if (result == NULL) {
result = dlopen (libname102, RTLD_NOW);
result = dlopen (libname3_a, RTLD_NOW | RTLD_MEMBER);
if (result == NULL) {
result = dlopen (symlink, RTLD_NOW | RTLD_MEMBER);
result = dlopen (libname3, RTLD_NOW);
if (result == NULL) {
result = dlopen (libname111, RTLD_NOW | RTLD_MEMBER);
if (result == NULL) {
result = dlopen (libname110, RTLD_NOW);
if (result == NULL) {
result = dlopen (libname102, RTLD_NOW);
if (result == NULL) {
result = dlopen (symlink, RTLD_NOW | RTLD_MEMBER);
}
}
}
}
}
}
}
Expand Down
14 changes: 9 additions & 5 deletions closed/src/java.base/macosx/native/libjncrypto/NativeCrypto_md.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2019, 2022 All Rights Reserved
* (c) Copyright IBM Corp. 2019, 2023 All Rights Reserved
* ===========================================================================
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -32,16 +32,20 @@
/* Load the crypto library (return NULL on error) */
void * load_crypto_library(jboolean traceEnabled) {
void * result = NULL;


const char *libname3 = "libcrypto.3.dylib";
const char *libname = "libcrypto.1.1.dylib";
const char *oldname = "libcrypto.1.0.0.dylib";
const char *symlink = "libcrypto.dylib";

result = dlopen (libname, RTLD_NOW);
result = dlopen (libname3, RTLD_NOW);
if (result == NULL) {
result = dlopen (oldname, RTLD_NOW);
result = dlopen (libname, RTLD_NOW);
if (result == NULL) {
result = dlopen (symlink, RTLD_NOW);
result = dlopen (oldname, RTLD_NOW);
if (result == NULL) {
result = dlopen (symlink, RTLD_NOW);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2019, 2022 All Rights Reserved
* (c) Copyright IBM Corp. 2019, 2023 All Rights Reserved
* ===========================================================================
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,13 +29,16 @@
/* Load the crypto library (return NULL on error) */
void * load_crypto_library(jboolean traceEnabled) {
void * result = NULL;
const char *libname3 = "libcrypto-3-x64.dll";
const char *libname = "libcrypto-1_1-x64.dll";
const char *oldname = "libeay32.dll";

result = LoadLibrary(libname);

result = LoadLibrary(libname3);
if (result == NULL) {
result = LoadLibrary(oldname);
result = LoadLibrary(libname);
if (result == NULL) {
result = LoadLibrary(oldname);
}
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static String getCurveName(ECParameterSpec params) {
String curveName;
if (params instanceof NamedCurve) {
NamedCurve namedCurve = (NamedCurve) params;
curveName = namedCurve.getName();
curveName = namedCurve.getNameAndAliases()[0];
} else {
/* use the OID */
try {
Expand Down
9 changes: 6 additions & 3 deletions make/autoconf/hotspot.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2023, 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 @@ -165,8 +165,11 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_DTRACE],
DTRACE_DEP_MISSING=false
AC_MSG_CHECKING([for dtrace tool])
if test "x$DTRACE" != "x" && test -x "$DTRACE"; then
AC_MSG_CHECKING([for dtrace tool and platform support])
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU_ARCH])
DTRACE_DEP_MISSING=true
elif test "x$DTRACE" != "x" && test -x "$DTRACE"; then
AC_MSG_RESULT([$DTRACE])
else
AC_MSG_RESULT([not found, cannot build dtrace])
Expand Down
6 changes: 3 additions & 3 deletions make/autoconf/version-numbers
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@

DEFAULT_VERSION_FEATURE=11
DEFAULT_VERSION_INTERIM=0
DEFAULT_VERSION_UPDATE=20
DEFAULT_VERSION_UPDATE=21
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_EXTRA1=0
DEFAULT_VERSION_EXTRA2=0
DEFAULT_VERSION_EXTRA3=0
DEFAULT_VERSION_DATE=2023-07-18
DEFAULT_VERSION_DATE=2023-10-17
DEFAULT_VERSION_CLASSFILE_MAJOR=55 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
DEFAULT_VERSION_CLASSFILE_MINOR=0
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="10 11"
DEFAULT_PROMOTED_VERSION_PRE=
DEFAULT_PROMOTED_VERSION_PRE=ea

LAUNCHER_NAME=openjdk
PRODUCT_NAME=OpenJDK
Expand Down
27 changes: 0 additions & 27 deletions make/data/cacerts/secomscrootca1

This file was deleted.

6 changes: 4 additions & 2 deletions make/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,12 @@ else
# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc

HARFBUZZ_DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing
HARFBUZZ_DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing \
array-bounds
# noexcept-type required for GCC 7 builds. Not required for GCC 8+.
# expansion-to-defined required for GCC 9 builds. Not required for GCC 10+.
HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \
maybe-uninitialized class-memaccess unused-result extra noexcept-type
maybe-uninitialized class-memaccess unused-result extra noexcept-type expansion-to-defined
HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \
tautological-constant-out-of-range-compare int-to-pointer-cast \
undef missing-field-initializers deprecated-declarations c++11-narrowing range-loop-analysis
Expand Down
17 changes: 6 additions & 11 deletions src/java.base/macosx/classes/apple/security/KeychainStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ class TrustedCertEntry {
private Hashtable<String, Object> entries = new Hashtable<>();

/**
* Algorithm identifiers and corresponding OIDs for the contents of the PKCS12 bag we get from the Keychain.
* Algorithm identifiers and corresponding OIDs for the contents of the
* PKCS12 bag we get from the Keychain.
*/
private static final int keyBag[] = {1, 2, 840, 113549, 1, 12, 10, 1, 2};
private static final int pbeWithSHAAnd3KeyTripleDESCBC[] = {1, 2, 840, 113549, 1, 12, 1, 3};
private static ObjectIdentifier PKCS8ShroudedKeyBag_OID;
private static ObjectIdentifier pbeWithSHAAnd3KeyTripleDESCBC_OID;
private static ObjectIdentifier PKCS8ShroudedKeyBag_OID =
ObjectIdentifier.of(KnownOIDs.PKCS8ShroudedKeyBag);
private static ObjectIdentifier pbeWithSHAAnd3KeyTripleDESCBC_OID =
ObjectIdentifier.of(KnownOIDs.PBEWithSHA1AndDESede);

/**
* Constnats used in PBE decryption.
Expand All @@ -131,12 +132,6 @@ public Void run() {
return null;
}
});
try {
PKCS8ShroudedKeyBag_OID = new ObjectIdentifier(keyBag);
pbeWithSHAAnd3KeyTripleDESCBC_OID = new ObjectIdentifier(pbeWithSHAAnd3KeyTripleDESCBC);
} catch (IOException ioe) {
// should not happen
}
}

private static void permissionCheck() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, 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 @@ -71,8 +71,6 @@ final class DHPrivateKey implements PrivateKey,
// the private-value length (optional)
private int l;

private int DH_data[] = { 1, 2, 840, 113549, 1, 3, 1 };

/**
* Make a DH private key out of a private value <code>x</code>, a prime
* modulus <code>p</code>, and a base generator <code>g</code>.
Expand Down Expand Up @@ -219,7 +217,7 @@ public synchronized byte[] getEncoded() {
DerOutputStream algid = new DerOutputStream();

// store OID
algid.putOID(new ObjectIdentifier(DH_data));
algid.putOID(DHPublicKey.DH_OID);
// encode parameters
DerOutputStream params = new DerOutputStream();
params.putInteger(this.p);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020, 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 @@ -68,7 +68,9 @@ final class DHPublicKey implements PublicKey,
// the private-value length (optional)
private int l;

private int DH_data[] = { 1, 2, 840, 113549, 1, 3, 1 };
// Note: this OID is used by DHPrivateKey as well.
static ObjectIdentifier DH_OID =
ObjectIdentifier.of(KnownOIDs.DiffieHellman);

/**
* Make a DH public key out of a public value <code>y</code>, a prime
Expand Down Expand Up @@ -202,7 +204,7 @@ public synchronized byte[] getEncoded() {
DerOutputStream algid = new DerOutputStream();

// store oid in algid
algid.putOID(new ObjectIdentifier(DH_data));
algid.putOID(DH_OID);

// encode parameters
DerOutputStream params = new DerOutputStream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

import sun.security.x509.AlgorithmId;
import sun.security.util.ObjectIdentifier;
import sun.security.util.KnownOIDs;
import sun.security.util.SecurityProperties;

/**
Expand All @@ -67,14 +68,6 @@

final class KeyProtector {

// defined by SunSoft (SKI project)
private static final String PBE_WITH_MD5_AND_DES3_CBC_OID
= "1.3.6.1.4.1.42.2.19.1";

// JavaSoft proprietary key-protection algorithm (used to protect private
// keys in the keystore implementation that comes with JDK 1.2)
private static final String KEY_PROTECTOR_OID = "1.3.6.1.4.1.42.2.17.1.1";

private static final int MAX_ITERATION_COUNT = 5000000;
private static final int MIN_ITERATION_COUNT = 10000;
private static final int DEFAULT_ITERATION_COUNT = 200000;
Expand Down Expand Up @@ -154,7 +147,8 @@ byte[] protect(PrivateKey key)
pbeParams.init(pbeSpec);

AlgorithmId encrAlg = new AlgorithmId
(new ObjectIdentifier(PBE_WITH_MD5_AND_DES3_CBC_OID), pbeParams);
(ObjectIdentifier.of(KnownOIDs.JAVASOFT_JCEKeyProtector),
pbeParams);
return new EncryptedPrivateKeyInfo(encrAlg,encrKey).getEncoded();
}

Expand All @@ -169,13 +163,13 @@ Key recover(EncryptedPrivateKeyInfo encrInfo)
SecretKey sKey = null;
try {
String encrAlg = encrInfo.getAlgorithm().getOID().toString();
if (!encrAlg.equals(PBE_WITH_MD5_AND_DES3_CBC_OID)
&& !encrAlg.equals(KEY_PROTECTOR_OID)) {
if (!encrAlg.equals(KnownOIDs.JAVASOFT_JCEKeyProtector.value())
&& !encrAlg.equals(KnownOIDs.JAVASOFT_JDKKeyProtector.value())) {
throw new UnrecoverableKeyException("Unsupported encryption "
+ "algorithm");
}

if (encrAlg.equals(KEY_PROTECTOR_OID)) {
if (encrAlg.equals(KnownOIDs.JAVASOFT_JDKKeyProtector.value())) {
// JDK 1.2 style recovery
plain = recover(encrInfo.getEncryptedData());
} else {
Expand Down
Loading

0 comments on commit b7d53f4

Please sign in to comment.