Skip to content

Commit

Permalink
Merge pull request ibmruntimes#120 from yaroklochko/bl-patches-may-it…
Browse files Browse the repository at this point in the history
…er-3

Port 5 patches from Java 11 z/OS for sun/security and crypto/provider
  • Loading branch information
PUSHKAR KULKARNI authored and GitHub Enterprise committed Jul 29, 2022
2 parents 4124889 + 520cb17 commit bf0be85
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
13 changes: 1 addition & 12 deletions closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
fi
],
[
case "$OPENJ9_PLATFORM_CODE" in
ap64|oa64|or64|wa64|xa64|xl64|xr64|xz64)
if test "x$COMPILE_TYPE" != xcross ; then
with_cmake=cmake
else
with_cmake=no
fi
;;
*)
with_cmake=no
;;
esac
with_cmake=cmake
])
# at this point with_cmake should either be no, or the name of the cmake command
if test "x$with_cmake" = xno ; then
Expand Down
24 changes: 24 additions & 0 deletions closed/custom/gensrc/GensrcVarHandles-post.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ===========================================================================
# (c) Copyright IBM Corp. 2018, 2022 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/>.
# ===========================================================================

ifneq (true,$(OPENJ9_ENABLE_OPENJDK_METHODHANDLES))
# OpenJ9 uses it's own VarHandles implementation
GENSRC_JAVA_BASE := $(filter-out $(GENSRC_VARHANDLES),$(GENSRC_JAVA_BASE))
endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Key recover(EncryptedPrivateKeyInfo encrInfo)
String oidName = new AlgorithmId
(privateKeyInfo.getAlgorithm().getOID()).getName();
KeyFactory kFac;
if (oidName.equals("RSA")) {
if (oidName.equalsIgnoreCase("RSA")) {
try {
// Ensures a PKCS#8 key will be loaded in the event IBMJCECCA
// is at the top of the provider list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public Key engineGetKey(String alias, char[] password)
// decode private key
if (entry instanceof PrivateKeyEntry) {
KeyFactory kfac;
if (keyAlgo.equals("RSA")) {
if (keyAlgo.equalsIgnoreCase("RSA")) {
try {
// Ensures a PKCS#8 key will be loaded in the event
// IBMJCECCA is at the top of the provider list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1935,10 +1935,10 @@ private void doGenKeyPair(String alias, String dname, String keyAlgName,
KeyIdentifier signerSubjectKeyId = null;
String providerName0 = providerName;

if (keyAlgName.equals("RSA") &&
(keyStore.getType().equals("JKS") ||
keyStore.getType().equals("JCEKS") ||
keyStore.getType().equals("PKCS12"))) {
if (keyAlgName.equalsIgnoreCase("RSA") &&
(keyStore.getType().equalsIgnoreCase("JKS") ||
keyStore.getType().equalsIgnoreCase("JCEKS") ||
keyStore.getType().equalsIgnoreCase("PKCS12"))) {
// Ensures a PKCS#8 key will be generated in the event IBMJCECCA is
// at the top of the provider list.
providerName0 = "SunRsaSign";
Expand Down

0 comments on commit bf0be85

Please sign in to comment.