Version in base suite: 17.0.7+7-1~deb11u1 Version in overlay suite: 17.0.9+9-1~deb11u1 Base version: openjdk-17_17.0.9+9-1~deb11u1 Target version: openjdk-17_17.0.10+7-1~deb11u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/o/openjdk-17/openjdk-17_17.0.9+9-1~deb11u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/o/openjdk-17/openjdk-17_17.0.10+7-1~deb11u1.dsc /srv/release.debian.org/tmp/dMyM48XNv5/openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/ksWithSAN |binary openjdk-17-17.0.10+7/.jcheck/conf | 2 openjdk-17-17.0.10+7/debian/changelog | 65 openjdk-17-17.0.10+7/debian/control | 2 openjdk-17-17.0.10+7/debian/copyright | 4539 ++++------ openjdk-17-17.0.10+7/debian/copyright-generator/bundled-stanzas | 31 openjdk-17-17.0.10+7/debian/copyright-generator/copyright-gen.py | 291 openjdk-17-17.0.10+7/debian/copyright-generator/debian-stanzas | 40 openjdk-17-17.0.10+7/debian/copyright-generator/strip-common-licenses.sh | 18 openjdk-17-17.0.10+7/debian/patches/8315020.diff | 31 openjdk-17-17.0.10+7/debian/patches/build_gtest.patch | 4 openjdk-17-17.0.10+7/debian/patches/googletest-version.diff | 24 openjdk-17-17.0.10+7/debian/patches/hotspot-disable-exec-shield-workaround.diff | 4 openjdk-17-17.0.10+7/debian/patches/jtreg-location.diff | 14 openjdk-17-17.0.10+7/debian/patches/m68k-support.diff | 12 openjdk-17-17.0.10+7/debian/patches/series | 2 openjdk-17-17.0.10+7/debian/patches/system-pcsclite.diff | 20 openjdk-17-17.0.10+7/debian/patches/update-permission-test.patch | 8 openjdk-17-17.0.10+7/debian/rules | 30 openjdk-17-17.0.10+7/debian/tests/control | 4 openjdk-17-17.0.10+7/debian/tests/hotspot | 9 openjdk-17-17.0.10+7/debian/tests/jdk | 8 openjdk-17-17.0.10+7/debian/tests/jtreg-autopkgtest.sh | 2 openjdk-17-17.0.10+7/debian/tests/langtools | 5 openjdk-17-17.0.10+7/debian/tests/write-problems | 25 openjdk-17-17.0.10+7/debian/watch | 10 openjdk-17-17.0.10+7/debian/watch.in | 13 openjdk-17-17.0.10+7/doc/testing.html | 1 openjdk-17-17.0.10+7/doc/testing.md | 5 openjdk-17-17.0.10+7/make/RunTests.gmk | 11 openjdk-17-17.0.10+7/make/RunTestsPrebuilt.gmk | 7 openjdk-17-17.0.10+7/make/autoconf/basic.m4 | 11 openjdk-17-17.0.10+7/make/autoconf/configure.ac | 18 openjdk-17-17.0.10+7/make/autoconf/jdk-options.m4 | 26 openjdk-17-17.0.10+7/make/autoconf/lib-tests.m4 | 187 openjdk-17-17.0.10+7/make/autoconf/lib-x11.m4 | 8 openjdk-17-17.0.10+7/make/autoconf/libraries.m4 | 6 openjdk-17-17.0.10+7/make/autoconf/platform.m4 | 2 openjdk-17-17.0.10+7/make/autoconf/toolchain.m4 | 140 openjdk-17-17.0.10+7/make/conf/github-actions.conf | 2 openjdk-17-17.0.10+7/make/conf/jib-profiles.js | 9 openjdk-17-17.0.10+7/make/conf/version-numbers.conf | 4 openjdk-17-17.0.10+7/make/data/cacerts/digicertcseccrootg5 | 21 openjdk-17-17.0.10+7/make/data/cacerts/digicertcsrsarootg5 | 38 openjdk-17-17.0.10+7/make/data/cacerts/digicerttlseccrootg5 | 21 openjdk-17-17.0.10+7/make/data/cacerts/digicerttlsrsarootg5 | 38 openjdk-17-17.0.10+7/make/data/cacerts/emsigneccrootcag3 | 22 openjdk-17-17.0.10+7/make/data/cacerts/emsignrootcag1 | 29 openjdk-17-17.0.10+7/make/data/cacerts/emsignrootcag2 | 39 openjdk-17-17.0.10+7/make/data/cacerts/letsencryptisrgx2 | 21 openjdk-17-17.0.10+7/make/data/cacerts/teliarootcav2 | 39 openjdk-17-17.0.10+7/make/devkit/createJMHBundle.sh | 22 openjdk-17-17.0.10+7/make/modules/java.desktop/lib/Awt2dLibraries.gmk | 2 openjdk-17-17.0.10+7/make/modules/jdk.net/Lib.gmk | 7 openjdk-17-17.0.10+7/make/test/BuildTestLib.gmk | 15 openjdk-17-17.0.10+7/make/test/JtregNativeJdk.gmk | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/frame_ppc.inline.hpp | 1 openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp | 142 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/assembler_riscv.hpp | 24 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp | 143 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp | 6 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv.ad | 285 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv64.ad | 285 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/z/z_riscv.ad | 233 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/z/z_riscv64.ad | 233 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/icache_riscv.cpp | 19 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/interp_masm_riscv.cpp | 31 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/interp_masm_riscv.hpp | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp | 218 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp | 16 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/nativeInst_riscv.cpp | 24 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/nativeInst_riscv.hpp | 22 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/register_riscv.hpp | 68 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/relocInfo_riscv.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/riscv.ad | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp | 521 - openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp | 4 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp | 5 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/templateTable_riscv.cpp | 30 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/vm_version_riscv.cpp | 54 openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/vm_version_riscv.hpp | 194 openjdk-17-17.0.10+7/src/hotspot/cpu/x86/vm_version_x86.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/cpu/x86/x86.ad | 4 openjdk-17-17.0.10+7/src/hotspot/os/linux/globals_linux.hpp | 9 openjdk-17-17.0.10+7/src/hotspot/os/linux/hugepages.cpp | 241 openjdk-17-17.0.10+7/src/hotspot/os/linux/hugepages.hpp | 115 openjdk-17-17.0.10+7/src/hotspot/os/linux/os_linux.cpp | 276 openjdk-17-17.0.10+7/src/hotspot/os/linux/os_linux.hpp | 6 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp | 73 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp | 2 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp | 77 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.hpp | 39 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp | 152 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.hpp | 39 openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp | 224 openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_GraphBuilder.cpp | 9 openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_LIRGenerator.cpp | 1 openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_RangeCheckElimination.cpp | 21 openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_ValueMap.cpp | 29 openjdk-17-17.0.10+7/src/hotspot/share/cds/heapShared.cpp | 25 openjdk-17-17.0.10+7/src/hotspot/share/ci/ciEnv.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp | 98 openjdk-17-17.0.10+7/src/hotspot/share/classfile/javaClasses.cpp | 9 openjdk-17-17.0.10+7/src/hotspot/share/classfile/verifier.cpp | 5 openjdk-17-17.0.10+7/src/hotspot/share/code/codeBlob.cpp | 3 openjdk-17-17.0.10+7/src/hotspot/share/code/codeCache.cpp | 30 openjdk-17-17.0.10+7/src/hotspot/share/code/codeCache.hpp | 2 openjdk-17-17.0.10+7/src/hotspot/share/code/vtableStubs.cpp | 5 openjdk-17-17.0.10+7/src/hotspot/share/compiler/compileBroker.cpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/compiler/compilerDefinitions.cpp | 7 openjdk-17-17.0.10+7/src/hotspot/share/compiler/compilerOracle.cpp | 19 openjdk-17-17.0.10+7/src/hotspot/share/gc/g1/g1Trace.cpp | 6 openjdk-17-17.0.10+7/src/hotspot/share/gc/parallel/psPromotionManager.cpp | 5 openjdk-17-17.0.10+7/src/hotspot/share/gc/parallel/psScavenge.cpp | 10 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gcTimer.cpp | 3 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gcTraceSend.cpp | 6 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gc_globals.hpp | 8 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.cpp | 6 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.hpp | 1 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.inline.hpp | 6 openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/tlab_globals.hpp | 7 openjdk-17-17.0.10+7/src/hotspot/share/interpreter/bytecodes.cpp | 22 openjdk-17-17.0.10+7/src/hotspot/share/jfr/metadata/metadata.xml | 5 openjdk-17-17.0.10+7/src/hotspot/share/jfr/recorder/service/jfrPostBox.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp | 5 openjdk-17-17.0.10+7/src/hotspot/share/jfr/utilities/jfrTryLock.hpp | 16 openjdk-17-17.0.10+7/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp | 9 openjdk-17-17.0.10+7/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/opto/doCall.cpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/opto/ifnode.cpp | 59 openjdk-17-17.0.10+7/src/hotspot/share/opto/loopTransform.cpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/opto/loopnode.cpp | 363 openjdk-17-17.0.10+7/src/hotspot/share/opto/loopnode.hpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/opto/loopopts.cpp | 51 openjdk-17-17.0.10+7/src/hotspot/share/prims/jvmtiEnvBase.cpp | 27 openjdk-17-17.0.10+7/src/hotspot/share/prims/whitebox.cpp | 15 openjdk-17-17.0.10+7/src/hotspot/share/runtime/deoptimization.cpp | 121 openjdk-17-17.0.10+7/src/hotspot/share/runtime/deoptimization.hpp | 1 openjdk-17-17.0.10+7/src/hotspot/share/runtime/os.cpp | 29 openjdk-17-17.0.10+7/src/hotspot/share/services/mallocSiteTable.cpp | 22 openjdk-17-17.0.10+7/src/hotspot/share/services/mallocSiteTable.hpp | 43 openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.cpp | 120 openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.hpp | 170 openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.inline.hpp | 36 openjdk-17-17.0.10+7/src/hotspot/share/services/memBaseline.hpp | 2 openjdk-17-17.0.10+7/src/hotspot/share/services/memReporter.cpp | 115 openjdk-17-17.0.10+7/src/hotspot/share/services/memReporter.hpp | 6 openjdk-17-17.0.10+7/src/hotspot/share/services/memTracker.cpp | 6 openjdk-17-17.0.10+7/src/hotspot/share/services/memTracker.hpp | 42 openjdk-17-17.0.10+7/src/hotspot/share/services/nmtCommon.hpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/services/nmtDCmd.cpp | 2 openjdk-17-17.0.10+7/src/hotspot/share/utilities/debug.cpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/utilities/globalDefinitions.hpp | 4 openjdk-17-17.0.10+7/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp | 10 openjdk-17-17.0.10+7/src/hotspot/share/utilities/growableArray.hpp | 20 openjdk-17-17.0.10+7/src/hotspot/share/utilities/nativeCallStack.cpp | 1 openjdk-17-17.0.10+7/src/hotspot/share/utilities/nativeCallStack.hpp | 28 openjdk-17-17.0.10+7/src/hotspot/share/utilities/vmError.cpp | 1 openjdk-17-17.0.10+7/src/java.base/aix/native/libnet/aix_close.c | 48 openjdk-17-17.0.10+7/src/java.base/linux/native/libnet/linux_close.c | 50 openjdk-17-17.0.10+7/src/java.base/macosx/native/libnet/bsd_close.c | 50 openjdk-17-17.0.10+7/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java | 7 openjdk-17-17.0.10+7/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java | 47 openjdk-17-17.0.10+7/src/java.base/share/classes/java/lang/System.java | 10 openjdk-17-17.0.10+7/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java | 20 openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/Formatter.java | 9 openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/jar/JarFile.java | 4 openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/zip/ZipFile.java | 15 openjdk-17-17.0.10+7/src/java.base/share/classes/javax/crypto/JceSecurity.java.template | 71 openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java | 53 openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java | 33 openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java | 60 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java | 8 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java | 52 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/rsa/RSAPadding.java | 69 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/rsa/RSASignature.java | 65 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java | 30 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java | 62 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java | 8 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/X509Authentication.java | 224 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/util/KeyUtil.java | 75 openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java | 12 openjdk-17-17.0.10+7/src/java.base/share/native/libverify/check_code.c | 11 openjdk-17-17.0.10+7/src/java.base/unix/native/jspawnhelper/jspawnhelper.c | 4 openjdk-17-17.0.10+7/src/java.base/unix/native/libjava/ProcessImpl_md.c | 12 openjdk-17-17.0.10+7/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java | 19 openjdk-17-17.0.10+7/src/java.desktop/share/classes/javax/imageio/ImageIO.java | 2 openjdk-17-17.0.10+7/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java | 48 openjdk-17-17.0.10+7/src/java.desktop/share/classes/sun/swing/CachedPainter.java | 7 openjdk-17-17.0.10+7/src/java.desktop/share/native/libfontmanager/freetypeScaler.c | 8 openjdk-17-17.0.10+7/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java | 20 openjdk-17-17.0.10+7/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java | 15 openjdk-17-17.0.10+7/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java | 55 openjdk-17-17.0.10+7/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java | 128 openjdk-17-17.0.10+7/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java | 29 openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp | 54 openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp | 14 openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp | 10 openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp | 23 openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp | 30 openjdk-17-17.0.10+7/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.cpp | 21 openjdk-17-17.0.10+7/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java | 180 openjdk-17-17.0.10+7/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java | 6 openjdk-17-17.0.10+7/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java | 11 openjdk-17-17.0.10+7/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c | 5 openjdk-17-17.0.10+7/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java | 1 openjdk-17-17.0.10+7/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java | 1 openjdk-17-17.0.10+7/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java | 11 openjdk-17-17.0.10+7/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java | 8 openjdk-17-17.0.10+7/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java | 735 - openjdk-17-17.0.10+7/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java | 46 openjdk-17-17.0.10+7/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java | 82 openjdk-17-17.0.10+7/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp | 42 openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java | 2 openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java | 6 openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java | 4 openjdk-17-17.0.10+7/src/jdk.internal.le/share/legal/jline.md | 253 openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/TargetDescription.java | 4 openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java | 2 openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java | 29 openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java | 3 openjdk-17-17.0.10+7/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c | 44 openjdk-17-17.0.10+7/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c | 31 openjdk-17-17.0.10+7/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec | 9 openjdk-17-17.0.10+7/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java | 24 openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp | 41 openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/common/Executor.cpp | 166 openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/common/Executor.h | 111 openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp | 129 openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/msiwrapper/Executor.h | 84 openjdk-17-17.0.10+7/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java | 12 openjdk-17-17.0.10+7/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c | 8 openjdk-17-17.0.10+7/src/jdk.net/macosx/classes/jdk/net/MacOSXSocketOptions.java | 12 openjdk-17-17.0.10+7/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c | 8 openjdk-17-17.0.10+7/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java | 20 openjdk-17-17.0.10+7/src/jdk.net/windows/classes/jdk/net/WindowsSocketOptions.java | 92 openjdk-17-17.0.10+7/src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c | 171 openjdk-17-17.0.10+7/test/failure_handler/src/share/conf/common.properties | 2 openjdk-17-17.0.10+7/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp | 4 openjdk-17-17.0.10+7/test/hotspot/gtest/runtime/test_os.cpp | 58 openjdk-17-17.0.10+7/test/hotspot/gtest/utilities/test_globalDefinitions.cpp | 22 openjdk-17-17.0.10+7/test/hotspot/jtreg/ProblemList-zgc.txt | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/ProblemList.txt | 17 openjdk-17-17.0.10+7/test/hotspot/jtreg/TEST.ROOT | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/applications/scimark/Scimark.java | 7 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/Test8301489.java | 116 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiver.java | 60 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiverHelper.jasm | 44 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java | 98 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java | 18 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java | 10 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java | 52 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java | 12 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c | 33 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java | 48 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/aarch64/AArch64TestAssembler.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/meta/StableFieldTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java | 32 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java | 56 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestNodeSunkFromPreLoop.java | 71 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSinkingMoreThan2AddPNodes.java | 75 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSinkingNodesCausesLongCompilation.java | 63 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSunkNodeMissingCastAssert.java | 57 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm | 111 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java | 65 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java | 22 openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java | 24 openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java | 70 openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java | 28 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStrings.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/VerifyArchivedFields.java | 53 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java | 5 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ItablesTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ModulesTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/SafepointTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/StackWalkTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VMOperationTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VerificationTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VtablesTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java | 1 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/HugePageConfiguration.java | 270 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java | 244 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java | 157 openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java | 75 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java | 92 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/vm/TrimLibcHeapTest.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java | 18 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java | 22 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java | 91 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java | 3 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004a.java | 10 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001a.java | 11 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/_bounds_/filters001a.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter001a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003a.java | 13 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter004a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter001a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003a.java | 7 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt001a.java | 25 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt003a.java | 25 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s001a.java | 25 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002a.java | 17 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod007a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011t.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod013t.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001a.java | 7 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance007a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/equals/equals001a.java | 10 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/hashCode/hashcode001a.java | 10 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002a.java | 7 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001a.java | 7 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002a.java | 7 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003a.java | 10 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004a.java | 10 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/eventIterator/eventiterator003a.java | 6 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume008a.java | 24 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/resume/resume009a.java | 24 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy008a.java | 40 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/suspendPolicy/suspendpolicy009a.java | 40 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassExclusionFilter/filter001a.java | 30 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_rt/filter_rt001a.java | 25 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_rt/filter_rt002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_rt/filter_rt003a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_s/filter_s001a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addClassFilter_s/filter_s002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter001a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter002a.java | 12 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter003a.java | 13 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addInstanceFilter/instancefilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter001a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/addThreadFilter/threadfilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyCaught/notifycaught001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ExceptionRequest/notifyUncaught/notifyuncaught001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocalVariable/isVisible/isvisible001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location004a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Locatable/location/location005a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/LocatableEvent/thread/thread001a.java | 11 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassExclusionFilter/filter001a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_rt/filter_rt001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_rt/filter_rt002a.java | 12 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_rt/filter_rt003a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addClassFilter_s/filter_s001a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter001a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addInstanceFilter/instancefilter004a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter001a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodEntryRequest/addThreadFilter/threadfilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassExclusionFilter/filter001a.java | 17 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_rt/filter_rt001a.java | 17 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_rt/filter_rt002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_rt/filter_rt003a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addClassFilter_s/filter_s001a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter001a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter003a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addInstanceFilter/instancefilter004a.java | 22 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter001a.java | 20 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter003a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/MethodExitRequest/addThreadFilter/threadfilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/getValue/getvalue001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread001a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/getValue/getvalue001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/getValue/getvalue002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/getValues/getvalues001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/getValues/getvalues002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/location/location001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue001/setvalue001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue002/setvalue002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue003/setvalue003a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/setValue/setvalue004/setvalue004a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/thread/thread001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter001a.java | 28 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt001a.java | 37 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt003a.java | 34 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s001a.java | 28 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter001a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/depth/depth003a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/size/size002a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/StepRequest/thread/thread001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter005a.java | 11 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001a.java | 2 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frame/frame001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended002a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended003a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended004a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/name/name001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes002a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes004a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/resume/resume001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/stop/stop001a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspend/suspend001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartEvent/thread/thread001a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001a.java | 16 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter004a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter005a.java | 11 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose002a.java | 14 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose004a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/dispose/dispose005a.java | 8 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/suspend/suspend001a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter001a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter002a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt001a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt002a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt005a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt006a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s001a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s002a.java | 29 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter001a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter002a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter004a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter005a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter006a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter007a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter008a.java | 21 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter001a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter002a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter003a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter004a.java | 15 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter005a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter006a.java | 9 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter007a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter008a.java | 19 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001.java | 98 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load007/TestDescription.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load011/TestDescription.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load012/TestDescription.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIThreadFactory.java | 50 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIUtils.java | 44 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/NamedTask.java | 40 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties | 24 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java | 4 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java | 5 openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java | 4 openjdk-17-17.0.10+7/test/jaxp/TEST.ROOT | 2 openjdk-17-17.0.10+7/test/jdk/ProblemList.txt | 28 openjdk-17-17.0.10+7/test/jdk/TEST.ROOT | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java | 58 openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/AfterThreadDeathTest.java | 32 openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/JdwpOnThrowTest.java | 157 openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/ThrowCaughtException.java | 36 openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java | 39 openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java | 249 openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java | 168 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/DateFormatterTest.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/HttpServerTest.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/SelCacheTest.java | 7 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test.java | 8 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test1.java | 7 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test10.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test11.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test12.java | 7 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test13.java | 7 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test14.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test2.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test3.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test4.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test5.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test6.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test6a.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test7.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test7a.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test8.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test8a.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test9.java | 7 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test9a.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/TestLogging.java | 5 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6339483.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6341616.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6361557.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6393710.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6401598.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6431193.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6433018.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6526158.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6526913.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6529200.java | 10 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6744329.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6886436.java | 6 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B8211420.java | 4 openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java | 4 openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java | 11 openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/EmptyChoiceTest.java | 85 openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/InsertRemoveTest.java | 92 openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/OpenedChoiceHangs.java | 145 openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java | 113 openjdk-17-17.0.10+7/test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java | 35 openjdk-17-17.0.10+7/test/jdk/java/awt/FontClass/FontScalerRoundTest.java | 69 openjdk-17-17.0.10+7/test/jdk/java/awt/Frame/AwtFramePackTest.java | 120 openjdk-17-17.0.10+7/test/jdk/java/awt/Graphics2D/DrawPrimitivesTest.java | 150 openjdk-17-17.0.10+7/test/jdk/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java | 72 openjdk-17-17.0.10+7/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java | 24 openjdk-17-17.0.10+7/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.html | 42 openjdk-17-17.0.10+7/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.java | 76 openjdk-17-17.0.10+7/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.html | 42 openjdk-17-17.0.10+7/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.java | 72 openjdk-17-17.0.10+7/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java | 41 openjdk-17-17.0.10+7/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java | 9 openjdk-17-17.0.10+7/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java | 556 + openjdk-17-17.0.10+7/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java | 29 openjdk-17-17.0.10+7/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java | 1 openjdk-17-17.0.10+7/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java | 1 openjdk-17-17.0.10+7/test/jdk/java/io/File/GetXSpace.java | 198 openjdk-17-17.0.10+7/test/jdk/java/io/File/libGetXSpace.c | 164 openjdk-17-17.0.10+7/test/jdk/java/io/ObjectStreamClass/TestOSCClassLoaderLeak.java | 11 openjdk-17-17.0.10+7/test/jdk/java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java | 5 openjdk-17-17.0.10+7/test/jdk/java/lang/ProcessHandle/InfoTest.java | 51 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder | 1 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java | 94 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java | 92 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java | 132 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder | 1 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java | 307 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java | 74 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java | 155 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties | 14 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java | 7 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java | 5 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java | 61 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java | 4 openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java | 61 openjdk-17-17.0.10+7/test/jdk/java/lang/Thread/IsAlive.java | 2 openjdk-17-17.0.10+7/test/jdk/java/lang/instrument/GetObjectSizeIntrinsicsTest.java | 6 openjdk-17-17.0.10+7/test/jdk/java/lang/invoke/defineHiddenClass/UnloadingTest.java | 13 openjdk-17-17.0.10+7/test/jdk/java/lang/invoke/unreflect/TEST.properties | 24 openjdk-17-17.0.10+7/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java | 76 openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java | 6 openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/sealed_classes/SealedClassesReflectionTest.java | 6 openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/sealed_classes/TestSecurityManagerChecks.java | 6 openjdk-17-17.0.10+7/test/jdk/java/net/DatagramSocket/DatagramSocketMulticasting.java | 96 openjdk-17-17.0.10+7/test/jdk/java/net/DatagramSocket/SendPortZero.java | 24 openjdk-17-17.0.10+7/test/jdk/java/net/MulticastSocket/SendPortZero.java | 22 openjdk-17-17.0.10+7/test/jdk/java/net/Socket/B8312065.java | 88 openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/HandshakeFailureTest.java | 2 openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/HttpServerAdapters.java | 19 openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/SpecialHeadersTest.java | 448 openjdk-17-17.0.10+7/test/jdk/java/nio/Buffer/BulkPutBuffer.java | 6 openjdk-17-17.0.10+7/test/jdk/java/nio/file/FileStore/Basic.java | 32 openjdk-17-17.0.10+7/test/jdk/java/nio/file/Files/CopyAndMove.java | 4 openjdk-17-17.0.10+7/test/jdk/java/util/Formatter/Padding.java | 313 openjdk-17-17.0.10+7/test/jdk/java/util/Random/RandomTestBsi1999.java | 4 openjdk-17-17.0.10+7/test/jdk/java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java | 4 openjdk-17-17.0.10+7/test/jdk/java/util/concurrent/tck/JSR166TestCase.java | 41 openjdk-17-17.0.10+7/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java | 173 openjdk-17-17.0.10+7/test/jdk/java/util/zip/DeInflate.java | 75 openjdk-17-17.0.10+7/test/jdk/java/util/zip/ZipFile/ZipFileDuplicateEntryTest.java | 581 + openjdk-17-17.0.10+7/test/jdk/javax/crypto/JceSecurity/VerificationResults.java | 59 openjdk-17-17.0.10+7/test/jdk/javax/imageio/ReadImageNoIAETest.java | 156 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java | 138 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLEngineAlpnTest.java | 5 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLServerSocketAlpnTest.java | 287 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLSocketAlpnTest.java | 273 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/DTLS/DTLSOverDatagram.java | 181 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java | 33 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/Basics.java | 160 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java | 714 - openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/CheckTlsEngineResults.java | 709 + openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java | 777 - openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java | 92 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/HandshakeWithInvalidRecordVersion.java | 226 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java | 1 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java | 77 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/TestAllSuites.java | 267 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLSession/ResumeTLS13withSNI.java | 18 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java | 11 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java | 168 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java | 1319 +- openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java | 2 openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java | 532 - openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java | 740 - openjdk-17-17.0.10+7/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java | 83 openjdk-17-17.0.10+7/test/jdk/javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java | 1 openjdk-17-17.0.10+7/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java | 50 openjdk-17-17.0.10+7/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy | 4 openjdk-17-17.0.10+7/test/jdk/javax/swing/JMenuItem/8031573/bug8031573.java | 34 openjdk-17-17.0.10+7/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java | 119 openjdk-17-17.0.10+7/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java | 6 openjdk-17-17.0.10+7/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java | 88 openjdk-17-17.0.10+7/test/jdk/javax/swing/dnd/7171812/bug7171812.java | 43 openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4357975.java | 103 openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/HTMLWriter/bug4841760.java | 67 openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/ImageView/bug4329185.java | 118 openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/InlineView/bug4623342.java | 110 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMCrash.java | 6 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMExit.java | 4 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java | 7 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java | 4 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java | 4 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java | 19 openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java | 3 openjdk-17-17.0.10+7/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java | 137 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java | 217 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java | 613 - openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java | 330 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java | 695 + openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java | 220 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java | 293 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java | 643 - openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java | 303 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java | 179 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java | 319 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java | 212 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java | 346 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java | 621 - openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java | 180 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java | 348 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java | 495 - openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java | 490 - openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java | 206 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java | 195 openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java | 229 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/RunTest.sh | 33 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh | 131 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java | 787 - openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.sh | 66 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh | 64 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.java | 413 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiSslNoKeyStoreTest.sh | 62 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiTestBase.java | 265 openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/Utils.java | 146 openjdk-17-17.0.10+7/test/jdk/sun/misc/UnsafeFieldOffsets.java | 6 openjdk-17-17.0.10+7/test/jdk/sun/net/www/http/HttpClient/ProxyFromCache.java | 25 openjdk-17-17.0.10+7/test/jdk/sun/net/www/http/HttpClient/RequestURI.java | 11 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/CloseOptionHeader.java | 32 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/HttpHeaderParserTest.java | 498 + openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/NTLMTest.java | 8 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/NoNTLM.java | 18 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/RetryUponTimeout.java | 8 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/UserAgent.java | 10 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java | 16 openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java | 11 openjdk-17-17.0.10+7/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java | 25 openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java | 4 openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java | 98 openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java | 4 openjdk-17-17.0.10+7/test/jdk/sun/security/rsa/RSAPaddingCheck.java | 63 openjdk-17-17.0.10+7/test/jdk/sun/security/rsa/WithoutNULL.java | 57 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java | 2 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/CipherSuite/DisabledCurve.java | 20 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/CipherSuite/RestrictSignatureScheme.java | 135 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLContextImpl/MultipleChooseAlias.java | 169 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineBadBufferArrayAccess.java | 103 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSessionImpl/InvalidateSession.java | 2 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/ClientSocketCloseHang.java | 2 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruceForceClose.java | 141 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruteForceClose.java | 102 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketClose.java | 168 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SocketExceptionForSocketIssues.java | 148 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SignatureScheme/SigAlgosExtTestWithTLS12.java | 135 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SignatureScheme/Tls13NamedGroups.java | 137 openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/TooManyCAs.java | 165 openjdk-17-17.0.10+7/test/jdk/sun/security/tools/jarsigner/Warning.java | 2 openjdk-17-17.0.10+7/test/jdk/sun/util/calendar/zi/GenDoc.java | 8 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/WindowsHelper.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java | 16 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/Win8301247Test.java | 164 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinDirChooserTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinInstallerIconTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinL10nTest.java | 9 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinMenuTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinScriptTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinShortcutPromptTest.java | 10 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinShortcutTest.java | 2 openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinUrlTest.java | 2 openjdk-17-17.0.10+7/test/jtreg-ext/requires/VMProps.java | 101 openjdk-17-17.0.10+7/test/langtools/TEST.ROOT | 2 openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java | 9 openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java | 3 openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/tool/CheckManPageOptions.java | 287 openjdk-17-17.0.10+7/test/langtools/jdk/jshell/HangingRemoteAgent.java | 11 openjdk-17-17.0.10+7/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java | 4 openjdk-17-17.0.10+7/test/langtools/tools/javac/ConditionalExpressionResolvePending.java | 4 openjdk-17-17.0.10+7/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java | 49 openjdk-17-17.0.10+7/test/langtools/tools/javac/lib/DPrinter.java | 2 openjdk-17-17.0.10+7/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.java | 13 openjdk-17-17.0.10+7/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.out | 2 openjdk-17-17.0.10+7/test/lib-test/TEST.ROOT | 4 openjdk-17-17.0.10+7/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java | 4 openjdk-17-17.0.10+7/test/lib-test/jdk/test/lib/hprof/HprofTest.java | 171 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/Platform.java | 63 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/SA/SATestUtils.java | 6 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/SecurityTools.java | 12 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/cds/CDSTestUtils.java | 13 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java | 37 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hexdump/ASN1Formatter.java | 4 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hprof/model/JavaObject.java | 4 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java | 32 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/jfr/StreamingUtils.java | 4 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/net/HttpHeaderParser.java | 390 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/net/SimpleHttpServer.java | 4 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/process/OutputAnalyzer.java | 56 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/security/SecurityUtils.java | 23 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/util/CoreUtils.java | 18 openjdk-17-17.0.10+7/test/lib/jdk/test/lib/util/ForceGC.java | 79 openjdk-17-17.0.10+7/test/lib/jdk/test/whitebox/WhiteBox.java | 2 openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/Multiple.java | 85 openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java | 111 openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java | 105 openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java | 80 openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/Single.java | 70 904 files changed, 28046 insertions(+), 21258 deletions(-) diff -Nru openjdk-17-17.0.9+9/.jcheck/conf openjdk-17-17.0.10+7/.jcheck/conf --- openjdk-17-17.0.9+9/.jcheck/conf 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/.jcheck/conf 2024-01-09 21:18:15.000000000 +0000 @@ -1,7 +1,7 @@ [general] project=jdk-updates jbs=JDK -version=17.0.9 +version=17.0.10 [checks] error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists diff -Nru openjdk-17-17.0.9+9/debian/changelog openjdk-17-17.0.10+7/debian/changelog --- openjdk-17-17.0.9+9/debian/changelog 2023-10-31 23:23:59.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/changelog 2024-01-30 23:08:29.000000000 +0000 @@ -1,8 +1,69 @@ -openjdk-17 (17.0.9+9-1~deb11u1) bullseye-security; urgency=medium +openjdk-17 (17.0.10+7-1~deb11u1) bullseye-security; urgency=medium * Rebuild for bullseye - -- Moritz Muehlenhoff Wed, 01 Nov 2023 00:23:59 +0100 + -- Moritz Wed, 31 Jan 2024 00:08:29 +0100 + +openjdk-17 (17.0.10+7-1) unstable; urgency=high + + * OpenJDK 17.0.10 release, build 7. + - CVEs: + + CVE-2024-20918 + + CVE-2024-20919 + + CVE-2024-20921 + + CVE-2024-20932 + + CVE-2024-20945 + + CVE-2024-20952 + - Security fixes: + + JDK-8276123, JDK-8316613: ZipFile::getEntry will not return a file entry + when there is a directory entry of the same name within a Zip File. + + JDK-8308204: Enhanced certificate processing. + + JDK-8314295: Enhance verification of verifier. + + JDK-8314307: Improve loop handling. + + JDK-8314468: Improve Compiler loops. + + JDK-8316976: Improve signature handling. + + JDK-8317547: Enhance TLS connection support. + + [ Vladimir Petko ] + * d/t/jtreg-autopkgtest.sh: Regenerate test script. + * Generate d/watch to cope with early access and release builds. + * d/rules: Trim trailing whitespaces from debian/control. + + [ Matthias Klose ] + * Build again zero on amd64 (accidental change in 6ea-1). + + [ Pushkar Kulkarni ] + * Minor improvements to the copyright-generator. + + -- Matthias Klose Wed, 17 Jan 2024 12:09:47 +0100 + +openjdk-17 (17.0.10~6ea-1) unstable; urgency=medium + + * OpenJDK 17.0.10 early access, build 6. + + [ Pushkar Kulkarni ] + * debian/copyright: Fix whitespace issues. + + [ Vladimir Petko ] + * d/copyright: Fix lintian warning. + + [ Matthias Klose ] + * d/copyright: Fix source location. + * Build-depend on jtreg7 instead of jtreg6. + * d/p/googletest-version.diff: Ignore the version check, keep 1.14. + * Refresh patches. + + -- Matthias Klose Tue, 26 Dec 2023 13:18:48 +0100 + +openjdk-17 (17.0.9+9-2) unstable; urgency=medium + + [ Vladimir Petko ] + * d/t/write-problems: Add missing file to generate the problem list. + + [ Pushkar Kulkarni ] + * debian/copyright: Update copyrights and notices, using a generator script. + + -- Matthias Klose Thu, 02 Nov 2023 11:23:27 +0100 openjdk-17 (17.0.9+9-1) unstable; urgency=high diff -Nru openjdk-17-17.0.9+9/debian/control openjdk-17-17.0.10+7/debian/control --- openjdk-17-17.0.9+9/debian/control 2023-10-31 23:23:59.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/control 2024-01-30 23:08:29.000000000 +0000 @@ -13,7 +13,7 @@ openjdk-17-jdk-headless:native | openjdk-16-jdk-headless:native, libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, libasound2-dev, liblcms2-dev, libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libxrandr-dev, libelf-dev, libfontconfig1-dev, libgtk2.0-0 | libgtk-3-0, libfreetype-dev, libharfbuzz-dev, libffi-dev, libffi-dev:native, - zlib1g-dev:native, zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, + zlib1g-dev:native, zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, libnss3-dev (>= 2:3.17.1), openjdk-17-jdk-headless , Build-Depends-Indep: graphviz, pandoc, diff -Nru openjdk-17-17.0.9+9/debian/copyright openjdk-17-17.0.10+7/debian/copyright --- openjdk-17-17.0.9+9/debian/copyright 2023-10-18 07:04:49.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/copyright 2024-01-17 10:59:57.000000000 +0000 @@ -20,85 +20,386 @@ src/java.desktop/share/native/libjavajpeg/README Source: https://github.com/openjdk/jdk17u Comment: - ------------------------------------------------------------------------------ - This package was debianized by Matthias Klose on - Wed, 08 Aug 2007 15:55:39 +0200. - ------------------------------------------------------------------------------ Upstream Authors: OpenJDK: - Sun Microsystems, Inc. - Oracle and/or its affiliates. - Packaging: - Matthias Klose - ------------------------------------------------------------------------------ + Oracle and/or its affiliates + Sun Microsystems, Inc + Red Hat, Inc + SAP SE + Azul Systems, Inc + Apache Software Foundation + Microsoft Corporation + Intel Corportation + IBM Corporation + Google LLC + Amazon.com, Inc + Other contributors + See the third party licenses below. + Packaged by: + Matthias Klose Files: * Copyright: - OpenJDK: - Copyright © 1996-2007 Sun Microsystems, Inc. - Copyright © 1996-2023 Oracle and/or its affiliates. - For third party copyrights see below (copies from the third party readme). - Portions Copyright © 1993-2014 IBM Corp. - Portions Copyright © 1997 Eastman Kodak Company. - Portions Copyright © 1999-2005 The Apache Software Foundation. - Java Access Bridge: - Portions Copyright © 2002-2007 Bill Haneman - Portions Copyright © 2002-2007 Louise Miller - Portions Copyright © 2002-2007 Gergõ Érdi - Portions Copyright © 2002-2007 Laszlo (Laca) Peter - Portions Copyright © 2002-2007 Jeff Cai - Portions Copyright © 2002-2007 George Kraft IV - Portions Copyright © 2002-2007 Padraig O'Briain - Portions Copyright © 2002-2007 Darren Kenny - ------------------------------------------------------------------------------ -License: GPL with the Classpath exception - NOTE: the combined work which includes the upstream components below - carries forward the OpenJDK Assembly Exception (text included below). - . - OpenJDK: - OpenJDK is licensed under the GPL v2 with exceptions, - see `/usr/share/common-licenses/GPL-2'. - The exceptions are: - - "CLASSPATH" EXCEPTION TO THE GPL - - OPENJDK ASSEMBLY EXCEPTION - Various third party code in OpenJDK is licensed under different licenses. - . - Java Access Bridge: - Java Access Bridge is licensed under the LGPL v2. - See `/usr/share/common-licenses/LGPL-2'. - . - A Note About License Headers - ---------------------------- - . - Some sources downloaded from openjdk.java.net do not display the GPL - license header. Instances are: - . - - The files in openjdk/j2se/src/share/classes/javax/xml/stream/ seem to - comprise the BEA-StAX source code - . - http://ftpna2.bea.com/pub/downloads/jsr173.jar - . - with some Sun-specific modifications. We're assuming that Sun is - bundling BEA-StAX under the terms of the Apache License 2.0 and - that the modifications are owned by Sun. - . - - We are assuming that these files are owned by Sun: - openjdk/j2se/src/share/classes/**/resources/*.properties - . - The downloaded sources include a script that inserts proprietary - license headers into the source files it generates. The script - itself is GPL'd so we patched them to emit the GPL header. The - file is: - openjdk/j2se/make/java/nio/genExceptions.sh + Copyright (c) 1996-2023 Oracle and/or its affiliates. + Copyright (c) 1996-2003 Sun Microsystems, Inc. + Copyright (c) 2009-2012 Red Hat, Inc. + Copyright (c) 2012-2022 SAP SE. + Copyright (c) 2020-2021 Azul Systems, Inc. + Copyright (c) 1999-2022 The Apache Software Foundation. + Copyright (c) 2020-2021 Microsoft Corporation + Copyright (c) 2009-2022 Google LLC + Copyright (c) 2020-2021 Amazon.com, Inc + Copyright (c) 2021 Alibaba Group Holding Limited + Copyright (c) 2019-2021 Huawei Technologies Co. Ltd. + Copyright (c) 2021-2023 BELLSOFT + Copyright (c) 2022-23 THL A29 Limited, a Tencent company. + Copyright (c) 2021-2023, Arm Limited. + Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn. + Copyright (c) 2017 Instituto de Pesquisas Eldorado. + Copyright (c) 1999-2007 Brian Paul. + Copyright (c) 2018-2019 Adobe Inc. + Copyright 2006-2014 Adobe Systems Incorporated. + Copyright 1994-2011 Hewlett-Packard Co. + Portions Copyright (c) 2011-2014 IBM Corporation + Portions Copyright (c) 1995 Colin Plumb + Portions Copyright (c) 1997-2003 Eastman Kodak Company + See other third party notices under the License section +License: GPL with Classpath exception + . + --- begin of LICENSE --- + . + The GNU General Public License (GPL) + . + Version 2, June 1991 + . + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + . + Everyone is permitted to copy and distribute verbatim copies of this license + document, but changing it is not allowed. + . + Preamble + . + The licenses for most software are designed to take away your freedom to share + and change it. By contrast, the GNU General Public License is intended to + guarantee your freedom to share and change free software--to make sure the + software is free for all its users. This General Public License applies to + most of the Free Software Foundation's software and to any other program whose + authors commit to using it. (Some other Free Software Foundation software is + covered by the GNU Library General Public License instead.) You can apply it to + your programs, too. + . + When we speak of free software, we are referring to freedom, not price. Our + General Public Licenses are designed to make sure that you have the freedom to + distribute copies of free software (and charge for this service if you wish), + that you receive source code or can get it if you want it, that you can change + the software or use pieces of it in new free programs; and that you know you + can do these things. + . + To protect your rights, we need to make restrictions that forbid anyone to deny + you these rights or to ask you to surrender the rights. These restrictions + translate to certain responsibilities for you if you distribute copies of the + software, or if you modify it. + . + For example, if you distribute copies of such a program, whether gratis or for + a fee, you must give the recipients all the rights that you have. You must + make sure that they, too, receive or can get the source code. And you must + show them these terms so they know their rights. + . + We protect your rights with two steps: (1) copyright the software, and (2) + offer you this license which gives you legal permission to copy, distribute + and/or modify the software. + . + Also, for each author's protection and ours, we want to make certain that + everyone understands that there is no warranty for this free software. If the + software is modified by someone else and passed on, we want its recipients to + know that what they have is not the original, so that any problems introduced + by others will not reflect on the original authors' reputations. + . + Finally, any free program is threatened constantly by software patents. We + wish to avoid the danger that redistributors of a free program will + individually obtain patent licenses, in effect making the program proprietary. + To prevent this, we have made it clear that any patent must be licensed for + everyone's free use or not licensed at all. + . + The precise terms and conditions for copying, distribution and modification + follow. + . + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + . + 0. This License applies to any program or other work which contains a notice + placed by the copyright holder saying it may be distributed under the terms of + this General Public License. The "Program", below, refers to any such program + or work, and a "work based on the Program" means either the Program or any + derivative work under copyright law: that is to say, a work containing the + Program or a portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is included + without limitation in the term "modification".) Each licensee is addressed as + "you". + . + Activities other than copying, distribution and modification are not covered by + this License; they are outside its scope. The act of running the Program is + not restricted, and the output from the Program is covered only if its contents + constitute a work based on the Program (independent of having been made by + running the Program). Whether that is true depends on what the Program does. + . + 1. You may copy and distribute verbatim copies of the Program's source code as + you receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice and + disclaimer of warranty; keep intact all the notices that refer to this License + and to the absence of any warranty; and give any other recipients of the + Program a copy of this License along with the Program. + . + You may charge a fee for the physical act of transferring a copy, and you may + at your option offer warranty protection in exchange for a fee. + . + 2. You may modify your copy or copies of the Program or any portion of it, thus + forming a work based on the Program, and copy and distribute such modifications + or work under the terms of Section 1 above, provided that you also meet all of + these conditions: + . + a) You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + . + b) You must cause any work that you distribute or publish, that in whole or + in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of + this License. + . + c) If the modified program normally reads commands interactively when run, + you must cause it, when started running for such interactive use in the + most ordinary way, to print or display an announcement including an + appropriate copyright notice and a notice that there is no warranty (or + else, saying that you provide a warranty) and that users may redistribute + the program under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive but does + not normally print such an announcement, your work based on the Program is + not required to print an announcement.) + . + These requirements apply to the modified work as a whole. If identifiable + sections of that work are not derived from the Program, and can be reasonably + considered independent and separate works in themselves, then this License, and + its terms, do not apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a whole which is a + work based on the Program, the distribution of the whole must be on the terms + of this License, whose permissions for other licensees extend to the entire + whole, and thus to each and every part regardless of who wrote it. + . + Thus, it is not the intent of this section to claim rights or contest your + rights to work written entirely by you; rather, the intent is to exercise the + right to control the distribution of derivative or collective works based on + the Program. + . + In addition, mere aggregation of another work not based on the Program with the + Program (or with a work based on the Program) on a volume of a storage or + distribution medium does not bring the other work under the scope of this + License. + . + 3. You may copy and distribute the Program (or a work based on it, under + Section 2) in object code or executable form under the terms of Sections 1 and + 2 above provided that you also do one of the following: + . + a) Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 above + on a medium customarily used for software interchange; or, + . + b) Accompany it with a written offer, valid for at least three years, to + give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of Sections 1 + and 2 above on a medium customarily used for software interchange; or, + . + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed only + for noncommercial distribution and only if you received the program in + object code or executable form with such an offer, in accord with + Subsection b above.) + . + The source code for a work means the preferred form of the work for making + modifications to it. For an executable work, complete source code means all + the source code for all modules it contains, plus any associated interface + definition files, plus the scripts used to control compilation and installation + of the executable. However, as a special exception, the source code + distributed need not include anything that is normally distributed (in either + source or binary form) with the major components (compiler, kernel, and so on) + of the operating system on which the executable runs, unless that component + itself accompanies the executable. + . + If distribution of executable or object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the source + code from the same place counts as distribution of the source code, even though + third parties are not compelled to copy the source along with the object code. + . + 4. You may not copy, modify, sublicense, or distribute the Program except as + expressly provided under this License. Any attempt otherwise to copy, modify, + sublicense or distribute the Program is void, and will automatically terminate + your rights under this License. However, parties who have received copies, or + rights, from you under this License will not have their licenses terminated so + long as such parties remain in full compliance. + . + 5. You are not required to accept this License, since you have not signed it. + However, nothing else grants you permission to modify or distribute the Program + or its derivative works. These actions are prohibited by law if you do not + accept this License. Therefore, by modifying or distributing the Program (or + any work based on the Program), you indicate your acceptance of this License to + do so, and all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + . + 6. Each time you redistribute the Program (or any work based on the Program), + the recipient automatically receives a license from the original licensor to + copy, distribute or modify the Program subject to these terms and conditions. + You may not impose any further restrictions on the recipients' exercise of the + rights granted herein. You are not responsible for enforcing compliance by + third parties to this License. + . + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), conditions + are imposed on you (whether by court order, agreement or otherwise) that + contradict the conditions of this License, they do not excuse you from the + conditions of this License. If you cannot distribute so as to satisfy + simultaneously your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the Program at all. + For example, if a patent license would not permit royalty-free redistribution + of the Program by all those who receive copies directly or indirectly through + you, then the only way you could satisfy both it and this License would be to + refrain entirely from distribution of the Program. + . + If any portion of this section is held invalid or unenforceable under any + particular circumstance, the balance of the section is intended to apply and + the section as a whole is intended to apply in other circumstances. + . + It is not the purpose of this section to induce you to infringe any patents or + other property right claims or to contest validity of any such claims; this + section has the sole purpose of protecting the integrity of the free software + distribution system, which is implemented by public license practices. Many + people have made generous contributions to the wide range of software + distributed through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing to + distribute software through any other system and a licensee cannot impose that + choice. + . + This section is intended to make thoroughly clear what is believed to be a + consequence of the rest of this License. + . + 8. If the distribution and/or use of the Program is restricted in certain + countries either by patents or by copyrighted interfaces, the original + copyright holder who places the Program under this License may add an explicit + geographical distribution limitation excluding those countries, so that + distribution is permitted only in or among countries not thus excluded. In + such case, this License incorporates the limitation as if written in the body + of this License. + . + 9. The Free Software Foundation may publish revised and/or new versions of the + General Public License from time to time. Such new versions will be similar in + spirit to the present version, but may differ in detail to address new problems + or concerns. + . + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and "any later + version", you have the option of following the terms and conditions either of + that version or of any later version published by the Free Software Foundation. + If the Program does not specify a version number of this License, you may + choose any version ever published by the Free Software Foundation. + . + 10. If you wish to incorporate parts of the Program into other free programs + whose distribution conditions are different, write to the author to ask for + permission. For software which is copyrighted by the Free Software Foundation, + write to the Free Software Foundation; we sometimes make exceptions for this. + Our decision will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing and reuse of + software generally. + . + NO WARRANTY + . + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR + THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE + STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE + PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, + YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + . + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL + ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE + PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY + GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A + FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER + OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + . + END OF TERMS AND CONDITIONS + . + How to Apply These Terms to Your New Programs + . + If you develop a new program, and you want it to be of the greatest possible + use to the public, the best way to achieve this is to make it free software + which everyone can redistribute and change under these terms. + . + To do so, attach the following notices to the program. It is safest to attach + them to the start of each source file to most effectively convey the exclusion + of warranty; and each file should have at least the "copyright" line and a + pointer to where the full notice is found. + . + One line to give the program's name and a brief idea of what it does. + . + Copyright (C) + . + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + . + This program 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 for + more details. + . + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + . + Also add information on how to contact you by electronic and paper mail. + . + If the program is interactive, make it output a short notice like this when it + starts in an interactive mode: + . + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes + with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free + software, and you are welcome to redistribute it under certain conditions; + type 'show c' for details. + . + The hypothetical commands 'show w' and 'show c' should show the appropriate + parts of the General Public License. Of course, the commands you use may be + called something other than 'show w' and 'show c'; they could even be + mouse-clicks or menu items--whatever suits your program. + . + You should also get your employer (if you work as a programmer) or your school, + if any, to sign a "copyright disclaimer" for the program, if necessary. Here + is a sample; alter the names: + . + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + 'Gnomovision' (which makes passes at compilers) written by James Hacker. + . + signature of Ty Coon, 1 April 1989 + . + Ty Coon, President of Vice + . + This General Public License does not permit incorporating your program into + proprietary programs. If your program is a subroutine library, you may + consider it more useful to permit linking proprietary applications with the + library. If this is what you want to do, use the GNU Library General Public + License instead of this License. + . . - ------------------------------------------------------------------------------ "CLASSPATH" EXCEPTION TO THE GPL . - Certain source files distributed by Sun Microsystems, Inc. are subject to - the following clarification and special exception to the GPL, but only where - Sun has expressly included in the particular source file's header the words - "Sun designates this particular file as subject to the "Classpath" exception - as provided by Sun in the LICENSE file that accompanied this code." + Certain source files distributed by Oracle America and/or its affiliates are + subject to the following clarification and special exception to the GPL, but + only where Oracle has expressly included in the particular source file's header + the words "Oracle designates this particular file as subject to the "Classpath" + exception as provided by Oracle in the LICENSE file that accompanied this code." . Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of @@ -115,208 +416,20 @@ the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. . - ------------------------------------------------------------------------------ - OPENJDK ASSEMBLY EXCEPTION - . - The OpenJDK source code made available by Sun at openjdk.java.net and - openjdk.dev.java.net ("OpenJDK Code") is distributed under the terms of the - GNU General Public License version 2 - only ("GPL2"), with the following clarification and special exception. - . - Linking this OpenJDK Code statically or dynamically with other code - is making a combined work based on this library. Thus, the terms - and conditions of GPL2 cover the whole combination. - . - As a special exception, Sun gives you permission to link this - OpenJDK Code with certain code licensed by Sun as indicated at - http://openjdk.java.net/legal/exception-modules-2007-05-08.html - ("Designated Exception Modules") to produce an executable, - regardless of the license terms of the Designated Exception Modules, - and to copy and distribute the resulting executable under GPL2, - provided that the Designated Exception Modules continue to be - governed by the licenses under which they were offered by Sun. - . - As such, it allows licensees and sublicensees of Sun's GPL2 OpenJDK Code to - build an executable that includes those portions of necessary code that Sun - could not provide under GPL2 (or that Sun has provided under GPL2 with the - Classpath exception). If you modify or add to the OpenJDK code, that new - GPL2 code may still be combined with Designated Exception Modules if the - new code is made subject to this exception by its copyright holder. - . - ------------------------------------------------------------------------------ - OpenJDK Trademark Notice - Version 1.1, 2008/3/10 - . - OpenJDK (the "Name") is a trademark of Sun Microsystems, Inc. (the "Owner"). - Owner permits any person obtaining a copy of this software (the "Software") - which is based on original software retrieved from one of the following - websites: http://download.java.net/openjdk, http://hg.openjdk.java.net/jdk6, - or http://openjdk.java.net (each a "Website", with the original software made - available by the Owner on a Website being known as the "Website Software") to - use the Name in package names and version strings of the Software subject to - the following conditions: - . - - The Software is a substantially complete implementation of the OpenJDK - development kit or runtime environment code made available by Owner on a - Website, and the vast majority of the Software code is identical to the - upstream Website Software; - . - - No permission is hereby granted to use the Name in any other manner, - unless such use constitutes "fair use." - . - - The Owner makes no warranties of any kind respecting the Name and all - representations and warranties, including any implied warranty of - merchantability, fitness for a particular purpose or non-infringement - are hereby disclaimed; and - . - - This notice and the following legend are included in all copies of the - Software or portions of it: - . - OpenJDK is a trademark or registered trademark of Sun Microsystems, - Inc. in the United States and other countries. - . - The Name may also be used in connection with descriptions of the Software that - constitute "fair use," such as "derived from the OpenJDK code base" or "based - on the OpenJDK source code." - . - Owner intends to revise this Notice as necessary in order to meet the needs of - the OpenJDK Community. Please send questions or comments about this Notice to - Sun Microsystems at openjdk-tm@sun.com. Revisions to this Notice will be - announced on the public mailing list announce@openjdk.java.net, to which you - may subscribe by visiting http://mail.openjdk.java.net. The latest version of - this Notice may be found at http://openjdk.java.net/legal. - . - ------------------------------------------------------------------------------ - . - The contents of the jdk/src/share/native/sun/security/ec/impl/ directory are - licensed under the LGPL-2.1. See `/usr/share/common-licenses/LGPL-2-1'. - . - ------------------------------------------------------------------------------ - The following licenses for third party code are taken from - openjdk/THIRD_PARTY_README - ------------------------------------------------------------------------------ - . - DO NOT TRANSLATE OR LOCALIZE. - ----------------------------- - . - %% This notice is provided with respect to ASM Bytecode Manipulation - Framework v5.0, which may be included with JRE 8, and JDK 8, and - OpenJDK 8. - . - --- begin of LICENSE --- - . - Copyright (c) 2000-2011 France Télécom - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - . - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - 3. Neither the name of the copyright holders nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to BSDiff v4.3, which may be - included with JRE 8, JDK 8, and OpenJDK 8. - . - --- begin of LICENSE --- - . - Copyright 2003-2005 Colin Percival - All rights reserved - . - Redistribution and use in source and binary forms, with or without - modification, are permitted providing that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - . - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - . - --- end of LICENSE --- - . + The following licenses for third party code are taken from 'legal' + directories of modules under src/ ------------------------------------------------------------------------------ . - %% This notice is provided with respect to CodeViewer 1.0, which may be - included with JDK 8. + %% This notice is provided with respect to Cryptix AES v3.2.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright 1999 by CoolServlets.com. - . - Any errors or suggested improvements to this class can be reported as - instructed on CoolServlets.com. We hope you enjoy this program... your - comments will encourage further development! This software is distributed - under the terms of the BSD License. Redistribution and use in source and - binary forms, with or without modification, are permitted provided that the - following conditions are met: - . - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - . - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - Neither name of CoolServlets.com nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY COOLSERVLETS.COM AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." - . - . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------- + Cryptix General License . - %% This notice is provided with respect to Cryptix AES 3.2.0, which may be - included with JRE 8, JDK 8, and OpenJDK 8. - . - --- begin of LICENSE --- . Cryptix General License . @@ -328,12 +441,12 @@ met: . 1. Redistributions of source code must retain the copyright notice, - this list of conditions and the following disclaimer. + this list of conditions and the following disclaimer. . 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. . THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, @@ -348,1122 +461,381 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------- - . - %% This notice is provided with respect to CUP Parser Generator for - Java 0.10k, which may be included with JRE 8, JDK 8, and OpenJDK 8. - . - --- begin of LICENSE --- - . - Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian - . - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, provided - that the above copyright notice appear in all copies and that both the - copyright notice and this permission notice and warranty disclaimer appear in - supporting documentation, and that the names of the authors or their - employers not be used in advertising or publicity pertaining to distribution of - the software without specific, written prior permission. - . - The authors and their employers disclaim all warranties with regard to - this software, including all implied warranties of merchantability and fitness. - In no event shall the authors or their employers be liable for any special, - indirect or consequential damages or any damages whatsoever resulting from - loss of use, data or profits, whether in an action of contract, negligence or - other tortious action, arising out of or in connection with the use or - performance of this software. - . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to Document Object Model (DOM) Level 2 - & 3, which may be included with JRE 8, JDK 8, and OpenJDK 8. . - --- begin of LICENSE --- - . - W3C SOFTWARE NOTICE AND LICENSE - . - http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 - . - This work (and included software, documentation such as READMEs, or other - related items) is being provided by the copyright holders under the following - license. By obtaining, using and/or copying this work, you (the licensee) - agree that you have read, understood, and will comply with the following terms - and conditions. - . - Permission to copy, modify, and distribute this software and its - documentation, with or without modification, for any purpose and without fee - or royalty is hereby granted, provided that you include the following on ALL - copies of the software and documentation or portions thereof, including - modifications: - . - 1.The full text of this NOTICE in a location viewable to users of the - redistributed or derivative work. - . - 2.Any pre-existing intellectual property disclaimers, notices, or terms and - conditions. If none exist, the W3C Software Short Notice should be included - (hypertext is preferred, text is permitted) within the body of any - redistributed or derivative code. - . - 3.Notice of any changes or modifications to the files, including the date - changes were made. (We recommend you provide URIs to the location from - which the code is derived.) - . - THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS - MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT - LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR - PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY - THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. - . - COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL - OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR - DOCUMENTATION. The name and trademarks of copyright holders may NOT be used - in advertising or publicity pertaining to the software without specific, - written prior permission. Title to copyright in this software and any - associated documentation will at all times remain with copyright holders. - . - ____________________________________ - . - This formulation of W3C's notice and license became active on December 31 - 2002. This version removes the copyright ownership notice such that this - license can be used with materials other than those owned by the W3C, reflects - that ERCIM is now a host of the W3C, includes references to this specific - dated version of the license, and removes the ambiguous grant of "use". - Otherwise, this version is the same as the previous version and is written so - as to preserve the Free Software Foundation's assessment of GPL compatibility - and OSI's certification under the Open Source Definition. Please see our - Copyright FAQ for common questions about using materials from our site, - including specific terms and conditions for packages like libwww, Amaya, and - Jigsaw. Other questions about this notice can be directed to - site-policy@w3.org. - . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------- - . - %% This notice is provided with respect to Dynalink v0.5, which may be - included with JRE 8, JDK 8, and OpenJDK 8. - . - --- begin of LICENSE --- - . - Copyright (c) 2009-2013, Attila Szegedi - . - All rights reserved.Redistribution and use in source and binary forms, with or - without modification, are permitted provided that the following conditions are - met:* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. * Redistributions in - binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or other - materials provided with the distribution. * Neither the name of Attila - Szegedi nor the names of its contributors may be used to endorse or promote - products derived from this software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE. - . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------- - . - %% This notice is provided with respect to Elliptic Curve Cryptography, which - may be included with JRE 8, JDK 8, and OpenJDK 8. - . - You are receiving a copy of the Elliptic Curve Cryptography library in source - form with the JDK 8 and OpenJDK 8 source distributions, and as object code in - the JRE 8 & JDK 8 runtimes. - . - In the case of the JRE 8 & JDK 8 runtimes, the terms of the Oracle license do - NOT apply to the Elliptic Curve Cryptography library; it is licensed under the - following license, separately from Oracle's JDK & JRE. If you do not wish to - install the Elliptic Curve Cryptography library, you may delete the library - named libsunec.so (on Solaris and Linux systems) or sunec.dll (on Windows - systems) from the JRE bin directory reserved for native libraries. - . - . - --- begin of LICENSE --- - . - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - . - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - . - [This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - . - Preamble - . - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public - Licenses are intended to guarantee your freedom to share and change - free software--to make sure the software is free for all its users. - . - This license, the Lesser General Public License, applies to some - specially designated software packages--typically libraries--of the - Free Software Foundation and other authors who decide to use it. You - can use it too, but we suggest you first think carefully about whether - this license or the ordinary General Public License is the better - strategy to use in any particular case, based on the explanations below. - . - When we speak of free software, we are referring to freedom of use, - not price. Our General Public Licenses are designed to make sure that - you have the freedom to distribute copies of free software (and charge - for this service if you wish); that you receive source code or can get - it if you want it; that you can change the software and use pieces of - it in new free programs; and that you are informed that you can do - these things. - . - To protect your rights, we need to make restrictions that forbid - distributors to deny you these rights or to ask you to surrender these - rights. These restrictions translate to certain responsibilities for - you if you distribute copies of the library or if you modify it. - . - For example, if you distribute copies of the library, whether gratis - or for a fee, you must give the recipients all the rights that we gave - you. You must make sure that they, too, receive or can get the source - code. If you link other code with the library, you must provide - complete object files to the recipients, so that they can relink them - with the library after making changes to the library and recompiling - it. And you must show them these terms so they know their rights. - . - We protect your rights with a two-step method: (1) we copyright the - library, and (2) we offer you this license, which gives you legal - permission to copy, distribute and/or modify the library. - . - To protect each distributor, we want to make it very clear that - there is no warranty for the free library. Also, if the library is - modified by someone else and passed on, the recipients should know - that what they have is not the original version, so that the original - author's reputation will not be affected by problems that might be - introduced by others. - . - Finally, software patents pose a constant threat to the existence of - any free program. We wish to make sure that a company cannot - effectively restrict the users of a free program by obtaining a - restrictive license from a patent holder. Therefore, we insist that - any patent license obtained for a version of the library must be - consistent with the full freedom of use specified in this license. - . - Most GNU software, including some libraries, is covered by the - ordinary GNU General Public License. This license, the GNU Lesser - General Public License, applies to certain designated libraries, and - is quite different from the ordinary General Public License. We use - this license for certain libraries in order to permit linking those - libraries into non-free programs. - . - When a program is linked with a library, whether statically or using - a shared library, the combination of the two is legally speaking a - combined work, a derivative of the original library. The ordinary - General Public License therefore permits such linking only if the - entire combination fits its criteria of freedom. The Lesser General - Public License permits more lax criteria for linking other code with - the library. - . - We call this license the "Lesser" General Public License because it - does Less to protect the user's freedom than the ordinary General - Public License. It also provides other free software developers Less - of an advantage over competing non-free programs. These disadvantages - are the reason we use the ordinary General Public License for many - libraries. However, the Lesser license provides advantages in certain - special circumstances. - . - For example, on rare occasions, there may be a special need to - encourage the widest possible use of a certain library, so that it becomes - a de-facto standard. To achieve this, non-free programs must be - allowed to use the library. A more frequent case is that a free - library does the same job as widely used non-free libraries. In this - case, there is little to gain by limiting the free library to free - software only, so we use the Lesser General Public License. - . - In other cases, permission to use a particular library in non-free - programs enables a greater number of people to use a large body of - free software. For example, permission to use the GNU C Library in - non-free programs enables many more people to use the whole GNU - operating system, as well as its variant, the GNU/Linux operating - system. - . - Although the Lesser General Public License is Less protective of the - users' freedom, it does ensure that the user of a program that is - linked with the Library has the freedom and the wherewithal to run - that program using a modified version of the Library. - . - The precise terms and conditions for copying, distribution and - modification follow. Pay close attention to the difference between a - "work based on the library" and a "work that uses the library". The - former contains code derived from the library, whereas the latter must - be combined with the library in order to run. - . - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - . - 0. This License Agreement applies to any software library or other - program which contains a notice placed by the copyright holder or - other authorized party saying it may be distributed under the terms of - this Lesser General Public License (also called "this License"). - Each licensee is addressed as "you". - . - A "library" means a collection of software functions and/or data - prepared so as to be conveniently linked with application programs - (which use some of those functions and data) to form executables. - . - The "Library", below, refers to any such software library or work - which has been distributed under these terms. A "work based on the - Library" means either the Library or any derivative work under - copyright law: that is to say, a work containing the Library or a - portion of it, either verbatim or with modifications and/or translated - straightforwardly into another language. (Hereinafter, translation is - included without limitation in the term "modification".) - . - "Source code" for a work means the preferred form of the work for - making modifications to it. For a library, complete source code means - all the source code for all modules it contains, plus any associated - interface definition files, plus the scripts used to control compilation - and installation of the library. - . - Activities other than copying, distribution and modification are not - covered by this License; they are outside its scope. The act of - running a program using the Library is not restricted, and output from - such a program is covered only if its contents constitute a work based - on the Library (independent of the use of the Library in a tool for - writing it). Whether that is true depends on what the Library does - and what the program that uses the Library does. - . - 1. You may copy and distribute verbatim copies of the Library's - complete source code as you receive it, in any medium, provided that - you conspicuously and appropriately publish on each copy an - appropriate copyright notice and disclaimer of warranty; keep intact - all the notices that refer to this License and to the absence of any - warranty; and distribute a copy of this License along with the - Library. - . - You may charge a fee for the physical act of transferring a copy, - and you may at your option offer warranty protection in exchange for a - fee. - . - 2. You may modify your copy or copies of the Library or any portion - of it, thus forming a work based on the Library, and copy and - distribute such modifications or work under the terms of Section 1 - above, provided that you also meet all of these conditions: - . - a) The modified work must itself be a software library. - . - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - . - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - . - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - . - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - . - These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the Library, - and can be reasonably considered independent and separate works in - themselves, then this License, and its terms, do not apply to those - sections when you distribute them as separate works. But when you - distribute the same sections as part of a whole which is a work based - on the Library, the distribution of the whole must be on the terms of - this License, whose permissions for other licensees extend to the - entire whole, and thus to each and every part regardless of who wrote - it. - . - Thus, it is not the intent of this section to claim rights or contest - your rights to work written entirely by you; rather, the intent is to - exercise the right to control the distribution of derivative or - collective works based on the Library. - . - In addition, mere aggregation of another work not based on the Library - with the Library (or with a work based on the Library) on a volume of - a storage or distribution medium does not bring the other work under - the scope of this License. - . - 3. You may opt to apply the terms of the ordinary GNU General Public - License instead of this License to a given copy of the Library. To do - this, you must alter all the notices that refer to this License, so - that they refer to the ordinary GNU General Public License, version 2, - instead of to this License. (If a newer version than version 2 of the - ordinary GNU General Public License has appeared, then you can specify - that version instead if you wish.) Do not make any other change in - these notices. - . - Once this change is made in a given copy, it is irreversible for - that copy, so the ordinary GNU General Public License applies to all - subsequent copies and derivative works made from that copy. - . - This option is useful when you wish to copy part of the code of - the Library into a program that is not a library. - . - 4. You may copy and distribute the Library (or a portion or - derivative of it, under Section 2) in object code or executable form - under the terms of Sections 1 and 2 above provided that you accompany - it with the complete corresponding machine-readable source code, which - must be distributed under the terms of Sections 1 and 2 above on a - medium customarily used for software interchange. - . - If distribution of object code is made by offering access to copy - from a designated place, then offering equivalent access to copy the - source code from the same place satisfies the requirement to - distribute the source code, even though third parties are not - compelled to copy the source along with the object code. - . - 5. A program that contains no derivative of any portion of the - Library, but is designed to work with the Library by being compiled or - linked with it, is called a "work that uses the Library". Such a - work, in isolation, is not a derivative work of the Library, and - therefore falls outside the scope of this License. - . - However, linking a "work that uses the Library" with the Library - creates an executable that is a derivative of the Library (because it - contains portions of the Library), rather than a "work that uses the - library". The executable is therefore covered by this License. - Section 6 states terms for distribution of such executables. - . - When a "work that uses the Library" uses material from a header file - that is part of the Library, the object code for the work may be a - derivative work of the Library even though the source code is not. - Whether this is true is especially significant if the work can be - linked without the Library, or if the work is itself a library. The - threshold for this to be true is not precisely defined by law. - . - If such an object file uses only numerical parameters, data - structure layouts and accessors, and small macros and small inline - functions (ten lines or less in length), then the use of the object - file is unrestricted, regardless of whether it is legally a derivative - work. (Executables containing this object code plus portions of the - Library will still fall under Section 6.) - . - Otherwise, if the work is a derivative of the Library, you may - distribute the object code for the work under the terms of Section 6. - Any executables containing that work also fall under Section 6, - whether or not they are linked directly with the Library itself. - . - 6. As an exception to the Sections above, you may also combine or - link a "work that uses the Library" with the Library to produce a - work containing portions of the Library, and distribute that work - under terms of your choice, provided that the terms permit - modification of the work for the customer's own use and reverse - engineering for debugging such modifications. - . - You must give prominent notice with each copy of the work that the - Library is used in it and that the Library and its use are covered by - this License. You must supply a copy of this License. If the work - during execution displays copyright notices, you must include the - copyright notice for the Library among them, as well as a reference - directing the user to the copy of this License. Also, you must do one - of these things: - . - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - . - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - . - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - . - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - . - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - . - For an executable, the required form of the "work that uses the - Library" must include any data and utility programs needed for - reproducing the executable from it. However, as a special exception, - the materials to be distributed need not include anything that is - normally distributed (in either source or binary form) with the major - components (compiler, kernel, and so on) of the operating system on - which the executable runs, unless that component itself accompanies - the executable. - . - It may happen that this requirement contradicts the license - restrictions of other proprietary libraries that do not normally - accompany the operating system. Such a contradiction means you cannot - use both them and the Library together in an executable that you - distribute. - . - 7. You may place library facilities that are a work based on the - Library side-by-side in a single library together with other library - facilities not covered by this License, and distribute such a combined - library, provided that the separate distribution of the work based on - the Library and of the other library facilities is otherwise - permitted, and provided that you do these two things: - . - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - . - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - . - 8. You may not copy, modify, sublicense, link with, or distribute - the Library except as expressly provided under this License. Any - attempt otherwise to copy, modify, sublicense, link with, or - distribute the Library is void, and will automatically terminate your - rights under this License. However, parties who have received copies, - or rights, from you under this License will not have their licenses - terminated so long as such parties remain in full compliance. - . - 9. You are not required to accept this License, since you have not - signed it. However, nothing else grants you permission to modify or - distribute the Library or its derivative works. These actions are - prohibited by law if you do not accept this License. Therefore, by - modifying or distributing the Library (or any work based on the - Library), you indicate your acceptance of this License to do so, and - all its terms and conditions for copying, distributing or modifying - the Library or works based on it. - . - 10. Each time you redistribute the Library (or any work based on the - Library), the recipient automatically receives a license from the - original licensor to copy, distribute, link with or modify the Library - subject to these terms and conditions. You may not impose any further - restrictions on the recipients' exercise of the rights granted herein. - You are not responsible for enforcing compliance by third parties with - this License. - . - 11. If, as a consequence of a court judgment or allegation of patent - infringement or for any other reason (not limited to patent issues), - conditions are imposed on you (whether by court order, agreement or - otherwise) that contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you cannot - distribute so as to satisfy simultaneously your obligations under this - License and any other pertinent obligations, then as a consequence you - may not distribute the Library at all. For example, if a patent - license would not permit royalty-free redistribution of the Library by - all those who receive copies directly or indirectly through you, then - the only way you could satisfy both it and this License would be to - refrain entirely from distribution of the Library. - . - If any portion of this section is held invalid or unenforceable under any - particular circumstance, the balance of the section is intended to apply, - and the section as a whole is intended to apply in other circumstances. - . - It is not the purpose of this section to induce you to infringe any - patents or other property right claims or to contest validity of any - such claims; this section has the sole purpose of protecting the - integrity of the free software distribution system which is - implemented by public license practices. Many people have made - generous contributions to the wide range of software distributed - through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is willing - to distribute software through any other system and a licensee cannot - impose that choice. - . - This section is intended to make thoroughly clear what is believed to - be a consequence of the rest of this License. - . - 12. If the distribution and/or use of the Library is restricted in - certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Library under this License may add - an explicit geographical distribution limitation excluding those countries, - so that distribution is permitted only in or among countries not thus - excluded. In such case, this License incorporates the limitation as if - written in the body of this License. - . - 13. The Free Software Foundation may publish revised and/or new - versions of the Lesser General Public License from time to time. - Such new versions will be similar in spirit to the present version, - but may differ in detail to address new problems or concerns. - . - Each version is given a distinguishing version number. If the Library - specifies a version number of this License which applies to it and - "any later version", you have the option of following the terms and - conditions either of that version or of any later version published by - the Free Software Foundation. If the Library does not specify a - license version number, you may choose any version ever published by - the Free Software Foundation. - . - 14. If you wish to incorporate parts of the Library into other free - programs whose distribution conditions are incompatible with these, - write to the author to ask for permission. For software which is - copyrighted by the Free Software Foundation, write to the Free - Software Foundation; we sometimes make exceptions for this. Our - decision will be guided by the two goals of preserving the free status - of all derivatives of our free software and of promoting the sharing - and reuse of software generally. - . - NO WARRANTY - . - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO - WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. - EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR - OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE - LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME - THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - . - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN - WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY - AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU - FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR - CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE - LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING - RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A - FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF - SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH - DAMAGES. - . - END OF TERMS AND CONDITIONS - . - How to Apply These Terms to Your New Libraries - . - If you develop a new library, and you want it to be of the greatest - possible use to the public, we recommend making it free software that - everyone can redistribute and change. You can do so by permitting - redistribution under these terms (or, alternatively, under the terms of the - ordinary General Public License). - . - To apply these terms, attach the following notices to the library. It is - safest to attach them to the start of each source file to most effectively - convey the exclusion of warranty; and each file should have at least the - "copyright" line and a pointer to where the full notice is found. - . - - Copyright (C) - . - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - . - This library 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 - Lesser General Public License for more details. - . - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - . - Also add information on how to contact you by electronic and paper mail. - . - You should also get your employer (if you work as a programmer) or your - school, if any, to sign a "copyright disclaimer" for the library, if - necessary. Here is a sample; alter the names: - . - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - . - , 1 April 1990 - Ty Coon, President of Vice - . - That's all there is to it! . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to ECMAScript Language - Specification ECMA-262 Edition 5.1 which may be included with - JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to ASM Bytecode Manipulation Framework v8.0.1, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright notice - Copyright © 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva - Tel: +41 22 849 6000 - Fax: +41 22 849 6001 - Web: http://www.ecma-international.org - . - This document and possible translations of it may be copied and furnished to - others, and derivative works that comment on or otherwise explain it or assist - in its implementation may be prepared, copied, published, and distributed, in - whole or in part, without restriction of any kind, provided that the above - copyright notice and this section are included on all such copies and derivative - works. However, this document itself may not be modified in any way, including - by removing the copyright notice or references to Ecma International, except as - needed for the purpose of developing any document or deliverable produced by - Ecma International (in which case the rules applied to copyrights must be - followed) or as required to translate it into languages other than English. The - limited permissions granted above are perpetual and will not be revoked by Ecma - International or its successors or assigns. This document and the information - contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL - DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY - WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP - RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR - PURPOSE." Software License - . - All Software contained in this document ("Software)" is protected by copyright - and is being made available under the "BSD License", included below. This - Software may be subject to third party rights (rights from parties other than - Ecma International), including patent rights, and no licenses under such third - party rights are granted under this license even if the third party concerned is - a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS - AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR - INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO - IMPLEMENT ECMA INTERNATIONAL STANDARDS*. Redistribution and use in source and - binary forms, with or without modification, are permitted provided that the - following conditions are met: + ASM License . - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. . - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation and/or - other materials provided with the distribution. + Copyright (c) 2000-2011 France Télécom + All rights reserved. . - 3. Neither the name of the authors nor Ecma International may be used to endorse - or promote products derived from this software without specific prior written - permission. - . - THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - OF SUCH DAMAGE. - --- end of LICENSE --- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: . - %% This notice is provided with respect to Dynalink library which is included - with the Nashorn technology. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. . - --- begin of LICENSE --- - Copyright (c) 2009-2013, Attila Szegedi + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. + 3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - --- end of LICENSE --- - . - %% This notice is provided with respect to Joni library which is included - with the Nashorn technology. - . - --- begin of LICENSE --- - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + THE POSSIBILITY OF SUCH DAMAGE. . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to FontConfig 2.5, which may be - included with JRE 8, JDK 8, and OpenJDK 8 source distributions on - Linux and Solaris. + %% This notice is provided with respect to c-libutl 20160225, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright © 2001,2003 Keith Packard + c-libutl License . - Permission to use, copy, modify, distribute, and sell this software and its - documentation for any purpose is hereby granted without fee, provided that the - above copyright notice appear in all copies and that both that copyright - notice and this permission notice appear in supporting documentation, and that - the name of Keith Packard not be used in advertising or publicity pertaining - to distribution of the software without specific, written prior permission. - Keith Packard makes no representations about the suitability of this software - for any purpose. It is provided "as is" without express or implied warranty. - . - KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING - ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL KEITH - PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY - DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . + This software is distributed under the terms of the BSD license. . - --- end of LICENSE --- + == BSD LICENSE =============================================================== . - ------------------------------------------------------------------------------ + (C) 2009 by Remo Dentato (rdentato@gmail.com) . - %% This notice is provided with respect to IAIK PKCS#11 Wrapper, - which may be included with JRE 8, JDK 8, and OpenJDK 8. . - --- begin of LICENSE --- + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: . - IAIK PKCS#11 Wrapper License + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. . - Copyright (c) 2002 Graz University of Technology. All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - . - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - . - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - . - 3. The end-user documentation included with the redistribution, if any, must - include the following acknowledgment: - . - "This product includes software developed by IAIK of Graz University of - Technology." - . - Alternately, this acknowledgment may appear in the software itself, if and - wherever such third-party acknowledgments normally appear. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . - 4. The names "Graz University of Technology" and "IAIK of Graz University of - Technology" must not be used to endorse or promote products derived from this - software without prior written permission. + http://opensource.org/licenses/bsd-license.php . - 5. Products derived from this software may not be called "IAIK PKCS Wrapper", - nor may "IAIK" appear in their name, without prior written permission of - Graz University of Technology. . - THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to ICU4C 4.0.1 and ICU4J 4.4, which - may be included with JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to Unicode Common Local Data Repository (CLDR) v39, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright (c) 1995-2010 International Business Machines Corporation and others + CLDR License . - All rights reserved. - . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, and/or sell copies of the - Software, and to permit persons to whom the Software is furnished to do so, - provided that the above copyright notice(s) and this permission notice appear - in all copies of the Software and that both the above copyright notice(s) and - this permission notice appear in supporting documentation. - . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN - NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE - LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY - DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . - Except as contained in this notice, the name of a copyright holder shall not - be used in advertising or otherwise to promote the sale, use or other dealings - in this Software without prior written authorization of the copyright holder. - All trademarks and registered trademarks mentioned herein are the property of - their respective owners. . - --- end of LICENSE --- + UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE . - ------------------------------------------------------------------------------ + See Terms of Use for definitions of Unicode Inc.'s + Data Files and Software. . - %% This notice is provided with respect to IJG JPEG 6b, which may be - included with JRE 8, JDK 8, and OpenJDK 8. + NOTICE TO USER: Carefully read the following legal agreement. + BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S + DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), + YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE + TERMS AND CONDITIONS OF THIS AGREEMENT. + IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE + THE DATA FILES OR SOFTWARE. . - --- begin of LICENSE --- + COPYRIGHT AND PERMISSION NOTICE . - This software is copyright (C) 1991-1998, Thomas G. Lane. - All Rights Reserved except as specified below. + Copyright © 1991-2021 Unicode, Inc. All rights reserved. + Distributed under the Terms of Use in https://www.unicode.org/copyright.html. . - Permission is hereby granted to use, copy, modify, and distribute this - software (or portions thereof) for any purpose, without fee, subject to these - conditions: - (1) If any part of the source code for this software is distributed, then this - README file must be included, with this copyright and no-warranty notice - unaltered; and any additions, deletions, or changes to the original files - must be clearly indicated in accompanying documentation. - (2) If only executable code is distributed, then the accompanying - documentation must state that "this software is based in part on the work of - the Independent JPEG Group". - (3) Permission for use of this software is granted only if the user accepts - full responsibility for any undesirable consequences; the authors accept - NO LIABILITY for damages of any kind. + Permission is hereby granted, free of charge, to any person obtaining + a copy of the Unicode data files and any associated documentation + (the "Data Files") or Unicode software and any associated documentation + (the "Software") to deal in the Data Files or Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of + the Data Files or Software, and to permit persons to whom the Data Files + or Software are furnished to do so, provided that either + (a) this copyright and permission notice appear with all copies + of the Data Files or Software, or + (b) this copyright and permission notice appear in associated + Documentation. + . + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THE DATA FILES OR SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, + use or other dealings in these Data Files or Software without prior + written authorization of the copyright holder. + . + . + ------------------------------------------------------------ Terms of Use --------------------------------------------------------------- + . + Unicode® Copyright and Terms of Use + For the general privacy policy governing access to this site, see the Unicode Privacy Policy. + . + Unicode Copyright + Copyright © 1991-2021 Unicode, Inc. All rights reserved. + Definitions + Unicode Data Files ("DATA FILES") include all data files under the directories: + https://www.unicode.org/Public/ + https://www.unicode.org/reports/ + https://www.unicode.org/ivd/data/ + . + Unicode Data Files do not include PDF online code charts under the directory: + https://www.unicode.org/Public/ + . + Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard + or any source code or compiled code under the directories: + https://www.unicode.org/Public/PROGRAMS/ + https://www.unicode.org/Public/cldr/ + http://site.icu-project.org/download/ + Terms of Use + Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. + Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. + Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. + Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. + The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. + All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. + No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. + Modification is not permitted with respect to this document. All copies of this document must be verbatim. + Restricted Rights Legend + Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. + Warranties and Disclaimers + This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. + If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. + EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. + Waiver of Damages + In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. + Trademarks & Logos + The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. + The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. + All third party trademarks referenced herein are the property of their respective owners. + Miscellaneous + Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. + Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. + Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. + Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. + Entire Agreement. This Agreement constitutes the entire agreement between the parties. . - These conditions apply to any software derived from or based on the IJG code, - not just to the unmodified library. If you use our work, you ought to - acknowledge us. . - Permission is NOT granted for the use of any IJG author's name or company name - in advertising or publicity relating to this software or products derived from - it. This software may be referred to only as "the Independent JPEG Group's - software". . - We specifically permit and encourage the use of this software as the basis of - commercial products, provided that all warranty or liability claims are - assumed by the product vendor. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to Joni v1.1.9, which may be - included with JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to International Components for Unicode (ICU4J) v67.1, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: + ICU4J License . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) . - --- end of LICENSE --- + Copyright © 1991-2020 Unicode, Inc. All rights reserved. + Distributed under the Terms of Use in https://www.unicode.org/copyright.html. . - ------------------------------------------------------------------------------ + Permission is hereby granted, free of charge, to any person obtaining + a copy of the Unicode data files and any associated documentation + (the "Data Files") or Unicode software and any associated documentation + (the "Software") to deal in the Data Files or Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of + the Data Files or Software, and to permit persons to whom the Data Files + or Software are furnished to do so, provided that either + (a) this copyright and permission notice appear with all copies + of the Data Files or Software, or + (b) this copyright and permission notice appear in associated + Documentation. + . + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THE DATA FILES OR SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, + use or other dealings in these Data Files or Software without prior + written authorization of the copyright holder. + . + --------------------- + . + Third-Party Software Licenses + . + This section contains third-party software notices and/or additional + terms for licensed third-party software components included within ICU + libraries. . - %% This notice is provided with respect to JOpt-Simple v3.0, which may be - included with JRE 8, JDK 8, and OpenJDK 8. + 1. ICU License - ICU 1.8.1 to ICU 57.1 . - --- begin of LICENSE --- + COPYRIGHT AND PERMISSION NOTICE . - Copyright (c) 2004-2009 Paul R. Holser, Jr. + Copyright (c) 1995-2016 International Business Machines Corporation and others + All rights reserved. . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - . - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. + distribute, and/or sell copies of the Software, and to permit persons + to whom the Software is furnished to do so, provided that the above + copyright notice(s) and this permission notice appear in all copies of + the Software and that both the above copyright notice(s) and this + permission notice appear in supporting documentation. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to Kerberos functionality, which - which may be included with JRE 8, JDK 8, and OpenJDK 8. - . - --- begin of LICENSE --- - . - (C) Copyright IBM Corp. 1999 All Rights Reserved. - Copyright 1997 The Open Group Research Institute. All rights reserved. - . - --- end of LICENSE --- + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT + OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY + SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER + RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . - ------------------------------------------------------------------------------ + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, use + or other dealings in this Software without prior written authorization + of the copyright holder. . - %% This notice is provided with respect to Kerberos functionality from - FundsXpress, INC., which may be included with JRE 8, JDK 8, and OpenJDK 8. + All trademarks and registered trademarks mentioned herein are the + property of their respective owners. . - --- begin of LICENSE --- . - Copyright (C) 1998 by the FundsXpress, INC. + —————————————————————————————————————————————————————————————————————— . - All rights reserved. - . - Export of this software from the United States of America may require - a specific license from the United States Government. It is the - responsibility of any person or organization contemplating export to - obtain such a license before exporting. . - WITHIN THAT CONSTRAINT, permission to use, copy, modify, and - distribute this software and its documentation for any purpose and - without fee is hereby granted, provided that the above copyright - notice appear in all copies and that both that copyright notice and - this permission notice appear in supporting documentation, and that - the name of FundsXpress. not be used in advertising or publicity pertaining - to distribution of the software without specific, written prior - permission. FundsXpress makes no representations about the suitability of - this software for any purpose. It is provided "as is" without express - or implied warranty. + From: https://www.unicode.org/copyright.html: . - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + Unicode® Copyright and Terms of Use . + For the general privacy policy governing access to this site, see the Unicode Privacy Policy. . - --- end of LICENSE --- + Unicode Copyright + Copyright © 1991-2020 Unicode, Inc. All rights reserved. + Definitions . - ------------------------------------------------------------------------------ + Unicode Data Files ("DATA FILES") include all data files under the directories: + https://www.unicode.org/Public/ + https://www.unicode.org/reports/ + https://www.unicode.org/ivd/data/ . - %% This notice is provided with respect to Kronos OpenGL headers, which may be - included with JDK 8 and OpenJDK 8 source distributions. + Unicode Data Files do not include PDF online code charts under the directory: + https://www.unicode.org/Public/ . - --- begin of LICENSE --- + Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard + or any source code or compiled code under the directories: + https://www.unicode.org/Public/PROGRAMS/ + https://www.unicode.org/Public/cldr/ + http://site.icu-project.org/download/ . - Copyright (c) 2007 The Khronos Group Inc. + Terms of Use + Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. + Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. + Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. + Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. + The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. + All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. + No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. + Modification is not permitted with respect to this document. All copies of this document must be verbatim. + Restricted Rights Legend + Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. + Warranties and Disclaimers + This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. + If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. + EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. + Waiver of Damages + In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. + Trademarks & Logos + The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. + The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. + All third party trademarks referenced herein are the property of their respective owners. + Miscellaneous + Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. + Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. + Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. + Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. + Entire Agreement. This Agreement constitutes the entire agreement between the parties. . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and/or associated documentation files (the "Materials"), to - deal in the Materials without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Materials, and to permit persons to whom the Materials are - furnished to do so, subject to the following conditions: . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Materials. . - THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE - MATERIALS. . --- end of LICENSE --- . - ------------------------------------------------------------------------------- - . - %% Lucida is a registered trademark or trademark of Bigelow & Holmes in the - U.S. and other countries. - . - ------------------------------------------------------------------------------- - . - %% This notice is provided with respect to Mesa 3D Graphics Library v4.1, - which may be included with JRE 8, JDK 8, and OpenJDK 8 source distributions. + ------------------------------------------------------------------------------ + %% This notice is provided with respect to Mozilla Public Suffix List, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Mesa 3-D graphics library - Version: 4.1 + Public Suffix Notice . - Copyright (C) 1999-2002 Brian Paul All Rights Reserved. + You are receiving a copy of the Mozilla Public Suffix List in the following + file: /lib/security/public_suffix_list.dat. The terms of the + Oracle license do NOT apply to this file; it is licensed under the + Mozilla Public License 2.0, separately from the Oracle programs you receive. + If you do not wish to use the Public Suffix List, you may remove the + /lib/security/public_suffix_list.dat file. . - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: + The Source Code of this file is available under the + Mozilla Public License, v. 2.0 and is located at + https://raw.githubusercontent.com/publicsuffix/list/88467c960d6cdad2ca1623e892e5e17506bc269f/public_suffix_list.dat. + If a copy of the MPL was not distributed with this file, you can obtain one + at https://mozilla.org/MPL/2.0/. . - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. + Software distributed under the License is distributed on an "AS IS" basis, + WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + for the specific language governing rights and limitations under the License. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - . - --- end of LICENSE --- - . - ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to Mozilla Network Security - Services (NSS), which is supplied with the JDK test suite in the OpenJDK - source code repository. It is licensed under Mozilla Public License (MPL), - version 2.0. - . - The NSS libraries are supplied in executable form, built from unmodified - NSS source code labeled with the "NSS_3.13.1_RTM" release tag. . - The NSS source code is available in the OpenJDK source code repository at: - jdk/test/sun/security/pkcs11/nss/src - . - The NSS libraries are available in the OpenJDK source code repository at: - jdk/test/sun/security/pkcs11/nss/lib - . - --- begin of LICENSE --- + MPL v2.0 . Mozilla Public License Version 2.0 ================================== @@ -1502,7 +874,7 @@ means any form of the work other than Source Code Form. . 1.7. "Larger Work" - means a work that combines Covered Software with other material, in + means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. . 1.8. "License" @@ -1824,7 +1196,7 @@ . This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. + file, You can obtain one at https://mozilla.org/MPL/2.0/. . If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE @@ -1839,1584 +1211,1608 @@ This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. . + . + . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to PC/SC Lite for Suse Linux v.1.1.1, - which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + %% This notice is provided with respect to The Unicode Standard, Unicode Character Database, Version 13.0.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright (c) 1999-2004 David Corcoran - Copyright (c) 1999-2004 Ludovic Rousseau - All rights reserved. + Unicode Character Database . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: . - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by: - David Corcoran - http://www.linuxnet.com (MUSCLE) - 4. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - . - Changes to this license can be made only by the copyright author with - explicit written consent. - . - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE . - --- end of LICENSE --- + See Terms of Use for definitions of Unicode Inc.'s + Data Files and Software. . - ------------------------------------------------------------------------------ + NOTICE TO USER: Carefully read the following legal agreement. + BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S + DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), + YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE + TERMS AND CONDITIONS OF THIS AGREEMENT. + IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE + THE DATA FILES OR SOFTWARE. . - %% This notice is provided with respect to PorterStemmer v4, which may be - included with JRE 8, JDK 8, and OpenJDK 8. + COPYRIGHT AND PERMISSION NOTICE . - --- begin of LICENSE --- + Copyright © 1991-2020 Unicode, Inc. All rights reserved. + Distributed under the Terms of Use in https://www.unicode.org/copyright.html. . - See: http://tartarus.org/~martin/PorterStemmer + Permission is hereby granted, free of charge, to any person obtaining + a copy of the Unicode data files and any associated documentation + (the "Data Files") or Unicode software and any associated documentation + (the "Software") to deal in the Data Files or Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of + the Data Files or Software, and to permit persons to whom the Data Files + or Software are furnished to do so, provided that either + (a) this copyright and permission notice appear with all copies + of the Data Files or Software, or + (b) this copyright and permission notice appear in associated + Documentation. + . + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THE DATA FILES OR SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, + use or other dealings in these Data Files or Software without prior + written authorization of the copyright holder. . - The software is completely free for any purpose, unless notes at the head of - the program text indicates otherwise (which is rare). In any case, the notes - about licensing are never more restrictive than the BSD License. . - In every case where the software is not written by me (Martin Porter), this - licensing arrangement has been endorsed by the contributor, and it is - therefore unnecessary to ask the contributor again to confirm it. . - I have not asked any contributors (or their employers, if they have them) for - proofs that they have the right to distribute their software in this way. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to Relax NG Object/Parser v.20050510, - which may be included with JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to Eastman Kodak Company: Portions of color management and imaging software, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright (c) Kohsuke Kawaguchi + Eastman Kodak Notice + . + Portions Copyright Eastman Kodak Company 1991-2003 . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: The above copyright - notice and this permission notice shall be included in all copies or - substantial portions of the Software. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to RelaxNGCC v1.12, which may be - included with JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to The FreeType Project: Freetype v2.13.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright (c) 2000-2003 Daisuke Okajima and Kohsuke Kawaguchi. - All rights reserved. . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + FreeType Notice . - 1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. . - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + FreeType comes with two licenses from which you can choose the one + which fits your needs best. . - 3. The end-user documentation included with the redistribution, if any, must - include the following acknowledgment: + The FreeType License (FTL) is the most commonly used one. It is + a BSD-style license with a credit clause and thus compatible with + the GNU Public License (GPL) version 3, but not with the + GPL version 2. . - "This product includes software developed by Daisuke Okajima - and Kohsuke Kawaguchi (http://relaxngcc.sf.net/)." + The GNU General Public License (GPL), version 2. Use it for all + projects which use the GPLv2 also, or which need a license + compatible to the GPLv2. . - Alternately, this acknowledgment may appear in the software itself, if and - wherever such third-party acknowledgments normally appear. . - 4. The names of the copyright holders must not be used to endorse or promote - products derived from this software without prior written permission. For - written permission, please contact the copyright holders. . - 5. Products derived from this software may not be called "RELAXNGCC", nor may - "RELAXNGCC" appear in their name, without prior written permission of the - copyright holders. + FreeType License + . + . + Copyright (C) 1996-2023 by David Turner, Robert Wilhelm, and Werner Lemberg. + Copyright (C) 2007-2023 by Dereg Clegg and Michael Toftdal. + Copyright (C) 1996-2023 by Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. + Copyright (C) 2022-2023 by David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and + Copyright (C) 2004-2023 by Masatake YAMATO and Redhat K.K. + Copyright (C) 2007-2023 by Derek Clegg and Michael Toftdal. + Copyright (C) 2003-2023 by Masatake YAMATO, Red Hat K.K., + Copyright (C) 1996-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches. + Copyright (C) 2007-2023 by David Turner. + Copyright (C) 2022-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti. + Copyright (C) 2007-2023 by Rahul Bhalerao , . + Copyright (C) 2008-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya. + Copyright (C) 2013-2023 by Google, Inc. + Copyright (C) 2019-2023 by Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg. + Copyright (C) 2009-2023 by Oran Agra and Mickey Gabel. + Copyright (C) 2018-2023 by David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg. + Copyright (C) 2004-2023 by David Turner, Robert Wilhelm, Werner Lemberg, and George Williams. + . + . + The FreeType Project LICENSE + ---------------------------- + . + 2006-Jan-27 + . + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + . + . + . + Introduction + ============ + . + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + . + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + . + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + . + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + . + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + . + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + . + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + . + . + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + . + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + . + Please replace with the value from the FreeType version you + actually use. + . + . + Legal Terms + =========== + . + 0. Definitions + -------------- + . + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + . + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + . + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + . + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + . + 1. No Warranty + -------------- + . + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + . + 2. Redistribution + ----------------- + . + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + . + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + . + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + . + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + . + 3. Advertising + -------------- + . + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + . + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + . + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + . + 4. Contacts + ----------- + . + There are two mailing lists related to FreeType: + . + o freetype@nongnu.org + . + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + . + o freetype-devel@nongnu.org + . + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + . + Our home page can be found at + . + https://www.freetype.org + . + . + . + GPL v2: Refer to the copy under /usr/share/common-licenses + . + Additional Freetype Attributions + . + . + --------------------------------- + The below license applies to the following files: + libfreetype/src/psaux/psarrst.c + libfreetype/src/psaux/psarrst.h + libfreetype/src/psaux/psblues.c + libfreetype/src/psaux/psblues.h + libfreetype/src/psaux/pserror.c + libfreetype/src/psaux/pserror.h + libfreetype/src/psaux/psfixed.h + libfreetype/src/psaux/psfont.c + libfreetype/src/psaux/psfont.h + libfreetype/src/psaux/psft.c + libfreetype/src/psaux/psft.h + libfreetype/src/psaux/psglue.h + libfreetype/src/psaux/pshints.c + libfreetype/src/psaux/pshints.h + libfreetype/src/psaux/psintrp.c + libfreetype/src/psaux/psintrp.h + libfreetype/src/psaux/psread.c + libfreetype/src/psaux/psread.h + libfreetype/src/psaux/psstack.c + libfreetype/src/psaux/psstack.h + libfreetype/src/psaux/pstypes.h + . + Copyright 2006-2014 Adobe Systems Incorporated. + . + This software, and all works of authorship, whether in source or + object code form as indicated by the copyright notice(s) included + herein (collectively, the "Work") is made available, and may only be + used, modified, and distributed under the FreeType Project License, + LICENSE.TXT. Additionally, subject to the terms and conditions of the + FreeType Project License, each contributor to the Work hereby grants + to any individual or legal entity exercising permissions granted by + the FreeType Project License and this section (hereafter, "You" or + "Your") a perpetual, worldwide, non-exclusive, no-charge, + royalty-free, irrevocable (except as stated in this section) patent + license to make, have made, use, offer to sell, sell, import, and + otherwise transfer the Work, where such license applies only to those + patent claims licensable by such contributor that are necessarily + infringed by their contribution(s) alone or by combination of their + contribution(s) with the Work to which such contribution(s) was + submitted. If You institute patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + the Work or a contribution incorporated within the Work constitutes + direct or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate as of + the date such litigation is filed. + . + By using, modifying, or distributing the Work you indicate that you + have read and understood the terms and conditions of the + FreeType Project License as well as those provided in this section, + and you accept them fully. + . + . + . + . + MIT License + . + . + --------------------------------- + The below license applies to the following files: + libfreetype/include/freetype/internal/fthash.h + libfreetype/src/base/fthash.c + . + Copyright 2000 Computing Research Labs, New Mexico State University + Copyright 2001-2015 + . + Francesco Zappa Nardelli + . + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT + OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + . . - THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL THE APACHE - SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to SAX 2.0.1, which may be included - with JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to Harfbuzz v7.2.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - SAX is free! + Harfbuzz License + . + https://github.com/harfbuzz/harfbuzz/blob/7.2.0/COPYING + . + . + . + HarfBuzz is licensed under the so-called "Old MIT" license. Details follow. + For parts of HarfBuzz that are licensed under different licenses see individual + files names COPYING in subdirectories where applicable. . - In fact, it's not possible to own a license to SAX, since it's been placed in - the public domain. + Copyright © 2010-2023 Google, Inc. + Copyright © 2018-2020 Ebrahim Byagowi + Copyright © 2004-2013 Red Hat, Inc. + Copyright © 2019 Facebook, Inc. + Copyright © 2007 Chris Wilson + Copyright © 2018-2019 Adobe Inc. + Copyright © 2006-2023 Behdad Esfahbod + Copyright © 1998-2004 David Turner and Werner Lemberg + Copyright © 2009 Keith Stribley + Copyright © 2018 Khaled Hosny + Copyright © 2016 Elie Roux + Copyright © 2016 Igalia S.L. + Copyright © 2015 Mozilla Foundation. + Copyright © 1999 David Turner + Copyright © 2005 Werner Lemberg + Copyright © 2013-2015 Alexei Podtelezhnikov + Copyright © 2022 Matthias Clasen + Copyright © 2011 Codethink Limited . - No Warranty + For full copyright notices consult the individual files in the package. . - Because SAX is released to the public domain, there is no warranty for the - design or for the software implementation, to the extent permitted by - applicable law. Except when otherwise stated in writing the copyright holders - and/or other parties provide SAX "as is" without warranty of any kind, either - expressed or implied, including, but not limited to, the implied warranties - of merchantability and fitness for a particular purpose. The entire risk as - to the quality and performance of SAX is with you. Should SAX prove - defective, you assume the cost of all necessary servicing, repair or - correction. . - In no event unless required by applicable law or agreed to in writing will - any copyright holder, or any other party who may modify and/or redistribute - SAX, be liable to you for damages, including any general, special, incidental - or consequential damages arising out of the use or inability to use SAX - (including but not limited to loss of data or data being rendered inaccurate - or losses sustained by you or third parties or a failure of the SAX to - operate with any other programs), even if such holder or other party has been - advised of the possibility of such damages. + Permission is hereby granted, without written agreement and without + license or royalty fees, to use, copy, modify, and distribute this + software and its documentation for any purpose, provided that the + above copyright notice and the following two paragraphs appear in + all copies of this software. . - Copyright Disclaimers + IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + DAMAGE. . - This page includes statements to that effect by David Megginson, who would - have been able to claim copyright for the original work. SAX 1.0 + THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + . + All source code, except for one section, is licensed as above. The one + exception is licensed with a slightly different MIT variant: + The contents of this directory are licensed under the following terms: + . + --------------------------------- + The below license applies to the following files: + libharfbuzz/hb-ucd.cc + . + Copyright (C) 2012 Grigori Goronzy + . + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. . - Version 1.0 of the Simple API for XML (SAX), created collectively by the - membership of the XML-DEV mailing list, is hereby released into the public - domain. . - No one owns SAX: you may use it freely in both commercial and non-commercial - applications, bundle it with your software distribution, include it on a - CD-ROM, list the source code in a book, mirror the documentation at your own - web site, or use it in any other way you see fit. . - David Megginson, sax@megginson.com - 1998-05-11 + AUTHORS File Information . - SAX 2.0 . - I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and - release all of the SAX 2.0 source code, compiled code, and documentation - contained in this distribution into the Public Domain. SAX comes with NO - WARRANTY or guarantee of fitness for any purpose. + Behdad Esfahbod + David Corbett + David Turner + Ebrahim Byagowi + Garret Rieger + Jonathan Kew + Khaled Hosny + Lars Knoll + Martin Hosken + Owen Taylor + Roderick Sheeter + Roozbeh Pournader + Simon Hausmann + Werner Lemberg + . . - David Megginson, david@megginson.com - 2000-05-05 . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to SoftFloat version 2b, which may be - included with JRE 8, JDK 8, and OpenJDK 8 on Linux/ARM. + %% This notice is provided with respect to Little Color Management System (LCMS) v2.15, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Use of any of this software is governed by the terms of the license below: + LCMS License . - SoftFloat was written by me, John R. Hauser. This work was made possible in - part by the International Computer Science Institute, located at Suite 600, - 1947 Center Street, Berkeley, California 94704. Funding was partially - provided by the National Science Foundation under grant MIP-9311980. The - original version of this code was written as part of a project to build - a fixed-point vector processor in collaboration with the University of - California at Berkeley, overseen by Profs. Nelson Morgan and John Wawrzynek. + README.1ST file information + . + LittleCMS core is released under MIT License + . + --------------------------------- + . + Little CMS + Copyright (c) 1998-2023 Marti Maria Saguer + . + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject + to the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + --------------------------------- + The below license applies to the following files: + liblcms/cmssm.c + . + Copyright 2001, softSurfer (www.softsurfer.com) + . + This code may be freely used and modified for any purpose + providing that this copyright notice is included with it. + SoftSurfer makes no warranty for this code, and cannot be held + liable for any real or imagined damage resulting from its use. + Users of this code must verify correctness for their application. + . + . + . + AUTHORS File Information + . + . + . + Main Author + ------------ + Marti Maria + . + . + Contributors + ------------ + Bob Friesenhahn + Kai-Uwe Behrmann + Stuart Nixon + Jordi Vilar + Richard Hughes + Auke Nauta + Chris Evans (Google) + Lorenzo Ridolfi + Robin Watts (Artifex) + Shawn Pedersen + Andrew Brygin + Samuli Suominen + Florian Hˆch + Aurelien Jarno + Claudiu Cebuc + Michael Vhrel (Artifex) + Michal Cihar + Daniel Kaneider + Mateusz Jurczyk (Google) + Paul Miller + SÈbastien LÈon + Christian Schmitz + XhmikosR + Stanislav Brabec (SuSe) + Leonhard Gruenschloss (Google) + Patrick Noffke + Christopher James Halse Rogers + John Hein + Thomas Weber (Debian) + Mark Allen + Noel Carboni + Sergei Trofimovic + Philipp Knechtges + Amyspark + Lovell Fuller + Eli Schwartz + . + Special Thanks + -------------- + Artifex software + AlienSkin software + libVIPS + Jan Morovic + Jos Vernon (WebSupergoo) + Harald Schneider (Maxon) + Christian Albrecht + Dimitrios Anastassakis + Lemke Software + Tim Zaman . - THIS SOFTWARE IS DISTRIBUTED AS IS, FOR FREE. Although reasonable effort - has been made to avoid it, THIS SOFTWARE MAY CONTAIN FAULTS THAT WILL AT - TIMES RESULT IN INCORRECT BEHAVIOR. USE OF THIS SOFTWARE IS RESTRICTED TO - PERSONS AND ORGANIZATIONS WHO CAN AND WILL TAKE FULL RESPONSIBILITY FOR ALL - LOSSES, COSTS, OR OTHER PROBLEMS THEY INCUR DUE TO THE SOFTWARE, AND WHO - FURTHERMORE EFFECTIVELY INDEMNIFY JOHN HAUSER AND THE INTERNATIONAL COMPUTER - SCIENCE INSTITUTE (possibly via similar legal warning) AGAINST ALL LOSSES, - COSTS, OR OTHER PROBLEMS INCURRED BY THEIR CUSTOMERS AND CLIENTS DUE TO THE - SOFTWARE. . - Derivative works are acceptable, even for commercial purposes, provided - that the minimal documentation requirements stated in the source code are - satisfied. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to Sparkle 1.5, - which may be included with JRE 8 on Mac OS X. + %% This notice is provided with respect to Mesa 3-D Graphics Library v21.0.3, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Copyright (c) 2012 Sparkle.org and Andy Matuschak + Mesa License . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. + Copyright (C) 1999-2007 Brian Paul All Rights Reserved. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. . - --- end of LICENSE --- + Attention, Contributors . - ------------------------------------------------------------------------------ + When contributing to the Mesa project you must agree to the licensing terms + of the component to which you're contributing. + The following section lists the primary components of the Mesa distribution + and their respective licenses. + Mesa Component Licenses . - %% Portions licensed from Taligent, Inc. . - ------------------------------------------------------------------------------ . - %% This notice is provided with respect to Thai Dictionary, which may be - included with JRE 8, JDK 8, and OpenJDK 8. + Component Location License + ------------------------------------------------------------------ + Main Mesa code src/mesa/ MIT + Device drivers src/mesa/drivers/* MIT, generally . - --- begin of LICENSE --- + Gallium code src/gallium/ MIT . - Copyright (C) 1982 The Royal Institute, Thai Royal Government. + Ext headers GL/glext.h Khronos + GL/glxext.h Khronos + GL/wglext.h Khronos + KHR/khrplatform.h Khronos . - Copyright (C) 1998 National Electronics and Computer Technology Center, - National Science and Technology Development Agency, - Ministry of Science Technology and Environment, - Thai Royal Government. + ***************************************************************************** . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: + ---- + include/GL/gl.h : . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. + Mesa 3-D graphics library . - --- end of LICENSE --- + Copyright (C) 1999-2006 Brian Paul All Rights Reserved. + Copyright (C) 2009 VMware, Inc. All Rights Reserved. . - ------------------------------------------------------------------------------ + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: . - %% This notice is provided with respect to Unicode 6.2.0 & CLDR 21.0.1 - which may be included with JRE 8, JDK 8, and OpenJDK 8. + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. . - --- begin of LICENSE --- + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. . - Unicode Terms of Use + ***************************************************************************** . - For the general privacy policy governing access to this site, see the Unicode - Privacy Policy. For trademark usage, see the Unicode® Consortium Name and - Trademark Usage Policy. - . - A. Unicode Copyright. - 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. - . - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative - works conforming to the Unicode® Standard, subject to Terms and - Conditions herein. - . - 3. Any person is hereby authorized, without fee, to view, use, reproduce, - and distribute all documents and files solely for informational - purposes in the creation of products supporting the Unicode Standard, - subject to the Terms and Conditions herein. - . - 4. Further specifications of rights and restrictions pertaining to the use - of the particular set of data files known as the "Unicode Character - Database" can be found in Exhibit 1. - . - 5. Each version of the Unicode Standard has further specifications of - rights and restrictions of use. For the book editions (Unicode 5.0 and - earlier), these are found on the back of the title page. The online - code charts carry specific restrictions. All other files, including - online documentation of the core specification for Unicode 6.0 and - later, are covered under these general Terms of Use. - . - 6. No license is granted to "mirror" the Unicode website where a fee is - charged for access to the "mirror" site. - . - 7. Modification is not permitted with respect to this document. All copies - of this document must be verbatim. - . - B. Restricted Rights Legend. Any technical data or software which is licensed - to the United States of America, its agencies and/or instrumentalities - under this Agreement is commercial technical data or commercial computer - software developed exclusively at private expense as defined in FAR 2.101, - or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, - duplication, or disclosure by the Government is subject to restrictions as - set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov - 1995) and this Agreement. For Software, in accordance with FAR 12-212 or - DFARS 227-7202, as applicable, use, duplication or disclosure by the - Government is subject to the restrictions set forth in this Agreement. - . - C. Warranties and Disclaimers. - 1. This publication and/or website may include technical or typographical - errors or other inaccuracies . Changes are periodically added to the - information herein; these changes will be incorporated in new editions - of the publication and/or website. Unicode may make improvements and/or - changes in the product(s) and/or program(s) described in this - publication and/or website at any time. - . - 2. If this file has been purchased on magnetic or optical media from - Unicode, Inc. the sole and exclusive remedy for any claim will be - exchange of the defective media within ninety (90) days of original - purchase. - . - 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR SOFTWARE IS - PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, - OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. - UNICODE AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR - OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH - ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. - . - D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - any special, incidental, indirect or consequential damages of any kind, or - any damages whatsoever, whether or not Unicode was advised of the - possibility of the damage, including, without limitation, those resulting - from the following: loss of use, data or profits, in connection with the - use, modification or distribution of this information or its derivatives. - . - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, - Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of - Unicode, Inc. Use of the information and materials found on this - website indicates your acknowledgement of Unicode, Inc.’s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - . - 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark - Policy”) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - . - 3. All third party trademarks referenced herein are the property of their - respective owners. - . - Miscellaneous. - 1. Jurisdiction and Venue. This server is operated from a location in the - State of California, United States of America. Unicode makes no - representation that the materials are appropriate for use in other - locations. If you access this server from other locations, you are - responsible for compliance with local laws. This Agreement, all use of - this site and any claims and damages resulting from use of this site are - governed solely by the laws of the State of California without regard to - any principles which would apply the laws of a different jurisdiction. - The user agrees that any disputes regarding this site shall be resolved - solely in the courts located in Santa Clara County, California. The user - agrees said courts have personal jurisdiction and agree to waive any - right to transfer the dispute to any other forum. - . - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not - assign any part of this Agreement without Unicode’s prior written - consent. - . - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on - Unicode’s net income. - . - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain - in effect. + ---- + include/GL/glext.h + include/GL/glxext.h + include/GL/wglxext.h : . - 5. Entire Agreement. This Agreement constitutes the entire agreement - between the parties. . - EXHIBIT 1 - UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + Copyright (c) 2013 - 2018 The Khronos Group Inc. . - Unicode Data Files include all data files under the directories - http://www.unicode.org/Public/, http://www.unicode.org/reports/, and - http://www.unicode.org/cldr/data/. Unicode Data Files do not include PDF - online code charts under the directory http://www.unicode.org/Public/. - Software includes any source code published in the Unicode Standard or under - the directories http://www.unicode.org/Public/, - http://www.unicode.org/reports/, and http://www.unicode.org/cldr/data/. - . - NOTICE TO USER: Carefully read the following legal agreement. BY DOWNLOADING, - INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES ("DATA - FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO - BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT - AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR - SOFTWARE. + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: . - COPYRIGHT AND PERMISSION NOTICE + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. . - Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. . - Permission is hereby granted, free of charge, to any person obtaining a copy - of the Unicode data files and any associated documentation (the "Data Files") - or Unicode software and any associated documentation (the "Software") to deal - in the Data Files or Software without restriction, including without - limitation the rights to use, copy, modify, merge, publish, distribute, and/or - sell copies of the Data Files or Software, and to permit persons to whom the - Data Files or Software are furnished to do so, provided that (a) the above - copyright notice(s) and this permission notice appear with all copies of the - Data Files or Software, (b) both the above copyright notice(s) and this - permission notice appear in associated documentation, and (c) there is clear - notice in each modified Data File or in the Software as well as in the - documentation associated with the Data File(s) or Software that the data or - software has been modified. + ***************************************************************************** + . + ---- + include/KHR/khrplatform.h : + . + Copyright (c) 2008 - 2018 The Khronos Group Inc. . - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY - KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD - PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN - THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL - DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE - DATA FILES OR SOFTWARE. + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and/or associated documentation files (the + "Materials"), to deal in the Materials without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Materials, and to + permit persons to whom the Materials are furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Materials. + . + THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + . + ***************************************************************************** . - Except as contained in this notice, the name of a copyright holder shall not - be used in advertising or otherwise to promote the sale, use or other dealings - in these Data Files or Software without prior written authorization of the - copyright holder. . - Unicode and the Unicode logo are trademarks of Unicode, Inc. in the United - States and other countries. All third party trademarks referenced herein are - the property of their respective owners. . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to UPX v3.01, which may be included - with JRE 8 on Windows. + %% This notice is provided with respect to xwd v1.0.7, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Use of any of this software is governed by the terms of the license below: + xwd utility . . - ooooo ooo ooooooooo. ooooooo ooooo - `888' `8' `888 `Y88. `8888 d8' - 888 8 888 .d88' Y888..8P - 888 8 888ooo88P' `8888' - 888 8 888 .8PY888. - `88. .8' 888 d8' `888b - `YbodP' o888o o888o o88888o + This is the copyright for the files in src/java.desktop/unix/native/libawt_xawt: + list.h, multiVis.h, wsutils.h, list.c, multiVis.c + . + Copyright 1994 Hewlett-Packard Co. + Copyright 1996, 1998 The Open Group + . + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation. . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. . - The Ultimate Packer for eXecutables - Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar - http://wildsau.idv.uni-linz.ac.at/mfx/upx.html - http://www.nexus.hu/upx - http://upx.tsx.org + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. . + Except as contained in this notice, the name of The Open Group shall + not be used in advertising or otherwise to promote the sale, use or + other dealings in this Software without prior written authorization + from The Open Group. . - PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN - TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION. . . - ABSTRACT - ======== + --- end of LICENSE --- . - UPX and UCL are copyrighted software distributed under the terms - of the GNU General Public License (hereinafter the "GPL"). + ------------------------------------------------------------------------------ + %% This notice is provided with respect to Apache Commons Byte Code Engineering Library (BCEL) Version 6.7.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - The stub which is imbedded in each UPX compressed program is part - of UPX and UCL, and contains code that is under our copyright. The - terms of the GNU General Public License still apply as compressing - a program is a special form of linking with our stub. + --- begin of LICENSE --- . - As a special exception we grant the free usage of UPX for all - executables, including commercial programs. - See below for details and restrictions. + Apache Commons BCEL Notice . . - COPYRIGHT - ========= + Apache Commons BCEL + Copyright 2004-2022 The Apache Software Foundation . - UPX and UCL are copyrighted software. All rights remain with the authors. + This product includes software developed at + The Apache Software Foundation (https://www.apache.org/). . - UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer - UPX is Copyright (C) 1996-2000 Laszlo Molnar . - UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer . + Apache 2.0 License: Refer to the copy under /usr/share/common-licenses . - GNU GENERAL PUBLIC LICENSE - ========================== . - UPX and the UCL library are free software; you can redistribute them - and/or modify them under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + --- end of LICENSE --- . - UPX and UCL are distributed in the hope that they 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 for more details. + ------------------------------------------------------------------------------ + %% This notice is provided with respect to DOM Level 3 Core Specification v1.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. + --- begin of LICENSE --- . + W3C Software Notice . - SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES - ============================================ + Copyright © 2004 World Wide Web Consortium, (Massachusetts Institute of Technology, + European Research Consortium for Informatics and Mathematics, Keio University). + All Rights Reserved. . - The stub which is imbedded in each UPX compressed program is part - of UPX and UCL, and contains code that is under our copyright. The - terms of the GNU General Public License still apply as compressing - a program is a special form of linking with our stub. + The DOM bindings are published under the W3C Software Copyright Notice and License. + The software license requires "Notice of any changes or modifications to the W3C + files, including the date changes were made." Consequently, modified versions of + the DOM bindings must document that they do not conform to the W3C standard; in the + case of the IDL definitions, the pragma prefix can no longer be 'w3c.org'; in the + case of the Java language binding, the package names can no longer be in the + 'org.w3c' package. . - Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special - permission to freely use and distribute all UPX compressed programs - (including commercial ones), subject to the following restrictions: . - 1. You must compress your program with a completely unmodified UPX - version; either with our precompiled version, or (at your option) - with a self compiled version of the unmodified UPX sources as - distributed by us. - 2. This also implies that the UPX stub must be completely unmodfied, i.e. - the stub imbedded in your compressed program must be byte-identical - to the stub that is produced by the official unmodified UPX version. - 3. The decompressor and any other code from the stub must exclusively get - used by the unmodified UPX stub for decompressing your program at - program startup. No portion of the stub may get read, copied, - called or otherwise get used or accessed by your program. + W3C License . . - ANNOTATIONS - =========== + W3C SOFTWARE NOTICE AND LICENSE . - - You can use a modified UPX version or modified UPX stub only for - programs that are compatible with the GNU General Public License. + http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 . - - We grant you special permission to freely use and distribute all UPX - compressed programs. But any modification of the UPX stub (such as, - but not limited to, removing our copyright string or making your - program non-decompressible) will immediately revoke your right to - use and distribute a UPX compressed program. + This work (and included software, documentation such as READMEs, or other + related items) is being provided by the copyright holders under the following + license. By obtaining, using and/or copying this work, you (the licensee) + agree that you have read, understood, and will comply with the following terms + and conditions. . - - UPX is not a software protection tool; by requiring that you use - the unmodified UPX version for your proprietary programs we - make sure that any user can decompress your program. This protects - both you and your users as nobody can hide malicious code - - any program that cannot be decompressed is highly suspicious - by definition. + Permission to copy, modify, and distribute this software and its + documentation, with or without modification, for any purpose and without fee + or royalty is hereby granted, provided that you include the following on ALL + copies of the software and documentation or portions thereof, including + modifications: . - - You can integrate all or part of UPX and UCL into projects that - are compatible with the GNU GPL, but obviously you cannot grant - any special exceptions beyond the GPL for our code in your project. + 1.The full text of this NOTICE in a location viewable to users of the + redistributed or derivative work. . - - We want to actively support manufacturers of virus scanners and - similar security software. Please contact us if you would like to - incorporate parts of UPX or UCL into such a product. + 2.Any pre-existing intellectual property disclaimers, notices, or terms and + conditions. If none exist, the W3C Software Short Notice should be included + (hypertext is preferred, text is permitted) within the body of any + redistributed or derivative code. + . + 3.Notice of any changes or modifications to the files, including the date + changes were made. (We recommend you provide URIs to the location from + which the code is derived.) . + THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS + MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT + LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR + PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY + THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. . + COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL + OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR + DOCUMENTATION. The name and trademarks of copyright holders may NOT be used + in advertising or publicity pertaining to the software without specific, + written prior permission. Title to copyright in this software and any + associated documentation will at all times remain with copyright holders. . - Markus F.X.J. Oberhumer Laszlo Molnar - markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu + ____________________________________ . - Linz, Austria, 25 Feb 2000 + This formulation of W3C's notice and license became active on December 31 + 2002. This version removes the copyright ownership notice such that this + license can be used with materials other than those owned by the W3C, reflects + that ERCIM is now a host of the W3C, includes references to this specific + dated version of the license, and removes the ambiguous grant of "use". + Otherwise, this version is the same as the previous version and is written so + as to preserve the Free Software Foundation's assessment of GPL compatibility + and OSI's certification under the Open Source Definition. Please see our + Copyright FAQ for common questions about using materials from our site, + including specific terms and conditions for packages like libwww, Amaya, and + Jigsaw. Other questions about this notice can be directed to + site-policy@w3.org. . - Additional License(s) . - The UPX license file is at http://upx.sourceforge.net/upx-license.html. . --- end of LICENSE --- . ------------------------------------------------------------------------------ + %% This notice is provided with respect to CUP Parser Generator for Java v 0.11b, + which may be included with JRE 17, JDK 17 and OpenJDK 17 + . + --- begin of LICENSE --- + . + CUP Parser Generator License + . + . + Copyright 1996-2015 by Scott Hudson, Frank Flannery, C. Scott Ananian, Michael Petter + . + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both + the copyright notice and this permission notice and warranty disclaimer + appear in supporting documentation, and that the names of the authors or + their employers not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior permission. + . + The authors and their employers disclaim all warranties with regard to + this software, including all implied warranties of merchantability and + fitness. In no event shall the authors or their employers be liable for + any special, indirect or consequential damages or any damages whatsoever + resulting from loss of use, data or profits, whether in an action of + contract, negligence or other tortious action, arising out of or in + connection with the use or performance of this software. + . + --- + . + This is an open source license. It is also GPL-Compatible (see entry for + "Standard ML of New Jersey"). The portions of CUP output which are hard-coded + into the CUP source code are (naturally) covered by this same license, as is + the CUP runtime code linked with the generated parser. . - %% This notice is provided with respect to Xfree86-VidMode Extension 1.0, - which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + . + . + --- end of LICENSE --- + . + ------------------------------------------------------------------------------ + %% This notice is provided with respect to Apache Xalan v2.7.2, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Version 1.1 of XFree86 ProjectLicence. + Apache Xalan Notice . - Copyright (C) 1994-2004 The XFree86 Project, Inc. All rights reserved. . - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicence, and/or sell - copies of the Software, and to permit persons to whom the Software is furnished - to do so,subject to the following conditions: + ====================================================================================== + == NOTICE file corresponding to the section 4d of the Apache License, Version 2.0, == + == in this case for the Apache Xalan distribution. == + ====================================================================================== + . + This product includes software developed by + The Apache Software Foundation (http://www.apache.org/). . - 1. Redistributions of source code must retain the above copyright - notice,this list of conditions, and the following disclaimer. + Specifically, we only include the XSLTC portion of the source from the Xalan distribution. + The Xalan project has two processors: an interpretive one (Xalan Interpretive) and a + compiled one (The XSLT Compiler (XSLTC)). We *only* use the XSLTC part of Xalan; We use + the source from the packages that are part of the XSLTC sources. . - 2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution, and in the same place - and form as other copyright, license and disclaimer information. + Portions of this software was originally based on the following: . - 3. The end-user documentation included with the redistribution, if any,must - include the following acknowledgment: "This product includes - software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and - its contributors", in the same place and form as other third-party - acknowledgments. Alternately, this acknowledgment may appear in the software - itself, in the same form and location as other such third-party - acknowledgments. + - software copyright (c) 1999-2002, Lotus Development Corporation., http://www.lotus.com. + - software copyright (c) 2001-2002, Sun Microsystems., http://www.sun.com. + - software copyright (c) 2003, IBM Corporation., http://www.ibm.com. + - voluntary contributions made by Ovidiu Predescu (ovidiu@cup.hp.com) on behalf of the + Apache Software Foundation and was originally developed at Hewlett Packard Company. . - 4. Except as contained in this notice, the name of The XFree86 Project,Inc - shall not be used in advertising or otherwise to promote the sale, use - or other dealings in this Software without prior written authorization from - The XFree86 Project, Inc. . - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED - WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR - SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - DAMAGE. + . + Apache 2.0 License: Refer to the copy under /usr/share/common-licenses + . . --- end of LICENSE --- . ------------------------------------------------------------------------------ + %% This notice is provided with respect to Apache Xerces v2.12.2, + which may be included with JRE 17, JDK 17 and OpenJDK 17 + . + --- begin of LICENSE --- + . + Apache Xerces Notice + . + ========================================================================= + == NOTICE file corresponding to section 4(d) of the Apache License, == + == Version 2.0, in this case for the Apache Xerces Java distribution. == + ========================================================================= + . + Apache Xerces Java + Copyright 1999-2022 The Apache Software Foundation . - %% This notice is provided with respect to X Window System 6.8.2, which may be - included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). + . + Portions of this software were originally based on the following: + - software copyright (c) 1999, IBM Corporation., http://www.ibm.com. + - software copyright (c) 1999, Sun Microsystems., http://www.sun.com. + - voluntary contributions made by Paul Eng on behalf of the + Apache Software Foundation that were originally developed at iClick, Inc., + software copyright (c) 1999. + . + . + Apache 2.0 License: Refer to the copy under /usr/share/common-licenses + . + . + --- end of LICENSE --- + . + ------------------------------------------------------------------------------ + %% This notice is provided with respect to Apache Santuario v2.3.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - Licenses - The X.Org Foundation March 2004 + Apache Santuario Notice . - 1. Introduction . - The X.org Foundation X Window System distribution is a compilation of code and - documentation from many sources. This document is intended primarily as a - guide to the licenses used in the distribution: you must check each file - and/or package for precise redistribution terms. None-the-less, this summary - may be useful to many users. No software incorporating the XFree86 1.1 license - has been incorporated. + Apache Santuario - XML Security for Java + Copyright 1999-2021 The Apache Software Foundation . - This document is based on the compilation from XFree86. + This product includes software developed at + The Apache Software Foundation (http://www.apache.org/). . - 2. XFree86 License + It was originally based on software copyright (c) 2001, Institute for + Data Communications Systems, . . - XFree86 code without an explicit copyright is covered by the following - copyright/license: + The development of this software was partly funded by the European + Commission in the project in the ISIS Programme. . - Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. + Apache 2.0 License: Refer to the copy under /usr/share/common-licenses . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. . - Except as contained in this notice, the name of the XFree86 Project shall not - be used in advertising or otherwise to promote the sale, use or other dealings - in this Software without prior written authorization from the XFree86 Project. + --- end of LICENSE --- . - 3. Other Licenses + ------------------------------------------------------------------------------ + %% This notice is provided with respect to OASIS PKCS #11 Cryptographic Token Interface v3.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - Portions of code are covered by the following licenses/copyrights. See - individual files for the copyright dates. + --- begin of LICENSE --- . - 3.1. X/MIT Copyrights + OASIS PKCS #11 Cryptographic Token Interface License . - 3.1.1. X Consortium . - Copyright (C) X Consortium + Copyright © OASIS Open 2020. All Rights Reserved. . - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: + All capitalized terms in the following text have the meanings + assigned to them in the OASIS Intellectual Property Rights Policy (the + "OASIS IPR Policy"). The full Policy may be found at the OASIS website: + [http://www.oasis-open.org/policies-guidelines/ipr] . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it or + assist in its implementation may be prepared, copied, published, and + distributed, in whole or in part, without restriction of any kind, + provided that the above copyright notice and this section are included + on all such copies and derivative works. However, this document itself + may not be modified in any way, including by removing the copyright + notice or references to OASIS, except as needed for the purpose of + developing any document or deliverable produced by an OASIS Technical + Committee (in which case the rules applicable to copyrights, as set + forth in the OASIS IPR Policy, must be followed) or as required to + translate it into languages other than English. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X - CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + The limited permissions granted above are perpetual and will not be + revoked by OASIS or its successors or assigns. . - Except as contained in this notice, the name of the X Consortium shall not be - used in advertising or otherwise to promote the sale, use or other dealings in - this Software without prior written authorization from the X Consortium. + This document and the information contained herein is provided on an + "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE + INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP RIGHTS OR ANY IMPLIED + WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. OASIS + AND ITS MEMBERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THIS DOCUMENT OR ANY + PART THEREOF. . - X Window System is a trademark of X Consortium, Inc. + [OASIS requests that any OASIS Party or any other party that + believes it has patent claims that would necessarily be infringed by + implementations of this OASIS Standards Final Deliverable, to notify + OASIS TC Administrator and provide an indication of its willingness to + grant patent licenses to such patent claims in a manner consistent with + the IPR Mode of the OASIS Technical Committee that produced this + deliverable.] . - 3.1.2. The Open Group + [OASIS invites any party to contact the OASIS TC Administrator if it + is aware of a claim of ownership of any patent claims that would + necessarily be infringed by implementations of this OASIS Standards + Final Deliverable by a patent holder that is not willing to provide a + license to such patent claims in a manner consistent with the IPR Mode + of the OASIS Technical Committee that produced this OASIS Standards + Final Deliverable. OASIS may include such claims on its website, but + disclaims any obligation to do so.] . - Copyright The Open Group + [OASIS takes no position regarding the validity or scope of any + intellectual property or other rights that might be claimed to pertain + to the implementation or use of the technology described in this OASIS + Standards Final Deliverable or the extent to which any license under + such rights might or might not be available; neither does it represent + that it has made any effort to identify any such rights. Information on + OASIS' procedures with respect to rights in any document or deliverable + produced by an OASIS Technical Committee can be found on the OASIS + website. Copies of claims of rights made available for publication and + any assurances of licenses to be made available, or the result of an + attempt made to obtain a general license or permission for the use of + such proprietary rights by implementers or users of this OASIS Standards + Final Deliverable, can be obtained from the OASIS TC Administrator. + OASIS makes no representation that any information or list of + intellectual property rights will at any time be complete, or that any + claims in such list are, in fact, Essential Claims.] . - Permission to use, copy, modify, distribute, and sell this software and its - documentation for any purpose is hereby granted without fee, provided that the - above copyright notice appear in all copies and that both that copyright - notice and this permission notice appear in supporting documentation. . - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. . - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + --- end of LICENSE --- + . + ------------------------------------------------------------------------------ + %% This notice is provided with respect to IAIK (Institute for Applied Information Processing and Communication) PKCS#11 wrapper files v1, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - Except as contained in this notice, the name of The Open Group shall not be - used in advertising or otherwise to promote the sale, use or other dealings in - this Software without prior written authorization from The Open Group. 3.2. - Berkeley-based copyrights: + --- begin of LICENSE --- + . + IAIK License . - o - 3.2.1. General + . + Copyright (c) 2002 Graz University of Technology. All rights reserved. . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: . - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. . - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. + 3. The end-user documentation included with the redistribution, if any, must + include the following acknowledgment: . - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + "This product includes software developed by IAIK of Graz University of + Technology." + . + Alternately, this acknowledgment may appear in the software itself, if and + wherever such third-party acknowledgments normally appear. + . + 4. The names "Graz University of Technology" and "IAIK of Graz University of + Technology" must not be used to endorse or promote products derived from this + software without prior written permission. + . + 5. Products derived from this software may not be called "IAIK PKCS Wrapper", + nor may "IAIK" appear in their name, without prior written permission of + Graz University of Technology. + . + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. 3.2.2. UCB/LBL + POSSIBILITY OF SUCH DAMAGE. . - Copyright (c) 1993 The Regents of the University of California. All rights - reserved. . - This software was developed by the Computer Systems Engineering group at - Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and contributed to - Berkeley. - . - All advertising materials mentioning features or use of this software must - display the following acknowledgement: This product includes software - developed by the University of California, Lawrence Berkeley Laboratory. . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + --- end of LICENSE --- . - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + ------------------------------------------------------------------------------ + %% This notice is provided with respect to Dynalink v.5, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - 2. Redistributions in binary form must reproduce the above copyright + --- begin of LICENSE --- + . + Dynalink License + . + . + Copyright (c) 2009-2013, Attila Szegedi + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. . - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: This product includes software - developed by the University of California, Berkeley and its contributors. - . - 4. Neither the name of the University nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. . - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3.2.3. The - NetBSD Foundation, Inc. . - Copyright (c) 2003 The NetBSD Foundation, Inc. All rights reserved. . - This code is derived from software contributed to The NetBSD Foundation by Ben - Collver + --- end of LICENSE --- . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + ------------------------------------------------------------------------------ + %% This notice is provided with respect to JLine v3.22.0, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + --- begin of LICENSE --- . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + JLine License . - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: This product includes software - developed by the NetBSD Foundation, Inc. and its contributors. - . - 4. Neither the name of The NetBSD Foundation nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS ``AS - IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3.2.4. Theodore - Ts'o. . - Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All rights - reserved. + Copyright (c) 2002-2018, the original author or authors. + All rights reserved. . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + https://opensource.org/licenses/BSD-3-Clause . - 1. Redistributions of source code must retain the above copyright notice, - and the entire permission notice in its entirety, including the disclaimer - of warranties. + Redistribution and use in source and binary forms, with or + without modification, are permitted provided that the following + conditions are met: . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. . - 3. he name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. + Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with + the distribution. . - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE, ALL OF WHICH ARE HEREBY DISCLAIMED. IN NO - EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. 3.2.5. Theo de Raadt and Damien Miller + Neither the name of JLine nor the names of its contributors + may be used to endorse or promote products derived from this + software without specific prior written permission. . - Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. Copyright (c) - 2001-2002 Damien Miller. All rights reserved. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: . - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + --- end of LICENSE --- . - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. 3.2.6. Todd C. Miller + ------------------------------------------------------------------------------ + %% This notice is provided with respect to jopt-simple v5.0.4, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - Copyright (c) 1998 Todd C. Miller + --- begin of LICENSE --- . - Permission to use, copy, modify, and distribute this software for any purpose - with or without fee is hereby granted, provided that the above copyright - notice and this permission notice appear in all copies. + MIT License . - THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 3.2.7. Thomas - Winischhofer . - Copyright (C) 2001-2004 Thomas Winischhofer + Copyright (c) 2004-2015 Paul R. Holser, Jr. . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: . - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. . - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. . - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. . - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESSED OR IMPLIED - WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. 3.3. NVIDIA Corp . - Copyright (c) 1996 NVIDIA, Corp. All rights reserved. + --- end of LICENSE --- . - NOTICE TO USER: The source code is copyrighted under U.S. and international - laws. NVIDIA, Corp. of Sunnyvale, California owns the copyright and as design - patents pending on the design and interface of the NV chips. Users and - possessors of this source code are hereby granted a nonexclusive, royalty-free - copyright and design patent license to use this code in individual and - commercial software. - . - Any use of this source code must include, in the user documentation and - internal comments to the code, notices to the end user as follows: - . - Copyright (c) 1996 NVIDIA, Corp. NVIDIA design patents pending in the U.S. and - foreign countries. - . - NVIDIA, CORP. MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE - CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED - WARRANTY OF ANY KIND. NVIDIA, CORP. DISCLAIMS ALL WARRANTIES WITH REGARD TO - THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA, CORP. BE LIABLE - FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY - DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE CODE. 3.4. GLX Public - License - . - GLX PUBLIC LICENSE (Version 1.0 (2/11/99)) ("License") - . - Subject to any third party claims, Silicon Graphics, Inc. ("SGI") hereby - grants permission to Recipient (defined below), under Recipient's copyrights - in the Original Software (defined below), to use, copy, modify, merge, - publish, distribute, sublicense and/or sell copies of Subject Software - (defined below), and to permit persons to whom the Subject Software is - furnished in accordance with this License to do the same, subject to all of - the following terms and conditions, which Recipient accepts by engaging in any - such use, copying, modifying, merging, publishing, distributing, sublicensing - or selling: - . - 1. Definitions. - . - (a) "Original Software" means source code of computer software code which - is described in Exhibit A as Original Software. - . - (b) "Modifications" means any addition to or deletion from the substance - or structure of either the Original Software or any previous - Modifications. When Subject Software is released as a series of files, a - Modification means (i) any addition to or deletion from the contents of a - file containing Original Software or previous Modifications and (ii) any - new file that contains any part of the Original Code or previous - Modifications. - . - (c) "Subject Software" means the Original Software or Modifications or the - combination of the Original Software and Modifications, or portions of any - of the foregoing. - . - (d) "Recipient" means an individual or a legal entity exercising rights - under, and complying with all of the terms of, this License. For legal - entities, "Recipient" includes any entity which controls, is controlled - by, or is under common control with Recipient. For purposes of this - definition, "control" of an entity means (a) the power, direct or - indirect, to direct or manage such entity, or (b) ownership of fifty - percent (50%) or more of the outstanding shares or beneficial ownership of - such entity. - . - 2. Redistribution of Source Code Subject to These Terms. Redistributions of - Subject Software in source code form must retain the notice set forth in - Exhibit A, below, in every file. A copy of this License must be included in - any documentation for such Subject Software where the recipients' rights - relating to Subject Software are described. Recipient may distribute the - source code version of Subject Software under a license of Recipient's choice, - which may contain terms different from this License, provided that (i) - Recipient is in compliance with the terms of this License, and (ii) the - license terms include this Section 2 and Sections 3, 4, 7, 8, 10, 12 and 13 of - this License, which terms may not be modified or superseded by any other terms - of such license. If Recipient distributes the source code version under a - different license Recipient must make it absolutely clear that any terms which - differ from this License are offered by Recipient alone, not by SGI. Recipient - hereby agrees to indemnify SGI for any liability incurred by SGI as a result - of any such terms Recipient offers. - . - 3. Redistribution in Executable Form. The notice set forth in Exhibit A must - be conspicuously included in any notice in an executable version of Subject - Software, related documentation or collateral in which Recipient describes the - user's rights relating to the Subject Software. Recipient may distribute the - executable version of Subject Software under a license of Recipient's choice, - which may contain terms different from this License, provided that (i) - Recipient is in compliance with the terms of this License, and (ii) the - license terms include this Section 3 and Sections 4, 7, 8, 10, 12 and 13 of - this License, which terms may not be modified or superseded by any other terms - of such license. If Recipient distributes the executable version under a - different license Recipient must make it absolutely clear that any terms which - differ from this License are offered by Recipient alone, not by SGI. Recipient - hereby agrees to indemnify SGI for any liability incurred by SGI as a result - of any such terms Recipient offers. - . - 4. Termination. This License and the rights granted hereunder will terminate - automatically if Recipient fails to comply with terms herein and fails to cure - such breach within 30 days of the breach. Any sublicense to the Subject - Software which is properly granted shall survive any termination of this - License absent termination by the terms of such sublicense. Provisions which, - by their nature, must remain in effect beyond the termination of this License - shall survive. - . - 5. No Trademark Rights. This License does not grant any rights to use any - trade name, trademark or service mark whatsoever. No trade name, trademark or - service mark of SGI may be used to endorse or promote products derived from - the Subject Software without prior written permission of SGI. - . - 6. No Other Rights. This License does not grant any rights with respect to the - OpenGL API or to any software or hardware implementation thereof or to any - other software whatsoever, nor shall any other rights or licenses not - expressly granted hereunder arise by implication, estoppel or otherwise with - respect to the Subject Software. Title to and ownership of the Original - Software at all times remains with SGI. All rights in the Original Software - not expressly granted under this License are reserved. - . - 7. Compliance with Laws; Non-Infringement. Recipient shall comply with all - applicable laws and regulations in connection with use and distribution of the - Subject Software, including but not limited to, all export and import control - laws and regulations of the U.S. government and other countries. Recipient may - not distribute Subject Software that (i) in any way infringes (directly or - contributorily) the rights (including patent, copyright, trade secret, - trademark or other intellectual property rights of any kind) of any other - person or entity or (ii) breaches any representation or warranty, express, - implied or statutory, which under any applicable law it might be deemed to - have been distributed. - . - 8. Claims of Infringement. If Recipient at any time has knowledge of any one - or more third party claims that reproduction, modification, use, distribution, - import or sale of Subject Software (including particular functionality or code - incorporated in Subject Software) infringes the third party's intellectual - property rights, Recipient must place in a well-identified web page bearing - the title "LEGAL" a description of each such claim and a description of the - party making each such claim in sufficient detail that a user of the Subject - Software will know whom to contact regarding the claim. Also, upon gaining - such knowledge of any such claim, Recipient must conspicuously include the URL - for such web page in the Exhibit A notice required under Sections 2 and 3, - above, and in the text of any related documentation, license agreement or - collateral in which Recipient describes end user's rights relating to the - Subject Software. If Recipient obtains such knowledge after it makes Subject - Software available to any other person or entity, Recipient shall take other - steps (such as notifying appropriate mailing lists or newsgroups) reasonably - calculated to inform those who received the Subject Software that new - knowledge has been obtained. - . - 9. DISCLAIMER OF WARRANTY. SUBJECT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT - LIMITATION, WARRANTIES THAT THE SUBJECT SOFTWARE IS FREE OF DEFECTS, - MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON- INFRINGING. SGI ASSUMES NO - RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. SHOULD ANY SOFTWARE - PROVE DEFECTIVE IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR ANY - SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN - ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY SUBJECT SOFTWARE IS AUTHORIZED - HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - . - 10. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, - WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT LIABILITY), - CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR BE LIABLE FOR ANY - DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK - STOPPAGE, LOSS OF DATA, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF - THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY - TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SGI's NEGLIGENCE TO - THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT - ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO RECIPIENT. - . - 11. Indemnity. Recipient shall be solely responsible for damages arising, - directly or indirectly, out of its utilization of rights under this License. - Recipient will defend, indemnify and hold harmless Silicon Graphics, Inc. from - and against any loss, liability, damages, costs or expenses (including the - payment of reasonable attorneys fees) arising out of Recipient's use, - modification, reproduction and distribution of the Subject Software or out of - any representation or warranty made by Recipient. - . - 12. U.S. Government End Users. The Subject Software is a "commercial item" - consisting of "commercial computer software" as such terms are defined in - title 48 of the Code of Federal Regulations and all U.S. Government End Users - acquire only the rights set forth in this License and are subject to the terms - of this License. + ------------------------------------------------------------------------------ + %% This notice is provided with respect to jQuery v3.6.1, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . - 13. Miscellaneous. This License represents the complete agreement concerning - subject matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed so as to achieve as nearly as - possible the same economic effect as the original provision and the remainder - of this License will remain in effect. This License shall be governed by and - construed in accordance with the laws of the United States and the State of - California as applied to agreements entered into and to be performed entirely - within California between California residents. Any litigation relating to - this License shall be subject to the exclusive jurisdiction of the Federal - Courts of the Northern District of California (or, absent subject matter - jurisdiction in such courts, the courts of the State of California), with - venue lying exclusively in Santa Clara County, California, with the losing - party responsible for costs, including without limitation, court costs and - reasonable attorneys fees and expenses. The application of the United Nations - Convention on Contracts for the International Sale of Goods is expressly - excluded. Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this License. - . - Exhibit A - . - The contents of this file are subject to Sections 2, 3, 4, 7, 8, 10, 12 and 13 - of the GLX Public License Version 1.0 (the "License"). You may not use this - file except in compliance with those sections of the License. You may obtain a - copy of the License at Silicon Graphics, Inc., attn: Legal Services, 2011 N. - Shoreline Blvd., Mountain View, CA 94043 or at - http://www.sgi.com/software/opensource/glx/license.html. - . - Software distributed under the License is distributed on an "AS IS" basis. ALL - WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF NON- - INFRINGEMENT. See the License for the specific language governing rights and - limitations under the License. - . - The Original Software is GLX version 1.2 source code, released February, 1999. - The developer of the Original Software is Silicon Graphics, Inc. Those - portions of the Subject Software created by Silicon Graphics, Inc. are - Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved. 3.5. CID - Font Code Public License - . - CID FONT CODE PUBLIC LICENSE (Version 1.0 (3/31/99))("License") - . - Subject to any applicable third party claims, Silicon Graphics, Inc. ("SGI") - hereby grants permission to Recipient (defined below), under SGI's copyrights - in the Original Software (defined below), to use, copy, modify, merge, - publish, distribute, sublicense and/or sell copies of Subject Software - (defined below) in both source code and executable form, and to permit persons - to whom the Subject Software is furnished in accordance with this License to - do the same, subject to all of the following terms and conditions, which - Recipient accepts by engaging in any such use, copying, modifying, merging, - publication, distributing, sublicensing or selling: - . - 1. Definitions. - . - a. "Original Software" means source code of computer software code that is - described in Exhibit A as Original Software. - . - b. "Modifications" means any addition to or deletion from the substance or - structure of either the Original Software or any previous Modifications. - When Subject Software is released as a series of files, a Modification - means (i) any addition to or deletion from the contents of a file - containing Original Software or previous Modifications and (ii) any new - file that contains any part of the Original Code or previous - Modifications. - . - c. "Subject Software" means the Original Software or Modifications or the - combination of the Original Software and Modifications, or portions of any - of the foregoing. - . - d. "Recipient" means an individual or a legal entity exercising rights - under the terms of this License. For legal entities, "Recipient" includes - any entity that controls, is controlled by, or is under common control - with Recipient. For purposes of this definition, "control" of an entity - means (i) the power, direct or indirect, to direct or manage such entity, - or (ii) ownership of fifty percent (50%) or more of the outstanding shares - or beneficial ownership of such entity. - . - e. "Required Notice" means the notice set forth in Exhibit A to this - License. - . - f. "Accompanying Technology" means any software or other technology that - is not a Modification and that is distributed or made publicly available - by Recipient with the Subject Software. Separate software files that do - not contain any Original Software or any previous Modification shall not - be deemed a Modification, even if such software files are aggregated as - part of a product, or in any medium of storage, with any file that does - contain Original Software or any previous Modification. - . - 2. License Terms. All distribution of the Subject Software must be made - subject to the terms of this License. A copy of this License and the Required - Notice must be included in any documentation for Subject Software where - Recipient's rights relating to Subject Software and/or any Accompanying - Technology are described. Distributions of Subject Software in source code - form must also include the Required Notice in every file distributed. In - addition, a ReadMe file entitled "Important Legal Notice" must be distributed - with each distribution of one or more files that incorporate Subject Software. - That file must be included with distributions made in both source code and - executable form. A copy of the License and the Required Notice must be - included in that file. Recipient may distribute Accompanying Technology under - a license of Recipient's choice, which may contain terms different from this - License, provided that (i) Recipient is in compliance with the terms of this - License, (ii) such other license terms do not modify or supersede the terms of - this License as applicable to the Subject Software, (iii) Recipient hereby - indemnifies SGI for any liability incurred by SGI as a result of the - distribution of Accompanying Technology or the use of other license terms. - . - 3. Termination. This License and the rights granted hereunder will terminate - automatically if Recipient fails to comply with terms herein and fails to cure - such breach within 30 days of the breach. Any sublicense to the Subject - Software that is properly granted shall survive any termination of this - License absent termination by the terms of such sublicense. Provisions which, - by their nature, must remain in effect beyond the termination of this License - shall survive. - . - 4. Trademark Rights. This License does not grant any rights to use any trade - name, trademark or service mark whatsoever. No trade name, trademark or - service mark of SGI may be used to endorse or promote products derived from or - incorporating any Subject Software without prior written permission of SGI. - . - 5. No Other Rights. No rights or licenses not expressly granted hereunder - shall arise by implication, estoppel or otherwise. Title to and ownership of - the Original Software at all times remains with SGI. All rights in the - Original Software not expressly granted under this License are reserved. - . - 6. Compliance with Laws; Non-Infringement. Recipient shall comply with all - applicable laws and regulations in connection with use and distribution of the - Subject Software, including but not limited to, all export and import control - laws and regulations of the U.S. government and other countries. Recipient may - not distribute Subject Software that (i) in any way infringes (directly or - contributorily) the rights (including patent, copyright, trade secret, - trademark or other intellectual property rights of any kind) of any other - person or entity, or (ii) breaches any representation or warranty, express, - implied or statutory, which under any applicable law it might be deemed to - have been distributed. - . - 7. Claims of Infringement. If Recipient at any time has knowledge of any one - or more third party claims that reproduction, modification, use, distribution, - import or sale of Subject Software (including particular functionality or code - incorporated in Subject Software) infringes the third party's intellectual - property rights, Recipient must place in a well-identified web page bearing - the title "LEGAL" a description of each such claim and a description of the - party making each such claim in sufficient detail that a user of the Subject - Software will know whom to contact regarding the claim. Also, upon gaining - such knowledge of any such claim, Recipient must conspicuously include the URL - for such web page in the Required Notice, and in the text of any related - documentation, license agreement or collateral in which Recipient describes - end user's rights relating to the Subject Software. If Recipient obtains such - knowledge after it makes Subject Software available to any other person or - entity, Recipient shall take other steps (such as notifying appropriate - mailing lists or newsgroups) reasonably calculated to provide such knowledge - to those who received the Subject Software. - . - 8. DISCLAIMER OF WARRANTY. SUBJECT SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT - LIMITATION, WARRANTIES THAT THE SUBJECT SOFTWARE IS FREE OF DEFECTS, - MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. SGI ASSUMES NO - RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE. SHOULD ANY SOFTWARE - PROVE DEFECTIVE IN ANY RESPECT, SGI ASSUMES NO COST OR LIABILITY FOR ANY - SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN - ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY SUBJECT SOFTWARE IS AUTHORIZED - HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - . - 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, - WHETHER TORT (INCLUDING, WITHOUT LIMITATION, NEGLIGENCE OR STRICT LIABILITY), - CONTRACT, OR OTHERWISE, SHALL SGI OR ANY SGI LICENSOR BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SUBJECT SOFTWARE OR - THE USE OR OTHER DEALINGS IN THE SUBJECT SOFTWARE. SOME JURISDICTIONS DO NOT - ALLOW THE EXCLUSION OR LIMITATION OF CERTAIN DAMAGES, SO THIS EXCLUSION AND - LIMITATION MAY NOT APPLY TO RECIPIENT TO THE EXTENT SO DISALLOWED. - . - 10. Indemnity. Recipient shall be solely responsible for damages arising, - directly or indirectly, out of its utilization of rights under this License. - Recipient will defend, indemnify and hold SGI and its successors and assigns - harmless from and against any loss, liability, damages, costs or expenses - (including the payment of reasonable attorneys fees) arising out of - (Recipient's use, modification, reproduction and distribution of the Subject - Software or out of any representation or warranty made by Recipient. - . - 11. U.S. Government End Users. The Subject Software is a "commercial item" - consisting of "commercial computer software" as such terms are defined in - title 48 of the Code of Federal Regulations and all U.S. Government End Users - acquire only the rights set forth in this License and are subject to the terms - of this License. + --- begin of LICENSE --- . - 12. Miscellaneous. This License represents the complete agreement concerning - subject matter hereof. If any provision of this License is held to be - unenforceable by any judicial or administrative authority having proper - jurisdiction with respect thereto, such provision shall be reformed so as to - achieve as nearly as possible the same economic effect as the original - provision and the remainder of this License will remain in effect. This - License shall be governed by and construed in accordance with the laws of the - United States and the State of California as applied to agreements entered - into and to be performed entirely within California between California - residents. Any litigation relating to this License shall be subject to the - exclusive jurisdiction of the Federal Courts of the Northern District of - California (or, absent subject matter jurisdiction in such courts, the courts - of the State of California), with venue lying exclusively in Santa Clara - County, California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys fees and expenses. - The application of the United Nations Convention on Contracts for the - International Sale of Goods is expressly excluded. Any law or regulation that - provides that the language of a contract shall be construed against the - drafter shall not apply to this License. - . - Exhibit A - . - Copyright (c) 1994-1999 Silicon Graphics, Inc. - . - The contents of this file are subject to the CID Font Code Public License - Version 1.0 (the "License"). You may not use this file except in compliance - with the License. You may obtain a copy of the License at Silicon Graphics, - Inc., attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043 - or at http://www.sgi.com/software/opensource/cid/license.html - . - Software distributed under the License is distributed on an "AS IS" basis. ALL - WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED - WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE OR OF - NON-INFRINGEMENT. See the License for the specific language governing rights - and limitations under the License. - . - The Original Software (as defined in the License) is CID font code that was - developed by Silicon Graphics, Inc. Those portions of the Subject Software (as - defined in the License) that were created by Silicon Graphics, Inc. are - Copyright (c) 1994-1999 Silicon Graphics, Inc. All Rights Reserved. - . - [NOTE: When using this text in connection with Subject Software delivered - solely in object code form, Recipient may replace the words "this file" with - "this software" in both the first and second sentences.] 3.6. Bitstream Vera - Fonts Copyright - . - The fonts have a generous copyright, allowing derivative works (as long as - "Bitstream" or "Vera" are not in the names), and full redistribution (so long - as they are not *sold* by themselves). They can be be bundled, redistributed - and sold with any software. + jQuery License . - The fonts are distributed under the following copyright: + jQuery v 3.6.1 + Copyright OpenJS Foundation and other contributors, https://openjsf.org/ . - Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a - trademark of Bitstream, Inc. + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: . - Permission is hereby granted, free of charge, to any person obtaining a copy - of the fonts accompanying this license ("Fonts") and associated documentation - files (the "Font Software"), to reproduce and distribute the Font Software, - including without limitation the rights to use, copy, merge, publish, - distribute, and/or sell copies of the Font Software, and to permit persons to - whom the Font Software is furnished to do so, subject to the following - conditions: - . - The above copyright and trademark notices and this permission notice shall be - included in all copies of one or more of the Font Software typefaces. - . - The Font Software may be modified, altered, or added to, and in particular the - designs of glyphs or characters in the Fonts may be modified and additional - glyphs or characters may be added to the Fonts, only if the fonts are renamed - to names not containing either the words "Bitstream" or the word "Vera". - . - This License becomes null and void to the extent applicable to Fonts or Font - Software that has been modified and is distributed under the "Bitstream Vera" - names. - . - The Font Software may be sold as part of a larger software package but no copy - of one or more of the Font Software typefaces may be sold by itself. - . - THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, - TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME FOUNDATION - BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, - SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO - USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. - . - Except as contained in this notice, the names of Gnome, the Gnome Foundation, - and Bitstream Inc., shall not be used in advertising or otherwise to promote - the sale, use or other dealings in this Font Software without prior written - authorization from the Gnome Foundation or Bitstream Inc., respectively. For - further information, contact: fonts at gnome dot org. 3.7. Bigelow & Holmes - Inc and URW++ GmbH Luxi font license - . - Luxi fonts copyright (c) 2001 by Bigelow & Holmes Inc. Luxi font instruction - code copyright (c) 2001 by URW++ GmbH. All Rights Reserved. Luxi is a - registered trademark of Bigelow & Holmes Inc. + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. . - Permission is hereby granted, free of charge, to any person obtaining a copy - of these Fonts and associated documentation files (the "Font Software"), to - deal in the Font Software, including without limitation the rights to use, - copy, merge, publish, distribute, sublicense, and/or sell copies of the Font - Software, and to permit persons to whom the Font Software is furnished to do - so, subject to the following conditions: - . - The above copyright and trademark notices and this permission notice shall be - included in all copies of one or more of the Font Software. - . - The Font Software may not be modified, altered, or added to, and in particular - the designs of glyphs or characters in the Fonts may not be modified nor may - additional glyphs or characters be added to the Fonts. This License becomes - null and void when the Fonts or Font Software have been modified. - . - THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, - TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BIGELOW & HOLMES INC. OR URW++ - GMBH. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY - GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN - AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR - INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT - SOFTWARE. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + ****************************************** + . + The jQuery JavaScript Library v3.6.1 also includes Sizzle.js + . + Sizzle.js includes the following license: . - Except as contained in this notice, the names of Bigelow & Holmes Inc. and - URW++ GmbH. shall not be used in advertising or otherwise to promote the sale, - use or other dealings in this Font Software without prior written - authorization from Bigelow & Holmes Inc. and URW++ GmbH. + Copyright JS Foundation and other contributors, https://js.foundation/ . - For further information, contact: + This software consists of voluntary contributions made by many + individuals. For exact contribution history, see the revision history + available at https://github.com/jquery/sizzle + . + The following license applies to all parts of this software except as + documented below: + . + ==== + . + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + ==== + . + All files located in the node_modules and external directories are + externally maintained libraries used by this software which have their + own licenses; we recommend you read them, as their terms may differ from + the terms above. + . + ********************* . - info@urwpp.de or design@bigelowandholmes.com . . --- end of LICENSE --- . ------------------------------------------------------------------------------ - . - %% This notice is provided with respect to zlib v1.2.5, which may be included - with JRE 8, JDK 8, and OpenJDK 8. + %% This notice is provided with respect to jQuery UI v1.13.2, + which may be included with JRE 17, JDK 17 and OpenJDK 17 . --- begin of LICENSE --- . - version 1.2.5, July 18th, 2005 + jQuery UI License . - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + Copyright jQuery Foundation and other contributors, https://jquery.org/ . - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. + This software consists of voluntary contributions made by many + individuals. For exact contribution history, see the revision history + available at https://github.com/jquery/jquery-ui . - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: + The following license applies to all parts of this software except as + documented below: + . + ==== + . + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + ==== + . + Copyright and related rights for sample code are waived via CC0. Sample + code is defined as all source code contained within the demos directory. + . + CC0: http://creativecommons.org/publicdomain/zero/1.0/ + . + ==== + . + All files located in the node_modules and external directories are + externally maintained libraries used by this software which have their + own licenses; we recommend you read them, as their terms may differ from + the terms above. . - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. . - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu . --- end of LICENSE --- . ------------------------------------------------------------------------------ + %% This notice is provided with respect to Unicode Common Local Data Repository (CLDR) v39, + which may be included with JRE 17, JDK 17 and OpenJDK 17 + . + --- begin of LICENSE --- + . + CLDR License . - %% This notice is provided with respect to the following which may be - included with JRE 8, JDK 8, and OpenJDK 8, except where noted: . - Apache Commons Math 2.2 - Apache Derby 10.10.1.2 [included with JDK 8] - Apache Jakarta BCEL 5.2 - Apache Jakarta Regexp 1.4 - Apache Santuario XML Security for Java 1.5.4 - Apache Xalan-Java 2.7.1 - Apache Xerces Java 2.10.0 - Apache XML Resolver 1.1 - Dynalink 0.5 . - These components are licensed under the Apache License, Version 2.0. - See /usr/share/common-licenses/Apache-2.0 + UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + . + See Terms of Use for definitions of Unicode Inc.'s + Data Files and Software. + . + NOTICE TO USER: Carefully read the following legal agreement. + BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S + DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), + YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE + TERMS AND CONDITIONS OF THIS AGREEMENT. + IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE + THE DATA FILES OR SOFTWARE. + . + COPYRIGHT AND PERMISSION NOTICE + . + Copyright © 1991-2021 Unicode, Inc. All rights reserved. + Distributed under the Terms of Use in https://www.unicode.org/copyright.html. + . + Permission is hereby granted, free of charge, to any person obtaining + a copy of the Unicode data files and any associated documentation + (the "Data Files") or Unicode software and any associated documentation + (the "Software") to deal in the Data Files or Software + without restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, and/or sell copies of + the Data Files or Software, and to permit persons to whom the Data Files + or Software are furnished to do so, provided that either + (a) this copyright and permission notice appear with all copies + of the Data Files or Software, or + (b) this copyright and permission notice appear in associated + Documentation. + . + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF + ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT OF THIRD PARTY RIGHTS. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS + NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THE DATA FILES OR SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder + shall not be used in advertising or otherwise to promote the sale, + use or other dealings in these Data Files or Software without prior + written authorization of the copyright holder. + . + . + ------------------------------------------------------------ Terms of Use --------------------------------------------------------------- + . + Unicode® Copyright and Terms of Use + For the general privacy policy governing access to this site, see the Unicode Privacy Policy. + . + Unicode Copyright + Copyright © 1991-2021 Unicode, Inc. All rights reserved. + Definitions + Unicode Data Files ("DATA FILES") include all data files under the directories: + https://www.unicode.org/Public/ + https://www.unicode.org/reports/ + https://www.unicode.org/ivd/data/ + . + Unicode Data Files do not include PDF online code charts under the directory: + https://www.unicode.org/Public/ + . + Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard + or any source code or compiled code under the directories: + https://www.unicode.org/Public/PROGRAMS/ + https://www.unicode.org/Public/cldr/ + http://site.icu-project.org/download/ + Terms of Use + Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, without fee, to modify such documents and files to create derivative works conforming to the Unicode® Standard, subject to Terms and Conditions herein. + Any person is hereby authorized, without fee, to view, use, reproduce, and distribute all documents and files, subject to the Terms and Conditions herein. + Further specifications of rights and restrictions pertaining to the use of the Unicode DATA FILES and SOFTWARE can be found in the Unicode Data Files and Software License. + Each version of the Unicode Standard has further specifications of rights and restrictions of use. For the book editions (Unicode 5.0 and earlier), these are found on the back of the title page. + The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the first page of each PDF code chart. + All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use. + No license is granted to "mirror" the Unicode website where a fee is charged for access to the "mirror" site. + Modification is not permitted with respect to this document. All copies of this document must be verbatim. + Restricted Rights Legend + Any technical data or software which is licensed to the United States of America, its agencies and/or instrumentalities under this Agreement is commercial technical data or commercial computer software developed exclusively at private expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, duplication, or disclosure by the Government is subject to restrictions as set forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, as applicable, use, duplication or disclosure by the Government is subject to the restrictions set forth in this Agreement. + Warranties and Disclaimers + This publication and/or website may include technical or typographical errors or other inaccuracies. Changes are periodically added to the information herein; these changes will be incorporated in new editions of the publication and/or website. Unicode, Inc. may make improvements and/or changes in the product(s) and/or program(s) described in this publication and/or website at any time. + If this file has been purchased on magnetic or optical media from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange of the defective media within ninety (90) days of original purchase. + EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE. + Waiver of Damages + In no event shall Unicode, Inc. or its licensors be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever, whether or not Unicode, Inc. was advised of the possibility of the damage, including, without limitation, those resulting from the following: loss of use, data or profits, in connection with the use, modification or distribution of this information or its derivatives. + Trademarks & Logos + The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names. + The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. + All third party trademarks referenced herein are the property of their respective owners. + Miscellaneous + Jurisdiction and Venue. This website is operated from a location in the State of California, United States of America. Unicode, Inc. makes no representation that the materials are appropriate for use in other locations. If you access this website from other locations, you are responsible for compliance with local laws. This Agreement, all use of this website and any claims and damages resulting from use of this website are governed solely by the laws of the State of California without regard to any principles which would apply the laws of a different jurisdiction. The user agrees that any disputes regarding this website shall be resolved solely in the courts located in Santa Clara County, California. The user agrees said courts have personal jurisdiction and agree to waive any right to transfer the dispute to any other forum. + Modification by Unicode, Inc. Unicode, Inc. shall have the right to modify this Agreement at any time by posting it to this website. The user may not assign any part of this Agreement without Unicode, Inc.’s prior written consent. + Taxes. The user agrees to pay any taxes arising from access to this website or use of the information herein, except for those based on Unicode’s net income. + Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain in effect. + Entire Agreement. This Agreement constitutes the entire agreement between the parties. + . + . + . + . + --- end of LICENSE --- . ------------------------------------------------------------------------------ + %% This notice is provided with respect to Thai Dictionary, + which may be included with JRE 17, JDK 17 and OpenJDK 17 + . + --- begin of LICENSE --- . + Thai Dictionary License . - ============================================================================== + . + Copyright (C) 1982 The Royal Institute, Thai Royal Government. + . + Copyright (C) 1998 National Electronics and Computer Technology Center, + National Science and Technology Development Agency, + Ministry of Science Technology and Environment, + Thai Royal Government. + . + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + . + . + . + --- end of LICENSE --- + . + ------------------------------------------------------------------------------ Files: googletest/* Copyright: Copyright 2008, Google Inc. License: BSD-C3 - Copyright 2008, Google Inc. - All rights reserved. - . - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - . + Copyright 2008, Google Inc. + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following disclaimer - in the documentation and/or other materials provided with the - distribution. + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - . - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Files: debian/* Copyright: Copyright © 2007-2023 Canonical Ltd. @@ -3458,3 +2854,4 @@ . On Debian systems a full copy of the GNU General Public License, GPL, can be found in the file /usr/share/common-licenses/GPL-2. + diff -Nru openjdk-17-17.0.9+9/debian/copyright-generator/bundled-stanzas openjdk-17-17.0.10+7/debian/copyright-generator/bundled-stanzas --- openjdk-17-17.0.9+9/debian/copyright-generator/bundled-stanzas 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/copyright-generator/bundled-stanzas 2023-11-02 10:22:48.000000000 +0000 @@ -0,0 +1,31 @@ +Files: googletest/* +Copyright: Copyright 2008, Google Inc. +License: BSD-C3 + Copyright 2008, Google Inc. + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff -Nru openjdk-17-17.0.9+9/debian/copyright-generator/copyright-gen.py openjdk-17-17.0.10+7/debian/copyright-generator/copyright-gen.py --- openjdk-17-17.0.9+9/debian/copyright-generator/copyright-gen.py 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/copyright-generator/copyright-gen.py 2024-01-17 10:59:10.000000000 +0000 @@ -0,0 +1,291 @@ +#!/usr/bin/python3 + +# This script needs to be run from the `debian/copyright-generator` directory. + +# This is an initial version of a script that generates the copyrights file +# for the openjdk-XX packages. A lot of information is still hard-coded, +# which means the script needs to be improved. +# +# For instance, it must be possible to parse all the copyright headers from +# all the source files and deduce a list of "Upstream Authors". It must +# also be possible to deduce the smallest yet complete list of copyrights. +# For now, we have these hard-coded in the "copyright-gen/upstream-authors" +# and "copyright-gen/copyrights" file. +# +# Licenses from the legal directories of different modules are gathered and +# dumped under the License field of the first File stanza. +# The debian build does not build native libraries like zlib, pcsclite, giflib +# libpng and libjpeg. These are excluded. There's scope for improvement here too. +# The script must be able to look into "debian/rules" and deduce these exclusions. + +import os +import sys +import textwrap + +version = ""; +needs_cleanup = False +packaged_by = "Matthias Klose "; +common_licenses = {}; + +## TODO: Can the script deduce this list? +excluded_files = [ + ".github/*", + ".gitattributes", + "src/java.base/share/native/libzip/zlib/*", + "src/java.desktop/share/native/libsplashscreen/giflib/*", + "src/java.desktop/share/native/libsplashscreen/libpng/*", + "src/java.smartcardio/unix/native/libj2pcsc/MUSCLE/*", + "src/java.desktop/share/native/libjavajpeg/jc*", + "src/java.desktop/share/native/libjavajpeg/jd*", + "src/java.desktop/share/native/libjavajpeg/je*", + "src/java.desktop/share/native/libjavajpeg/jf*", + "src/java.desktop/share/native/libjavajpeg/ji*.c", + "src/java.desktop/share/native/libjavajpeg/jm*", + "src/java.desktop/share/native/libjavajpeg/jpegi*", + "src/java.desktop/share/native/libjavajpeg/jpeglib.h", + "src/java.desktop/share/native/libjavajpeg/jq*", + "src/java.desktop/share/native/libjavajpeg/jv*", + "src/java.desktop/share/native/libjavajpeg/ju*", + "src/java.desktop/share/native/libjavajpeg/README" +] + +## TODO: Can the script deduce this list? +openjdk_copyrights = [ + "Copyright (c) 1996-2023 Oracle and/or its affiliates.", + "Copyright (c) 1996-2003 Sun Microsystems, Inc.", + "Copyright (c) 2009-2012 Red Hat, Inc.", + "Copyright (c) 2012-2022 SAP SE.", + "Copyright (c) 2020-2021 Azul Systems, Inc.", + "Copyright (c) 1999-2022 The Apache Software Foundation.", + "Copyright (c) 2020-2021 Microsoft Corporation", + "Copyright (c) 2009-2022 Google LLC", + "Copyright (c) 2020-2021 Amazon.com, Inc", + "Copyright (c) 2021 Alibaba Group Holding Limited", + "Copyright (c) 2019-2021 Huawei Technologies Co. Ltd.", + "Copyright (c) 2021-2023 BELLSOFT", + "Copyright (c) 2022-23 THL A29 Limited, a Tencent company.", + "Copyright (c) 2021-2023, Arm Limited.", + "Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn.", + "Copyright (c) 2017 Instituto de Pesquisas Eldorado.", + "Copyright (c) 1999-2007 Brian Paul.", + "Copyright (c) 2018-2019 Adobe Inc.", + "Copyright 2006-2014 Adobe Systems Incorporated.", + "Copyright 1994-2011 Hewlett-Packard Co.", + "Portions Copyright (c) 2011-2014 IBM Corporation", + "Portions Copyright (c) 1995 Colin Plumb", + "Portions Copyright (c) 1997-2003 Eastman Kodak Company", + "See other third party notices under the License section" +] + +## TODO: Can the script deduce this list? +upstream_authors = [ + "Oracle and/or its affiliates", + "Sun Microsystems, Inc", + "Red Hat, Inc", + "SAP SE", + "Azul Systems, Inc", + "Apache Software Foundation", + "Microsoft Corporation", + "Intel Corportation", + "IBM Corporation", + "Google LLC", + "Amazon.com, Inc", + "Other contributors", + "See the third party licenses below." +] + +exclude_licenses = ["zlib.md", "pcsclite.md", "giflib.md", "libpng.md", "jpeg.md"] + +def print_field(name, single_line, value): + print(name + ":", end="") + if (single_line): + print(" " + value) + else: + print("\n" + value) + +def print_header_stanza(format, files_excluded, source, comment): + print_field("Format", True, format) + print_field("Files-Excluded", False, files_excluded) + print_field("Source", True, source) + print_field("Comment", False, comment) + print() # an empty line + +def print_file_stanza(files, copyrights, license, comments): + print_field("Files", True, files) + print_field("Copyright", False, copyrights) + print_field("License", True, license) + if (comments is not None and len(comments) != 0): + print_field("Comments", True, comments) + print() # an empty line + +def generate_excluded_files_str(): + return " " + "\n ".join(excluded_files) + +def generate_comment_str(): + upstream_authors_str = "\n ".join(upstream_authors) + return f""" Upstream Authors: + OpenJDK: + {upstream_authors_str} + Packaged by: + {packaged_by}""" + +def generate_header_stanza(): + format = "https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/" + excluded = generate_excluded_files_str() + source = "https://github.com/openjdk/jdk17u" + comment = generate_comment_str() + print_header_stanza(format, excluded, source, comment) + +def get_content(path): + lines = [] + with open(path, 'r') as file: + for line in file: + lines.append(line + .replace("### ","") + .replace("```", "") + .replace("
", "")
+        .replace("
", "")) + + return lines[0], "".join(lines[1:]) + + +def fill_with_dots_and_indent(text): + indentation = " " * 2 + # Setting a large arbitrary width because we don't want to wrap lines + wrapper = textwrap.TextWrapper(initial_indent=indentation, width=2000, subsequent_indent=indentation, drop_whitespace=False) + lines = text.split("\n") + out = [] + for line in lines: + if line.strip() == "": + line = "." + out.append(wrapper.fill(line)) + return "\n".join(out) + +def gen_comment(component): + return f"""%% This notice is provided with respect to {component}, +which may be included with JRE {version}, JDK {version} and OpenJDK {version}""" + +def gen_license_text(license): + print("Gathering license content for " + license, file=sys.stderr) + component, content = get_content(license) + component = component.split("## ")[1].rstrip("\n"); + return f""" +{gen_comment(component)} + +--- begin of LICENSE --- +{content} +--- end of LICENSE --- + +------------------------------------------------------------------------------""" + + +def gather_legal_dirs(path): + legal_dirs = [] + for root, dirs, files in os.walk(path): + if "legal" in dirs and (root.endswith("share") or root.endswith("unix")): + legal_dirs.append(os.path.join(root, "legal")) + return legal_dirs + +def gather_licenses(module): + legal_dirs = gather_legal_dirs(module) + licenses_text = "" + for dir in sorted(legal_dirs): + licenses = os.listdir(dir) + for license in sorted(licenses): + if not license in exclude_licenses: + licenses_text += gen_license_text(dir + "/" + license) + return licenses_text + +def gather_modules_licenses(srcdir): + licenses = "" + modules = os.listdir(srcdir) + for module in sorted(modules): + licenses += gather_licenses(srcdir + "/" + module) + return licenses + +def find_directory(prefix, path = '.'): + for file in os.scandir(path): + if file.is_dir() and file.name.startswith(prefix): + return file.path + +def search_source_rootdir(level, path = '.'): + # The user might have already pulled the source package. + # Search for a downloaded package at three levels + # - openjdk + # - openjdk/debian + # - openjdk/debian/copyright-generator + # if one none found, download the source package + rootdir = find_directory(f"openjdk-{version}", path) + if rootdir is not None: + return rootdir + + match level: + case 0: + path = "./debian" + level= level + 1 + case 1: + path = "./debian/copyright-generator" + level = level + 1 + case 2: + print("No source package found. Downloading...", file = sys.stderr) + os.system(f"pull-debian-source openjdk-{version} > /dev/null 2>&1") + needs_cleanup = True + return find_directory(f"openjdk-{version}") + case _: + print("Irrecoverable error while searching for source package") + exit(1) + + return search_source_rootdir(level, path) + +def generate_copyright(): + rootdir = search_source_rootdir(0) + if rootdir is None: + print("No source package found. Download also failed. Aborting.") + exit(2) + print(f"Using the source package at {rootdir}", file = sys.stderr) + srcdir = f"{rootdir}/src"; + + os.system(f"/bin/sh ./debian/copyright-generator/strip-common-licenses.sh {rootdir} {version}") + generate_header_stanza(); + + licenses = f"""GPL with Classpath exception + +--- begin of LICENSE --- + +{open(rootdir + "/LICENSE").read()} +--- end of LICENSE --- + +------------------------------------------------------------------------------ +The following licenses for third party code are taken from 'legal' \ndirectories of modules under src/ +------------------------------------------------------------------------------ +{gather_modules_licenses(srcdir)}""" + + print_file_stanza("*", " " + "\n ".join(openjdk_copyrights), fill_with_dots_and_indent(licenses), "") + if (version != "11"): + print(open("./debian/copyright-generator/bundled-stanzas").read()) + print(open("./debian/copyright-generator/debian-stanzas").read()) + + # clean-up + if needs_cleanup: + os.system(f"rm -rf *.debian.tar.xz *.orig.tar.xz *.dsc *googletest.tar.xz"); + + +def main(): + global version + + sys.stdout = open('./debian/copyright', 'w') + supported_versions = ["11", "17", "21", "22", "23"] + if (len(sys.argv) >= 1): + version = sys.argv[1] + + if version == "" or version == "--help" or version == "-help" or version == "help": + print("Usage:\ndebian/copyright-generator/copyright-gen.py ", file=sys.stderr) + print("version - 11 | 17 | 21 | 22 | 23", file=sys.stderr) + + elif version in supported_versions: + generate_copyright() + else: + print("Version not supported.") + +if __name__ == "__main__": + main() diff -Nru openjdk-17-17.0.9+9/debian/copyright-generator/debian-stanzas openjdk-17-17.0.10+7/debian/copyright-generator/debian-stanzas --- openjdk-17-17.0.9+9/debian/copyright-generator/debian-stanzas 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/copyright-generator/debian-stanzas 2023-10-31 07:49:58.000000000 +0000 @@ -0,0 +1,40 @@ +Files: debian/* +Copyright: Copyright © 2007-2023 Canonical Ltd. +License: MIT + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Files: debian/dbg.py +Copyright: Copyright 2016, Red Hat and individual contributors +License: LGPL + # Copyright 2016, Red Hat and individual contributors + # by the @authors tag. + # + # This is free software; you can redistribute it and/or modify it + # under the terms of the GNU Lesser General Public License as + # published by the Free Software Foundation; either version 2.1 of + # the License, or (at your option) any later version. + # + # This software 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 + # Lesser General Public License for more details. + . + On Debian systems a full copy of the GNU General Public License, GPL, can be + found in the file /usr/share/common-licenses/GPL-2. diff -Nru openjdk-17-17.0.9+9/debian/copyright-generator/strip-common-licenses.sh openjdk-17-17.0.10+7/debian/copyright-generator/strip-common-licenses.sh --- openjdk-17-17.0.9+9/debian/copyright-generator/strip-common-licenses.sh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/copyright-generator/strip-common-licenses.sh 2023-10-31 07:49:58.000000000 +0000 @@ -0,0 +1,18 @@ +SOURCE_DIR=$1 +VERSION=$2 +for LEGAL_DIR in `find $SOURCE_DIR/src -name legal`; do + for COMMON_LICENSE in "### Apache 2.0 License" "### GPL v2" ; do + for FILE in `grep -Rl "${COMMON_LICENSE}" $LEGAL_DIR`; do + sed -i "/^${COMMON_LICENSE}/,/^###/{/^###/!{d}}" $FILE + sed -i "s/${COMMON_LICENSE}/${COMMON_LICENSE}: Refer to the copy under \/usr\/share\/common-licenses\n/g" $FILE + done + done + # special cases + if [ $VERSION = "21" ] || [ $VERSION = "17" ] || [ $VERSION = "11" ]; then + FILE=$SOURCE_DIR/src/jdk.internal.le/share/legal/jline.md + sed -i "/^Apache License/,/^=====/{/^Apache License/!{/^=====/!{d}}}" $FILE + sed -i "s/^Apache License/Apache 2.0 License: Refer to the copy under \/usr\/share\/common-licenses\n\n/g" $FILE + fi +done + + diff -Nru openjdk-17-17.0.9+9/debian/patches/8315020.diff openjdk-17-17.0.10+7/debian/patches/8315020.diff --- openjdk-17-17.0.9+9/debian/patches/8315020.diff 2023-09-16 10:25:53.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/8315020.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -diff --git a/make/autoconf/platform.m4 b/make/autoconf/platform.m4 -index 5752d3bd1a6..eb66266262b 100644 ---- a/make/autoconf/platform.m4 -+++ b/make/autoconf/platform.m4 -@@ -573,6 +573,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], - HOTSPOT_$1_CPU_DEFINE=S390 - elif test "x$OPENJDK_$1_CPU" = xs390x; then - HOTSPOT_$1_CPU_DEFINE=S390 -+ elif test "x$OPENJDK_$1_CPU" = xloongarch64; then -+ HOTSPOT_$1_CPU_DEFINE=LOONGARCH64 - elif test "x$OPENJDK_$1_CPU" != x; then - HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z) - fi -diff --git a/src/hotspot/os/linux/os_linux.cpp b/src/hotspot/os/linux/os_linux.cpp -index 99dd4c82420..4c63f292e86 100644 ---- a/src/hotspot/os/linux/os_linux.cpp -+++ b/src/hotspot/os/linux/os_linux.cpp -@@ -1791,11 +1791,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) { - static Elf32_Half running_arch_code=EM_SH; - #elif (defined RISCV) - static Elf32_Half running_arch_code=EM_RISCV; --#elif (defined LOONGARCH) -+#elif (defined LOONGARCH64) - static Elf32_Half running_arch_code=EM_LOONGARCH; - #else - #error Method os::dll_load requires that one of following is defined:\ -- AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc -+ AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc - #endif - - // Identify compatibility class for VM's architecture and library's architecture diff -Nru openjdk-17-17.0.9+9/debian/patches/build_gtest.patch openjdk-17-17.0.10+7/debian/patches/build_gtest.patch --- openjdk-17-17.0.9+9/debian/patches/build_gtest.patch 2023-08-23 12:57:29.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/build_gtest.patch 2023-12-26 11:07:25.000000000 +0000 @@ -7,7 +7,7 @@ Last-Update: 2023-07-20 --- a/make/autoconf/lib-tests.m4 +++ b/make/autoconf/lib-tests.m4 -@@ -36,6 +36,8 @@ +@@ -43,6 +43,8 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST], AC_MSG_CHECKING([for gtest]) if test "x${with_gtest}" = xno; then AC_MSG_RESULT([no, disabled]) @@ -18,7 +18,7 @@ AC_MSG_ERROR([--with-gtest must have a value]) --- a/test/hotspot/gtest/gtestMain.cpp +++ b/test/hotspot/gtest/gtestMain.cpp -@@ -230,7 +230,9 @@ +@@ -230,7 +230,9 @@ static void runUnitTestsInner(int argc, bool is_vmassert_test = false; bool is_othervm_test = false; // death tests facility is used for both regular death tests, other vm and vmassert tests diff -Nru openjdk-17-17.0.9+9/debian/patches/googletest-version.diff openjdk-17-17.0.10+7/debian/patches/googletest-version.diff --- openjdk-17-17.0.9+9/debian/patches/googletest-version.diff 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/googletest-version.diff 2023-12-26 11:23:19.000000000 +0000 @@ -0,0 +1,24 @@ +--- a/make/autoconf/lib-tests.m4 ++++ b/make/autoconf/lib-tests.m4 +@@ -64,16 +64,17 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST], + # determined. :-( Instead, there are different, incorrect version + # numbers we can look for. + GTEST_VERSION_1="`$GREP GOOGLETEST_VERSION $GTEST_FRAMEWORK_SRC/CMakeLists.txt | $SED -E -e 's/set\(GOOGLETEST_VERSION (.*)\)/\1/'`" +- if test "x$GTEST_VERSION_1" != "x1.9.0"; then +- AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.8.1]) ++ if test "x$GTEST_VERSION_1" != "x1.14.0"; then ++ AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.14.0]) + fi + ++ # $GTEST_FRAMEWORK_SRC/configure.ac does not exist + # We cannot grep for "AC_IN*T" as a literal since then m4 will treat it as a macro + # and expand it. + # Additional [] needed to keep m4 from mangling shell constructs. + [ GTEST_VERSION_2="`$GREP -A1 ^.C_INIT $GTEST_FRAMEWORK_SRC/configure.ac | $TAIL -n 1 | $SED -E -e 's/ +\[(.*)],/\1/'`" ] +- if test "x$GTEST_VERSION_2" != "x1.8.0"; then +- AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.8.1 B]) ++ if false && test "x$GTEST_VERSION_2" != "x1.14.0"; then ++ AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.14.0 B]) + fi + fi + fi diff -Nru openjdk-17-17.0.9+9/debian/patches/hotspot-disable-exec-shield-workaround.diff openjdk-17-17.0.10+7/debian/patches/hotspot-disable-exec-shield-workaround.diff --- openjdk-17-17.0.9+9/debian/patches/hotspot-disable-exec-shield-workaround.diff 2023-06-09 08:47:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/hotspot-disable-exec-shield-workaround.diff 2023-12-26 11:07:05.000000000 +0000 @@ -1,6 +1,6 @@ --- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp +++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp -@@ -657,7 +657,7 @@ +@@ -663,7 +663,7 @@ void os::verify_stack_alignment() { * updates (JDK-8023956). */ void os::workaround_expand_exec_shield_cs_limit() { @@ -8,4 +8,4 @@ +#if 0 assert(Linux::initial_thread_stack_bottom() != NULL, "sanity"); size_t page_size = os::vm_page_size(); - + diff -Nru openjdk-17-17.0.9+9/debian/patches/jtreg-location.diff openjdk-17-17.0.10+7/debian/patches/jtreg-location.diff --- openjdk-17-17.0.9+9/debian/patches/jtreg-location.diff 2023-06-09 08:47:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/jtreg-location.diff 2023-12-26 11:05:55.000000000 +0000 @@ -1,6 +1,6 @@ ---- a/make/autoconf/toolchain.m4 -+++ b/make/autoconf/toolchain.m4 -@@ -1029,7 +1029,7 @@ +--- a/make/autoconf/lib-tests.m4 ++++ b/make/autoconf/lib-tests.m4 +@@ -179,7 +179,7 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG], AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist]) fi @@ -9,7 +9,7 @@ AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home]) fi -@@ -1043,7 +1043,7 @@ +@@ -193,7 +193,7 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG], AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME]) JT_HOME= else @@ -18,7 +18,7 @@ AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME]) JT_HOME= else -@@ -1059,7 +1059,7 @@ +@@ -209,7 +209,7 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG], if test "x$JTREGEXE" != x; then # That's good, now try to derive JT_HOME JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)` @@ -29,7 +29,7 @@ else --- a/make/RunTests.gmk +++ b/make/RunTests.gmk -@@ -846,7 +846,7 @@ +@@ -847,7 +847,7 @@ define SetupRunJtregTestBody $1_COMMAND_LINE := \ $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ @@ -40,7 +40,7 @@ -dir:$$(JTREG_TOPDIR) \ --- a/make/test/BuildFailureHandler.gmk +++ b/make/test/BuildFailureHandler.gmk -@@ -38,7 +38,7 @@ +@@ -38,7 +38,7 @@ FH_BASEDIR := $(TOPDIR)/test/failure_han FH_SUPPORT := $(SUPPORT_OUTPUTDIR)/test/failure_handler FH_JAR := $(FH_SUPPORT)/jtregFailureHandler.jar diff -Nru openjdk-17-17.0.9+9/debian/patches/m68k-support.diff openjdk-17-17.0.10+7/debian/patches/m68k-support.diff --- openjdk-17-17.0.9+9/debian/patches/m68k-support.diff 2023-06-09 08:47:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/m68k-support.diff 2023-12-26 11:07:10.000000000 +0000 @@ -1042,7 +1042,7 @@ $(eval $(call SetupExecute, gen_x11wrappers, \ --- a/src/hotspot/share/memory/allocation.hpp +++ b/src/hotspot/share/memory/allocation.hpp -@@ -239,7 +239,7 @@ +@@ -239,7 +239,7 @@ template class CHeapObj ALL void operator delete(void* p) { FreeHeap(p); } void operator delete [] (void* p) { FreeHeap(p); } @@ -1051,7 +1051,7 @@ // Base class for objects allocated on the stack only. // Calling new or delete will result in fatal error. -@@ -250,7 +250,7 @@ +@@ -250,7 +250,7 @@ class StackObj ALLOCATION_SUPER_CLASS_SP void* operator new [](size_t size) throw(); void operator delete(void* p); void operator delete [](void* p); @@ -1060,7 +1060,7 @@ // Base class for objects stored in Metaspace. // Calling delete will result in fatal error. -@@ -372,7 +372,7 @@ +@@ -372,7 +372,7 @@ class MetaspaceObj { // that should be read-only by default. See symbol.hpp for an example. This function // is used by the templates in metaspaceClosure.hpp static bool is_read_only_by_default() { return false; } @@ -1069,7 +1069,7 @@ // Base class for classes that constitute name spaces. -@@ -457,7 +457,7 @@ +@@ -457,7 +457,7 @@ protected: void operator delete(void* p); void operator delete [](void* p); @@ -1080,7 +1080,7 @@ // or object to determine whether it should reside in the C heap on in --- a/src/hotspot/share/oops/constMethod.hpp +++ b/src/hotspot/share/oops/constMethod.hpp -@@ -525,6 +525,6 @@ +@@ -525,6 +525,6 @@ private: // Verify void verify_on(outputStream* st); @@ -1090,7 +1090,7 @@ #endif // SHARE_OOPS_CONSTMETHOD_HPP --- a/src/hotspot/share/oops/oop.hpp +++ b/src/hotspot/share/oops/oop.hpp -@@ -315,6 +315,6 @@ +@@ -316,6 +316,6 @@ class oopDesc { // Avoid include gc_globals.hpp in oop.inline.hpp DEBUG_ONLY(bool get_UseParallelGC();) DEBUG_ONLY(bool get_UseG1GC();) diff -Nru openjdk-17-17.0.9+9/debian/patches/series openjdk-17-17.0.10+7/debian/patches/series --- openjdk-17-17.0.9+9/debian/patches/series 2023-10-18 07:04:49.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/series 2023-12-26 11:18:38.000000000 +0000 @@ -37,4 +37,4 @@ ldap-timeout-test-use-ip.patch test-use-ip-address.patch loong64-autoconf-config.diff -8315020.diff +googletest-version.diff diff -Nru openjdk-17-17.0.9+9/debian/patches/system-pcsclite.diff openjdk-17-17.0.10+7/debian/patches/system-pcsclite.diff --- openjdk-17-17.0.9+9/debian/patches/system-pcsclite.diff 2023-06-09 08:47:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/system-pcsclite.diff 2023-12-26 11:06:49.000000000 +0000 @@ -1,6 +1,6 @@ --- a/make/autoconf/lib-bundled.m4 +++ b/make/autoconf/lib-bundled.m4 -@@ -41,6 +41,7 @@ +@@ -41,6 +41,7 @@ AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS], LIB_SETUP_ZLIB LIB_SETUP_LCMS LIB_SETUP_HARFBUZZ @@ -8,7 +8,7 @@ ]) ################################################################################ -@@ -307,3 +308,41 @@ +@@ -309,3 +310,41 @@ AC_DEFUN_ONCE([LIB_SETUP_HARFBUZZ], AC_SUBST(HARFBUZZ_CFLAGS) AC_SUBST(HARFBUZZ_LIBS) ]) @@ -52,7 +52,7 @@ +]) --- a/make/modules/java.smartcardio/Lib.gmk +++ b/make/modules/java.smartcardio/Lib.gmk -@@ -30,12 +30,12 @@ +@@ -30,12 +30,12 @@ include LibCommon.gmk $(eval $(call SetupJdkLibrary, BUILD_LIBJ2PCSC, \ NAME := j2pcsc, \ CFLAGS := $(CFLAGS_JDKLIB), \ @@ -70,7 +70,7 @@ --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in -@@ -774,6 +774,7 @@ +@@ -774,6 +774,7 @@ TAR_SUPPORTS_TRANSFORM:=@TAR_SUPPORTS_TR # Build setup USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ @@ -88,7 +88,7 @@ void *hModule; FPTR_SCardEstablishContext scardEstablishContext; FPTR_SCardConnect scardConnect; -@@ -47,6 +48,7 @@ +@@ -47,6 +48,7 @@ FPTR_SCardListReaders scardListReaders; FPTR_SCardBeginTransaction scardBeginTransaction; FPTR_SCardEndTransaction scardEndTransaction; FPTR_SCardControl scardControl; @@ -96,7 +96,7 @@ /* * Throws a Java Exception by name -@@ -75,7 +77,9 @@ +@@ -75,7 +77,9 @@ void throwIOException(JNIEnv *env, const throwByName(env, "java/io/IOException", msg); } @@ -106,7 +106,7 @@ void *fAddress = dlsym(hModule, functionName); if (fAddress == NULL) { char errorMessage[256]; -@@ -85,9 +89,11 @@ +@@ -85,9 +89,11 @@ void *findFunction(JNIEnv *env, void *hM } return fAddress; } @@ -118,7 +118,7 @@ const char *libName = (*env)->GetStringUTFChars(env, jLibName, NULL); if (libName == NULL) { throwNullPointerException(env, "PCSC library name is null"); -@@ -141,4 +147,5 @@ +@@ -141,4 +147,5 @@ JNIEXPORT void JNICALL Java_sun_security #else scardControl = (FPTR_SCardControl) findFunction(env, hModule, "SCardControl132"); #endif // __APPLE__ @@ -135,7 +135,7 @@ typedef LONG (*FPTR_SCardEstablishContext)(DWORD dwScope, LPCVOID pvReserved1, LPCVOID pvReserved2, -@@ -111,3 +113,41 @@ +@@ -111,3 +113,41 @@ extern FPTR_SCardListReaders scardListRe extern FPTR_SCardBeginTransaction scardBeginTransaction; extern FPTR_SCardEndTransaction scardEndTransaction; extern FPTR_SCardControl scardControl; @@ -179,7 +179,7 @@ +#endif --- a/test/jdk/java/security/misc/Versions.java +++ b/test/jdk/java/security/misc/Versions.java -@@ -55,12 +55,7 @@ +@@ -55,12 +55,7 @@ public class Versions { Pattern.compile("list/(?[0-9a-f]+)/public_suffix_list.dat"), "src/java.base/share/legal/public_suffix.md", Pattern.compile("list/(?[0-9a-f]+)/public_suffix_list.dat"), diff -Nru openjdk-17-17.0.9+9/debian/patches/update-permission-test.patch openjdk-17-17.0.10+7/debian/patches/update-permission-test.patch --- openjdk-17-17.0.9+9/debian/patches/update-permission-test.patch 2023-06-09 08:55:58.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/patches/update-permission-test.patch 2023-12-26 11:07:35.000000000 +0000 @@ -4,7 +4,7 @@ Last-Update: 2023-03-24 --- a/test/jdk/java/lang/ProcessHandle/PermissionTest.java +++ b/test/jdk/java/lang/ProcessHandle/PermissionTest.java -@@ -219,6 +219,7 @@ +@@ -219,6 +219,7 @@ class TestPolicy extends Policy { permissions.add(new PropertyPermission("testng.mode.dryrun", "read")); permissions.add(new PropertyPermission("testng.report.xml.name", "read")); permissions.add(new PropertyPermission("testng.timezone", "read")); @@ -14,7 +14,7 @@ } --- a/test/jdk/java/sql/testng/util/TestPolicy.java +++ b/test/jdk/java/sql/testng/util/TestPolicy.java -@@ -114,6 +114,8 @@ +@@ -114,6 +114,8 @@ public class TestPolicy extends Policy { permissions.add(new PropertyPermission("testng.mode.dryrun", "read")); permissions.add(new PropertyPermission("testng.report.xml.name", "read")); permissions.add(new PropertyPermission("testng.timezone", "read")); @@ -25,7 +25,7 @@ "read, write, delete")); --- a/test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPPolicyManager.java +++ b/test/jaxp/javax/xml/jaxp/libs/jaxp/library/JAXPPolicyManager.java -@@ -35,6 +35,7 @@ +@@ -37,6 +37,7 @@ import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.PropertyPermission; @@ -33,7 +33,7 @@ import java.util.Set; import java.util.StringJoiner; -@@ -110,6 +111,15 @@ +@@ -112,6 +113,15 @@ public class JAXPPolicyManager { addPermission(new SecurityPermission("setPolicy")); addPermission(new RuntimePermission("setSecurityManager")); addPermission(new PropertyPermission("test.src", "read")); diff -Nru openjdk-17-17.0.9+9/debian/rules openjdk-17-17.0.10+7/debian/rules --- openjdk-17-17.0.9+9/debian/rules 2023-10-18 07:04:49.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/rules 2024-01-17 11:09:47.000000000 +0000 @@ -82,7 +82,6 @@ endif is_upstream_release = yes -#is_upstream_release = srcdir = . builddir = build @@ -157,7 +156,7 @@ NJOBS = $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif -jtreg_pkg = jtreg6 +jtreg_pkg = jtreg7 testng_pkg= libtestng7-java with_check = $(if $(findstring nocheck, $(DEB_BUILD_OPTIONS)),,yes) @@ -880,7 +879,7 @@ control_vars += '-Vdbg:Conflicts=openjdk-11-dbg, openjdk-12-dbg, openjdk-13-dbg, openjdk-14-dbg, openjdk-15-dbg, openjdk-16-dbg' endif -debian/control: debian/control.in debian/tests/control debian/rules +debian/control: debian/control.in debian/tests/control debian/rules debian/watch @cp -p debian/control debian/control.old sed \ -e 's/@basename@/$(basename)/g' \ @@ -908,6 +907,7 @@ $(if $(altzero_archs), debian/control.zero-jre) \ $(if $(DEB_HOST_MULTIARCH),,| grep -v '^Multi-Arch') \ > debian/control + sed -i 's/[[:blank:]]*$$//' debian/control @if cmp -s debian/control debian/control.old; then \ rm -f debian/control.old; \ else \ @@ -1238,7 +1238,7 @@ dh_prep for f in debian/*.in; do \ f2=$$(echo $$f | sed 's/JB/$(basename)/;s/\.in$$//'); \ - case "$$f2" in debian/control) continue; esac; \ + case "$$f2" in debian/control|debian/watch) continue; esac; \ rm -f $$f2; \ done rm -f debian/*.install debian/*.links debian/*.debhelper.log @@ -1901,26 +1901,36 @@ NO_PKG_MANGLE=1 \ dh_builddeb -a $(nodemo) $(nojrez) #$(bd_options) -is_release = yes -#is_release = git_project = jdk17u -git_tag = jdk-17.0.9+9 +git_tag = jdk-17.0.10+7 package_version = $(subst jdk-,,$(git_tag)) package_version = $(shell echo $(PKGVERSION) | sed 's/-[^-][^-]*$$//') -ifneq ($(is_release),yes) +ifneq ($(is_upstream_release),yes) package_version := $(subst +,~,$(package_version)) endif git_url = https://github.com/openjdk/$(git_project) origdir = ../$(basename)-$(package_version).orig topdir = $(basename)-$(package_version) -gtest_repo = https://github.com/google/googletest/archive/refs/tags/ +gtest_repo = https://github.com/google/googletest gtest_tag = 1.14.0 gtestdir = ../$(basename)-$(package_version)-googletest.orig +debian/watch: debian/watch.in debian/rules + sed \ + -e 's|@git_url@|$(git_url)/tags|g' \ + -e 's|@gtest_repo@|$(gtest_repo)/tags|g' \ + -e 's|@gtest_tag@|$(gtest_tag)|g' \ + -e 's|@shortver@|$(shortver)|g' \ + debian/watch.in > debian/watch +# disable version mangling for the release version +ifeq ($(is_upstream_release),yes) + sed -i 's|repack.*\\|repack,\\|g' debian/watch +endif + get-gtest: rm -rf $(gtestdir) || true mkdir $(gtestdir) - wget -O $(gtestdir)/googletest.tar.gz $(gtest_repo)/v$(gtest_tag).tar.gz + wget -O $(gtestdir)/googletest.tar.gz $(gtest_repo)/archive/refs/tags/v$(gtest_tag).tar.gz set -ex; \ repo=googletest; \ d=$$(tar tf $(gtestdir)/$$repo.tar.gz | head -1 | sed 's,/.*,,'); \ diff -Nru openjdk-17-17.0.9+9/debian/tests/control openjdk-17-17.0.10+7/debian/tests/control --- openjdk-17-17.0.9+9/debian/tests/control 2023-10-18 07:07:04.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/tests/control 2024-01-30 23:08:29.000000000 +0000 @@ -7,9 +7,9 @@ Restrictions: superficial #Tests: hotspot, jaxp, langtools -#Depends: @, default-jre-headless, jtreg6:native (>= 6+1-0~), testng:native, build-essential +#Depends: @, default-jre-headless, jtreg7:native (>= 7.3.1+1-0~), testng:native, build-essential #Restrictions: allow-stderr, skippable, flaky #Tests: jdk -#Depends: @, default-jre-headless, jtreg6:native (>= 6+1-0~), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11 +#Depends: @, default-jre-headless, jtreg7:native (>= 7.3.1+1-0~), testng:native, build-essential, xfwm4:native, xvfb, dbus-x11 #Restrictions: allow-stderr, skippable, flaky diff -Nru openjdk-17-17.0.9+9/debian/tests/hotspot openjdk-17-17.0.10+7/debian/tests/hotspot --- openjdk-17-17.0.9+9/debian/tests/hotspot 2023-06-09 09:02:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/tests/hotspot 2023-10-31 07:11:28.000000000 +0000 @@ -4,13 +4,8 @@ set -o pipefail set -o nounset -problem_list=${AUTOPKGTEST_TMP}/hotspot-problems.txt -cat test/hotspot/jtreg/ProblemList.txt > ${problem_list} - -host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" -if [[ -f debian/tests/problems-${host_arch}.txt ]]; then - cat debian/tests/problems-${host_arch}.txt >> ${problem_list} -fi +problem_list=${AUTOPKGTEST_TMP}/problems.txt +debian/tests/write-problems ${problem_list} test/hotspot/jtreg/ProblemList.txt hotspot native_path=$(pwd)/build/images/test/hotspot/jtreg/native debian/tests/jtreg-autopkgtest.sh hotspot \ diff -Nru openjdk-17-17.0.9+9/debian/tests/jdk openjdk-17-17.0.10+7/debian/tests/jdk --- openjdk-17-17.0.9+9/debian/tests/jdk 2023-06-09 09:02:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/tests/jdk 2023-10-31 07:11:28.000000000 +0000 @@ -25,13 +25,9 @@ debian/tests/start-xvfb.sh 10 & sleep 3 -problem_list=${AUTOPKGTEST_TMP}/jdk-problems.txt -cat test/jdk/ProblemList.txt > ${problem_list} -host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" -if [[ -f debian/tests/problems-${host_arch}.txt ]]; then - cat debian/tests/problems-${host_arch}.txt >> ${problem_list} -fi +problem_list=${AUTOPKGTEST_TMP}/problems.txt +debian/tests/write-problems ${problem_list} test/jdk/ProblemList.txt jdk native_path=$(pwd)/build/images/test/jdk/jtreg/native debian/tests/jtreg-autopkgtest.sh jdk \ diff -Nru openjdk-17-17.0.9+9/debian/tests/jtreg-autopkgtest.sh openjdk-17-17.0.10+7/debian/tests/jtreg-autopkgtest.sh --- openjdk-17-17.0.9+9/debian/tests/jtreg-autopkgtest.sh 2023-10-18 07:04:49.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/tests/jtreg-autopkgtest.sh 2024-01-03 10:49:08.000000000 +0000 @@ -22,7 +22,7 @@ BOOTJDK_HOME=${JDK_TO_TEST} fi -jtreg_version="$(dpkg-query -W jtreg6 | cut -f2)" +jtreg_version="$(dpkg-query -W jtreg7 | cut -f2)" # set additional jtreg options jt_options="${JTREG_OPTIONS:-}" diff -Nru openjdk-17-17.0.9+9/debian/tests/langtools openjdk-17-17.0.10+7/debian/tests/langtools --- openjdk-17-17.0.9+9/debian/tests/langtools 2023-06-09 09:02:21.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/tests/langtools 2023-10-31 07:11:28.000000000 +0000 @@ -4,8 +4,11 @@ set -o pipefail set -o nounset +problem_list=${AUTOPKGTEST_TMP}/problems.txt +debian/tests/write-problems ${problem_list} test/langtools/ProblemList.txt langtools + debian/tests/jtreg-autopkgtest.sh langtools \ - -exclude:test/langtools/ProblemList.txt \ + -exclude:${problem_list} \ -dir:test/langtools \ -k:!stress \ :tier1 :tier2 diff -Nru openjdk-17-17.0.9+9/debian/tests/write-problems openjdk-17-17.0.10+7/debian/tests/write-problems --- openjdk-17-17.0.9+9/debian/tests/write-problems 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/tests/write-problems 2023-10-31 07:11:28.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/bash + +problem_list=$1 +upstream_problems=$2 +suite=$3 + +cat ${upstream_problems} > ${problem_list} + +if [[ -f debian/tests/problems-${suite}.txt ]]; then + cat debian/tests/problems-${suite}.txt >> ${problem_list} +fi + +distrel=`lsb_release --codename --short` +if [[ -f debian/tests/problems-${distrel}.txt ]]; then + cat debian/tests/problems-${distrel}.txt >> ${problem_list} +fi + +host_arch="${DEB_HOST_ARCH:-$(dpkg --print-architecture)}" +if [[ -f debian/tests/problems-${host_arch}.txt ]]; then + cat debian/tests/problems-${host_arch}.txt >> ${problem_list} +fi + +if [[ -f debian/tests/problems-${distrel}-${host_arch}.txt ]]; then + cat debian/tests/problems-${distrel}-${host_arch}.txt >> ${problem_list} +fi diff -Nru openjdk-17-17.0.9+9/debian/watch openjdk-17-17.0.10+7/debian/watch --- openjdk-17-17.0.9+9/debian/watch 2023-10-18 07:04:49.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/watch 2024-01-17 11:09:47.000000000 +0000 @@ -1,13 +1,13 @@ version=4 opts=\ repack,\ -compression=xz \ - https://github.com/openjdk/jdk17u/tags \ - (?:.*?/)?jdk-(\d[\d.]*\+\d[\d]*)\.tar\.gz +compression=xz, \ + https://github.com/openjdk/jdk17u/tags \ + (?:.*?/)?jdk-(17[\+\.\d]*)\.tar\.gz opts=\ component=googletest,\ repack,\ compression=xz \ - https://github.com/google/googletest/tags \ - (?:.*?/)?v(1.14.0)\.tar\.gz + https://github.com/google/googletest/tags \ + (?:.*?/)?v([\.\d]+)\.tar\.gz 1.14.0 diff -Nru openjdk-17-17.0.9+9/debian/watch.in openjdk-17-17.0.10+7/debian/watch.in --- openjdk-17-17.0.9+9/debian/watch.in 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/debian/watch.in 2024-01-05 08:35:54.000000000 +0000 @@ -0,0 +1,13 @@ +version=4 +opts=\ +repack,repacksuffix=ea,oversionmangle=s/\+(\d+)/\~$1/,dversionmangle=s/\~(\d*)ea$/\+$1/,\ +compression=xz, \ + @git_url@ \ + (?:.*?/)?jdk-(@shortver@[\+\.\d]*)\.tar\.gz + +opts=\ +component=googletest,\ +repack,\ +compression=xz \ + @gtest_repo@ \ + (?:.*?/)?v([\.\d]+)\.tar\.gz @gtest_tag@ diff -Nru openjdk-17-17.0.9+9/doc/testing.html openjdk-17-17.0.10+7/doc/testing.html --- openjdk-17-17.0.9+9/doc/testing.html 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/doc/testing.html 2024-01-09 21:18:15.000000000 +0000 @@ -88,6 +88,7 @@

Individual JTReg tests or directories containing JTReg tests can also be specified, like test/hotspot/jtreg/native_sanity/JniVersion.java or hotspot/jtreg/native_sanity. Just like for test root selection, you can either specify an absolute path (which can even point to JTReg tests outside the source tree), or a path relative to either the JDK top directory or the test directory. hotspot can be used as an alias for hotspot/jtreg here as well.

As long as the test groups or test paths can be uniquely resolved, you do not need to enter the jtreg: prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add jtreg:, e.g. jtreg:test/hotspot/jtreg/native_sanity.

Gtest

+

Note: To be able to run the Gtest suite, you need to configure your build to be able to find a proper version of the gtest source. For details, see the section "Running Tests" in the build documentation.

Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just gtest, or as a fully qualified test descriptor gtest:all.

If you want, you can single out an individual test or a group of tests, for instance gtest:LogDecorations or gtest:LogDecorations.level_test_vm. This can be particularly useful if you want to run a shaky test repeatedly.

For Gtest, there is a separate test suite for each JVM variant. The JVM variant is defined by adding /<variant> to the test descriptor, e.g. gtest:Log/client. If you specify no variant, gtest will run once for each JVM variant present (e.g. server, client). So if you only have the server JVM present, then gtest:all will be equivalent to gtest:all/server.

diff -Nru openjdk-17-17.0.9+9/doc/testing.md openjdk-17-17.0.10+7/doc/testing.md --- openjdk-17-17.0.9+9/doc/testing.md 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/doc/testing.md 2024-01-09 21:18:15.000000000 +0000 @@ -142,6 +142,11 @@ ### Gtest +**Note:** To be able to run the Gtest suite, you need to configure your build to +be able to find a proper version of the gtest source. For details, see the +section ["Running Tests" in the build +documentation](building.html#running-tests). + Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just `gtest`, or as a fully qualified test descriptor `gtest:all`. diff -Nru openjdk-17-17.0.9+9/make/RunTests.gmk openjdk-17-17.0.10+7/make/RunTests.gmk --- openjdk-17-17.0.9+9/make/RunTests.gmk 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/RunTests.gmk 2024-01-09 21:18:15.000000000 +0000 @@ -523,7 +523,7 @@ $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR)))) $$(if $$(wildcard $$($1_RESULT_FILE)), \ $$(eval $1_TOTAL := $$(shell $$(AWK) '/==========.* tests? from .* \ - test cases? ran/ { print $$$$2 }' $$($1_RESULT_FILE))) \ + test (cases?|suites?) ran/ { print $$$$2 }' $$($1_RESULT_FILE))) \ $$(if $$($1_TOTAL), , $$(eval $1_TOTAL := 0)) \ $$(eval $1_PASSED := $$(shell $$(AWK) '/\[ PASSED \] .* tests?./ \ { print $$$$4 }' $$($1_RESULT_FILE))) \ @@ -841,8 +841,9 @@ endif endif - clean-workdir-$1: + clean-outputdirs-$1: $$(RM) -r $$($1_TEST_SUPPORT_DIR) + $$(RM) -r $$($1_TEST_RESULTS_DIR) $1_COMMAND_LINE := \ $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ @@ -887,7 +888,7 @@ done endif - run-test-$1: pre-run-test clean-workdir-$1 + run-test-$1: pre-run-test clean-outputdirs-$1 $$(call LogWarn) $$(call LogWarn, Running test '$$($1_TEST)') $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR) \ @@ -924,9 +925,9 @@ $$(eval $1_TOTAL := 1) \ ) - $1: run-test-$1 parse-test-$1 clean-workdir-$1 + $1: run-test-$1 parse-test-$1 clean-outputdirs-$1 - TARGETS += $1 run-test-$1 parse-test-$1 clean-workdir-$1 + TARGETS += $1 run-test-$1 parse-test-$1 clean-outputdirs-$1 TEST_TARGETS += parse-test-$1 endef diff -Nru openjdk-17-17.0.9+9/make/RunTestsPrebuilt.gmk openjdk-17-17.0.10+7/make/RunTestsPrebuilt.gmk --- openjdk-17-17.0.9+9/make/RunTestsPrebuilt.gmk 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/RunTestsPrebuilt.gmk 2024-01-09 21:18:15.000000000 +0000 @@ -157,6 +157,10 @@ OPENJDK_TARGET_OS := windows OPENJDK_TARGET_OS_TYPE := windows OPENJDK_TARGET_OS_ENV := windows.cygwin +else ifeq ($(UNAME_OS), MINGW64) + OPENJDK_TARGET_OS := windows + OPENJDK_TARGET_OS_TYPE := windows + OPENJDK_TARGET_OS_ENV := windows.msys2 else OPENJDK_TARGET_OS_TYPE:=unix ifeq ($(UNAME_OS), Linux) @@ -169,6 +173,9 @@ OPENJDK_TARGET_OS_ENV := $(OPENJDK_TARGET_OS) endif +# Sanity check env detection +$(info Detected target OS, type and env: [$(OPENJDK_TARGET_OS)] [$(OPENJDK_TARGET_OS_TYPE)] [$(OPENJDK_TARGET_OS_ENV)]) + # Assume little endian unless otherwise specified OPENJDK_TARGET_CPU_ENDIAN := little diff -Nru openjdk-17-17.0.9+9/make/autoconf/basic.m4 openjdk-17-17.0.10+7/make/autoconf/basic.m4 --- openjdk-17-17.0.9+9/make/autoconf/basic.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/basic.m4 2024-01-09 21:18:15.000000000 +0000 @@ -358,9 +358,9 @@ # WARNING: This might be a bad thing to do. You need to be sure you want to # have a configuration in this directory. Do some sanity checks! - if test ! -e "$OUTPUTDIR/spec.gmk"; then - # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for - # other files + if test ! -e "$OUTPUTDIR/spec.gmk" && test ! -e "$OUTPUTDIR/configure-support/generated-configure.sh"; then + # If we have a spec.gmk or configure-support/generated-configure.sh, + # we have run here before and we are OK. Otherwise, check for other files files_present=`$LS $OUTPUTDIR` # Configure has already touched config.log and confdefs.h in the current dir when this check # is performed. @@ -375,8 +375,9 @@ AC_MSG_NOTICE([Current directory is $CONFIGURE_START_DIR.]) AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here]) AC_MSG_NOTICE([(as opposed to creating a configuration in /build/).]) - AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could]) - AC_MSG_NOTICE([seriously mess up just about everything.]) + AC_MSG_NOTICE([However, this directory is not empty, additionally to some allowed files]) + AC_MSG_NOTICE([it contains $filtered_files.]) + AC_MSG_NOTICE([This is not allowed, since it could seriously mess up just about everything.]) AC_MSG_NOTICE([Try 'cd $TOPDIR' and restart configure]) AC_MSG_NOTICE([(or create a new empty directory and cd to it).]) AC_MSG_ERROR([Will not continue creating configuration in $CONFIGURE_START_DIR]) diff -Nru openjdk-17-17.0.9+9/make/autoconf/configure.ac openjdk-17-17.0.10+7/make/autoconf/configure.ac --- openjdk-17-17.0.9+9/make/autoconf/configure.ac 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/configure.ac 2024-01-09 21:18:15.000000000 +0000 @@ -191,18 +191,15 @@ TOOLCHAIN_SETUP_BUILD_COMPILERS TOOLCHAIN_MISC_CHECKS -# Setup the JTReg Regression Test Harness. -TOOLCHAIN_SETUP_JTREG - -# Setup the Java Microbenchmark Harness (JMH) -LIB_TESTS_SETUP_JMH - -# Setup Jib dependency tool -TOOLCHAIN_SETUP_JIB - # After toolchain setup, we need to process some flags to be able to continue. FLAGS_POST_TOOLCHAIN +# Setup the tools needed to test the JDK (JTReg Regression Test Harness, +# Java Microbenchmark Harness (JMH) and the Jib dependency tool). +LIB_TESTS_SETUP_JTREG +LIB_TESTS_SETUP_JMH +LIB_TESTS_SETUP_JIB + # Now we can test some aspects on the target using configure macros. PLATFORM_SETUP_OPENJDK_TARGET_BITS PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS @@ -244,7 +241,8 @@ # ############################################################################### -JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER +LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER + JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST JDKOPT_EXCLUDE_TRANSLATIONS JDKOPT_ENABLE_DISABLE_MANPAGES diff -Nru openjdk-17-17.0.9+9/make/autoconf/jdk-options.m4 openjdk-17-17.0.10+7/make/autoconf/jdk-options.m4 --- openjdk-17-17.0.9+9/make/autoconf/jdk-options.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/jdk-options.m4 2024-01-09 21:18:15.000000000 +0000 @@ -502,29 +502,6 @@ ################################################################################ # -# Check if building of the jtreg failure handler should be enabled. -# -AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER], -[ - UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto, - RESULT: BUILD_FAILURE_HANDLER, - DESC: [enable building of the jtreg failure handler], - DEFAULT_DESC: [enabled if jtreg is present], - CHECKING_MSG: [if the jtreg failure handler should be built], - CHECK_AVAILABLE: [ - AC_MSG_CHECKING([if the jtreg failure handler is available]) - if test "x$JT_HOME" != "x"; then - AC_MSG_RESULT([yes]) - else - AVAILABLE=false - AC_MSG_RESULT([no (jtreg not present)]) - fi - ]) - AC_SUBST(BUILD_FAILURE_HANDLER) -]) - -################################################################################ -# # Enable or disable generation of the classlist at build time # AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST], @@ -748,6 +725,9 @@ $RM "$CODESIGN_TESTFILE" $TOUCH "$CODESIGN_TESTFILE" CODESIGN_SUCCESS=false + + $ECHO "check codesign, calling $CODESIGN $PARAMS $CODESIGN_TESTFILE" >&AS_MESSAGE_LOG_FD + eval \"$CODESIGN\" $PARAMS \"$CODESIGN_TESTFILE\" 2>&AS_MESSAGE_LOG_FD \ >&AS_MESSAGE_LOG_FD && CODESIGN_SUCCESS=true $RM "$CODESIGN_TESTFILE" diff -Nru openjdk-17-17.0.9+9/make/autoconf/lib-tests.m4 openjdk-17-17.0.10+7/make/autoconf/lib-tests.m4 --- openjdk-17-17.0.9+9/make/autoconf/lib-tests.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/lib-tests.m4 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 2022, 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 @@ -23,6 +23,13 @@ # questions. # +################################################################################ +# Setup libraries and functionalities needed to test the JDK. +################################################################################ + +# Minimum supported version +JTREG_MINIMUM_VERSION=7.3.1 + ############################################################################### # # Setup and check for gtest framework source files @@ -47,9 +54,25 @@ AC_MSG_RESULT([no]) AC_MSG_ERROR([Can't find 'googlemock/include/gmock/gmock.h' under ${with_gtest} given with the --with-gtest option.]) else - GTEST_FRAMEWORK_SRC=${with_gtest} + GTEST_FRAMEWORK_SRC=$with_gtest AC_MSG_RESULT([$GTEST_FRAMEWORK_SRC]) UTIL_FIXUP_PATH([GTEST_FRAMEWORK_SRC]) + + # Try to verify version. We require 1.8.1, but this can not be directly + # determined. :-( Instead, there are different, incorrect version + # numbers we can look for. + GTEST_VERSION_1="`$GREP GOOGLETEST_VERSION $GTEST_FRAMEWORK_SRC/CMakeLists.txt | $SED -E -e 's/set\(GOOGLETEST_VERSION (.*)\)/\1/'`" + if test "x$GTEST_VERSION_1" != "x1.9.0"; then + AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.8.1]) + fi + + # We cannot grep for "AC_IN*T" as a literal since then m4 will treat it as a macro + # and expand it. + # Additional [] needed to keep m4 from mangling shell constructs. + [ GTEST_VERSION_2="`$GREP -A1 ^.C_INIT $GTEST_FRAMEWORK_SRC/configure.ac | $TAIL -n 1 | $SED -E -e 's/ +\[(.*)],/\1/'`" ] + if test "x$GTEST_VERSION_2" != "x1.8.0"; then + AC_MSG_ERROR([gtest at $GTEST_FRAMEWORK_SRC does not seem to be version 1.8.1 B]) + fi fi fi fi @@ -118,3 +141,163 @@ AC_SUBST(JMH_COMMONS_MATH_JAR) AC_SUBST(JMH_VERSION) ]) + +# Setup the JTReg Regression Test Harness. +AC_DEFUN_ONCE([LIB_TESTS_SETUP_JTREG], +[ + AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], + [Regression Test Harness @<:@probed@:>@])]) + + if test "x$with_jtreg" = xno; then + # jtreg disabled + AC_MSG_CHECKING([for jtreg test harness]) + AC_MSG_RESULT([no, disabled]) + elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then + if test -d "$with_jtreg"; then + # An explicit path is specified, use it. + JT_HOME="$with_jtreg" + else + case "$with_jtreg" in + *.zip ) + JTREG_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/jtreg + $RM -rf $JTREG_SUPPORT_DIR + $MKDIR -p $JTREG_SUPPORT_DIR + $UNZIP -qq -d $JTREG_SUPPORT_DIR $with_jtreg + + # Try to find jtreg to determine JT_HOME path + JTREG_PATH=`$FIND $JTREG_SUPPORT_DIR | $GREP "/bin/jtreg"` + if test "x$JTREG_PATH" != x; then + JT_HOME=$($DIRNAME $($DIRNAME $JTREG_PATH)) + fi + ;; + * ) + ;; + esac + fi + UTIL_FIXUP_PATH([JT_HOME]) + if test ! -d "$JT_HOME"; then + AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist]) + fi + + if test ! -e "$JT_HOME/lib/jtreg.jar"; then + AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home]) + fi + + AC_MSG_CHECKING([for jtreg test harness]) + AC_MSG_RESULT([$JT_HOME]) + else + # Try to locate jtreg using the JT_HOME environment variable + if test "x$JT_HOME" != x; then + # JT_HOME set in environment, use it + if test ! -d "$JT_HOME"; then + AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME]) + JT_HOME= + else + if test ! -e "$JT_HOME/lib/jtreg.jar"; then + AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME]) + JT_HOME= + else + AC_MSG_NOTICE([Located jtreg using JT_HOME from environment]) + fi + fi + fi + + if test "x$JT_HOME" = x; then + # JT_HOME is not set in environment, or was deemed invalid. + # Try to find jtreg on path + UTIL_LOOKUP_PROGS(JTREGEXE, jtreg) + if test "x$JTREGEXE" != x; then + # That's good, now try to derive JT_HOME + JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)` + if test ! -e "$JT_HOME/lib/jtreg.jar"; then + AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found]) + JT_HOME= + else + AC_MSG_NOTICE([Located jtreg using jtreg executable in path]) + fi + fi + fi + + AC_MSG_CHECKING([for jtreg test harness]) + if test "x$JT_HOME" != x; then + AC_MSG_RESULT([$JT_HOME]) + else + AC_MSG_RESULT([no, not found]) + + if test "x$with_jtreg" = xyes; then + AC_MSG_ERROR([--with-jtreg was specified, but no jtreg found.]) + fi + fi + fi + + UTIL_FIXUP_PATH(JT_HOME) + AC_SUBST(JT_HOME) + + # Verify jtreg version + if test "x$JT_HOME" != x; then + AC_MSG_CHECKING([jtreg version number]) + # jtreg -version looks like this: "jtreg 6.1+1-19" + # Extract actual version part ("6.1" in this case) + jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2` + jtreg_version=${jtreg_version_full/%+*} + AC_MSG_RESULT([$jtreg_version]) + + # This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION + comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"` + comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"` + if test $comparable_actual_version -lt $comparable_minimum_version ; then + AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required]) + fi + fi +]) + +# Setup the JIB dependency resolver +AC_DEFUN_ONCE([LIB_TESTS_SETUP_JIB], +[ + AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib], + [Jib dependency management tool @<:@not used@:>@])]) + + if test "x$with_jib" = xno || test "x$with_jib" = x; then + # jib disabled + AC_MSG_CHECKING([for jib]) + AC_MSG_RESULT(no) + elif test "x$with_jib" = xyes; then + AC_MSG_ERROR([Must supply a value to --with-jib]) + else + JIB_HOME="${with_jib}" + AC_MSG_CHECKING([for jib]) + AC_MSG_RESULT(${JIB_HOME}) + if test ! -d "${JIB_HOME}"; then + AC_MSG_ERROR([--with-jib must be a directory]) + fi + JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar) + if test ! -f "${JIB_JAR}"; then + AC_MSG_ERROR([Could not find jib jar file in ${JIB_HOME}]) + fi + fi + + AC_SUBST(JIB_HOME) +]) + +################################################################################ +# +# Check if building of the jtreg failure handler should be enabled. +# +AC_DEFUN_ONCE([LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER], +[ + UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto, + RESULT: BUILD_FAILURE_HANDLER, + DESC: [enable building of the jtreg failure handler], + DEFAULT_DESC: [enabled if jtreg is present], + CHECKING_MSG: [if the jtreg failure handler should be built], + CHECK_AVAILABLE: [ + AC_MSG_CHECKING([if the jtreg failure handler is available]) + if test "x$JT_HOME" != "x"; then + AC_MSG_RESULT([yes]) + else + AVAILABLE=false + AC_MSG_RESULT([no (jtreg not present)]) + fi + ]) + AC_SUBST(BUILD_FAILURE_HANDLER) +]) diff -Nru openjdk-17-17.0.9+9/make/autoconf/lib-x11.m4 openjdk-17-17.0.10+7/make/autoconf/lib-x11.m4 --- openjdk-17-17.0.9+9/make/autoconf/lib-x11.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/lib-x11.m4 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2022, 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 @@ -35,6 +35,7 @@ X_CFLAGS= X_LIBS= else + x_libraries_orig="$x_libraries" if test "x${with_x}" = xno; then AC_MSG_ERROR([It is not possible to disable the use of X11. Remove the --without-x option.]) @@ -48,6 +49,7 @@ fi if test "x$x_libraries" = xNONE; then x_libraries="${with_x}/lib" + x_libraries_orig="$x_libraries" fi else # Check if the user has specified sysroot, but not --with-x, --x-includes or --x-libraries. @@ -82,8 +84,8 @@ AC_PATH_XTRA # AC_PATH_XTRA creates X_LIBS and sometimes adds -R flags. When cross compiling - # this doesn't make sense so we remove it. - if test "x$COMPILE_TYPE" = xcross; then + # this doesn't make sense so we remove it; same for sysroot (devkit). + if test "x$COMPILE_TYPE" = xcross || (test "x$SYSROOT" != "x" && test "x$x_libraries_orig" = xNONE); then X_LIBS=`$ECHO $X_LIBS | $SED 's/-R \{0,1\}[[^ ]]*//g'` fi diff -Nru openjdk-17-17.0.9+9/make/autoconf/libraries.m4 openjdk-17-17.0.10+7/make/autoconf/libraries.m4 --- openjdk-17-17.0.9+9/make/autoconf/libraries.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/libraries.m4 2024-01-09 21:18:15.000000000 +0000 @@ -146,12 +146,6 @@ fi fi - # Because RISC-V only has word-sized atomics, it requries libatomic where - # other common architectures do not. So link libatomic by default. - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xriscv64; then - BASIC_JVM_LIBS="$BASIC_JVM_LIBS -latomic" - fi - # perfstat lib if test "x$OPENJDK_TARGET_OS" = xaix; then BASIC_JVM_LIBS="$BASIC_JVM_LIBS -lperfstat" diff -Nru openjdk-17-17.0.9+9/make/autoconf/platform.m4 openjdk-17-17.0.10+7/make/autoconf/platform.m4 --- openjdk-17-17.0.9+9/make/autoconf/platform.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/platform.m4 2024-01-09 21:18:15.000000000 +0000 @@ -573,6 +573,8 @@ HOTSPOT_$1_CPU_DEFINE=S390 elif test "x$OPENJDK_$1_CPU" = xs390x; then HOTSPOT_$1_CPU_DEFINE=S390 + elif test "x$OPENJDK_$1_CPU" = xloongarch64; then + HOTSPOT_$1_CPU_DEFINE=LOONGARCH64 elif test "x$OPENJDK_$1_CPU" != x; then HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z) fi diff -Nru openjdk-17-17.0.9+9/make/autoconf/toolchain.m4 openjdk-17-17.0.10+7/make/autoconf/toolchain.m4 --- openjdk-17-17.0.9+9/make/autoconf/toolchain.m4 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/autoconf/toolchain.m4 2024-01-09 21:18:15.000000000 +0000 @@ -58,9 +58,6 @@ # Minimum supported linker versions, empty means unspecified TOOLCHAIN_MINIMUM_LD_VERSION_gcc="2.18" -# Minimum supported version -JTREG_MINIMUM_VERSION=6.1 - # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called. # Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER. # $1 - optional variable prefix for compiler and version variables (BUILD_) @@ -994,140 +991,3 @@ fi AC_SUBST(HOTSPOT_TOOLCHAIN_TYPE) ]) - -# Setup the JTReg Regression Test Harness. -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], -[ - AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], - [Regression Test Harness @<:@probed@:>@])]) - - if test "x$with_jtreg" = xno; then - # jtreg disabled - AC_MSG_CHECKING([for jtreg test harness]) - AC_MSG_RESULT([no, disabled]) - elif test "x$with_jtreg" != xyes && test "x$with_jtreg" != x; then - if test -d "$with_jtreg"; then - # An explicit path is specified, use it. - JT_HOME="$with_jtreg" - else - case "$with_jtreg" in - *.zip ) - JTREG_SUPPORT_DIR=$CONFIGURESUPPORT_OUTPUTDIR/jtreg - $RM -rf $JTREG_SUPPORT_DIR - $MKDIR -p $JTREG_SUPPORT_DIR - $UNZIP -qq -d $JTREG_SUPPORT_DIR $with_jtreg - - # Try to find jtreg to determine JT_HOME path - JTREG_PATH=`$FIND $JTREG_SUPPORT_DIR | $GREP "/bin/jtreg"` - if test "x$JTREG_PATH" != x; then - JT_HOME=$($DIRNAME $($DIRNAME $JTREG_PATH)) - fi - ;; - * ) - ;; - esac - fi - UTIL_FIXUP_PATH([JT_HOME]) - if test ! -d "$JT_HOME"; then - AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg does not exist]) - fi - - if test ! -e "$JT_HOME/lib/jtreg.jar"; then - AC_MSG_ERROR([jtreg home directory from --with-jtreg=$with_jtreg is not a valid jtreg home]) - fi - - AC_MSG_CHECKING([for jtreg test harness]) - AC_MSG_RESULT([$JT_HOME]) - else - # Try to locate jtreg using the JT_HOME environment variable - if test "x$JT_HOME" != x; then - # JT_HOME set in environment, use it - if test ! -d "$JT_HOME"; then - AC_MSG_WARN([Ignoring JT_HOME pointing to invalid directory: $JT_HOME]) - JT_HOME= - else - if test ! -e "$JT_HOME/lib/jtreg.jar"; then - AC_MSG_WARN([Ignoring JT_HOME which is not a valid jtreg home: $JT_HOME]) - JT_HOME= - else - AC_MSG_NOTICE([Located jtreg using JT_HOME from environment]) - fi - fi - fi - - if test "x$JT_HOME" = x; then - # JT_HOME is not set in environment, or was deemed invalid. - # Try to find jtreg on path - UTIL_LOOKUP_PROGS(JTREGEXE, jtreg) - if test "x$JTREGEXE" != x; then - # That's good, now try to derive JT_HOME - JT_HOME=`(cd $($DIRNAME $JTREGEXE)/.. && pwd)` - if test ! -e "$JT_HOME/lib/jtreg.jar"; then - AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found]) - JT_HOME= - else - AC_MSG_NOTICE([Located jtreg using jtreg executable in path]) - fi - fi - fi - - AC_MSG_CHECKING([for jtreg test harness]) - if test "x$JT_HOME" != x; then - AC_MSG_RESULT([$JT_HOME]) - else - AC_MSG_RESULT([no, not found]) - - if test "x$with_jtreg" = xyes; then - AC_MSG_ERROR([--with-jtreg was specified, but no jtreg found.]) - fi - fi - fi - - UTIL_FIXUP_PATH(JT_HOME) - AC_SUBST(JT_HOME) - - # Verify jtreg version - if test "x$JT_HOME" != x; then - AC_MSG_CHECKING([jtreg version number]) - # jtreg -version looks like this: "jtreg 6.1+1-19" - # Extract actual version part ("6.1" in this case) - jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2` - jtreg_version=${jtreg_version_full/%+*} - AC_MSG_RESULT([$jtreg_version]) - - # This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION - comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"` - comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"` - if test $comparable_actual_version -lt $comparable_minimum_version ; then - AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required]) - fi - fi -]) - -# Setup the JIB dependency resolver -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JIB], -[ - AC_ARG_WITH(jib, [AS_HELP_STRING([--with-jib], - [Jib dependency management tool @<:@not used@:>@])]) - - if test "x$with_jib" = xno || test "x$with_jib" = x; then - # jib disabled - AC_MSG_CHECKING([for jib]) - AC_MSG_RESULT(no) - elif test "x$with_jib" = xyes; then - AC_MSG_ERROR([Must supply a value to --with-jib]) - else - JIB_HOME="${with_jib}" - AC_MSG_CHECKING([for jib]) - AC_MSG_RESULT(${JIB_HOME}) - if test ! -d "${JIB_HOME}"; then - AC_MSG_ERROR([--with-jib must be a directory]) - fi - JIB_JAR=$(ls ${JIB_HOME}/lib/jib-*.jar) - if test ! -f "${JIB_JAR}"; then - AC_MSG_ERROR([Could not find jib jar file in ${JIB_HOME}]) - fi - fi - - AC_SUBST(JIB_HOME) -]) diff -Nru openjdk-17-17.0.9+9/make/conf/github-actions.conf openjdk-17-17.0.10+7/make/conf/github-actions.conf --- openjdk-17-17.0.9+9/make/conf/github-actions.conf 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/conf/github-actions.conf 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ # Versions and download locations for dependencies used by GitHub Actions (GHA) GTEST_VERSION=1.8.1 -JTREG_VERSION=6.1+3 +JTREG_VERSION=7.3.1+1 LINUX_X64_BOOT_JDK_EXT=tar.gz LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.6%2B10/OpenJDK17U-jdk_x64_linux_hotspot_17.0.6_10.tar.gz diff -Nru openjdk-17-17.0.9+9/make/conf/jib-profiles.js openjdk-17-17.0.10+7/make/conf/jib-profiles.js --- openjdk-17-17.0.9+9/make/conf/jib-profiles.js 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/conf/jib-profiles.js 2024-01-09 21:18:15.000000000 +0000 @@ -917,10 +917,7 @@ target_os: input.build_os, target_cpu: input.build_cpu, dependencies: [ "jtreg", "gnumake", "boot_jdk", "devkit", "jib" ], - labels: "test", - environment: { - "JT_JAVA": common.boot_jdk_home - } + labels: "test" } }; profiles = concatObjects(profiles, testOnlyProfiles); @@ -1156,9 +1153,9 @@ jtreg: { server: "jpg", product: "jtreg", - version: "6", + version: "7.3.1", build_number: "1", - file: "bundles/jtreg-6+1.zip", + file: "bundles/jtreg-7.3.1+1.zip", environment_name: "JT_HOME", environment_path: input.get("jtreg", "home_path") + "/bin", configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"), diff -Nru openjdk-17-17.0.9+9/make/conf/version-numbers.conf openjdk-17-17.0.10+7/make/conf/version-numbers.conf --- openjdk-17-17.0.9+9/make/conf/version-numbers.conf 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/conf/version-numbers.conf 2024-01-09 21:18:15.000000000 +0000 @@ -28,12 +28,12 @@ DEFAULT_VERSION_FEATURE=17 DEFAULT_VERSION_INTERIM=0 -DEFAULT_VERSION_UPDATE=9 +DEFAULT_VERSION_UPDATE=10 DEFAULT_VERSION_PATCH=0 DEFAULT_VERSION_EXTRA1=0 DEFAULT_VERSION_EXTRA2=0 DEFAULT_VERSION_EXTRA3=0 -DEFAULT_VERSION_DATE=2023-10-17 +DEFAULT_VERSION_DATE=2024-01-16 DEFAULT_VERSION_CLASSFILE_MAJOR=61 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`" DEFAULT_VERSION_CLASSFILE_MINOR=0 DEFAULT_VERSION_DOCS_API_SINCE=11 diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/digicertcseccrootg5 openjdk-17-17.0.10+7/make/data/cacerts/digicertcseccrootg5 --- openjdk-17-17.0.9+9/make/data/cacerts/digicertcseccrootg5 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/digicertcseccrootg5 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,21 @@ +Owner: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Serial number: 3698fe712d519f3ced0fdb7b1643011 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICFjCCAZ2gAwIBAgIQA2mP5xLVGfPO0P23sWQwETAKBggqhkjOPQQDAzBNMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERp +Z2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWhcNNDYw +MTE0MjM1OTU5WjBNMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIElu +Yy4xJTAjBgNVBAMTHERpZ2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwdjAQBgcq +hkjOPQIBBgUrgQQAIgNiAAR/FK2Ftpf9AiE1TWDoOJOTmz0FEG2v0/7v+rv7c5nz +7DISjcdouIveiaKIVHeNuyF+M5VWlgno1YyhBLibbhkAYuhCKKZYN4QZVSZ7Mzdn +8ppyraGurgBCPBx+uHqeIZyjQjBAMB0GA1UdDgQWBBTwjJhxOThlwjobphdmHcjt +Zd6SNjAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQD +AwNnADBkAjAjb+EAGSZQ5EYgZYs3p8/rBuHMMskqoewyDXOiHgIcNWEqTmmrOXft +l4jAfWvqid0CMEPx0VijdT6Gm7ZVEYsX9z3+CmnFf07GdRtalMvqERHGCCKI3tB6 +oqV56OMhp80Tsw== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/digicertcsrsarootg5 openjdk-17-17.0.10+7/make/data/cacerts/digicertcsrsarootg5 --- openjdk-17-17.0.9+9/make/data/cacerts/digicertcsrsarootg5 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/digicertcsrsarootg5 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,38 @@ +Owner: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Serial number: 6cee131be6d55c807f7c0c7fb44e620 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFZDCCA0ygAwIBAgIQBs7hMb5tVcgH98DH+0TmIDANBgkqhkiG9w0BAQwFADBM +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJDAiBgNVBAMT +G0RpZ2lDZXJ0IENTIFJTQTQwOTYgUm9vdCBHNTAeFw0yMTAxMTUwMDAwMDBaFw00 +NjAxMTQyMzU5NTlaMEwxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwg +SW5jLjEkMCIGA1UEAxMbRGlnaUNlcnQgQ1MgUlNBNDA5NiBSb290IEc1MIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtjNzgNhiA3AULBEcOV58rnyDhh3+ +Ji9MJK2L6oNfqbw9W/wLmEwCRzDs4v7s6DRbZl6/O9cspiX/jFmz3+rafCnZRlBy +CB1u0RsK3R/NmYn6Dw9zxOGcHXUyzW+X2ipqlbJsyQnQ6gt7fRcGSZnv1t7gyFPU +rsZ38Ya7Ixy4wN9Z94590e+C5iaLWji1/3XVstlPCfM3iFDaEaSKFBTRUwQAffNq +RBj+UHAyBxyomg46HcUKH24LJmm3PKJXcCyG+kxulalYQ7msEtb/P+3XQxdrTM6e +xJCr//oQUJqjkFfW54wQrp8WGs81HX/Xdu2KnDWnKLinXSH8MDfd3ggZTxXG56ba +kEeO95RTTI5TAr79meXqhtCvAwLTm6qT8asojiAB/0z7zLcpQPWHpBITBR9DbtdR +UJ84tCDtFwkSj8y5Ga+fzb5pEdOvVRBtF4Z5llLGsgCd5a84sDX0iGuPDgQ9fO6v +zdNqEErGzYbKIj2hSlz7Dv+I31xip8C5HtmsbH44N/53kyXChYpPtTcGWgaBFPHO +lJ2ZkeoyWs5nPW4EZq0MTy2jLvee9Xid9wr9fo/jQopVlrzxnzct/J5flf6MGBv8 +jv1LkK/XA2gSY6zik6eiywTlT2TOA/rGFJ/Zi+jM1GKMa+QALBmfGgbGMYFU+1Mk +mq9Vmbqdda64wt0CAwEAAaNCMEAwHQYDVR0OBBYEFGgBk7HSSkBCaZRGLBxaiKkl +tEdPMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +DAUAA4ICAQCS/O64AnkXAlF9IcVJZ6ek8agkOOsMaOpaQmuc9HPBaUotszcFUEKY +kp4GeSwuBpn2798roM2zkgGDtaDLJ7U8IxqYSaLsLZmlWUOs0rGT1lfXHLyT1sZA +4bNvGVW3E9flQzOktavL2sExZA101iztw41u67uvGUdhYS3A9AW5b3jcOvdCQGVT +kb2ZDZOSVKapN1krm8uZxrw99wSE8JQzHQ+CWjnLLkXDKBmjspuYyPwxa2CP9umG +KLzgPH10XRaJW2kkxxCLxEu7Nk/UWT/DsKSRmfgu0UoBnfWIEu+/WhFqWU9Za1pn +84+0Ew/A2C89KHKqGX8RfWpbn5XnX7eUT/E+oVr/Lcyd3yd3jzJzHGcKdvP6XLG/ +vB29DCibsscXZwszD8O9Ntz7ukILq+2Ew2LWhBapsQdrqW7uxs/msEQpwvCzYYAq +i2/SFFwlh1Rk86RMwaH4p2vq/uo6/HnbDo/cxvPJ1Gze6YOhjh0i7Mk6sgB73Dun +Qhp/3IupET2Op8Agb10JXUNE5o9mzKlbB/Hvm3oOs1ThlP0OLMaT11X9cZg1uAlK +/8YpKCz2Ui3bFBiSJ+IWfozK1GG+goeR65g3P79fXXc/NKwbOEOraHKZMh46Ghml +ozhMI9ej58zVKpIXkAtaS70WvfuGauKJmezkoFUYyaMIHxPgMghy0A== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/digicerttlseccrootg5 openjdk-17-17.0.10+7/make/data/cacerts/digicerttlseccrootg5 --- openjdk-17-17.0.9+9/make/data/cacerts/digicerttlseccrootg5 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/digicerttlseccrootg5 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,21 @@ +Owner: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert TLS ECC P384 Root G5, O="DigiCert, Inc.", C=US +Serial number: 9e09365acf7d9c8b93e1c0b042a2ef3 +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICGTCCAZ+gAwIBAgIQCeCTZaz32ci5PhwLBCou8zAKBggqhkjOPQQDAzBOMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJjAkBgNVBAMTHURp +Z2lDZXJ0IFRMUyBFQ0MgUDM4NCBSb290IEc1MB4XDTIxMDExNTAwMDAwMFoXDTQ2 +MDExNDIzNTk1OVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJ +bmMuMSYwJAYDVQQDEx1EaWdpQ2VydCBUTFMgRUNDIFAzODQgUm9vdCBHNTB2MBAG +ByqGSM49AgEGBSuBBAAiA2IABMFEoc8Rl1Ca3iOCNQfN0MsYndLxf3c1TzvdlHJS +7cI7+Oz6e2tYIOyZrsn8aLN1udsJ7MgT9U7GCh1mMEy7H0cKPGEQQil8pQgO4CLp +0zVozptjn4S1mU1YoI71VOeVyaNCMEAwHQYDVR0OBBYEFMFRRVBZqz7nLFr6ICIS +B4CIfBFqMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49 +BAMDA2gAMGUCMQCJao1H5+z8blUD2WdsJk6Dxv3J+ysTvLd6jLRl0mlpYxNjOyZQ +LgGheQaRnUi/wr4CMEfDFXuxoJGZSZOoPHzoRgaLLPIxAJSdYsiJvRmEFOml+wG4 +DXZDjC5Ty3zfDBeWUA== +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/digicerttlsrsarootg5 openjdk-17-17.0.10+7/make/data/cacerts/digicerttlsrsarootg5 --- openjdk-17-17.0.9+9/make/data/cacerts/digicerttlsrsarootg5 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/digicerttlsrsarootg5 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,38 @@ +Owner: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Issuer: CN=DigiCert TLS RSA4096 Root G5, O="DigiCert, Inc.", C=US +Serial number: 8f9b478a8fa7eda6a333789de7ccf8a +Valid from: Fri Jan 15 00:00:00 GMT 2021 until: Sun Jan 14 23:59:59 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCPm0eKj6ftpqMzeJ3nzPijANBgkqhkiG9w0BAQwFADBN +MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMT +HERpZ2lDZXJ0IFRMUyBSU0E0MDk2IFJvb3QgRzUwHhcNMjEwMTE1MDAwMDAwWhcN +NDYwMTE0MjM1OTU5WjBNMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQs +IEluYy4xJTAjBgNVBAMTHERpZ2lDZXJ0IFRMUyBSU0E0MDk2IFJvb3QgRzUwggIi +MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz0PTJeRGd/fxmgefM1eS87IE+ +ajWOLrfn3q/5B03PMJ3qCQuZvWxX2hhKuHisOjmopkisLnLlvevxGs3npAOpPxG0 +2C+JFvuUAT27L/gTBaF4HI4o4EXgg/RZG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SYZ4Y1b+qOTEZvpyDrDVWiakuFSdjjo4bq9+0/V77PnSIMx8IIh47a+ +p6tv75/fTM8BuGJqIz3nCU2AG3swpMPdB380vqQmsvZB6Akd4yCYqjdP//fx4ilw +MUc/dNAUFvohigLVigmUdy7yWSiLfFCSCmZ4OIN1xLVaqBHG5cGdZlXPU8Sv13WF +qUITVuwhd4GTWgzqltlJyqEI8pc7bZsEGCREjnwB8twl2F6GmrE52/WRMmrRpnCK +ovfepEWFJqgejF0pW8hL2JpqA15w8oVPbEtoL8pU9ozaMv7Da4M/OMZ+ +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/emsigneccrootcag3 openjdk-17-17.0.10+7/make/data/cacerts/emsigneccrootcag3 --- openjdk-17-17.0.9+9/make/data/cacerts/emsigneccrootcag3 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/emsigneccrootcag3 2024-01-09 21:18:15.000000000 +0000 @@ -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----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/emsignrootcag1 openjdk-17-17.0.10+7/make/data/cacerts/emsignrootcag1 --- openjdk-17-17.0.9+9/make/data/cacerts/emsignrootcag1 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/emsignrootcag1 2024-01-09 21:18:15.000000000 +0000 @@ -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----- +MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQ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MjNYBBjWzEN3uBL4ChQEKF6dk4jeihU80Bv2noWgby +RQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx +iN66zB+Afko= +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/emsignrootcag2 openjdk-17-17.0.10+7/make/data/cacerts/emsignrootcag2 --- openjdk-17-17.0.9+9/make/data/cacerts/emsignrootcag2 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/emsignrootcag2 2024-01-09 21:18:15.000000000 +0000 @@ -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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skOvl3es2EcHytbS9c9P+0z +Mpka7zGC1FHrvLb/FoduH86TeZt0QjZ6pcplNzoaxDnDvzTJ6CC2Eny+qH/APFCu +VUv5/wjwF+HPm8Pup2ARj9cEp92+0qcerfHacNq5hMeGZdbA/dzdUR/5z5zXdxAk +nl8mcfGb0eMNSTXQmmB/i4AecNnr72uYjzlaXUGYN7Nrb6XouG0pnh0/BBtWWp0U +ShIPpWEAqs7RJBj6+1ZUYXZ4ObrCw962DxhN2p19Hxw9LtuUUcLqqTPrFXYvwO4t +ouj7KJnAkaTUfXGdEaFVtFig1EA30WzJY2X1vAQ7hVnniCjgaXAGqjsU6sklNM9n +xDx5rFCCCEtj9Kh8UHjGK2QqgP5kwgttjOApQMaCoezMfK4KD7WpOXU= +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/letsencryptisrgx2 openjdk-17-17.0.10+7/make/data/cacerts/letsencryptisrgx2 --- openjdk-17-17.0.9+9/make/data/cacerts/letsencryptisrgx2 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/letsencryptisrgx2 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,21 @@ +Owner: CN=ISRG Root X2, O=Internet Security Research Group, C=US +Issuer: CN=ISRG Root X2, O=Internet Security Research Group, C=US +Serial number: 41d29dd172eaeea780c12c6ce92f8752 +Valid from: Fri Sep 04 00:00:00 GMT 2020 until: Mon Sep 17 16:00:00 GMT 2040 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw +CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg +R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00 +MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT +ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw +EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW ++1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9 +ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI +zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW +tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1 +/q4AaOeMSQ+2b1tbFfLn +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/data/cacerts/teliarootcav2 openjdk-17-17.0.10+7/make/data/cacerts/teliarootcav2 --- openjdk-17-17.0.9+9/make/data/cacerts/teliarootcav2 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/make/data/cacerts/teliarootcav2 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,39 @@ +Owner: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI +Issuer: CN=Telia Root CA v2, O=Telia Finland Oyj, C=FI +Serial number: 1675f27d6fe7ae3e4acbe095b059e +Valid from: Thu Nov 29 11:55:54 GMT 2018 until: Sun Nov 29 11:55:54 GMT 2043 +Signature algorithm name: SHA256withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIPAWdfJ9b+euPkrL4JWwWeMA0GCSqGSIb3DQEBCwUAMEQx +CzAJB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NVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAoDtZpwmUPjaE0n4vOaWWl/oRrfxn83EJ +8rKJhGdEr7nv7ZbsnGTbMjBvZ5qsfl+yqwE2foH65IRe0qw24GtixX1LDoJt0nZi +0f6X+J8wfBj5tFJ3gh1229MdqfDBmgC9bXXYfef6xzijnHDoRnkDry5023X4blMM +A8iZGok1GTzTyVR8qPAs5m4HeW9q4ebqkYJpCh3DflminmtGFZhb069GHWLIzoBS +SRE/yQQSwxN8PzuKlts8oB4KtItUsiRnDe+Cy748fdHif64W1lZYudogsYMVoe+K +TTJvQS8TUoKU1xrBeKJR3Stwbbca+few4GeXVtt8YVMJAygCQMez2P2ccGrGKMOF +6eLtGpOg3kuYooQ+BXcBlj37tCAPnHICehIv1aO6UXivKitEZU61/Qrowc15h2Er +3oBXRb9n8ZuRXqWk7FlIEA04x7D6w0RtBPV4UBySllva9bguulvP5fBqnUsvWHMt +Ty3EHD70sz+rFQ47GUGKpMFXEmZxTPpT41frYpUJnlTd0cI8Vzy9OK2YZLe4A5pT +VmBds9hCG1xLEooc6+t9xnppxyd/pPiL8uSUZodL6ZQHCRJ5irLrdATczvREWeAW +ysUsWNc8e89ihmpQfTU2Zqf7N+cox9jQraVplI/owd8k+BsHMYeB2F326CjYSlKA +rBPuUBQemMc= +-----END CERTIFICATE----- diff -Nru openjdk-17-17.0.9+9/make/devkit/createJMHBundle.sh openjdk-17-17.0.10+7/make/devkit/createJMHBundle.sh --- openjdk-17-17.0.9+9/make/devkit/createJMHBundle.sh 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/devkit/createJMHBundle.sh 2024-01-09 21:18:15.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash -e # -# Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2018, 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 @@ -40,10 +40,22 @@ cd $JAR_DIR rm -f * -wget https://repo.maven.apache.org/maven2/org/apache/commons/commons-math3/$COMMONS_MATH3_VERSION/commons-math3-$COMMONS_MATH3_VERSION.jar -wget https://repo.maven.apache.org/maven2/net/sf/jopt-simple/jopt-simple/$JOPT_SIMPLE_VERSION/jopt-simple-$JOPT_SIMPLE_VERSION.jar -wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-core/$JMH_VERSION/jmh-core-$JMH_VERSION.jar -wget https://repo.maven.apache.org/maven2/org/openjdk/jmh/jmh-generator-annprocess/$JMH_VERSION/jmh-generator-annprocess-$JMH_VERSION.jar +fetchJar() { + url="https://repo.maven.apache.org/maven2/$1/$2/$3/$2-$3.jar" + if command -v curl > /dev/null; then + curl -O --fail $url + elif command -v wget > /dev/null; then + wget $url + else + echo "Could not find either curl or wget" + exit 1 + fi +} + +fetchJar org/apache/commons commons-math3 $COMMONS_MATH3_VERSION +fetchJar net/sf/jopt-simple jopt-simple $JOPT_SIMPLE_VERSION +fetchJar org/openjdk/jmh jmh-core $JMH_VERSION +fetchJar org/openjdk/jmh jmh-generator-annprocess $JMH_VERSION tar -cvzf ../$BUNDLE_NAME * diff -Nru openjdk-17-17.0.9+9/make/modules/java.desktop/lib/Awt2dLibraries.gmk openjdk-17-17.0.10+7/make/modules/java.desktop/lib/Awt2dLibraries.gmk --- openjdk-17-17.0.9+9/make/modules/java.desktop/lib/Awt2dLibraries.gmk 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/modules/java.desktop/lib/Awt2dLibraries.gmk 2024-01-09 21:18:15.000000000 +0000 @@ -461,7 +461,7 @@ LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc HARFBUZZ_DISABLED_WARNINGS_gcc := type-limits missing-field-initializers strict-aliasing \ - array-bounds + array-bounds parentheses # 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 \ diff -Nru openjdk-17-17.0.9+9/make/modules/jdk.net/Lib.gmk openjdk-17-17.0.10+7/make/modules/jdk.net/Lib.gmk --- openjdk-17-17.0.9+9/make/modules/jdk.net/Lib.gmk 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/modules/jdk.net/Lib.gmk 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 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 @@ -27,7 +27,7 @@ ################################################################################ -ifeq ($(call isTargetOs, linux macosx), true) +ifeq ($(call isTargetOs, linux macosx windows), true) $(eval $(call SetupJdkLibrary, BUILD_LIBEXTNET, \ NAME := extnet, \ @@ -35,8 +35,9 @@ CFLAGS := $(CFLAGS_JDKLIB), \ LDFLAGS := $(LDFLAGS_JDKLIB) \ $(call SET_SHARED_LIBRARY_ORIGIN), \ - LIBS := -ljava, \ + LIBS_unix := -ljava, \ LIBS_linux := -ljvm, \ + LIBS_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB), \ )) $(BUILD_LIBEXTNET): $(call FindLib, java.base, java) diff -Nru openjdk-17-17.0.9+9/make/test/BuildTestLib.gmk openjdk-17-17.0.10+7/make/test/BuildTestLib.gmk --- openjdk-17-17.0.9+9/make/test/BuildTestLib.gmk 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/test/BuildTestLib.gmk 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 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 @@ -36,9 +36,11 @@ $(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \ TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \ - SRC := $(TEST_LIB_SOURCE_DIR)/sun, \ + SRC := $(TEST_LIB_SOURCE_DIR)/jdk/test/whitebox/, \ BIN := $(TEST_LIB_SUPPORT)/wb_classes, \ JAR := $(TEST_LIB_SUPPORT)/wb.jar, \ + DISABLED_WARNINGS := deprecation removal preview, \ + JAVAC_FLAGS := --enable-preview, \ )) TARGETS += $(BUILD_WB_JAR) @@ -50,7 +52,14 @@ BIN := $(TEST_LIB_SUPPORT)/test-lib_classes, \ HEADERS := $(TEST_LIB_SUPPORT)/test-lib_headers, \ JAR := $(TEST_LIB_SUPPORT)/test-lib.jar, \ - DISABLED_WARNINGS := try deprecation rawtypes unchecked serial cast, \ + DISABLED_WARNINGS := try deprecation rawtypes unchecked serial cast removal preview, \ + JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \ + --add-exports java.base/jdk.internal.classfile=ALL-UNNAMED \ + --add-exports java.base/jdk.internal.classfile.attribute=ALL-UNNAMED \ + --add-exports java.base/jdk.internal.classfile.constantpool=ALL-UNNAMED \ + --add-exports java.base/jdk.internal.classfile.java.lang.constant=ALL-UNNAMED \ + --add-exports java.base/jdk.internal.module=ALL-UNNAMED \ + --enable-preview, \ )) TARGETS += $(BUILD_TEST_LIB_JAR) diff -Nru openjdk-17-17.0.9+9/make/test/JtregNativeJdk.gmk openjdk-17-17.0.10+7/make/test/JtregNativeJdk.gmk --- openjdk-17-17.0.9+9/make/test/JtregNativeJdk.gmk 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/make/test/JtregNativeJdk.gmk 2024-01-09 21:18:15.000000000 +0000 @@ -66,9 +66,11 @@ BUILD_JDK_JTREG_EXECUTABLES_LIBS_exeCallerAccessTest := jvm.lib BUILD_JDK_JTREG_EXECUTABLES_LIBS_exerevokeall := advapi32.lib BUILD_JDK_JTREG_LIBRARIES_CFLAGS_libAsyncStackWalk := /EHsc + BUILD_JDK_JTREG_LIBRARIES_LIBS_libGetXSpace := $(WIN_LIB_JAVA) else BUILD_JDK_JTREG_LIBRARIES_LIBS_libstringPlatformChars := -ljava BUILD_JDK_JTREG_LIBRARIES_LIBS_libDirectIO := -ljava + BUILD_JDK_JTREG_LIBRARIES_LIBS_libGetXSpace := -ljava BUILD_JDK_JTREG_EXCLUDE += exerevokeall.c ifeq ($(call isTargetOs, linux), true) BUILD_JDK_JTREG_LIBRARIES_LIBS_libInheritedChannel := -ljava diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/ppc/frame_ppc.inline.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/frame_ppc.inline.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/ppc/frame_ppc.inline.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/frame_ppc.inline.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -143,7 +143,6 @@ return (intptr_t*) &(get_ijava_state()->mdx); } -// Pointer beyond the "oldest/deepest" BasicObjectLock on stack. inline BasicObjectLock* frame::interpreter_frame_monitor_end() const { return (BasicObjectLock*) get_ijava_state()->monitors; } diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1933,7 +1933,7 @@ } } -// Add a InterpMonitorElem to stack (see frame_sparc.hpp). +// Add a monitor (see frame_ppc.hpp). void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty, Register Rtemp1, Register Rtemp2) { // Very-local scratch registers. diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -4045,90 +4045,78 @@ // at next monitor exit. void TemplateTable::monitorenter() { transition(atos, vtos); - __ verify_oop(R17_tos); - Register Rcurrent_monitor = R11_scratch1, - Rcurrent_obj = R12_scratch2, + Register Rcurrent_monitor = R3_ARG1, + Rcurrent_obj = R4_ARG2, Robj_to_lock = R17_tos, - Rscratch1 = R3_ARG1, - Rscratch2 = R4_ARG2, - Rscratch3 = R5_ARG3, - Rcurrent_obj_addr = R6_ARG4; + Rscratch1 = R11_scratch1, + Rscratch2 = R12_scratch2, + Rbot = R5_ARG3, + Rfree_slot = R6_ARG4; + + Label Lfound, Lallocate_new; + + __ ld(Rscratch1, _abi0(callers_sp), R1_SP); // load FP + __ li(Rfree_slot, 0); // Points to free slot or null. + + // Set up search loop - start with topmost monitor. + __ mr(Rcurrent_monitor, R26_monitor); + __ addi(Rbot, Rscratch1, -frame::ijava_state_size); // ------------------------------------------------------------------------------ // Null pointer exception. - __ null_check_throw(Robj_to_lock, -1, R11_scratch1); + __ null_check_throw(Robj_to_lock, -1, Rscratch1); - // Try to acquire a lock on the object. - // Repeat until succeeded (i.e., until monitorenter returns true). + // Check if any slot is present => short cut to allocation if not. + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ beq(CCR0, Lallocate_new); // ------------------------------------------------------------------------------ // Find a free slot in the monitor block. - Label Lfound, Lexit, Lallocate_new; - ConditionRegister found_free_slot = CCR0, - found_same_obj = CCR1, - reached_limit = CCR6; + // Note: The order of the monitors is important for C2 OSR which derives the + // unlock order from it (see comments for interpreter_frame_monitor_*). { - Label Lloop; - Register Rlimit = Rcurrent_monitor; + Label Lloop, LnotFree, Lexit; - // Set up search loop - start with topmost monitor. - __ add(Rcurrent_obj_addr, BasicObjectLock::obj_offset_in_bytes(), R26_monitor); - - __ ld(Rlimit, 0, R1_SP); - __ addi(Rlimit, Rlimit, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes() - BasicObjectLock::obj_offset_in_bytes())); // Monitor base - - // Check if any slot is present => short cut to allocation if not. - __ cmpld(reached_limit, Rcurrent_obj_addr, Rlimit); - __ bgt(reached_limit, Lallocate_new); - - // Pre-load topmost slot. - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - // The search loop. __ bind(Lloop); - // Found free slot? - __ cmpdi(found_free_slot, Rcurrent_obj, 0); - // Is this entry for same obj? If so, stop the search and take the found - // free slot or allocate a new one to enable recursive locking. - __ cmpd(found_same_obj, Rcurrent_obj, Robj_to_lock); - __ cmpld(reached_limit, Rcurrent_obj_addr, Rlimit); - __ beq(found_free_slot, Lexit); - __ beq(found_same_obj, Lallocate_new); - __ bgt(reached_limit, Lallocate_new); - // Check if last allocated BasicLockObj reached. - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - // Next iteration if unchecked BasicObjectLocks exist on the stack. - __ b(Lloop); + __ ld(Rcurrent_obj, BasicObjectLock::obj_offset_in_bytes(), Rcurrent_monitor); + // Exit if current entry is for same object; this guarantees, that new monitor + // used for recursive lock is above the older one. + __ cmpd(CCR0, Rcurrent_obj, Robj_to_lock); + __ beq(CCR0, Lexit); // recursive locking + + __ cmpdi(CCR0, Rcurrent_obj, 0); + __ bne(CCR0, LnotFree); + __ mr(Rfree_slot, Rcurrent_monitor); // remember free slot closest to the bottom + __ bind(LnotFree); + + __ addi(Rcurrent_monitor, Rcurrent_monitor, frame::interpreter_frame_monitor_size_in_bytes()); + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ bne(CCR0, Lloop); + __ bind(Lexit); } // ------------------------------------------------------------------------------ // Check if we found a free slot. - __ bind(Lexit); - - __ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size() * wordSize) - BasicObjectLock::obj_offset_in_bytes()); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size() * wordSize); - __ b(Lfound); + __ cmpdi(CCR0, Rfree_slot, 0); + __ bne(CCR0, Lfound); // We didn't find a free BasicObjLock => allocate one. - __ align(32, 12); __ bind(Lallocate_new); __ add_monitor_to_stack(false, Rscratch1, Rscratch2); - __ mr(Rcurrent_monitor, R26_monitor); - __ addi(Rcurrent_obj_addr, R26_monitor, BasicObjectLock::obj_offset_in_bytes()); + __ mr(Rfree_slot, R26_monitor); // ------------------------------------------------------------------------------ // We now have a slot to lock. __ bind(Lfound); // Increment bcp to point to the next bytecode, so exception handling for async. exceptions work correctly. - // The object has already been poped from the stack, so the expression stack looks correct. + // The object has already been popped from the stack, so the expression stack looks correct. __ addi(R14_bcp, R14_bcp, 1); - __ std(Robj_to_lock, 0, Rcurrent_obj_addr); - __ lock_object(Rcurrent_monitor, Robj_to_lock); + __ std(Robj_to_lock, BasicObjectLock::obj_offset_in_bytes(), Rfree_slot); + __ lock_object(Rfree_slot, Robj_to_lock); // Check if there's enough space on the stack for the monitors after locking. // This emits a single store. @@ -4142,46 +4130,40 @@ transition(atos, vtos); __ verify_oop(R17_tos); - Register Rcurrent_monitor = R11_scratch1, - Rcurrent_obj = R12_scratch2, + Register Rcurrent_monitor = R3_ARG1, + Rcurrent_obj = R4_ARG2, Robj_to_lock = R17_tos, - Rcurrent_obj_addr = R3_ARG1, - Rlimit = R4_ARG2; + Rscratch = R11_scratch1, + Rbot = R12_scratch2; + Label Lfound, Lillegal_monitor_state; - // Check corner case: unbalanced monitorEnter / Exit. - __ ld(Rlimit, 0, R1_SP); - __ addi(Rlimit, Rlimit, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base + __ ld(Rscratch, _abi0(callers_sp), R1_SP); // load FP + + // Set up search loop - start with topmost monitor. + __ mr(Rcurrent_monitor, R26_monitor); + __ addi(Rbot, Rscratch, -frame::ijava_state_size); // Null pointer check. - __ null_check_throw(Robj_to_lock, -1, R11_scratch1); + __ null_check_throw(Robj_to_lock, -1, Rscratch); - __ cmpld(CCR0, R26_monitor, Rlimit); - __ bgt(CCR0, Lillegal_monitor_state); + // Check corner case: unbalanced monitorEnter / Exit. + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ beq(CCR0, Lillegal_monitor_state); // Find the corresponding slot in the monitors stack section. { Label Lloop; - // Start with topmost monitor. - __ addi(Rcurrent_obj_addr, R26_monitor, BasicObjectLock::obj_offset_in_bytes()); - __ addi(Rlimit, Rlimit, BasicObjectLock::obj_offset_in_bytes()); - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - __ bind(Lloop); + __ ld(Rcurrent_obj, BasicObjectLock::obj_offset_in_bytes(), Rcurrent_monitor); // Is this entry for same obj? __ cmpd(CCR0, Rcurrent_obj, Robj_to_lock); __ beq(CCR0, Lfound); - // Check if last allocated BasicLockObj reached. - - __ ld(Rcurrent_obj, 0, Rcurrent_obj_addr); - __ cmpld(CCR0, Rcurrent_obj_addr, Rlimit); - __ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize); - - // Next iteration if unchecked BasicObjectLocks exist on the stack. - __ ble(CCR0, Lloop); + __ addi(Rcurrent_monitor, Rcurrent_monitor, frame::interpreter_frame_monitor_size_in_bytes()); + __ cmpld(CCR0, Rcurrent_monitor, Rbot); + __ bne(CCR0, Lloop); } // Fell through without finding the basic obj lock => throw up! @@ -4191,8 +4173,6 @@ __ align(32, 12); __ bind(Lfound); - __ addi(Rcurrent_monitor, Rcurrent_obj_addr, - -(frame::interpreter_frame_monitor_size() * wordSize) - BasicObjectLock::obj_offset_in_bytes()); __ unlock_object(Rcurrent_monitor); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/assembler_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/assembler_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/assembler_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/assembler_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -308,6 +308,22 @@ rdy = 0b111, // in instruction's rm field, selects dynamic rounding mode.In Rounding Mode register, Invalid. }; + // handle unaligned access + static inline uint16_t ld_c_instr(address addr) { + return Bytes::get_native_u2(addr); + } + static inline void sd_c_instr(address addr, uint16_t c_instr) { + Bytes::put_native_u2(addr, c_instr); + } + + // handle unaligned access + static inline uint32_t ld_instr(address addr) { + return Bytes::get_native_u4(addr); + } + static inline void sd_instr(address addr, uint32_t instr) { + Bytes::put_native_u4(addr, instr); + } + static inline uint32_t extract(uint32_t val, unsigned msb, unsigned lsb) { assert_cond(msb >= lsb && msb <= 31); unsigned nbits = msb - lsb + 1; @@ -332,10 +348,10 @@ unsigned mask = (1U << nbits) - 1; val <<= lsb; mask <<= lsb; - unsigned target = *(unsigned *)a; + unsigned target = ld_instr(a); target &= ~mask; target |= val; - *(unsigned *)a = target; + sd_instr(a, target); } static void patch(address a, unsigned bit, unsigned val) { @@ -1877,10 +1893,10 @@ uint16_t mask = (1U << nbits) - 1; val <<= lsb; mask <<= lsb; - uint16_t target = *(uint16_t *)a; + uint16_t target = ld_c_instr(a); target &= ~mask; target |= val; - *(uint16_t *)a = target; + sd_c_instr(a, target); } static void c_patch(address a, unsigned bit, uint16_t val) { diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -804,7 +804,7 @@ } void LIRGenerator::do_vectorizedMismatch(Intrinsic* x) { - fatal("vectorizedMismatch intrinsic is not implemented on this platform"); + ShouldNotReachHere(); } // _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -489,7 +489,9 @@ } bne(tmp3, skipch, BMSKIP); // if not equal, skipch is bad char add(result, haystack, isLL ? nlen_tmp : ch2); - ld(ch2, Address(result)); // load 8 bytes from source string + // load 8 bytes from source string + // if isLL is false then read granularity can be 2 + load_long_misaligned(ch2, Address(result), ch1, isLL ? 1 : 2); // can use ch1 as temp register here as it will be trashed by next mv anyway mv(ch1, tmp6); if (isLL) { j(BMLOOPSTR1_AFTER_LOAD); @@ -672,10 +674,30 @@ slli(tmp3, result_tmp, haystack_chr_shift); // result as tmp add(haystack, haystack, tmp3); neg(hlen_neg, tmp3); + if (AvoidUnalignedAccesses) { + // preload first value, then we will read by 1 character per loop, instead of four + // just shifting previous ch2 right by size of character in bits + add(tmp3, haystack, hlen_neg); + (this->*load_4chr)(ch2, Address(tmp3), noreg); + if (isLL) { + // need to erase 1 most significant byte in 32-bit value of ch2 + slli(ch2, ch2, 40); + srli(ch2, ch2, 32); + } else { + slli(ch2, ch2, 16); // 2 most significant bytes will be erased by this operation + } + } bind(CH1_LOOP); - add(ch2, haystack, hlen_neg); - (this->*load_4chr)(ch2, Address(ch2), noreg); + add(tmp3, haystack, hlen_neg); + if (AvoidUnalignedAccesses) { + srli(ch2, ch2, isLL ? 8 : 16); + (this->*haystack_load_1chr)(tmp3, Address(tmp3, isLL ? 3 : 6), noreg); + slli(tmp3, tmp3, isLL ? 24 : 48); + add(ch2, ch2, tmp3); + } else { + (this->*load_4chr)(ch2, Address(tmp3), noreg); + } beq(ch1, ch2, MATCH); add(hlen_neg, hlen_neg, haystack_chr_size); blez(hlen_neg, CH1_LOOP); @@ -693,10 +715,23 @@ slli(tmp3, result_tmp, haystack_chr_shift); add(haystack, haystack, tmp3); neg(hlen_neg, tmp3); - + if (AvoidUnalignedAccesses) { + // preload first value, then we will read by 1 character per loop, instead of two + // just shifting previous ch2 right by size of character in bits + add(tmp3, haystack, hlen_neg); + (this->*haystack_load_1chr)(ch2, Address(tmp3), noreg); + slli(ch2, ch2, isLL ? 8 : 16); + } bind(CH1_LOOP); add(tmp3, haystack, hlen_neg); - (this->*load_2chr)(ch2, Address(tmp3), noreg); + if (AvoidUnalignedAccesses) { + srli(ch2, ch2, isLL ? 8 : 16); + (this->*haystack_load_1chr)(tmp3, Address(tmp3, isLL ? 1 : 2), noreg); + slli(tmp3, tmp3, isLL ? 8 : 16); + add(ch2, ch2, tmp3); + } else { + (this->*load_2chr)(ch2, Address(tmp3), noreg); + } beq(ch1, ch2, MATCH); add(hlen_neg, hlen_neg, haystack_chr_size); blez(hlen_neg, CH1_LOOP); @@ -720,7 +755,14 @@ bind(FIRST_LOOP); add(ch2, haystack, hlen_neg); - (this->*load_2chr)(ch2, Address(ch2), noreg); + if (AvoidUnalignedAccesses) { + (this->*haystack_load_1chr)(tmp2, Address(ch2, isLL ? 1 : 2), noreg); // we need a temp register, we can safely use hlen_tmp here, which is a synonym for tmp2 + (this->*haystack_load_1chr)(ch2, Address(ch2), noreg); + slli(tmp2, tmp2, isLL ? 8 : 16); + add(ch2, ch2, tmp2); + } else { + (this->*load_2chr)(ch2, Address(ch2), noreg); + } beq(first, ch2, STR1_LOOP); bind(STR2_NEXT); @@ -744,10 +786,7 @@ bind(DO1); (this->*needle_load_1chr)(ch1, Address(needle), noreg); sub(result_tmp, haystack_len, 1); - mv(tmp3, result_tmp); - if (haystack_chr_shift) { - slli(tmp3, result_tmp, haystack_chr_shift); - } + slli(tmp3, result_tmp, haystack_chr_shift); add(haystack, haystack, tmp3); neg(hlen_neg, tmp3); @@ -822,9 +861,10 @@ // load first parts of strings and finish initialization while loading { if (str1_isL == str2_isL) { // LL or UU + // check if str1 and str2 is same pointer + beq(str1, str2, DONE); // load 8 bytes once to compare ld(tmp1, Address(str1)); - beq(str1, str2, DONE); ld(tmp2, Address(str2)); mv(t0, STUB_THRESHOLD); bge(cnt2, t0, STUB); @@ -867,9 +907,8 @@ addi(cnt1, cnt1, 8); } addi(cnt2, cnt2, isUL ? 4 : 8); + bne(tmp1, tmp2, DIFFERENCE); bgez(cnt2, TAIL); - xorr(tmp3, tmp1, tmp2); - bnez(tmp3, DIFFERENCE); // main loop bind(NEXT_WORD); @@ -898,38 +937,30 @@ addi(cnt1, cnt1, 8); addi(cnt2, cnt2, 4); } - bgez(cnt2, TAIL); - - xorr(tmp3, tmp1, tmp2); - beqz(tmp3, NEXT_WORD); - j(DIFFERENCE); + bne(tmp1, tmp2, DIFFERENCE); + bltz(cnt2, NEXT_WORD); bind(TAIL); - xorr(tmp3, tmp1, tmp2); - bnez(tmp3, DIFFERENCE); - // Last longword. In the case where length == 4 we compare the - // same longword twice, but that's still faster than another - // conditional branch. if (str1_isL == str2_isL) { // LL or UU - ld(tmp1, Address(str1)); - ld(tmp2, Address(str2)); + load_long_misaligned(tmp1, Address(str1), tmp3, isLL ? 1 : 2); + load_long_misaligned(tmp2, Address(str2), tmp3, isLL ? 1 : 2); } else if (isLU) { // LU case - lwu(tmp1, Address(str1)); - ld(tmp2, Address(str2)); + load_int_misaligned(tmp1, Address(str1), tmp3, false); + load_long_misaligned(tmp2, Address(str2), tmp3, 2); inflate_lo32(tmp3, tmp1); mv(tmp1, tmp3); } else { // UL case - lwu(tmp2, Address(str2)); - ld(tmp1, Address(str1)); + load_int_misaligned(tmp2, Address(str2), tmp3, false); + load_long_misaligned(tmp1, Address(str1), tmp3, 2); inflate_lo32(tmp3, tmp2); mv(tmp2, tmp3); } bind(TAIL_CHECK); - xorr(tmp3, tmp1, tmp2); - beqz(tmp3, DONE); + beq(tmp1, tmp2, DONE); // Find the first different characters in the longwords and // compute their difference. bind(DIFFERENCE); + xorr(tmp3, tmp1, tmp2); ctzc_bit(result, tmp3, isLL); // count zero from lsb to msb srl(tmp1, tmp1, result); srl(tmp2, tmp2, result); @@ -1099,8 +1130,10 @@ // and a2 and the length in cnt1. // elem_size is the element size in bytes: either 1 or 2. // There are two implementations. For arrays >= 8 bytes, all -// comparisons (including the final one, which may overlap) are -// performed 8 bytes at a time. For strings < 8 bytes, we compare a +// comparisons (for hw supporting unaligned access: including the final one, +// which may overlap) are performed 8 bytes at a time. +// For strings < 8 bytes (and for tails of long strings when +// AvoidUnalignedAccesses is true), we compare a // halfword, then a short, and then a byte. void C2_MacroAssembler::string_equals(Register a1, Register a2, @@ -1111,10 +1144,11 @@ Register tmp2 = t1; assert(elem_size == 1 || elem_size == 2, "must be 2 or 1 byte"); - assert_different_registers(a1, a2, result, cnt1, t0, t1); + assert_different_registers(a1, a2, result, cnt1, tmp1, tmp2); BLOCK_COMMENT("string_equals {"); + beqz(cnt1, SAME); mv(result, false); // Check for short strings, i.e. smaller than wordSize. @@ -1129,26 +1163,31 @@ add(a2, a2, wordSize); sub(cnt1, cnt1, wordSize); bne(tmp1, tmp2, DONE); - } bgtz(cnt1, NEXT_WORD); + } bgez(cnt1, NEXT_WORD); - // Last longword. In the case where length == 4 we compare the - // same longword twice, but that's still faster than another - // conditional branch. - // cnt1 could be 0, -1, -2, -3, -4 for chars; -4 only happens when - // length == 4. - add(tmp1, a1, cnt1); - ld(tmp1, Address(tmp1, 0)); - add(tmp2, a2, cnt1); - ld(tmp2, Address(tmp2, 0)); - bne(tmp1, tmp2, DONE); - j(SAME); + if (!AvoidUnalignedAccesses) { + // Last longword. In the case where length == 4 we compare the + // same longword twice, but that's still faster than another + // conditional branch. + // cnt1 could be 0, -1, -2, -3, -4 for chars; -4 only happens when + // length == 4. + add(tmp1, a1, cnt1); + ld(tmp1, Address(tmp1, 0)); + add(tmp2, a2, cnt1); + ld(tmp2, Address(tmp2, 0)); + bne(tmp1, tmp2, DONE); + j(SAME); + } else { + add(tmp1, cnt1, wordSize); + beqz(tmp1, SAME); + } bind(SHORT); Label TAIL03, TAIL01; // 0-7 bytes left. - test_bit(t0, cnt1, 2); - beqz(t0, TAIL03); + test_bit(tmp1, cnt1, 2); + beqz(tmp1, TAIL03); { lwu(tmp1, Address(a1, 0)); add(a1, a1, 4); @@ -1159,8 +1198,8 @@ bind(TAIL03); // 0-3 bytes left. - test_bit(t0, cnt1, 1); - beqz(t0, TAIL01); + test_bit(tmp1, cnt1, 1); + beqz(tmp1, TAIL01); { lhu(tmp1, Address(a1, 0)); add(a1, a1, 2); @@ -1172,8 +1211,8 @@ bind(TAIL01); if (elem_size == 1) { // Only needed when comparing 1-byte elements // 0-1 bytes left. - test_bit(t0, cnt1, 0); - beqz(t0, SAME); + test_bit(tmp1, cnt1, 0); + beqz(tmp1, SAME); { lbu(tmp1, Address(a1, 0)); lbu(tmp2, Address(a2, 0)); diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shared/barrierSetNMethod_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -84,11 +84,11 @@ // BarrierSetAssembler::nmethod_entry_barrier. The matching ignores the specific // register numbers and immediate values in the encoding. void NativeNMethodBarrier::verify() const { - intptr_t addr = (intptr_t) instruction_address(); + address addr = instruction_address(); for(unsigned int i = 0; i < sizeof(barrierInsn)/sizeof(struct CheckInsn); i++ ) { - uint32_t inst = *((uint32_t*) addr); + uint32_t inst = Assembler::ld_instr(addr); if ((inst & barrierInsn[i].mask) != barrierInsn[i].bits) { - tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", addr, inst); + tty->print_cr("Addr: " INTPTR_FORMAT " Code: 0x%x", p2i(addr), inst); fatal("not an %s instruction.", barrierInsn[i].name); } addr += 4; diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv.ad openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv.ad --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv.ad 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv.ad 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,285 @@ +// +// Copyright (c) 2018, Red Hat, Inc. All rights reserved. +// Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. 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 +// under the terms of the GNU General Public License version 2 only, as +// published by the Free Software Foundation. +// +// 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, write to the Free Software Foundation, +// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +// +// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +// or visit www.oracle.com if you need additional information or have any +// questions. +// +// + +source_hpp %{ +#include "gc/shenandoah/shenandoahBarrierSet.hpp" +#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp" +%} + +instruct compareAndSwapP_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ + match(Set res (ShenandoahCompareAndSwapP mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + + format %{ + "cmpxchg_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapP_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndSwapN_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ + match(Set res (ShenandoahCompareAndSwapN mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + + format %{ + "cmpxchgw_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapN_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndSwapPAcq_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ + predicate(needs_acquiring_load_reserved(n)); + match(Set res (ShenandoahCompareAndSwapP mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + + format %{ + "cmpxchg_acq_shenandoah_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapPAcq_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::aq /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndSwapNAcq_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ + predicate(needs_acquiring_load_reserved(n)); + match(Set res (ShenandoahCompareAndSwapN mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + + format %{ + "cmpxchgw_acq_shenandoah_narrow_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapNAcq_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::aq /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangeN_shenandoah(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ + match(Set res (ShenandoahCompareAndExchangeN mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + effect(TEMP_DEF res, TEMP tmp, KILL cr); + + format %{ + "cmpxchgw_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@compareAndExchangeN_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, + true /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangeP_shenandoah(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ + match(Set res (ShenandoahCompareAndExchangeP mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP_DEF res, TEMP tmp, KILL cr); + format %{ + "cmpxchg_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndExchangeP_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, + true /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapN_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ + match(Set res (ShenandoahWeakCompareAndSwapN mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + format %{ + "cmpxchgw_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapN_shenandoah" + "mv $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + // Weak is not current supported by ShenandoahBarrierSet::cmpxchg_oop + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangeNAcq_shenandoah(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ + predicate(needs_acquiring_load_reserved(n)); + match(Set res (ShenandoahCompareAndExchangeN mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP_DEF res, TEMP tmp, KILL cr); + format %{ + "cmpxchgw_acq_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@compareAndExchangeNAcq_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::aq /* acquire */, Assembler::rl /* release */, + true /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct compareAndExchangePAcq_shenandoah(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ + predicate(needs_acquiring_load_reserved(n)); + match(Set res (ShenandoahCompareAndExchangeP mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP_DEF res, TEMP tmp, KILL cr); + format %{ + "cmpxchg_acq_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@compareAndExchangePAcq_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::aq /* acquire */, Assembler::rl /* release */, + true /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapP_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ + match(Set res (ShenandoahWeakCompareAndSwapP mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + format %{ + "cmpxchg_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapP_shenandoah" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapNAcq_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ + predicate(needs_acquiring_load_reserved(n)); + match(Set res (ShenandoahWeakCompareAndSwapN mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + format %{ + "cmpxchgw_acq_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapNAcq_shenandoah" + "mv $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + // Weak is not current supported by ShenandoahBarrierSet::cmpxchg_oop + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::aq /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} + +instruct weakCompareAndSwapPAcq_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ + predicate(needs_acquiring_load_reserved(n)); + match(Set res (ShenandoahWeakCompareAndSwapP mem (Binary oldval newval))); + ins_cost(10 * DEFAULT_COST); + + effect(TEMP tmp, KILL cr); + format %{ + "cmpxchg_acq_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapPAcq_shenandoah" + "mv $res, EQ\t# $res <-- (EQ ? 1 : 0)" + %} + + ins_encode %{ + Register tmp = $tmp$$Register; + __ mv(tmp, $oldval$$Register); // Must not clobber oldval. + // Weak is not current supported by ShenandoahBarrierSet::cmpxchg_oop + ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, + Assembler::aq /* acquire */, Assembler::rl /* release */, + false /* is_cae */, $res$$Register); + %} + + ins_pipe(pipe_slow); +%} diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv64.ad openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv64.ad --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv64.ad 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/shenandoah/shenandoah_riscv64.ad 1970-01-01 00:00:00.000000000 +0000 @@ -1,285 +0,0 @@ -// -// Copyright (c) 2018, Red Hat, Inc. All rights reserved. -// Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. 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 -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// 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, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -source_hpp %{ -#include "gc/shenandoah/shenandoahBarrierSet.hpp" -#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp" -%} - -instruct compareAndSwapP_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ - match(Set res (ShenandoahCompareAndSwapP mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - - format %{ - "cmpxchg_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapP_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndSwapN_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ - match(Set res (ShenandoahCompareAndSwapN mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - - format %{ - "cmpxchgw_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapN_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndSwapPAcq_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ - predicate(needs_acquiring_load_reserved(n)); - match(Set res (ShenandoahCompareAndSwapP mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - - format %{ - "cmpxchg_acq_shenandoah_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapPAcq_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::aq /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndSwapNAcq_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ - predicate(needs_acquiring_load_reserved(n)); - match(Set res (ShenandoahCompareAndSwapN mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - - format %{ - "cmpxchgw_acq_shenandoah_narrow_oop $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndSwapNAcq_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::aq /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndExchangeN_shenandoah(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ - match(Set res (ShenandoahCompareAndExchangeN mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - effect(TEMP_DEF res, TEMP tmp, KILL cr); - - format %{ - "cmpxchgw_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@compareAndExchangeN_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, - true /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndExchangeP_shenandoah(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ - match(Set res (ShenandoahCompareAndExchangeP mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP_DEF res, TEMP tmp, KILL cr); - format %{ - "cmpxchg_shenandoah $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp, #@compareAndExchangeP_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, - true /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct weakCompareAndSwapN_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ - match(Set res (ShenandoahWeakCompareAndSwapN mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - format %{ - "cmpxchgw_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapN_shenandoah" - "mv $res, EQ\t# $res <-- (EQ ? 1 : 0)" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - // Weak is not current supported by ShenandoahBarrierSet::cmpxchg_oop - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndExchangeNAcq_shenandoah(iRegNNoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ - predicate(needs_acquiring_load_reserved(n)); - match(Set res (ShenandoahCompareAndExchangeN mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP_DEF res, TEMP tmp, KILL cr); - format %{ - "cmpxchgw_acq_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@compareAndExchangeNAcq_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::aq /* acquire */, Assembler::rl /* release */, - true /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct compareAndExchangePAcq_shenandoah(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ - predicate(needs_acquiring_load_reserved(n)); - match(Set res (ShenandoahCompareAndExchangeP mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP_DEF res, TEMP tmp, KILL cr); - format %{ - "cmpxchg_acq_shenandoah $res = $mem, $oldval, $newval\t# (narrow oop, weak) if $mem == $oldval then $mem <-- $newval, #@compareAndExchangePAcq_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::aq /* acquire */, Assembler::rl /* release */, - true /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct weakCompareAndSwapP_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ - match(Set res (ShenandoahWeakCompareAndSwapP mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - format %{ - "cmpxchg_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapP_shenandoah" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct weakCompareAndSwapNAcq_shenandoah(iRegINoSp res, indirect mem, iRegN oldval, iRegN newval, iRegNNoSp tmp, rFlagsReg cr) %{ - predicate(needs_acquiring_load_reserved(n)); - match(Set res (ShenandoahWeakCompareAndSwapN mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - format %{ - "cmpxchgw_acq_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapNAcq_shenandoah" - "mv $res, EQ\t# $res <-- (EQ ? 1 : 0)" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - // Weak is not current supported by ShenandoahBarrierSet::cmpxchg_oop - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::aq /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} - -instruct weakCompareAndSwapPAcq_shenandoah(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, iRegPNoSp tmp, rFlagsReg cr) %{ - predicate(needs_acquiring_load_reserved(n)); - match(Set res (ShenandoahWeakCompareAndSwapP mem (Binary oldval newval))); - ins_cost(10 * DEFAULT_COST); - - effect(TEMP tmp, KILL cr); - format %{ - "cmpxchg_acq_shenandoah $res = $mem, $oldval, $newval\t# (ptr, weak) if $mem == $oldval then $mem <-- $newval, #@weakCompareAndSwapPAcq_shenandoah" - "mv $res, EQ\t# $res <-- (EQ ? 1 : 0)" - %} - - ins_encode %{ - Register tmp = $tmp$$Register; - __ mv(tmp, $oldval$$Register); // Must not clobber oldval. - // Weak is not current supported by ShenandoahBarrierSet::cmpxchg_oop - ShenandoahBarrierSet::assembler()->cmpxchg_oop(&_masm, $mem$$Register, tmp, $newval$$Register, - Assembler::aq /* acquire */, Assembler::rl /* release */, - false /* is_cae */, $res$$Register); - %} - - ins_pipe(pipe_slow); -%} diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/z/z_riscv.ad openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/z/z_riscv.ad --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/z/z_riscv.ad 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/z/z_riscv.ad 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,233 @@ +// +// Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. 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 +// under the terms of the GNU General Public License version 2 only, as +// published by the Free Software Foundation. +// +// 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, write to the Free Software Foundation, +// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +// +// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +// or visit www.oracle.com if you need additional information or have any +// questions. +// + +source_hpp %{ + +#include "gc/shared/gc_globals.hpp" +#include "gc/z/c2/zBarrierSetC2.hpp" +#include "gc/z/zThreadLocalData.hpp" + +%} + +source %{ + +static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, int barrier_data) { + if (barrier_data == ZLoadBarrierElided) { + return; + } + ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, barrier_data); + __ ld(tmp, Address(xthread, ZThreadLocalData::address_bad_mask_offset())); + __ andr(tmp, tmp, ref); + __ bnez(tmp, *stub->entry(), true /* far */); + __ bind(*stub->continuation()); +} + +static void z_load_barrier_slow_path(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp) { + ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, ZLoadBarrierStrong); + __ j(*stub->entry()); + __ bind(*stub->continuation()); +} + +%} + +// Load Pointer +instruct zLoadP(iRegPNoSp dst, memory mem) +%{ + match(Set dst (LoadP mem)); + predicate(UseZGC && (n->as_Load()->barrier_data() != 0)); + effect(TEMP dst); + + ins_cost(4 * DEFAULT_COST); + + format %{ "ld $dst, $mem, #@zLoadP" %} + + ins_encode %{ + const Address ref_addr (as_Register($mem$$base), $mem$$disp); + __ ld($dst$$Register, ref_addr); + z_load_barrier(_masm, this, ref_addr, $dst$$Register, t0 /* tmp */, barrier_data()); + %} + + ins_pipe(iload_reg_mem); +%} + +instruct zCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{ + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + predicate(UseZGC && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong); + effect(KILL cr, TEMP_DEF res); + + ins_cost(2 * VOLATILE_REF_COST); + + format %{ "cmpxchg $mem, $oldval, $newval, #@zCompareAndSwapP\n\t" + "mv $res, $res == $oldval" %} + + ins_encode %{ + Label failed; + guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register, + true /* result_as_bool */); + __ beqz($res$$Register, failed); + __ mv(t0, $oldval$$Register); + __ bind(failed); + if (barrier_data() != ZLoadBarrierElided) { + Label good; + __ ld(t1, Address(xthread, ZThreadLocalData::address_bad_mask_offset()), t1 /* tmp */); + __ andr(t1, t1, t0); + __ beqz(t1, good); + z_load_barrier_slow_path(_masm, this, Address($mem$$Register), t0 /* ref */, t1 /* tmp */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register, + true /* result_as_bool */); + __ bind(good); + } + %} + + ins_pipe(pipe_slow); +%} + +instruct zCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{ + match(Set res (CompareAndSwapP mem (Binary oldval newval))); + match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); + predicate(UseZGC && needs_acquiring_load_reserved(n) && (n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong)); + effect(KILL cr, TEMP_DEF res); + + ins_cost(2 * VOLATILE_REF_COST); + + format %{ "cmpxchg $mem, $oldval, $newval, #@zCompareAndSwapPAcq\n\t" + "mv $res, $res == $oldval" %} + + ins_encode %{ + Label failed; + guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register, + true /* result_as_bool */); + __ beqz($res$$Register, failed); + __ mv(t0, $oldval$$Register); + __ bind(failed); + if (barrier_data() != ZLoadBarrierElided) { + Label good; + __ ld(t1, Address(xthread, ZThreadLocalData::address_bad_mask_offset()), t1 /* tmp */); + __ andr(t1, t1, t0); + __ beqz(t1, good); + z_load_barrier_slow_path(_masm, this, Address($mem$$Register), t0 /* ref */, t1 /* tmp */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register, + true /* result_as_bool */); + __ bind(good); + } + %} + + ins_pipe(pipe_slow); +%} + +instruct zCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval) %{ + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + predicate(UseZGC && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong); + effect(TEMP_DEF res); + + ins_cost(2 * VOLATILE_REF_COST); + + format %{ "cmpxchg $res = $mem, $oldval, $newval, #@zCompareAndExchangeP" %} + + ins_encode %{ + guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register); + if (barrier_data() != ZLoadBarrierElided) { + Label good; + __ ld(t0, Address(xthread, ZThreadLocalData::address_bad_mask_offset())); + __ andr(t0, t0, $res$$Register); + __ beqz(t0, good); + z_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, t0 /* tmp */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register); + __ bind(good); + } + %} + + ins_pipe(pipe_slow); +%} + +instruct zCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval) %{ + match(Set res (CompareAndExchangeP mem (Binary oldval newval))); + predicate(UseZGC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong); + effect(TEMP_DEF res); + + ins_cost(2 * VOLATILE_REF_COST); + + format %{ "cmpxchg $res = $mem, $oldval, $newval, #@zCompareAndExchangePAcq" %} + + ins_encode %{ + guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register); + if (barrier_data() != ZLoadBarrierElided) { + Label good; + __ ld(t0, Address(xthread, ZThreadLocalData::address_bad_mask_offset())); + __ andr(t0, t0, $res$$Register); + __ beqz(t0, good); + z_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, t0 /* tmp */); + __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, + Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register); + __ bind(good); + } + %} + + ins_pipe(pipe_slow); +%} + +instruct zGetAndSetP(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{ + match(Set prev (GetAndSetP mem newv)); + predicate(UseZGC && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); + effect(TEMP_DEF prev, KILL cr); + + ins_cost(2 * VOLATILE_REF_COST); + + format %{ "atomic_xchg $prev, $newv, [$mem], #@zGetAndSetP" %} + + ins_encode %{ + __ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base)); + z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, t0 /* tmp */, barrier_data()); + %} + + ins_pipe(pipe_serial); +%} + +instruct zGetAndSetPAcq(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{ + match(Set prev (GetAndSetP mem newv)); + predicate(UseZGC && needs_acquiring_load_reserved(n) && (n->as_LoadStore()->barrier_data() != 0)); + effect(TEMP_DEF prev, KILL cr); + + ins_cost(VOLATILE_REF_COST); + + format %{ "atomic_xchg_acq $prev, $newv, [$mem], #@zGetAndSetPAcq" %} + + ins_encode %{ + __ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base)); + z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, t0 /* tmp */, barrier_data()); + %} + ins_pipe(pipe_serial); +%} diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/z/z_riscv64.ad openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/z/z_riscv64.ad --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/gc/z/z_riscv64.ad 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/gc/z/z_riscv64.ad 1970-01-01 00:00:00.000000000 +0000 @@ -1,233 +0,0 @@ -// -// Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. -// Copyright (c) 2020, 2021, Huawei Technologies Co., Ltd. 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 -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// 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, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// - -source_hpp %{ - -#include "gc/shared/gc_globals.hpp" -#include "gc/z/c2/zBarrierSetC2.hpp" -#include "gc/z/zThreadLocalData.hpp" - -%} - -source %{ - -static void z_load_barrier(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp, int barrier_data) { - if (barrier_data == ZLoadBarrierElided) { - return; - } - ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, barrier_data); - __ ld(tmp, Address(xthread, ZThreadLocalData::address_bad_mask_offset())); - __ andr(tmp, tmp, ref); - __ bnez(tmp, *stub->entry(), true /* far */); - __ bind(*stub->continuation()); -} - -static void z_load_barrier_slow_path(MacroAssembler& _masm, const MachNode* node, Address ref_addr, Register ref, Register tmp) { - ZLoadBarrierStubC2* const stub = ZLoadBarrierStubC2::create(node, ref_addr, ref, tmp, ZLoadBarrierStrong); - __ j(*stub->entry()); - __ bind(*stub->continuation()); -} - -%} - -// Load Pointer -instruct zLoadP(iRegPNoSp dst, memory mem) -%{ - match(Set dst (LoadP mem)); - predicate(UseZGC && (n->as_Load()->barrier_data() != 0)); - effect(TEMP dst); - - ins_cost(4 * DEFAULT_COST); - - format %{ "ld $dst, $mem, #@zLoadP" %} - - ins_encode %{ - const Address ref_addr (as_Register($mem$$base), $mem$$disp); - __ ld($dst$$Register, ref_addr); - z_load_barrier(_masm, this, ref_addr, $dst$$Register, t0 /* tmp */, barrier_data()); - %} - - ins_pipe(iload_reg_mem); -%} - -instruct zCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{ - match(Set res (CompareAndSwapP mem (Binary oldval newval))); - match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); - predicate(UseZGC && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong); - effect(KILL cr, TEMP_DEF res); - - ins_cost(2 * VOLATILE_REF_COST); - - format %{ "cmpxchg $mem, $oldval, $newval, #@zCompareAndSwapP\n\t" - "mv $res, $res == $oldval" %} - - ins_encode %{ - Label failed; - guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register, - true /* result_as_bool */); - __ beqz($res$$Register, failed); - __ mv(t0, $oldval$$Register); - __ bind(failed); - if (barrier_data() != ZLoadBarrierElided) { - Label good; - __ ld(t1, Address(xthread, ZThreadLocalData::address_bad_mask_offset()), t1 /* tmp */); - __ andr(t1, t1, t0); - __ beqz(t1, good); - z_load_barrier_slow_path(_masm, this, Address($mem$$Register), t0 /* ref */, t1 /* tmp */); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register, - true /* result_as_bool */); - __ bind(good); - } - %} - - ins_pipe(pipe_slow); -%} - -instruct zCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP newval, rFlagsReg cr) %{ - match(Set res (CompareAndSwapP mem (Binary oldval newval))); - match(Set res (WeakCompareAndSwapP mem (Binary oldval newval))); - predicate(UseZGC && needs_acquiring_load_reserved(n) && (n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong)); - effect(KILL cr, TEMP_DEF res); - - ins_cost(2 * VOLATILE_REF_COST); - - format %{ "cmpxchg $mem, $oldval, $newval, #@zCompareAndSwapPAcq\n\t" - "mv $res, $res == $oldval" %} - - ins_encode %{ - Label failed; - guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register, - true /* result_as_bool */); - __ beqz($res$$Register, failed); - __ mv(t0, $oldval$$Register); - __ bind(failed); - if (barrier_data() != ZLoadBarrierElided) { - Label good; - __ ld(t1, Address(xthread, ZThreadLocalData::address_bad_mask_offset()), t1 /* tmp */); - __ andr(t1, t1, t0); - __ beqz(t1, good); - z_load_barrier_slow_path(_masm, this, Address($mem$$Register), t0 /* ref */, t1 /* tmp */); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register, - true /* result_as_bool */); - __ bind(good); - } - %} - - ins_pipe(pipe_slow); -%} - -instruct zCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval) %{ - match(Set res (CompareAndExchangeP mem (Binary oldval newval))); - predicate(UseZGC && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong); - effect(TEMP_DEF res); - - ins_cost(2 * VOLATILE_REF_COST); - - format %{ "cmpxchg $res = $mem, $oldval, $newval, #@zCompareAndExchangeP" %} - - ins_encode %{ - guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register); - if (barrier_data() != ZLoadBarrierElided) { - Label good; - __ ld(t0, Address(xthread, ZThreadLocalData::address_bad_mask_offset())); - __ andr(t0, t0, $res$$Register); - __ beqz(t0, good); - z_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, t0 /* tmp */); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::relaxed /* acquire */, Assembler::rl /* release */, $res$$Register); - __ bind(good); - } - %} - - ins_pipe(pipe_slow); -%} - -instruct zCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iRegP newval) %{ - match(Set res (CompareAndExchangeP mem (Binary oldval newval))); - predicate(UseZGC && needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() == ZLoadBarrierStrong); - effect(TEMP_DEF res); - - ins_cost(2 * VOLATILE_REF_COST); - - format %{ "cmpxchg $res = $mem, $oldval, $newval, #@zCompareAndExchangePAcq" %} - - ins_encode %{ - guarantee($mem$$index == -1 && $mem$$disp == 0, "impossible encoding"); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register); - if (barrier_data() != ZLoadBarrierElided) { - Label good; - __ ld(t0, Address(xthread, ZThreadLocalData::address_bad_mask_offset())); - __ andr(t0, t0, $res$$Register); - __ beqz(t0, good); - z_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, t0 /* tmp */); - __ cmpxchg($mem$$Register, $oldval$$Register, $newval$$Register, Assembler::int64, - Assembler::aq /* acquire */, Assembler::rl /* release */, $res$$Register); - __ bind(good); - } - %} - - ins_pipe(pipe_slow); -%} - -instruct zGetAndSetP(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{ - match(Set prev (GetAndSetP mem newv)); - predicate(UseZGC && !needs_acquiring_load_reserved(n) && n->as_LoadStore()->barrier_data() != 0); - effect(TEMP_DEF prev, KILL cr); - - ins_cost(2 * VOLATILE_REF_COST); - - format %{ "atomic_xchg $prev, $newv, [$mem], #@zGetAndSetP" %} - - ins_encode %{ - __ atomic_xchg($prev$$Register, $newv$$Register, as_Register($mem$$base)); - z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, t0 /* tmp */, barrier_data()); - %} - - ins_pipe(pipe_serial); -%} - -instruct zGetAndSetPAcq(indirect mem, iRegP newv, iRegPNoSp prev, rFlagsReg cr) %{ - match(Set prev (GetAndSetP mem newv)); - predicate(UseZGC && needs_acquiring_load_reserved(n) && (n->as_LoadStore()->barrier_data() != 0)); - effect(TEMP_DEF prev, KILL cr); - - ins_cost(VOLATILE_REF_COST); - - format %{ "atomic_xchg_acq $prev, $newv, [$mem], #@zGetAndSetPAcq" %} - - ins_encode %{ - __ atomic_xchgal($prev$$Register, $newv$$Register, as_Register($mem$$base)); - z_load_barrier(_masm, this, Address(noreg, 0), $prev$$Register, t0 /* tmp */, barrier_data()); - %} - ins_pipe(pipe_serial); -%} diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/icache_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/icache_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/icache_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/icache_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,6 +1,7 @@ /* - * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 @@ -25,6 +26,8 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "riscv_flush_icache.hpp" +#include "runtime/java.hpp" #include "runtime/icache.hpp" #define __ _masm-> @@ -33,16 +36,22 @@ // To make a store to instruction memory visible to all RISC-V harts, // the writing hart has to execute a data FENCE before requesting that // all remote RISC-V harts execute a FENCE.I. - // - // No sush assurance is defined at the interface level of the builtin - // method, and so we should make sure it works. + + // We need to make sure stores happens before the I/D cache synchronization. __asm__ volatile("fence rw, rw" : : : "memory"); - __builtin___clear_cache(addr, addr + (lines << ICache::log2_line_size)); + RiscvFlushIcache::flush((uintptr_t)addr, ((uintptr_t)lines) << ICache::log2_line_size); + return magic; } void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) { + // Only riscv_flush_icache is supported as I-cache synchronization. + // We must make sure the VM can execute such without error. + if (!RiscvFlushIcache::test()) { + vm_exit_during_initialization("Unable to synchronize I-cache"); + } + address start = (address)icache_flush; *flush_icache_stub = (ICache::flush_icache_stub_t)start; diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/interp_masm_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/interp_masm_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/interp_masm_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/interp_masm_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -176,8 +176,15 @@ void InterpreterMacroAssembler::get_unsigned_2_byte_index_at_bcp(Register reg, int bcp_offset) { assert(bcp_offset >= 0, "bcp is still pointing to start of bytecode"); - lhu(reg, Address(xbcp, bcp_offset)); - revb_h(reg, reg); + if (AvoidUnalignedAccesses && (bcp_offset % 2)) { + lbu(t1, Address(xbcp, bcp_offset)); + lbu(reg, Address(xbcp, bcp_offset + 1)); + slli(t1, t1, 8); + add(reg, reg, t1); + } else { + lhu(reg, Address(xbcp, bcp_offset)); + revb_h_h_u(reg, reg); + } } void InterpreterMacroAssembler::get_dispatch() { @@ -190,13 +197,23 @@ } void InterpreterMacroAssembler::get_cache_index_at_bcp(Register index, + Register tmp, int bcp_offset, size_t index_size) { assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); if (index_size == sizeof(u2)) { - load_unsigned_short(index, Address(xbcp, bcp_offset)); + if (AvoidUnalignedAccesses) { + assert_different_registers(index, tmp); + load_unsigned_byte(index, Address(xbcp, bcp_offset)); + load_unsigned_byte(tmp, Address(xbcp, bcp_offset + 1)); + slli(tmp, tmp, 8); + add(index, index, tmp); + } else { + load_unsigned_short(index, Address(xbcp, bcp_offset)); + } } else if (index_size == sizeof(u4)) { - lwu(index, Address(xbcp, bcp_offset)); + load_int_misaligned(index, Address(xbcp, bcp_offset), tmp, false); + // Check if the secondary index definition is still ~x, otherwise // we have to change the following assembler code to calculate the // plain index. @@ -223,7 +240,8 @@ size_t index_size) { assert_different_registers(cache, index); assert_different_registers(cache, xcpool); - get_cache_index_at_bcp(index, bcp_offset, index_size); + // register "cache" is trashed in next shadd, so lets use it as a temporary register + get_cache_index_at_bcp(index, cache, bcp_offset, index_size); assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below"); // Convert from field index to ConstantPoolCacheEntry // riscv already has the cache in xcpool so there is no need to @@ -260,7 +278,8 @@ int bcp_offset, size_t index_size) { assert_different_registers(cache, tmp); - get_cache_index_at_bcp(tmp, bcp_offset, index_size); + // register "cache" is trashed in next ld, so lets use it as a temporary register + get_cache_index_at_bcp(tmp, cache, bcp_offset, index_size); assert(sizeof(ConstantPoolCacheEntry) == 4 * wordSize, "adjust code below"); // Convert from field index to ConstantPoolCacheEntry index // and from word offset to byte offset diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/interp_masm_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/interp_masm_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/interp_masm_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/interp_masm_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -113,7 +113,7 @@ void get_cache_and_index_at_bcp(Register cache, Register index, int bcp_offset, size_t index_size = sizeof(u2)); void get_cache_and_index_and_bytecode_at_bcp(Register cache, Register index, Register bytecode, int byte_no, int bcp_offset, size_t index_size = sizeof(u2)); void get_cache_entry_pointer_at_bcp(Register cache, Register tmp, int bcp_offset, size_t index_size = sizeof(u2)); - void get_cache_index_at_bcp(Register index, int bcp_offset, size_t index_size = sizeof(u2)); + void get_cache_index_at_bcp(Register index, Register tmp, int bcp_offset, size_t index_size = sizeof(u2)); void get_method_counters(Register method, Register mcs, Label& skip); // Load cpool->resolved_references(index). diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/macroAssembler_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1350,7 +1350,7 @@ static long get_offset_of_jal(address insn_addr) { assert_cond(insn_addr != NULL); long offset = 0; - unsigned insn = *(unsigned*)insn_addr; + unsigned insn = Assembler::ld_instr(insn_addr); long val = (long)Assembler::sextract(insn, 31, 12); offset |= ((val >> 19) & 0x1) << 20; offset |= (val & 0xff) << 12; @@ -1363,7 +1363,7 @@ static long get_offset_of_conditional_branch(address insn_addr) { long offset = 0; assert_cond(insn_addr != NULL); - unsigned insn = *(unsigned*)insn_addr; + unsigned insn = Assembler::ld_instr(insn_addr); offset = (long)Assembler::sextract(insn, 31, 31); offset = (offset << 12) | (((long)(Assembler::sextract(insn, 7, 7) & 0x1)) << 11); offset = offset | (((long)(Assembler::sextract(insn, 30, 25) & 0x3f)) << 5); @@ -1375,35 +1375,35 @@ static long get_offset_of_pc_relative(address insn_addr) { long offset = 0; assert_cond(insn_addr != NULL); - offset = ((long)(Assembler::sextract(((unsigned*)insn_addr)[0], 31, 12))) << 12; // Auipc. - offset += ((long)Assembler::sextract(((unsigned*)insn_addr)[1], 31, 20)); // Addi/Jalr/Load. + offset = ((long)(Assembler::sextract(Assembler::ld_instr(insn_addr), 31, 12))) << 12; // Auipc. + offset += ((long)Assembler::sextract(Assembler::ld_instr(insn_addr + 4), 31, 20)); // Addi/Jalr/Load. offset = (offset << 32) >> 32; return offset; } static address get_target_of_movptr(address insn_addr) { assert_cond(insn_addr != NULL); - intptr_t target_address = (((int64_t)Assembler::sextract(((unsigned*)insn_addr)[0], 31, 12)) & 0xfffff) << 29; // Lui. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[1], 31, 20)) << 17; // Addi. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[3], 31, 20)) << 6; // Addi. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[5], 31, 20)); // Addi/Jalr/Load. + intptr_t target_address = (((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr), 31, 12)) & 0xfffff) << 29; // Lui. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 4), 31, 20)) << 17; // Addi. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 12), 31, 20)) << 6; // Addi. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 20), 31, 20)); // Addi/Jalr/Load. return (address) target_address; } static address get_target_of_li64(address insn_addr) { assert_cond(insn_addr != NULL); - intptr_t target_address = (((int64_t)Assembler::sextract(((unsigned*)insn_addr)[0], 31, 12)) & 0xfffff) << 44; // Lui. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[1], 31, 20)) << 32; // Addi. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[3], 31, 20)) << 20; // Addi. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[5], 31, 20)) << 8; // Addi. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[7], 31, 20)); // Addi. + intptr_t target_address = (((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr), 31, 12)) & 0xfffff) << 44; // Lui. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 4), 31, 20)) << 32; // Addi. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 12), 31, 20)) << 20; // Addi. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 20), 31, 20)) << 8; // Addi. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 28), 31, 20)); // Addi. return (address)target_address; } static address get_target_of_li32(address insn_addr) { assert_cond(insn_addr != NULL); - intptr_t target_address = (((int64_t)Assembler::sextract(((unsigned*)insn_addr)[0], 31, 12)) & 0xfffff) << 12; // Lui. - target_address += ((int64_t)Assembler::sextract(((unsigned*)insn_addr)[1], 31, 20)); // Addiw. + intptr_t target_address = (((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr), 31, 12)) & 0xfffff) << 12; // Lui. + target_address += ((int64_t)Assembler::sextract(Assembler::ld_instr(insn_addr + 4), 31, 20)); // Addiw. return (address)target_address; } @@ -1428,7 +1428,7 @@ } else { #ifdef ASSERT tty->print_cr("pd_patch_instruction_size: instruction 0x%x at " INTPTR_FORMAT " could not be patched!\n", - *(unsigned*)branch, p2i(branch)); + Assembler::ld_instr(branch), p2i(branch)); Disassembler::decode(branch - 16, branch + 16); #endif ShouldNotReachHere(); @@ -1571,6 +1571,28 @@ sign_extend(Rd, Rd, 32); } +// Rd = Rs1 & (~Rd2) +void MacroAssembler::andn(Register Rd, Register Rs1, Register Rs2) { + if (UseZbb) { + Assembler::andn(Rd, Rs1, Rs2); + return; + } + + notr(Rd, Rs2); + andr(Rd, Rs1, Rd); +} + +// Rd = Rs1 | (~Rd2) +void MacroAssembler::orn(Register Rd, Register Rs1, Register Rs2) { + if (UseZbb) { + Assembler::orn(Rd, Rs1, Rs2); + return; + } + + notr(Rd, Rs2); + orr(Rd, Rs1, Rd); +} + // Note: load_unsigned_short used to be called load_unsigned_word. int MacroAssembler::load_unsigned_short(Register dst, Address src) { int off = offset(); @@ -1616,6 +1638,114 @@ } } +// granularity is 1 OR 2 bytes per load. dst and src.base() allowed to be the same register +void MacroAssembler::load_short_misaligned(Register dst, Address src, Register tmp, bool is_signed, int granularity) { + if (granularity != 1 && granularity != 2) { + ShouldNotReachHere(); + } + if (AvoidUnalignedAccesses && (granularity != 2)) { + assert_different_registers(dst, tmp); + assert_different_registers(tmp, src.base()); + is_signed ? lb(tmp, Address(src.base(), src.offset() + 1)) : lbu(tmp, Address(src.base(), src.offset() + 1)); + slli(tmp, tmp, 8); + lbu(dst, src); + add(dst, dst, tmp); + } else { + is_signed ? lh(dst, src) : lhu(dst, src); + } +} + +// granularity is 1, 2 OR 4 bytes per load, if granularity 2 or 4 then dst and src.base() allowed to be the same register +void MacroAssembler::load_int_misaligned(Register dst, Address src, Register tmp, bool is_signed, int granularity) { + if (AvoidUnalignedAccesses && (granularity != 4)) { + switch(granularity) { + case 1: + assert_different_registers(dst, tmp, src.base()); + lbu(dst, src); + lbu(tmp, Address(src.base(), src.offset() + 1)); + slli(tmp, tmp, 8); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 2)); + slli(tmp, tmp, 16); + add(dst, dst, tmp); + is_signed ? lb(tmp, Address(src.base(), src.offset() + 3)) : lbu(tmp, Address(src.base(), src.offset() + 3)); + slli(tmp, tmp, 24); + add(dst, dst, tmp); + break; + case 2: + assert_different_registers(dst, tmp); + assert_different_registers(tmp, src.base()); + is_signed ? lh(tmp, Address(src.base(), src.offset() + 2)) : lhu(tmp, Address(src.base(), src.offset() + 2)); + slli(tmp, tmp, 16); + lhu(dst, src); + add(dst, dst, tmp); + break; + default: + ShouldNotReachHere(); + } + } else { + is_signed ? lw(dst, src) : lwu(dst, src); + } +} + +// granularity is 1, 2, 4 or 8 bytes per load, if granularity 4 or 8 then dst and src.base() allowed to be same register +void MacroAssembler::load_long_misaligned(Register dst, Address src, Register tmp, int granularity) { + if (AvoidUnalignedAccesses && (granularity != 8)) { + switch(granularity){ + case 1: + assert_different_registers(dst, tmp, src.base()); + lbu(dst, src); + lbu(tmp, Address(src.base(), src.offset() + 1)); + slli(tmp, tmp, 8); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 2)); + slli(tmp, tmp, 16); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 3)); + slli(tmp, tmp, 24); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 4)); + slli(tmp, tmp, 32); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 5)); + slli(tmp, tmp, 40); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 6)); + slli(tmp, tmp, 48); + add(dst, dst, tmp); + lbu(tmp, Address(src.base(), src.offset() + 7)); + slli(tmp, tmp, 56); + add(dst, dst, tmp); + break; + case 2: + assert_different_registers(dst, tmp, src.base()); + lhu(dst, src); + lhu(tmp, Address(src.base(), src.offset() + 2)); + slli(tmp, tmp, 16); + add(dst, dst, tmp); + lhu(tmp, Address(src.base(), src.offset() + 4)); + slli(tmp, tmp, 32); + add(dst, dst, tmp); + lhu(tmp, Address(src.base(), src.offset() + 6)); + slli(tmp, tmp, 48); + add(dst, dst, tmp); + break; + case 4: + assert_different_registers(dst, tmp); + assert_different_registers(tmp, src.base()); + lwu(tmp, Address(src.base(), src.offset() + 4)); + slli(tmp, tmp, 32); + lwu(dst, src); + add(dst, dst, tmp); + break; + default: + ShouldNotReachHere(); + } + } else { + ld(dst, src); + } +} + // reverse bytes in halfword in lower 16 bits and sign-extend // Rd[15:0] = Rs[7:0] Rs[15:8] (sign-extend to 64 bits) void MacroAssembler::revb_h_h(Register Rd, Register Rs, Register tmp) { @@ -1776,6 +1906,22 @@ orr(dst, dst, tmp); } +// rotate left with shift bits, 32-bit version +void MacroAssembler::rolw_imm(Register dst, Register src, uint32_t shift, Register tmp) { + if (UseZbb) { + // no roliw available + roriw(dst, src, 32 - shift); + return; + } + + assert_different_registers(dst, tmp); + assert_different_registers(src, tmp); + assert(shift < 32, "shift amount must be < 32"); + srliw(tmp, src, 32 - shift); + slliw(dst, src, shift); + orr(dst, dst, tmp); +} + void MacroAssembler::andi(Register Rd, Register Rn, int64_t imm, Register tmp) { if (is_simm12(imm)) { and_imm12(Rd, Rn, imm); @@ -3985,18 +4131,17 @@ void MacroAssembler::inflate_lo32(Register Rd, Register Rs, Register tmp1, Register tmp2) { assert_different_registers(Rd, Rs, tmp1, tmp2); - mv(tmp1, 0xFF); - mv(Rd, zr); - for (int i = 0; i <= 3; i++) { + mv(tmp1, 0xFF000000); // first byte mask at lower word + andr(Rd, Rs, tmp1); + for (int i = 0; i < 2; i++) { + slli(Rd, Rd, wordSize); + srli(tmp1, tmp1, wordSize); andr(tmp2, Rs, tmp1); - if (i) { - slli(tmp2, tmp2, i * 8); - } orr(Rd, Rd, tmp2); - if (i != 3) { - slli(tmp1, tmp1, 8); - } } + slli(Rd, Rd, wordSize); + andi(tmp2, Rs, 0xFF); // last byte mask at lower word + orr(Rd, Rd, tmp2); } // This instruction reads adjacent 4 bytes from the upper half of source register, @@ -4005,17 +4150,8 @@ // Rd: 00A700A600A500A4 void MacroAssembler::inflate_hi32(Register Rd, Register Rs, Register tmp1, Register tmp2) { assert_different_registers(Rd, Rs, tmp1, tmp2); - - mv(tmp1, 0xFF00000000); - mv(Rd, zr); - for (int i = 0; i <= 3; i++) { - andr(tmp2, Rs, tmp1); - orr(Rd, Rd, tmp2); - srli(Rd, Rd, 8); - if (i != 3) { - slli(tmp1, tmp1, 8); - } - } + srli(Rs, Rs, 32); // only upper 32 bits are needed + inflate_lo32(Rd, Rs, tmp1, tmp2); } // The size of the blocks erased by the zero_blocks stub. We must @@ -4382,11 +4518,17 @@ bind(done); } -void MacroAssembler::test_bit(Register Rd, Register Rs, uint32_t bit_pos, Register tmp) { +void MacroAssembler::test_bit(Register Rd, Register Rs, uint32_t bit_pos) { assert(bit_pos < 64, "invalid bit range"); if (UseZbs) { bexti(Rd, Rs, bit_pos); return; } - andi(Rd, Rs, 1UL << bit_pos, tmp); + int64_t imm = (int64_t)(1UL << bit_pos); + if (is_simm12(imm)) { + and_imm12(Rd, Rs, imm); + } else { + srli(Rd, Rs, bit_pos); + and_imm12(Rd, Rd, 1); + } } diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/macroAssembler_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -407,6 +407,11 @@ void load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed, Register dst2 = noreg); void store_sized_value(Address dst, Register src, size_t size_in_bytes, Register src2 = noreg); + // Misaligned loads, will use the best way, according to the AvoidUnalignedAccess flag + void load_short_misaligned(Register dst, Address src, Register tmp, bool is_signed, int granularity = 1); + void load_int_misaligned(Register dst, Address src, Register tmp, bool is_signed, int granularity = 1); + void load_long_misaligned(Register dst, Address src, Register tmp, int granularity = 1); + public: // Standard pseudo instructions inline void nop() { @@ -568,7 +573,9 @@ void NAME(Register Rs1, Register Rs2, const address dest) { \ assert_cond(dest != NULL); \ int64_t offset = dest - pc(); \ - guarantee(is_simm13(offset) && ((offset % 2) == 0), "offset is invalid."); \ + guarantee(is_simm13(offset) && is_even(offset), \ + "offset is invalid: is_simm_13: %s offset: " INT64_FORMAT, \ + BOOL_TO_STR(is_simm13(offset)), offset); \ Assembler::NAME(Rs1, Rs2, offset); \ } \ INSN_ENTRY_RELOC(void, NAME(Register Rs1, Register Rs2, address dest, relocInfo::relocType rtype)) \ @@ -729,6 +736,10 @@ void orrw(Register Rd, Register Rs1, Register Rs2); void xorrw(Register Rd, Register Rs1, Register Rs2); + // logic with negate + void andn(Register Rd, Register Rs1, Register Rs2); + void orn(Register Rd, Register Rs1, Register Rs2); + // revb void revb_h_h(Register Rd, Register Rs, Register tmp = t0); // reverse bytes in halfword in lower 16 bits, sign-extend void revb_w_w(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in lower word, sign-extend @@ -740,6 +751,7 @@ void revb(Register Rd, Register Rs, Register tmp1 = t0, Register tmp2 = t1); // reverse bytes in doubleword void ror_imm(Register dst, Register src, uint32_t shift, Register tmp = t0); + void rolw_imm(Register dst, Register src, uint32_t, Register tmp = t0); void andi(Register Rd, Register Rn, int64_t imm, Register tmp = t0); void orptr(Address adr, RegisterOrConstant src, Register tmp1 = t0, Register tmp2 = t1); @@ -1132,7 +1144,7 @@ void shadd(Register Rd, Register Rs1, Register Rs2, Register tmp, int shamt); // test single bit in Rs, result is set to Rd - void test_bit(Register Rd, Register Rs, uint32_t bit_pos, Register tmp = t0); + void test_bit(Register Rd, Register Rs, uint32_t bit_pos); // Here the float instructions with safe deal with some exceptions. // e.g. convert from NaN, +Inf, -Inf to int, float, double diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/nativeInst_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/nativeInst_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/nativeInst_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/nativeInst_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -42,27 +42,27 @@ Register NativeInstruction::extract_rs1(address instr) { assert_cond(instr != NULL); - return as_Register(Assembler::extract(((unsigned*)instr)[0], 19, 15)); + return as_Register(Assembler::extract(Assembler::ld_instr(instr), 19, 15)); } Register NativeInstruction::extract_rs2(address instr) { assert_cond(instr != NULL); - return as_Register(Assembler::extract(((unsigned*)instr)[0], 24, 20)); + return as_Register(Assembler::extract(Assembler::ld_instr(instr), 24, 20)); } Register NativeInstruction::extract_rd(address instr) { assert_cond(instr != NULL); - return as_Register(Assembler::extract(((unsigned*)instr)[0], 11, 7)); + return as_Register(Assembler::extract(Assembler::ld_instr(instr), 11, 7)); } uint32_t NativeInstruction::extract_opcode(address instr) { assert_cond(instr != NULL); - return Assembler::extract(((unsigned*)instr)[0], 6, 0); + return Assembler::extract(Assembler::ld_instr(instr), 6, 0); } uint32_t NativeInstruction::extract_funct3(address instr) { assert_cond(instr != NULL); - return Assembler::extract(((unsigned*)instr)[0], 14, 12); + return Assembler::extract(Assembler::ld_instr(instr), 14, 12); } bool NativeInstruction::is_pc_relative_at(address instr) { @@ -206,7 +206,7 @@ intptr_t NativeMovConstReg::data() const { address addr = MacroAssembler::target_addr_for_insn(instruction_address()); if (maybe_cpool_ref(instruction_address())) { - return *(intptr_t*)addr; + return Bytes::get_native_u8(addr); } else { return (intptr_t)addr; } @@ -215,7 +215,7 @@ void NativeMovConstReg::set_data(intptr_t x) { if (maybe_cpool_ref(instruction_address())) { address addr = MacroAssembler::target_addr_for_insn(instruction_address()); - *(intptr_t*)addr = x; + Bytes::put_native_u8(addr, x); } else { // Store x into the instruction stream. MacroAssembler::pd_patch_instruction_size(instruction_address(), (address)x); @@ -231,11 +231,11 @@ while (iter.next()) { if (iter.type() == relocInfo::oop_type) { oop* oop_addr = iter.oop_reloc()->oop_addr(); - *oop_addr = cast_to_oop(x); + Bytes::put_native_u8((address)oop_addr, x); break; } else if (iter.type() == relocInfo::metadata_type) { Metadata** metadata_addr = iter.metadata_reloc()->metadata_addr(); - *metadata_addr = (Metadata*)x; + Bytes::put_native_u8((address)metadata_addr, x); break; } } @@ -343,7 +343,7 @@ void NativeIllegalInstruction::insert(address code_pos) { assert_cond(code_pos != NULL); - *(juint*)code_pos = 0xffffffff; // all bits ones is permanently reserved as an illegal instruction + Assembler::sd_instr(code_pos, 0xffffffff); // all bits ones is permanently reserved as an illegal instruction } bool NativeInstruction::is_stop() { @@ -379,7 +379,7 @@ Assembler::patch(pInsn, 19, 12, (offset >> 12) & 0xff); Assembler::patch(pInsn, 11, 7, 0); // zero, no link jump Assembler::patch(pInsn, 6, 0, 0b1101111); // j, (jal x0 offset) - *(unsigned int*)verified_entry = insn; + Assembler::sd_instr(verified_entry, insn); } else { // We use an illegal instruction for marking a method as // not_entrant or zombie. @@ -437,5 +437,5 @@ Assembler::patch(pInsn, 23, 20, successor); address membar = addr_at(0); - *(unsigned int*) membar = insn; + Assembler::sd_instr(membar, insn); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/nativeInst_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/nativeInst_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/nativeInst_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/nativeInst_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -80,7 +80,7 @@ assert_cond(instr != NULL); return (extract_opcode(instr) == 0b0010011 && // opcode field extract_funct3(instr) == 0b001 && // funct3 field, select the type of operation - Assembler::extract(((unsigned*)instr)[0], 25, 20) == shift); // shamt field + Assembler::extract(Assembler::ld_instr(instr), 25, 20) == shift); // shamt field } static Register extract_rs1(address instr); @@ -203,18 +203,18 @@ protected: address addr_at(int offset) const { return address(this) + offset; } - jint int_at(int offset) const { return *(jint*) addr_at(offset); } - juint uint_at(int offset) const { return *(juint*) addr_at(offset); } + jint int_at(int offset) const { return (jint)Bytes::get_native_u4(addr_at(offset)); } + juint uint_at(int offset) const { return Bytes::get_native_u4(addr_at(offset)); } - address ptr_at(int offset) const { return *(address*) addr_at(offset); } + address ptr_at(int offset) const { return (address)Bytes::get_native_u8(addr_at(offset)); } - oop oop_at (int offset) const { return *(oop*) addr_at(offset); } + oop oop_at (int offset) const { return cast_to_oop(Bytes::get_native_u8(addr_at(offset))); } - void set_int_at(int offset, jint i) { *(jint*)addr_at(offset) = i; } - void set_uint_at(int offset, jint i) { *(juint*)addr_at(offset) = i; } - void set_ptr_at (int offset, address ptr) { *(address*) addr_at(offset) = ptr; } - void set_oop_at (int offset, oop o) { *(oop*) addr_at(offset) = o; } + void set_int_at(int offset, jint i) { Bytes::put_native_u4(addr_at(offset), i); } + void set_uint_at(int offset, jint i) { Bytes::put_native_u4(addr_at(offset), i); } + void set_ptr_at (int offset, address ptr) { Bytes::put_native_u8(addr_at(offset), (u8)ptr); } + void set_oop_at (int offset, oop o) { Bytes::put_native_u8(addr_at(offset), cast_from_oop(o)); } public: @@ -485,7 +485,7 @@ }; inline bool NativeInstruction::is_nop() { - uint32_t insn = *(uint32_t*)addr_at(0); + uint32_t insn = Assembler::ld_instr(addr_at(0)); return insn == 0x13; } @@ -527,7 +527,7 @@ (NativeInstruction::extract_rd(addr + instr_size) == x5) && (NativeInstruction::extract_rs1(addr + instr_size) == x5) && (NativeInstruction::extract_rs1(addr + 2 * instr_size) == x5) && - (Assembler::extract(((unsigned*)addr)[1], 31, 20) == NativeCallTrampolineStub::data_offset)) { + (Assembler::extract(Assembler::ld_instr(addr + 4), 31, 20) == NativeCallTrampolineStub::data_offset)) { return true; } return false; diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/register_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/register_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/register_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/register_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -27,6 +27,8 @@ #define CPU_RISCV_REGISTER_RISCV_HPP #include "asm/register.hpp" +#include "utilities/population_count.hpp" +#include "utilities/powerOfTwo.hpp" #define CSR_FFLAGS 0x001 // Floating-Point Accrued Exceptions. #define CSR_FRM 0x002 // Floating-Point Dynamic Rounding Mode. @@ -318,6 +320,8 @@ static const int max_vpr; }; +template class RegSetIterator; + // A set of registers template class AbstractRegSet { @@ -325,7 +329,7 @@ AbstractRegSet(uint32_t bitset) : _bitset(bitset) { } - public: +public: AbstractRegSet() : _bitset(0) { } AbstractRegSet(RegImpl r1) : _bitset(1 << r1->encoding()) { } @@ -375,11 +379,73 @@ return AbstractRegSet(bits); } + uint size() const { return population_count(_bitset); } + uint32_t bits() const { return _bitset; } + +private: + + RegImpl first(); + +public: + + friend class RegSetIterator; + + RegSetIterator begin(); }; typedef AbstractRegSet RegSet; typedef AbstractRegSet FloatRegSet; typedef AbstractRegSet VectorRegSet; +template +class RegSetIterator { + AbstractRegSet _regs; + +public: + RegSetIterator(AbstractRegSet x): _regs(x) {} + RegSetIterator(const RegSetIterator& mit) : _regs(mit._regs) {} + + RegSetIterator& operator++() { + RegImpl r = _regs.first(); + if (r->is_valid()) + _regs -= r; + return *this; + } + + bool operator==(const RegSetIterator& rhs) const { + return _regs.bits() == rhs._regs.bits(); + } + bool operator!=(const RegSetIterator& rhs) const { + return ! (rhs == *this); + } + + RegImpl operator*() { + return _regs.first(); + } +}; + +template +inline RegSetIterator AbstractRegSet::begin() { + return RegSetIterator(*this); +} + +template <> +inline Register AbstractRegSet::first() { + uint32_t first = _bitset & -_bitset; + return first ? as_Register(exact_log2(first)) : noreg; +} + +template <> +inline FloatRegister AbstractRegSet::first() { + uint32_t first = _bitset & -_bitset; + return first ? as_FloatRegister(exact_log2(first)) : fnoreg; +} + +template<> +inline VectorRegister AbstractRegSet::first() { + uint32_t first = _bitset & -_bitset; + return first ? as_VectorRegister(exact_log2(first)) : vnoreg; +} + #endif // CPU_RISCV_REGISTER_RISCV_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/relocInfo_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/relocInfo_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/relocInfo_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/relocInfo_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -45,7 +45,7 @@ if (NativeInstruction::is_load_pc_relative_at(addr())) { address constptr = (address)code()->oop_addr_at(reloc->oop_index()); bytes = MacroAssembler::pd_patch_instruction_size(addr(), constptr); - assert(*(address*)constptr == x, "error in oop relocation"); + assert((address)Bytes::get_native_u8(constptr) == x, "error in oop relocation"); } else { bytes = MacroAssembler::patch_oop(addr(), x); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/riscv.ad openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/riscv.ad --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/riscv.ad 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/riscv.ad 2024-01-09 21:18:15.000000000 +0000 @@ -2318,7 +2318,7 @@ if (DiagnoseSyncOnValueBasedClasses != 0) { __ load_klass(flag, oop); __ lwu(flag, Address(flag, Klass::access_flags_offset())); - __ test_bit(flag, flag, exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS), tmp /* tmp */); + __ test_bit(flag, flag, exact_log2(JVM_ACC_IS_VALUE_BASED_CLASS)); __ bnez(flag, cont, true /* is_far */); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/stubGenerator_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -2311,24 +2311,21 @@ } // code for comparing 8 characters of strings with Latin1 and Utf16 encoding - void compare_string_8_x_LU(Register tmpL, Register tmpU, Label &DIFF1, - Label &DIFF2) { - const Register strU = x12, curU = x7, strL = x29, tmp = x30; - __ ld(tmpL, Address(strL)); - __ addi(strL, strL, 8); + void compare_string_8_x_LU(Register tmpL, Register tmpU, Register strL, Register strU, Label& DIFF) { + const Register tmp = x30, tmpLval = x12; + __ ld(tmpLval, Address(strL)); + __ addi(strL, strL, wordSize); __ ld(tmpU, Address(strU)); - __ addi(strU, strU, 8); - __ inflate_lo32(tmp, tmpL); - __ mv(t0, tmp); - __ xorr(tmp, curU, t0); - __ bnez(tmp, DIFF2); - - __ ld(curU, Address(strU)); - __ addi(strU, strU, 8); - __ inflate_hi32(tmp, tmpL); - __ mv(t0, tmp); - __ xorr(tmp, tmpU, t0); - __ bnez(tmp, DIFF1); + __ addi(strU, strU, wordSize); + __ inflate_lo32(tmpL, tmpLval); + __ xorr(tmp, tmpU, tmpL); + __ bnez(tmp, DIFF); + + __ ld(tmpU, Address(strU)); + __ addi(strU, strU, wordSize); + __ inflate_hi32(tmpL, tmpLval); + __ xorr(tmp, tmpU, tmpL); + __ bnez(tmp, DIFF); } // x10 = result @@ -2343,11 +2340,9 @@ __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", isLU ? "compare_long_string_different_encoding LU" : "compare_long_string_different_encoding UL"); address entry = __ pc(); - Label SMALL_LOOP, TAIL, TAIL_LOAD_16, LOAD_LAST, DIFF1, DIFF2, - DONE, CALCULATE_DIFFERENCE; - const Register result = x10, str1 = x11, cnt1 = x12, str2 = x13, cnt2 = x14, - tmp1 = x28, tmp2 = x29, tmp3 = x30, tmp4 = x7, tmp5 = x31; - RegSet spilled_regs = RegSet::of(tmp4, tmp5); + Label SMALL_LOOP, TAIL, LOAD_LAST, DONE, CALCULATE_DIFFERENCE; + const Register result = x10, str1 = x11, str2 = x13, cnt2 = x14, + tmp1 = x28, tmp2 = x29, tmp3 = x30, tmp4 = x12; // cnt2 == amount of characters left to compare // Check already loaded first 4 symbols @@ -2355,77 +2350,81 @@ __ mv(isLU ? tmp1 : tmp2, tmp3); __ addi(str1, str1, isLU ? wordSize / 2 : wordSize); __ addi(str2, str2, isLU ? wordSize : wordSize / 2); - __ sub(cnt2, cnt2, 8); // Already loaded 4 symbols. Last 4 is special case. - __ push_reg(spilled_regs, sp); + __ sub(cnt2, cnt2, wordSize / 2); // Already loaded 4 symbols - if (isLU) { - __ add(str1, str1, cnt2); - __ shadd(str2, cnt2, str2, t0, 1); - } else { - __ shadd(str1, cnt2, str1, t0, 1); - __ add(str2, str2, cnt2); - } __ xorr(tmp3, tmp1, tmp2); - __ mv(tmp5, tmp2); __ bnez(tmp3, CALCULATE_DIFFERENCE); Register strU = isLU ? str2 : str1, strL = isLU ? str1 : str2, - tmpU = isLU ? tmp5 : tmp1, // where to keep U for comparison - tmpL = isLU ? tmp1 : tmp5; // where to keep L for comparison + tmpU = isLU ? tmp2 : tmp1, // where to keep U for comparison + tmpL = isLU ? tmp1 : tmp2; // where to keep L for comparison + + // make sure main loop is 8 byte-aligned, we should load another 4 bytes from strL + // cnt2 is >= 68 here, no need to check it for >= 0 + __ lwu(tmpL, Address(strL)); + __ addi(strL, strL, wordSize / 2); + __ ld(tmpU, Address(strU)); + __ addi(strU, strU, wordSize); + __ inflate_lo32(tmp3, tmpL); + __ mv(tmpL, tmp3); + __ xorr(tmp3, tmpU, tmpL); + __ bnez(tmp3, CALCULATE_DIFFERENCE); + __ addi(cnt2, cnt2, -wordSize / 2); - __ sub(tmp2, strL, cnt2); // strL pointer to load from - __ slli(t0, cnt2, 1); - __ sub(cnt1, strU, t0); // strU pointer to load from - - __ ld(tmp4, Address(cnt1)); - __ addi(cnt1, cnt1, 8); - __ beqz(cnt2, LOAD_LAST); // no characters left except last load - __ sub(cnt2, cnt2, 16); + // we are now 8-bytes aligned on strL + __ sub(cnt2, cnt2, wordSize * 2); __ bltz(cnt2, TAIL); __ bind(SMALL_LOOP); // smaller loop - __ sub(cnt2, cnt2, 16); - compare_string_8_x_LU(tmpL, tmpU, DIFF1, DIFF2); - compare_string_8_x_LU(tmpL, tmpU, DIFF1, DIFF2); + __ sub(cnt2, cnt2, wordSize * 2); + compare_string_8_x_LU(tmpL, tmpU, strL, strU, CALCULATE_DIFFERENCE); + compare_string_8_x_LU(tmpL, tmpU, strL, strU, CALCULATE_DIFFERENCE); __ bgez(cnt2, SMALL_LOOP); - __ addi(t0, cnt2, 16); - __ beqz(t0, LOAD_LAST); - __ bind(TAIL); // 1..15 characters left until last load (last 4 characters) - // Address of 8 bytes before last 4 characters in UTF-16 string - __ shadd(cnt1, cnt2, cnt1, t0, 1); - // Address of 16 bytes before last 4 characters in Latin1 string - __ add(tmp2, tmp2, cnt2); - __ ld(tmp4, Address(cnt1, -8)); - // last 16 characters before last load - compare_string_8_x_LU(tmpL, tmpU, DIFF1, DIFF2); - compare_string_8_x_LU(tmpL, tmpU, DIFF1, DIFF2); - __ j(LOAD_LAST); - __ bind(DIFF2); - __ mv(tmpU, tmp4); - __ bind(DIFF1); - __ mv(tmpL, t0); - __ j(CALCULATE_DIFFERENCE); - __ bind(LOAD_LAST); - // Last 4 UTF-16 characters are already pre-loaded into tmp4 by compare_string_8_x_LU. - // No need to load it again - __ mv(tmpU, tmp4); - __ ld(tmpL, Address(strL)); + __ addi(t0, cnt2, wordSize * 2); + __ beqz(t0, DONE); + __ bind(TAIL); // 1..15 characters left + // Aligned access. Load bytes in portions - 4, 2, 1. + + __ addi(t0, cnt2, wordSize); + __ addi(cnt2, cnt2, wordSize * 2); // amount of characters left to process + __ bltz(t0, LOAD_LAST); + // remaining characters are greater than or equals to 8, we can do one compare_string_8_x_LU + compare_string_8_x_LU(tmpL, tmpU, strL, strU, CALCULATE_DIFFERENCE); + __ addi(cnt2, cnt2, -wordSize); + __ beqz(cnt2, DONE); // no character left + __ bind(LOAD_LAST); // cnt2 = 1..7 characters left + + __ addi(cnt2, cnt2, -wordSize); // cnt2 is now an offset in strL which points to last 8 bytes + __ slli(t0, cnt2, 1); // t0 is now an offset in strU which points to last 16 bytes + __ add(strL, strL, cnt2); // Address of last 8 bytes in Latin1 string + __ add(strU, strU, t0); // Address of last 16 bytes in UTF-16 string + __ load_int_misaligned(tmpL, Address(strL), t0, false); + __ load_long_misaligned(tmpU, Address(strU), t0, 2); + __ inflate_lo32(tmp3, tmpL); + __ mv(tmpL, tmp3); + __ xorr(tmp3, tmpU, tmpL); + __ bnez(tmp3, CALCULATE_DIFFERENCE); + + __ addi(strL, strL, wordSize / 2); // Address of last 4 bytes in Latin1 string + __ addi(strU, strU, wordSize); // Address of last 8 bytes in UTF-16 string + __ load_int_misaligned(tmpL, Address(strL), t0, false); + __ load_long_misaligned(tmpU, Address(strU), t0, 2); __ inflate_lo32(tmp3, tmpL); __ mv(tmpL, tmp3); __ xorr(tmp3, tmpU, tmpL); - __ beqz(tmp3, DONE); + __ bnez(tmp3, CALCULATE_DIFFERENCE); + __ j(DONE); // no character left // Find the first different characters in the longwords and // compute their difference. __ bind(CALCULATE_DIFFERENCE); __ ctzc_bit(tmp4, tmp3); __ srl(tmp1, tmp1, tmp4); - __ srl(tmp5, tmp5, tmp4); + __ srl(tmp2, tmp2, tmp4); __ andi(tmp1, tmp1, 0xFFFF); - __ andi(tmp5, tmp5, 0xFFFF); - __ sub(result, tmp1, tmp5); + __ andi(tmp2, tmp2, 0xFFFF); + __ sub(result, tmp1, tmp2); __ bind(DONE); - __ pop_reg(spilled_regs, sp); __ ret(); return entry; } @@ -2527,9 +2526,9 @@ __ xorr(tmp4, tmp1, tmp2); __ bnez(tmp4, DIFF); __ add(str1, str1, cnt2); - __ ld(tmp5, Address(str1)); + __ load_long_misaligned(tmp5, Address(str1), tmp3, isLL ? 1 : 2); __ add(str2, str2, cnt2); - __ ld(cnt1, Address(str2)); + __ load_long_misaligned(cnt1, Address(str2), tmp3, isLL ? 1 : 2); __ xorr(tmp4, tmp5, cnt1); __ beqz(tmp4, LENGTH_DIFF); // Find the first different characters in the longwords and @@ -3686,6 +3685,375 @@ }; #endif // COMPILER2 + // Set of L registers that correspond to a contiguous memory area. + // Each 64-bit register typically corresponds to 2 32-bit integers. + template + class RegCache { + private: + MacroAssembler *_masm; + Register _regs[L]; + + public: + RegCache(MacroAssembler *masm, RegSet rs): _masm(masm) { + assert(rs.size() == L, "%u registers are used to cache %u 4-byte data", rs.size(), 2 * L); + auto it = rs.begin(); + for (auto &r: _regs) { + r = *it; + ++it; + } + } + + // generate load for the i'th register + void gen_load(uint i, Register base) { + assert(i < L, "invalid i: %u", i); + __ ld(_regs[i], Address(base, 8 * i)); + } + + // add i'th 32-bit integer to dest + void add_u32(const Register dest, uint i, const Register rtmp = t0) { + assert(i < 2 * L, "invalid i: %u", i); + + if (is_even(i)) { + // Use the bottom 32 bits. No need to mask off the top 32 bits + // as addw will do the right thing. + __ addw(dest, dest, _regs[i / 2]); + } else { + // Use the top 32 bits by right-shifting them. + __ srli(rtmp, _regs[i / 2], 32); + __ addw(dest, dest, rtmp); + } + } + }; + + typedef RegCache<8> BufRegCache; + + // a += value + x + ac; + // a = Integer.rotateLeft(a, s) + b; + void m5_FF_GG_HH_II_epilogue(BufRegCache& reg_cache, + Register a, Register b, Register c, Register d, + int k, int s, int t, + Register value) { + // a += ac + __ addw(a, a, t, t1); + + // a += x; + reg_cache.add_u32(a, k); + // a += value; + __ addw(a, a, value); + + // a = Integer.rotateLeft(a, s) + b; + __ rolw_imm(a, a, s); + __ addw(a, a, b); + } + + // a += ((b & c) | ((~b) & d)) + x + ac; + // a = Integer.rotateLeft(a, s) + b; + void md5_FF(BufRegCache& reg_cache, + Register a, Register b, Register c, Register d, + int k, int s, int t, + Register rtmp1, Register rtmp2) { + // rtmp1 = b & c + __ andr(rtmp1, b, c); + + // rtmp2 = (~b) & d + __ andn(rtmp2, d, b); + + // rtmp1 = (b & c) | ((~b) & d) + __ orr(rtmp1, rtmp1, rtmp2); + + m5_FF_GG_HH_II_epilogue(reg_cache, a, b, c, d, k, s, t, rtmp1); + } + + // a += ((b & d) | (c & (~d))) + x + ac; + // a = Integer.rotateLeft(a, s) + b; + void md5_GG(BufRegCache& reg_cache, + Register a, Register b, Register c, Register d, + int k, int s, int t, + Register rtmp1, Register rtmp2) { + // rtmp1 = b & d + __ andr(rtmp1, b, d); + + // rtmp2 = c & (~d) + __ andn(rtmp2, c, d); + + // rtmp1 = (b & d) | (c & (~d)) + __ orr(rtmp1, rtmp1, rtmp2); + + m5_FF_GG_HH_II_epilogue(reg_cache, a, b, c, d, k, s, t, rtmp1); + } + + // a += ((b ^ c) ^ d) + x + ac; + // a = Integer.rotateLeft(a, s) + b; + void md5_HH(BufRegCache& reg_cache, + Register a, Register b, Register c, Register d, + int k, int s, int t, + Register rtmp1, Register rtmp2) { + // rtmp1 = (b ^ c) ^ d + __ xorr(rtmp2, b, c); + __ xorr(rtmp1, rtmp2, d); + + m5_FF_GG_HH_II_epilogue(reg_cache, a, b, c, d, k, s, t, rtmp1); + } + + // a += (c ^ (b | (~d))) + x + ac; + // a = Integer.rotateLeft(a, s) + b; + void md5_II(BufRegCache& reg_cache, + Register a, Register b, Register c, Register d, + int k, int s, int t, + Register rtmp1, Register rtmp2) { + // rtmp1 = c ^ (b | (~d)) + __ orn(rtmp2, b, d); + __ xorr(rtmp1, c, rtmp2); + + m5_FF_GG_HH_II_epilogue(reg_cache, a, b, c, d, k, s, t, rtmp1); + } + + // Arguments: + // + // Inputs: + // c_rarg0 - byte[] source+offset + // c_rarg1 - int[] SHA.state + // c_rarg2 - int offset (multi_block == True) + // c_rarg3 - int limit (multi_block == True) + // + // Registers: + // x0 zero (zero) + // x1 ra (return address) + // x2 sp (stack pointer) + // x3 gp (global pointer) + // x4 tp (thread pointer) + // x5 t0 (tmp register) + // x6 t1 (tmp register) + // x7 t2 state0 + // x8 f0/s0 (frame pointer) + // x9 s1 + // x10 a0 rtmp1 / c_rarg0 + // x11 a1 rtmp2 / c_rarg1 + // x12 a2 a / c_rarg2 + // x13 a3 b / c_rarg3 + // x14 a4 c + // x15 a5 d + // x16 a6 buf + // x17 a7 state + // x18 s2 ofs [saved-reg] (multi_block == True) + // x19 s3 limit [saved-reg] (multi_block == True) + // x20 s4 state1 [saved-reg] + // x21 s5 state2 [saved-reg] + // x22 s6 state3 [saved-reg] + // x23 s7 + // x24 s8 buf0 [saved-reg] + // x25 s9 buf1 [saved-reg] + // x26 s10 buf2 [saved-reg] + // x27 s11 buf3 [saved-reg] + // x28 t3 buf4 + // x29 t4 buf5 + // x30 t5 buf6 + // x31 t6 buf7 + address generate_md5_implCompress(bool multi_block, const char *name) { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ pc(); + + // rotation constants + const int S11 = 7; + const int S12 = 12; + const int S13 = 17; + const int S14 = 22; + const int S21 = 5; + const int S22 = 9; + const int S23 = 14; + const int S24 = 20; + const int S31 = 4; + const int S32 = 11; + const int S33 = 16; + const int S34 = 23; + const int S41 = 6; + const int S42 = 10; + const int S43 = 15; + const int S44 = 21; + + const int64_t mask32 = 0xffffffff; + + Register buf_arg = c_rarg0; // a0 + Register state_arg = c_rarg1; // a1 + Register ofs_arg = c_rarg2; // a2 + Register limit_arg = c_rarg3; // a3 + + // we'll copy the args to these registers to free up a0-a3 + // to use for other values manipulated by instructions + // that can be compressed + Register buf = x16; // a6 + Register state = x17; // a7 + Register ofs = x18; // s2 + Register limit = x19; // s3 + + // using x12->15 to allow compressed instructions + Register a = x12; // a2 + Register b = x13; // a3 + Register c = x14; // a4 + Register d = x15; // a5 + + Register state0 = x7; // t2 + Register state1 = x20; // s4 + Register state2 = x21; // s5 + Register state3 = x22; // s6 + + // using x10->x11 to allow compressed instructions + Register rtmp1 = x10; // a0 + Register rtmp2 = x11; // a1 + + RegSet reg_cache_saved_regs = RegSet::of(x24, x25, x26, x27); // s8, s9, s10, s11 + RegSet reg_cache_regs; + reg_cache_regs += reg_cache_saved_regs; + reg_cache_regs += RegSet::of(x28, x29, x30, x31); // t3, t4, t5, t6 + BufRegCache reg_cache(_masm, reg_cache_regs); + + RegSet saved_regs; + if (multi_block) { + saved_regs += RegSet::of(ofs, limit); + } + saved_regs += RegSet::of(state1, state2, state3); + saved_regs += reg_cache_saved_regs; + + __ push_reg(saved_regs, sp); + + __ mv(buf, buf_arg); + __ mv(state, state_arg); + if (multi_block) { + __ mv(ofs, ofs_arg); + __ mv(limit, limit_arg); + } + + // to minimize the number of memory operations: + // read the 4 state 4-byte values in pairs, with a single ld, + // and split them into 2 registers + __ mv(t0, mask32); + __ ld(state0, Address(state)); + __ srli(state1, state0, 32); + __ andr(state0, state0, t0); + __ ld(state2, Address(state, 8)); + __ srli(state3, state2, 32); + __ andr(state2, state2, t0); + + Label md5_loop; + __ BIND(md5_loop); + + __ mv(a, state0); + __ mv(b, state1); + __ mv(c, state2); + __ mv(d, state3); + + // Round 1 + reg_cache.gen_load(0, buf); + md5_FF(reg_cache, a, b, c, d, 0, S11, 0xd76aa478, rtmp1, rtmp2); + md5_FF(reg_cache, d, a, b, c, 1, S12, 0xe8c7b756, rtmp1, rtmp2); + reg_cache.gen_load(1, buf); + md5_FF(reg_cache, c, d, a, b, 2, S13, 0x242070db, rtmp1, rtmp2); + md5_FF(reg_cache, b, c, d, a, 3, S14, 0xc1bdceee, rtmp1, rtmp2); + reg_cache.gen_load(2, buf); + md5_FF(reg_cache, a, b, c, d, 4, S11, 0xf57c0faf, rtmp1, rtmp2); + md5_FF(reg_cache, d, a, b, c, 5, S12, 0x4787c62a, rtmp1, rtmp2); + reg_cache.gen_load(3, buf); + md5_FF(reg_cache, c, d, a, b, 6, S13, 0xa8304613, rtmp1, rtmp2); + md5_FF(reg_cache, b, c, d, a, 7, S14, 0xfd469501, rtmp1, rtmp2); + reg_cache.gen_load(4, buf); + md5_FF(reg_cache, a, b, c, d, 8, S11, 0x698098d8, rtmp1, rtmp2); + md5_FF(reg_cache, d, a, b, c, 9, S12, 0x8b44f7af, rtmp1, rtmp2); + reg_cache.gen_load(5, buf); + md5_FF(reg_cache, c, d, a, b, 10, S13, 0xffff5bb1, rtmp1, rtmp2); + md5_FF(reg_cache, b, c, d, a, 11, S14, 0x895cd7be, rtmp1, rtmp2); + reg_cache.gen_load(6, buf); + md5_FF(reg_cache, a, b, c, d, 12, S11, 0x6b901122, rtmp1, rtmp2); + md5_FF(reg_cache, d, a, b, c, 13, S12, 0xfd987193, rtmp1, rtmp2); + reg_cache.gen_load(7, buf); + md5_FF(reg_cache, c, d, a, b, 14, S13, 0xa679438e, rtmp1, rtmp2); + md5_FF(reg_cache, b, c, d, a, 15, S14, 0x49b40821, rtmp1, rtmp2); + + // Round 2 + md5_GG(reg_cache, a, b, c, d, 1, S21, 0xf61e2562, rtmp1, rtmp2); + md5_GG(reg_cache, d, a, b, c, 6, S22, 0xc040b340, rtmp1, rtmp2); + md5_GG(reg_cache, c, d, a, b, 11, S23, 0x265e5a51, rtmp1, rtmp2); + md5_GG(reg_cache, b, c, d, a, 0, S24, 0xe9b6c7aa, rtmp1, rtmp2); + md5_GG(reg_cache, a, b, c, d, 5, S21, 0xd62f105d, rtmp1, rtmp2); + md5_GG(reg_cache, d, a, b, c, 10, S22, 0x02441453, rtmp1, rtmp2); + md5_GG(reg_cache, c, d, a, b, 15, S23, 0xd8a1e681, rtmp1, rtmp2); + md5_GG(reg_cache, b, c, d, a, 4, S24, 0xe7d3fbc8, rtmp1, rtmp2); + md5_GG(reg_cache, a, b, c, d, 9, S21, 0x21e1cde6, rtmp1, rtmp2); + md5_GG(reg_cache, d, a, b, c, 14, S22, 0xc33707d6, rtmp1, rtmp2); + md5_GG(reg_cache, c, d, a, b, 3, S23, 0xf4d50d87, rtmp1, rtmp2); + md5_GG(reg_cache, b, c, d, a, 8, S24, 0x455a14ed, rtmp1, rtmp2); + md5_GG(reg_cache, a, b, c, d, 13, S21, 0xa9e3e905, rtmp1, rtmp2); + md5_GG(reg_cache, d, a, b, c, 2, S22, 0xfcefa3f8, rtmp1, rtmp2); + md5_GG(reg_cache, c, d, a, b, 7, S23, 0x676f02d9, rtmp1, rtmp2); + md5_GG(reg_cache, b, c, d, a, 12, S24, 0x8d2a4c8a, rtmp1, rtmp2); + + // Round 3 + md5_HH(reg_cache, a, b, c, d, 5, S31, 0xfffa3942, rtmp1, rtmp2); + md5_HH(reg_cache, d, a, b, c, 8, S32, 0x8771f681, rtmp1, rtmp2); + md5_HH(reg_cache, c, d, a, b, 11, S33, 0x6d9d6122, rtmp1, rtmp2); + md5_HH(reg_cache, b, c, d, a, 14, S34, 0xfde5380c, rtmp1, rtmp2); + md5_HH(reg_cache, a, b, c, d, 1, S31, 0xa4beea44, rtmp1, rtmp2); + md5_HH(reg_cache, d, a, b, c, 4, S32, 0x4bdecfa9, rtmp1, rtmp2); + md5_HH(reg_cache, c, d, a, b, 7, S33, 0xf6bb4b60, rtmp1, rtmp2); + md5_HH(reg_cache, b, c, d, a, 10, S34, 0xbebfbc70, rtmp1, rtmp2); + md5_HH(reg_cache, a, b, c, d, 13, S31, 0x289b7ec6, rtmp1, rtmp2); + md5_HH(reg_cache, d, a, b, c, 0, S32, 0xeaa127fa, rtmp1, rtmp2); + md5_HH(reg_cache, c, d, a, b, 3, S33, 0xd4ef3085, rtmp1, rtmp2); + md5_HH(reg_cache, b, c, d, a, 6, S34, 0x04881d05, rtmp1, rtmp2); + md5_HH(reg_cache, a, b, c, d, 9, S31, 0xd9d4d039, rtmp1, rtmp2); + md5_HH(reg_cache, d, a, b, c, 12, S32, 0xe6db99e5, rtmp1, rtmp2); + md5_HH(reg_cache, c, d, a, b, 15, S33, 0x1fa27cf8, rtmp1, rtmp2); + md5_HH(reg_cache, b, c, d, a, 2, S34, 0xc4ac5665, rtmp1, rtmp2); + + // Round 4 + md5_II(reg_cache, a, b, c, d, 0, S41, 0xf4292244, rtmp1, rtmp2); + md5_II(reg_cache, d, a, b, c, 7, S42, 0x432aff97, rtmp1, rtmp2); + md5_II(reg_cache, c, d, a, b, 14, S43, 0xab9423a7, rtmp1, rtmp2); + md5_II(reg_cache, b, c, d, a, 5, S44, 0xfc93a039, rtmp1, rtmp2); + md5_II(reg_cache, a, b, c, d, 12, S41, 0x655b59c3, rtmp1, rtmp2); + md5_II(reg_cache, d, a, b, c, 3, S42, 0x8f0ccc92, rtmp1, rtmp2); + md5_II(reg_cache, c, d, a, b, 10, S43, 0xffeff47d, rtmp1, rtmp2); + md5_II(reg_cache, b, c, d, a, 1, S44, 0x85845dd1, rtmp1, rtmp2); + md5_II(reg_cache, a, b, c, d, 8, S41, 0x6fa87e4f, rtmp1, rtmp2); + md5_II(reg_cache, d, a, b, c, 15, S42, 0xfe2ce6e0, rtmp1, rtmp2); + md5_II(reg_cache, c, d, a, b, 6, S43, 0xa3014314, rtmp1, rtmp2); + md5_II(reg_cache, b, c, d, a, 13, S44, 0x4e0811a1, rtmp1, rtmp2); + md5_II(reg_cache, a, b, c, d, 4, S41, 0xf7537e82, rtmp1, rtmp2); + md5_II(reg_cache, d, a, b, c, 11, S42, 0xbd3af235, rtmp1, rtmp2); + md5_II(reg_cache, c, d, a, b, 2, S43, 0x2ad7d2bb, rtmp1, rtmp2); + md5_II(reg_cache, b, c, d, a, 9, S44, 0xeb86d391, rtmp1, rtmp2); + + __ addw(state0, state0, a); + __ addw(state1, state1, b); + __ addw(state2, state2, c); + __ addw(state3, state3, d); + + if (multi_block) { + __ addi(buf, buf, 64); + __ addi(ofs, ofs, 64); + // if (ofs <= limit) goto m5_loop + __ bge(limit, ofs, md5_loop); + __ mv(c_rarg0, ofs); // return ofs + } + + // to minimize the number of memory operations: + // write back the 4 state 4-byte values in pairs, with a single sd + __ mv(t0, mask32); + __ andr(state0, state0, t0); + __ slli(state1, state1, 32); + __ orr(state0, state0, state1); + __ sd(state0, Address(state)); + __ andr(state2, state2, t0); + __ slli(state3, state3, 32); + __ orr(state2, state2, state3); + __ sd(state2, Address(state, 8)); + + __ pop_reg(saved_regs, sp); + __ ret(); + + return (address) start; + } + // Continuation point for throwing of implicit exceptions that are // not handled in the current activation. Fabricates an exception // oop and initiates normal exception dispatching in this @@ -3882,6 +4250,11 @@ generate_string_indexof_stubs(); + if (UseMD5Intrinsics) { + StubRoutines::_md5_implCompress = generate_md5_implCompress(false, "md5_implCompress"); + StubRoutines::_md5_implCompressMB = generate_md5_implCompress(true, "md5_implCompressMB"); + } + BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod(); if (bs_nm != NULL) { StubRoutines::riscv::_method_entry_barrier = generate_method_entry_barrier(); diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/stubRoutines_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -36,8 +36,8 @@ } enum platform_dependent_constants { - code_size1 = 19000, // simply increase if too small (assembler will crash if too small) - code_size2 = 28000 // simply increase if too small (assembler will crash if too small) + code_size1 = 20000, // simply increase if too small (assembler will crash if too small) + code_size2 = 30000 // simply increase if too small (assembler will crash if too small) }; class riscv { diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1060,8 +1060,9 @@ Label L; __ ld(x28, Address(xmethod, Method::native_function_offset())); address unsatisfied = (SharedRuntime::native_method_throw_unsatisfied_link_error_entry()); - __ mv(t1, unsatisfied); - __ ld(t1, Address(t1, 0)); + __ mv(t, unsatisfied); + __ load_long_misaligned(t1, Address(t, 0), t0, 2); // 2 bytes aligned, but not 4 or 8 + __ bne(x28, t1, L); __ call_VM(noreg, CAST_FROM_FN_PTR(address, diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/templateTable_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/templateTable_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/templateTable_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/templateTable_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -288,9 +288,15 @@ void TemplateTable::sipush() { transition(vtos, itos); - __ load_unsigned_short(x10, at_bcp(1)); - __ revb_w_w(x10, x10); - __ sraiw(x10, x10, 16); + if (AvoidUnalignedAccesses) { + __ load_signed_byte(x10, at_bcp(1)); + __ load_unsigned_byte(t1, at_bcp(2)); + __ slli(x10, x10, 8); + __ add(x10, x10, t1); + } else { + __ load_unsigned_short(x10, at_bcp(1)); + __ revb_h_h(x10, x10); // reverse bytes in half-word and sign-extend + } } void TemplateTable::ldc(bool wide) @@ -378,7 +384,8 @@ // We are resolved if the resolved reference cache entry contains a // non-null object (String, MethodType, etc.) assert_different_registers(result, tmp); - __ get_cache_index_at_bcp(tmp, 1, index_size); + // register result is trashed by next load, let's use it as temporary register + __ get_cache_index_at_bcp(tmp, result, 1, index_size); __ load_resolved_reference_at_index(result, tmp); __ bnez(result, resolved); @@ -1695,8 +1702,15 @@ // load branch displacement if (!is_wide) { - __ lhu(x12, at_bcp(1)); - __ revb_h_h(x12, x12); // reverse bytes in half-word and sign-extend + if (AvoidUnalignedAccesses) { + __ lb(x12, at_bcp(1)); + __ lbu(t1, at_bcp(2)); + __ slli(x12, x12, 8); + __ add(x12, x12, t1); + } else { + __ lhu(x12, at_bcp(1)); + __ revb_h_h(x12, x12); // reverse bytes in half-word and sign-extend + } } else { __ lwu(x12, at_bcp(1)); __ revb_w_w(x12, x12); // reverse bytes in word and sign-extend @@ -2099,7 +2113,7 @@ // else [i = h] // Convert array[h].match to native byte-ordering before compare __ shadd(temp, h, array, temp, 3); - __ ld(temp, Address(temp, 0)); + __ lwu(temp, Address(temp, 0)); __ revb_w_w(temp, temp); // reverse bytes in word (32bit) and sign-extend Label L_done, L_greater; @@ -2122,7 +2136,7 @@ Label default_case; // Convert array[i].match to native byte-ordering before compare __ shadd(temp, i, array, temp, 3); - __ ld(temp, Address(temp, 0)); + __ lwu(temp, Address(temp, 0)); __ revb_w_w(temp, temp); // reverse bytes in word (32bit) and sign-extend __ bne(key, temp, default_case); diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/vm_version_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/vm_version_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/vm_version_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/vm_version_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,6 +1,7 @@ /* * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 @@ -32,10 +33,18 @@ #include OS_HEADER_INLINE(os) -const char* VM_Version::_uarch = ""; -const char* VM_Version::_vm_mode = ""; uint32_t VM_Version::_initial_vector_length = 0; +#define DEF_RV_FEATURE(NAME, PRETTY, BIT, FSTRING, FLAGF) \ +VM_Version::NAME##RVFeatureValue VM_Version::NAME(PRETTY, BIT, FSTRING); +RV_FEATURE_FLAGS(DEF_RV_FEATURE) + +#define ADD_RV_FEATURE_IN_LIST(NAME, PRETTY, BIT, FSTRING, FLAGF) \ + &VM_Version::NAME, +VM_Version::RVFeatureValue* VM_Version::_feature_list[] = { +RV_FEATURE_FLAGS(ADD_RV_FEATURE_IN_LIST) + nullptr}; + void VM_Version::initialize() { _supports_cx8 = true; _supports_atomic_getset4 = true; @@ -43,13 +52,14 @@ _supports_atomic_getset8 = true; _supports_atomic_getadd8 = true; - get_os_cpu_info(); + setup_cpu_available_features(); // check if satp.mode is supported, currently supports up to SV48(RV64) - if (get_satp_mode() > VM_SV48) { + if (satp_mode.value() > VM_SV48 || satp_mode.value() < VM_MBARE) { vm_exit_during_initialization( - err_msg("Unsupported satp mode: %s. Only satp modes up to sv48 are supported for now.", - _vm_mode)); + err_msg( + "Unsupported satp mode: SV%d. Only satp modes up to sv48 are supported for now.", + (int)satp_mode.value())); } if (FLAG_IS_DEFAULT(UseFMA)) { @@ -111,28 +121,36 @@ FLAG_SET_DEFAULT(UseCRC32CIntrinsics, false); } - if (UseMD5Intrinsics) { - warning("MD5 intrinsics are not available on this CPU."); - FLAG_SET_DEFAULT(UseMD5Intrinsics, false); + if (UseVectorizedMismatchIntrinsic) { + warning("VectorizedMismatch intrinsic is not available on this CPU."); + FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); + } + + if (FLAG_IS_DEFAULT(UseMD5Intrinsics)) { + FLAG_SET_DEFAULT(UseMD5Intrinsics, true); } if (UseRVV) { - if (!(_features & CPU_V)) { + if (!ext_V.enabled()) { warning("RVV is not supported on this CPU"); FLAG_SET_DEFAULT(UseRVV, false); } else { // read vector length from vector CSR vlenb - _initial_vector_length = get_current_vector_length(); + _initial_vector_length = cpu_vector_length(); } } - if (UseRVC && !(_features & CPU_C)) { + if (UseRVC && !ext_C.enabled()) { warning("RVC is not supported on this CPU"); FLAG_SET_DEFAULT(UseRVC, false); } if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { - FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); + if (unaligned_access.value() != MISALIGNED_FAST) { + FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); + } else { + FLAG_SET_DEFAULT(AvoidUnalignedAccesses, false); + } } if (UseZbb) { @@ -143,16 +161,6 @@ FLAG_SET_DEFAULT(UsePopCountInstruction, false); } - char buf[512]; - buf[0] = '\0'; - if (_uarch != NULL && strcmp(_uarch, "") != 0) snprintf(buf, sizeof(buf), "%s,", _uarch); - strcat(buf, "rv64"); -#define ADD_FEATURE_IF_SUPPORTED(id, name, bit) if (_features & CPU_##id) strcat(buf, name); - CPU_FEATURE_FLAGS(ADD_FEATURE_IF_SUPPORTED) -#undef ADD_FEATURE_IF_SUPPORTED - - _features_string = os::strdup(buf); - #ifdef COMPILER2 c2_initialize(); #endif // COMPILER2 diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/vm_version_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/vm_version_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/riscv/vm_version_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/riscv/vm_version_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -2,6 +2,7 @@ * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved. * Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 @@ -30,53 +31,174 @@ #include "runtime/abstract_vm_version.hpp" #include "runtime/arguments.hpp" #include "runtime/globals_extension.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/growableArray.hpp" #include "utilities/sizes.hpp" +class RiscvHwprobe; + class VM_Version : public Abstract_VM_Version { -#ifdef COMPILER2 -private: - static void c2_initialize(); -#endif // COMPILER2 + friend RiscvHwprobe; + private: + class RVFeatureValue { + const char* const _pretty; + const bool _feature_string; + const uint64_t _feature_bit; + bool _enabled; + int64_t _value; + public: + RVFeatureValue(const char* pretty, int bit_num, bool fstring) : + _pretty(pretty), _feature_string(fstring), _feature_bit(nth_bit(bit_num)), + _enabled(false), _value(-1) { + } + void enable_feature(int64_t value = 0) { + _enabled = true; + _value = value; + } + const char* const pretty() { return _pretty; } + const uint64_t feature_bit() { return _feature_bit; } + const bool feature_string() { return _feature_string; } + bool enabled() { return _enabled; } + int64_t value() { return _value; } + virtual void update_flag() = 0; + }; -// VM modes (satp.mode) privileged ISA 1.10 -enum VM_MODE { - VM_MBARE = 0, - VM_SV39 = 8, - VM_SV48 = 9, - VM_SV57 = 10, - VM_SV64 = 11 -}; + #define UPDATE_DEFAULT(flag) \ + void update_flag() { \ + assert(enabled(), "Must be."); \ + if (FLAG_IS_DEFAULT(flag)) { \ + FLAG_SET_DEFAULT(flag, true); \ + } \ + } \ + + #define NO_UPDATE_DEFAULT \ + void update_flag() {} \ + + // Frozen standard extensions + // I RV64I + // M Integer Multiplication and Division + // A Atomic Instructions + // F Single-Precision Floating-Point + // D Single-Precision Floating-Point + // (G = M + A + F + D) + // Q Quad-Precision Floating-Point + // C Compressed Instructions + // H Hypervisor + // + // Others, open and non-standard + // V Vector + // + // Cache Management Operations + // Zicbom Cache Block Management Operations + // Zicboz Cache Block Zero Operations + // Zicbop Cache Block Prefetch Operations + // + // Bit-manipulation + // Zba Address generation instructions + // Zbb Basic bit-manipulation + // Zbc Carry-less multiplication + // Zbs Single-bit instructions + // + // Zicsr Control and Status Register (CSR) Instructions + // Zifencei Instruction-Fetch Fence + // Zic64b Cache blocks must be 64 bytes in size, naturally aligned in the address space. + // Zihintpause Pause instruction HINT + // + // Other features and settings + // mvendorid Manufactory JEDEC id encoded, ISA vol 2 3.1.2.. + // marchid Id for microarch. Mvendorid plus marchid uniquely identify the microarch. + // mimpid A unique encoding of the version of the processor implementation. + // unaligned_access Unaligned memory accesses (unknown, unspported, emulated, slow, firmware, fast) + // satp mode SATP bits (number of virtual addr bits) mbare, sv39, sv48, sv57, sv64 + + #define RV_NO_FLAG_BIT (BitsPerWord+1) // nth_bit will return 0 on values larger than BitsPerWord + + // declaration name , extension name, bit pos ,in str, mapped flag) + #define RV_FEATURE_FLAGS(decl) \ + decl(ext_I , "i" , ('I' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_M , "m" , ('M' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_A , "a" , ('A' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_F , "f" , ('F' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_D , "d" , ('D' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_C , "c" , ('C' - 'A'), true , UPDATE_DEFAULT(UseRVC)) \ + decl(ext_Q , "q" , ('Q' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_H , "h" , ('H' - 'A'), true , NO_UPDATE_DEFAULT) \ + decl(ext_V , "v" , ('V' - 'A'), true , UPDATE_DEFAULT(UseRVV)) \ + decl(ext_Zicbom , "Zicbom" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zicboz , "Zicboz" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zicbop , "Zicbop" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zba , "Zba" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZba)) \ + decl(ext_Zbb , "Zbb" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbb)) \ + decl(ext_Zbc , "Zbc" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zbs , "Zbs" , RV_NO_FLAG_BIT, true , UPDATE_DEFAULT(UseZbs)) \ + decl(ext_Zicsr , "Zicsr" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zifencei , "Zifencei" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zic64b , "Zic64b" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(ext_Zihintpause , "Zihintpause" , RV_NO_FLAG_BIT, true , NO_UPDATE_DEFAULT) \ + decl(mvendorid , "VendorId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \ + decl(marchid , "ArchId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \ + decl(mimpid , "ImpId" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \ + decl(unaligned_access, "Unaligned" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \ + decl(satp_mode , "SATP" , RV_NO_FLAG_BIT, false, NO_UPDATE_DEFAULT) \ + + #define DECLARE_RV_FEATURE(NAME, PRETTY, BIT, FSTRING, FLAGF) \ + struct NAME##RVFeatureValue : public RVFeatureValue { \ + NAME##RVFeatureValue(const char* pretty, int bit, bool fstring) : \ + RVFeatureValue(pretty, bit, fstring) {} \ + FLAGF; \ + }; \ + static NAME##RVFeatureValue NAME; \ + + RV_FEATURE_FLAGS(DECLARE_RV_FEATURE) + #undef DECLARE_RV_FEATURE + + // VM modes (satp.mode) privileged ISA 1.10 + enum VM_MODE : int { + VM_NOTSET = -1, + VM_MBARE = 0, + VM_SV39 = 39, + VM_SV48 = 48, + VM_SV57 = 57, + VM_SV64 = 64 + }; + + static VM_MODE parse_satp_mode(const char* vm_mode); + + // Values from riscv_hwprobe() + enum UNALIGNED_ACCESS : int { + MISALIGNED_UNKNOWN = 0, + MISALIGNED_EMULATED = 1, + MISALIGNED_SLOW = 2, + MISALIGNED_FAST = 3, + MISALIGNED_UNSUPPORTED = 4 + }; -protected: - static const char* _uarch; - static const char* _vm_mode; + // Null terminated list + static RVFeatureValue* _feature_list[]; + + // Enables features in _feature_list + static void setup_cpu_available_features(); + // Helper for specific queries + static void os_aux_features(); + static char* os_uarch_additional_features(); + static void vendor_features(); + // Vendors specific features + static void rivos_features(); + + // Determine vector length iff ext_V/UseRVV + static uint32_t cpu_vector_length(); static uint32_t _initial_vector_length; - static void get_os_cpu_info(); - static uint32_t get_current_vector_length(); - static VM_MODE get_satp_mode(); -public: +#ifdef COMPILER2 + static void c2_initialize(); +#endif // COMPILER2 + + public: // Initialization static void initialize(); + static void initialize_cpu_information(); constexpr static bool supports_stack_watermark_barrier() { return true; } - - enum Feature_Flag { -#define CPU_FEATURE_FLAGS(decl) \ - decl(I, "i", 8) \ - decl(M, "m", 12) \ - decl(A, "a", 0) \ - decl(F, "f", 5) \ - decl(D, "d", 3) \ - decl(C, "c", 2) \ - decl(V, "v", 21) - -#define DECLARE_CPU_FEATURE_FLAG(id, name, bit) CPU_##id = (1 << bit), - CPU_FEATURE_FLAGS(DECLARE_CPU_FEATURE_FLAG) -#undef DECLARE_CPU_FEATURE_FLAG - }; - - static void initialize_cpu_information(void); }; #endif // CPU_RISCV_VM_VERSION_RISCV_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/x86/vm_version_x86.cpp openjdk-17-17.0.10+7/src/hotspot/cpu/x86/vm_version_x86.cpp --- openjdk-17-17.0.9+9/src/hotspot/cpu/x86/vm_version_x86.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/x86/vm_version_x86.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -787,7 +787,7 @@ _has_intel_jcc_erratum = IntelJccErratumMitigation; } - char buf[512]; + char buf[1024]; int res = jio_snprintf( buf, sizeof(buf), "(%u cores per cpu, %u threads per core) family %d model %d stepping %d microcode 0x%x", diff -Nru openjdk-17-17.0.9+9/src/hotspot/cpu/x86/x86.ad openjdk-17-17.0.10+7/src/hotspot/cpu/x86/x86.ad --- openjdk-17-17.0.9+9/src/hotspot/cpu/x86/x86.ad 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/cpu/x86/x86.ad 2024-01-09 21:18:15.000000000 +0000 @@ -8195,9 +8195,9 @@ ins_pipe( pipe_slow ); %} -instruct vmask_gen(kReg dst, rRegL len, rRegL temp) %{ +instruct vmask_gen(kReg dst, rRegL len, rRegL temp, rFlagsReg cr) %{ match(Set dst (VectorMaskGen len)); - effect(TEMP temp); + effect(TEMP temp, KILL cr); format %{ "vector_mask_gen32 $dst, $len \t! vector mask generator" %} ins_encode %{ __ genmask($dst$$KRegister, $len$$Register, $temp$$Register); diff -Nru openjdk-17-17.0.9+9/src/hotspot/os/linux/globals_linux.hpp openjdk-17-17.0.10+7/src/hotspot/os/linux/globals_linux.hpp --- openjdk-17-17.0.9+9/src/hotspot/os/linux/globals_linux.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os/linux/globals_linux.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -98,6 +98,15 @@ "to disable both the override and the printouts." \ "See prctl(PR_SET_TIMERSLACK) for more info.") \ \ + product(bool, THPStackMitigation, true, DIAGNOSTIC, \ + "If THPs are unconditionally enabled on the system (mode " \ + "\"always\"), the JVM will prevent THP from forming in " \ + "thread stacks. When disabled, the absence of this mitigation"\ + "allows THPs to form in thread stacks.") \ + \ + develop(bool, DelayThreadStartALot, false, \ + "Artificially delay thread starts randomly for testing.") \ + \ // end of RUNTIME_OS_FLAGS diff -Nru openjdk-17-17.0.9+9/src/hotspot/os/linux/hugepages.cpp openjdk-17-17.0.10+7/src/hotspot/os/linux/hugepages.cpp --- openjdk-17-17.0.9+9/src/hotspot/os/linux/hugepages.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os/linux/hugepages.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, Red Hat Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "hugepages.hpp" + +#include "logging/log.hpp" +#include "logging/logStream.hpp" +#include "runtime/os.hpp" +#include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/ostream.hpp" + +#include + +StaticHugePageSupport::StaticHugePageSupport() : + _initialized(false), _pagesizes(), _default_hugepage_size(SIZE_MAX), _inconsistent(false) {} + +os::PageSizes StaticHugePageSupport::pagesizes() const { + assert(_initialized, "Not initialized"); + return _pagesizes; +} + +size_t StaticHugePageSupport::default_hugepage_size() const { + assert(_initialized, "Not initialized"); + return _default_hugepage_size; +} + +// Scan /proc/meminfo and return value of Hugepagesize +static size_t scan_default_hugepagesize() { + size_t pagesize = 0; + + // large_page_size on Linux is used to round up heap size. x86 uses either + // 2M or 4M page, depending on whether PAE (Physical Address Extensions) + // mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. IA64 can use + // page as large as 1G. + // + // Here we try to figure out page size by parsing /proc/meminfo and looking + // for a line with the following format: + // Hugepagesize: 2048 kB + // + // If we can't determine the value (e.g. /proc is not mounted, or the text + // format has been changed), we'll set largest page size to 0 + + FILE *fp = os::fopen("/proc/meminfo", "r"); + if (fp) { + while (!feof(fp)) { + int x = 0; + char buf[16]; + if (fscanf(fp, "Hugepagesize: %d", &x) == 1) { + if (x && fgets(buf, sizeof(buf), fp) && strcmp(buf, " kB\n") == 0) { + pagesize = x * K; + break; + } + } else { + // skip to next line + for (;;) { + int ch = fgetc(fp); + if (ch == EOF || ch == (int)'\n') break; + } + } + } + fclose(fp); + } + + return pagesize; +} + +// Given a file that contains a single (integral) number, return that number in (*out) and true; +// in case of an error, return false. +static bool read_number_file(const char* file, size_t* out) { + FILE* f = ::fopen(file, "r"); + bool rc = false; + if (f != nullptr) { + uint64_t i = 0; + if (::fscanf(f, SIZE_FORMAT, out) == 1) { + rc = true; + } + ::fclose(f); + } + return rc; +} + +static const char* const sys_hugepages = "/sys/kernel/mm/hugepages"; + +// Scan all directories in /sys/kernel/mm/hugepages/hugepages-xxxx +// to discover the available page sizes +static os::PageSizes scan_hugepages() { + + os::PageSizes pagesizes; + + DIR* dir = opendir(sys_hugepages); + + if (dir != nullptr) { + struct dirent *entry; + size_t pagesize; + while ((entry = readdir(dir)) != nullptr) { + if (entry->d_type == DT_DIR && + sscanf(entry->d_name, "hugepages-%zukB", &pagesize) == 1) { + // The kernel is using kB, hotspot uses bytes + // Add each found Large Page Size to page_sizes + pagesize *= K; + pagesizes.add(pagesize); + } + } + closedir(dir); + } + + return pagesizes; +} + +void StaticHugePageSupport::print_on(outputStream* os) { + if (_initialized) { + os->print_cr("Static hugepage support:"); + for (size_t s = _pagesizes.smallest(); s != 0; s = _pagesizes.next_larger(s)) { + os->print_cr(" hugepage size: " EXACTFMT, EXACTFMTARGS(s)); + } + os->print_cr(" default hugepage size: " EXACTFMT, EXACTFMTARGS(_default_hugepage_size)); + } else { + os->print_cr(" unknown."); + } + if (_inconsistent) { + os->print_cr(" Support inconsistent. JVM will not use static hugepages."); + } +} + +void StaticHugePageSupport::scan_os() { + _default_hugepage_size = scan_default_hugepagesize(); + if (_default_hugepage_size > 0) { + _pagesizes = scan_hugepages(); + // See https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt: /proc/meminfo should match + // /sys/kernel/mm/hugepages/hugepages-xxxx. However, we may run on a broken kernel (e.g. on WSL) + // that only exposes /proc/meminfo but not /sys/kernel/mm/hugepages. In that case, we are not + // sure about the state of hugepage support by the kernel, so we won't use static hugepages. + if (!_pagesizes.contains(_default_hugepage_size)) { + log_info(pagesize)("Unexpected configuration: default pagesize (" SIZE_FORMAT ") " + "has no associated directory in /sys/kernel/mm/hugepages..", _default_hugepage_size); + _inconsistent = true; + } + } + _initialized = true; + LogTarget(Info, pagesize) lt; + if (lt.is_enabled()) { + LogStream ls(lt); + print_on(&ls); + } +} + +THPSupport::THPSupport() : + _initialized(false), _mode(THPMode::never), _pagesize(SIZE_MAX) {} + + +THPMode THPSupport::mode() const { + assert(_initialized, "Not initialized"); + return _mode; +} + +size_t THPSupport::pagesize() const { + assert(_initialized, "Not initialized"); + return _pagesize; +} + +void THPSupport::scan_os() { + // Scan /sys/kernel/mm/transparent_hugepage/enabled + // see mm/huge_memory.c + _mode = THPMode::never; + const char* filename = "/sys/kernel/mm/transparent_hugepage/enabled"; + FILE* f = ::fopen(filename, "r"); + if (f != nullptr) { + char buf[64]; + char* s = fgets(buf, sizeof(buf), f); + assert(s == buf, "Should have worked"); + if (::strstr(buf, "[madvise]") != nullptr) { + _mode = THPMode::madvise; + } else if (::strstr(buf, "[always]") != nullptr) { + _mode = THPMode::always; + } else { + assert(::strstr(buf, "[never]") != nullptr, "Weird content of %s: %s", filename, buf); + } + fclose(f); + } + + // Scan large page size for THP from hpage_pmd_size + _pagesize = 0; + if (read_number_file("/sys/kernel/mm/transparent_hugepage/hpage_pmd_size", &_pagesize)) { + assert(_pagesize > 0, "Expected"); + } + _initialized = true; + + LogTarget(Info, pagesize) lt; + if (lt.is_enabled()) { + LogStream ls(lt); + print_on(&ls); + } +} + +void THPSupport::print_on(outputStream* os) { + if (_initialized) { + os->print_cr("Transparent hugepage (THP) support:"); + os->print_cr(" THP mode: %s", + (_mode == THPMode::always ? "always" : (_mode == THPMode::never ? "never" : "madvise"))); + os->print_cr(" THP pagesize: " EXACTFMT, EXACTFMTARGS(_pagesize)); + } else { + os->print_cr(" unknown."); + } +} + +StaticHugePageSupport HugePages::_static_hugepage_support; +THPSupport HugePages::_thp_support; + +void HugePages::initialize() { + _static_hugepage_support.scan_os(); + _thp_support.scan_os(); +} + +void HugePages::print_on(outputStream* os) { + _static_hugepage_support.print_on(os); + _thp_support.print_on(os); +} diff -Nru openjdk-17-17.0.9+9/src/hotspot/os/linux/hugepages.hpp openjdk-17-17.0.10+7/src/hotspot/os/linux/hugepages.hpp --- openjdk-17-17.0.9+9/src/hotspot/os/linux/hugepages.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os/linux/hugepages.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2023, Red Hat Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef OS_LINUX_HUGEPAGES_HPP +#define OS_LINUX_HUGEPAGES_HPP + +#include "memory/allStatic.hpp" +#include "runtime/os.hpp" // for os::PageSizes +#include "utilities/globalDefinitions.hpp" + +class outputStream; + +// Header contains the interface that reads OS information about +// available hugepage support: +// - class StaticHugePageSupport - about static (non-THP) hugepages +// - class THPSupport - about transparent huge pages +// and: +// - class HugePages - a static umbrella wrapper + +// Information about static (non-thp) hugepages +class StaticHugePageSupport { + bool _initialized; + + // All supported hugepage sizes (sizes for which entries exist + // in /sys/kernel/mm/hugepages/hugepage-xxx) + os::PageSizes _pagesizes; + + // Contains the default hugepage. The "default hugepage size" is the one that + // - is marked in /proc/meminfo as "Hugepagesize" + // - is the size one gets when using mmap(MAP_HUGETLB) when omitting size specifiers like MAP_HUGE_SHIFT) + size_t _default_hugepage_size; + + // If true, the kernel support for hugepages is inconsistent + bool _inconsistent; + +public: + StaticHugePageSupport(); + + void scan_os(); + + os::PageSizes pagesizes() const; + size_t default_hugepage_size() const; + void print_on(outputStream* os); + + bool inconsistent() const { return _inconsistent; } +}; + +enum class THPMode { always, never, madvise }; + +// 2) for transparent hugepages +class THPSupport { + bool _initialized; + + // See /sys/kernel/mm/transparent_hugepages/enabled + THPMode _mode; + + // Contains the THP page size + size_t _pagesize; + +public: + + THPSupport(); + + // Queries the OS, fills in object + void scan_os(); + + THPMode mode() const; + size_t pagesize() const; + void print_on(outputStream* os); +}; + +// Umbrella static interface +class HugePages : public AllStatic { + + static StaticHugePageSupport _static_hugepage_support; + static THPSupport _thp_support; + +public: + + static const StaticHugePageSupport& static_info() { return _static_hugepage_support; } + static const THPSupport& thp_info() { return _thp_support; } + + static size_t default_static_hugepage_size() { return _static_hugepage_support.default_hugepage_size(); } + static bool supports_static_hugepages() { return default_static_hugepage_size() > 0 && !_static_hugepage_support.inconsistent(); } + static THPMode thp_mode() { return _thp_support.mode(); } + static bool supports_thp() { return thp_mode() == THPMode::madvise || thp_mode() == THPMode::always; } + static size_t thp_pagesize() { return _thp_support.pagesize(); } + + static void initialize(); + static void print_on(outputStream* os); +}; + +#endif // OS_LINUX_HUGEPAGES_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/os/linux/os_linux.cpp openjdk-17-17.0.10+7/src/hotspot/os/linux/os_linux.cpp --- openjdk-17-17.0.9+9/src/hotspot/os/linux/os_linux.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os/linux/os_linux.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -30,6 +30,7 @@ #include "code/vtableStubs.hpp" #include "compiler/compileBroker.hpp" #include "compiler/disassembler.hpp" +#include "hugepages.hpp" #include "interpreter/interpreter.hpp" #include "jvmtifiles/jvmti.h" #include "logging/log.hpp" @@ -166,7 +167,6 @@ bool os::Linux::_supports_fast_thread_cpu_time = false; const char * os::Linux::_libc_version = NULL; const char * os::Linux::_libpthread_version = NULL; -size_t os::Linux::_default_large_page_size = 0; #ifdef __GLIBC__ os::Linux::mallinfo_func_t os::Linux::_mallinfo = NULL; @@ -721,6 +721,10 @@ assert(osthread->pthread_id() != 0, "pthread_id was not set as expected"); + if (DelayThreadStartALot) { + os::naked_short_sleep(100); + } + // call one more level start routine thread->call_run(); @@ -857,6 +861,7 @@ // Calculate stack size if it's not specified by caller. size_t stack_size = os::Posix::get_initial_stack_size(thr_type, req_stack_size); size_t guard_size = os::Linux::default_guard_size(thr_type); + // Configure glibc guard page. Must happen before calling // get_static_tls_area_size(), which uses the guard_size. pthread_attr_setguardsize(&attr, guard_size); @@ -877,13 +882,16 @@ } assert(is_aligned(stack_size, os::vm_page_size()), "stack_size not aligned"); - // Add an additional page to the stack size to reduce its chances of getting large page aligned - // so that the stack does not get backed by a transparent huge page. - size_t default_large_page_size = os::Linux::default_large_page_size(); - if (default_large_page_size != 0 && - stack_size >= default_large_page_size && - is_aligned(stack_size, default_large_page_size)) { - stack_size += os::vm_page_size(); + if (THPStackMitigation) { + // In addition to the glibc guard page that prevents inter-thread-stack hugepage + // coalescing (see comment in os::Linux::default_guard_size()), we also make + // sure the stack size itself is not huge-page-size aligned; that makes it much + // more likely for thread stack boundaries to be unaligned as well and hence + // protects thread stacks from being targeted by khugepaged. + if (HugePages::thp_pagesize() > 0 && + is_aligned(stack_size, HugePages::thp_pagesize())) { + stack_size += os::vm_page_size(); + } } int status = pthread_attr_setstacksize(&attr, stack_size); @@ -1791,11 +1799,11 @@ static Elf32_Half running_arch_code=EM_SH; #elif (defined RISCV) static Elf32_Half running_arch_code=EM_RISCV; -#elif (defined LOONGARCH) +#elif (defined LOONGARCH64) static Elf32_Half running_arch_code=EM_LOONGARCH; #else #error Method os::dll_load requires that one of following is defined:\ - AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc + AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc #endif // Identify compatibility class for VM's architecture and library's architecture @@ -3135,6 +3143,27 @@ } size_t os::Linux::default_guard_size(os::ThreadType thr_type) { + + if (THPStackMitigation) { + // If THPs are unconditionally enabled, the following scenario can lead to huge RSS + // - parent thread spawns, in quick succession, multiple child threads + // - child threads are slow to start + // - thread stacks of future child threads are adjacent and get merged into one large VMA + // by the kernel, and subsequently transformed into huge pages by khugepaged + // - child threads come up, place JVM guard pages, thus splinter the large VMA, splinter + // the huge pages into many (still paged-in) small pages. + // The result of that sequence are thread stacks that are fully paged-in even though the + // threads did not even start yet. + // We prevent that by letting the glibc allocate a guard page, which causes a VMA with different + // permission bits to separate two ajacent thread stacks and therefore prevent merging stacks + // into one VMA. + // + // Yes, this means we have two guard sections - the glibc and the JVM one - per thread. But the + // cost for that one extra protected page is dwarfed from a large win in performance and memory + // that avoiding interference by khugepaged buys us. + return os::vm_page_size(); + } + // Creating guard page is very expensive. Java thread has HotSpot // guard pages, only enable glibc guard page for non-Java threads. // (Remember: compiler thread is a Java thread, too!) @@ -3614,7 +3643,7 @@ } int os::Linux::hugetlbfs_page_size_flag(size_t page_size) { - if (page_size != default_large_page_size()) { + if (page_size != HugePages::default_static_hugepage_size()) { return (exact_log2(page_size) << MAP_HUGE_SHIFT); } return 0; @@ -3722,79 +3751,6 @@ static size_t _large_page_size = 0; -static size_t scan_default_large_page_size() { - size_t default_large_page_size = 0; - - // large_page_size on Linux is used to round up heap size. x86 uses either - // 2M or 4M page, depending on whether PAE (Physical Address Extensions) - // mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. IA64 can use - // page as large as 1G. - // - // Here we try to figure out page size by parsing /proc/meminfo and looking - // for a line with the following format: - // Hugepagesize: 2048 kB - // - // If we can't determine the value (e.g. /proc is not mounted, or the text - // format has been changed), we'll set largest page size to 0 - - FILE *fp = fopen("/proc/meminfo", "r"); - if (fp) { - while (!feof(fp)) { - int x = 0; - char buf[16]; - if (fscanf(fp, "Hugepagesize: %d", &x) == 1) { - if (x && fgets(buf, sizeof(buf), fp) && strcmp(buf, " kB\n") == 0) { - default_large_page_size = x * K; - break; - } - } else { - // skip to next line - for (;;) { - int ch = fgetc(fp); - if (ch == EOF || ch == (int)'\n') break; - } - } - } - fclose(fp); - } - - return default_large_page_size; -} - -static os::PageSizes scan_multiple_page_support() { - // Scan /sys/kernel/mm/hugepages - // to discover the available page sizes - const char* sys_hugepages = "/sys/kernel/mm/hugepages"; - os::PageSizes page_sizes; - - DIR *dir = opendir(sys_hugepages); - - struct dirent *entry; - size_t page_size; - while ((entry = readdir(dir)) != NULL) { - if (entry->d_type == DT_DIR && - sscanf(entry->d_name, "hugepages-%zukB", &page_size) == 1) { - // The kernel is using kB, hotspot uses bytes - // Add each found Large Page Size to page_sizes - page_sizes.add(page_size * K); - } - } - closedir(dir); - - LogTarget(Debug, pagesize) lt; - if (lt.is_enabled()) { - LogStream ls(lt); - ls.print("Large Page sizes: "); - page_sizes.print_on(&ls); - } - - return page_sizes; -} - -size_t os::Linux::default_large_page_size() { - return _default_large_page_size; -} - void warn_no_large_pages_configured() { if (!FLAG_IS_DEFAULT(UseLargePages)) { log_warning(pagesize)("UseLargePages disabled, no large pages configured and available on the system."); @@ -3847,10 +3803,44 @@ return false; } +struct LargePageInitializationLoggerMark { + ~LargePageInitializationLoggerMark() { + LogTarget(Info, pagesize) lt; + if (lt.is_enabled()) { + LogStream ls(lt); + if (UseLargePages) { + ls.print_cr("UseLargePages=1, UseTransparentHugePages=%d, UseHugeTLBFS=%d, UseSHM=%d", + UseTransparentHugePages, UseHugeTLBFS, UseSHM); + ls.print("Large page support enabled. Usable page sizes: "); + os::page_sizes().print_on(&ls); + ls.print_cr(". Default large page size: " EXACTFMT ".", EXACTFMTARGS(os::large_page_size())); + } else { + ls.print("Large page support disabled."); + } + } + } +}; + void os::large_page_init() { - // Always initialize the default large page size even if large pages are not being used. - size_t default_large_page_size = scan_default_large_page_size(); - os::Linux::_default_large_page_size = default_large_page_size; + LargePageInitializationLoggerMark logger; + + // Query OS information first. + HugePages::initialize(); + + // If THPs are unconditionally enabled (THP mode "always"), khugepaged may attempt to + // coalesce small pages in thread stacks to huge pages. That costs a lot of memory and + // is usually unwanted for thread stacks. Therefore we attempt to prevent THP formation in + // thread stacks unless the user explicitly allowed THP formation by manually disabling + // -XX:-THPStackMitigation. + if (HugePages::thp_mode() == THPMode::always) { + if (THPStackMitigation) { + log_info(pagesize)("JVM will attempt to prevent THPs in thread stacks."); + } else { + log_info(pagesize)("JVM will *not* prevent THPs in thread stacks. This may cause high RSS."); + } + } else { + FLAG_SET_ERGO(THPStackMitigation, false); // Mitigation not needed + } // 1) Handle the case where we do not want to use huge pages if (!UseLargePages && @@ -3870,67 +3860,77 @@ return; } - // 2) check if large pages are configured - if (default_large_page_size == 0) { - // No large pages configured, return. + // 2) check if the OS supports THPs resp. static hugepages. + if (UseTransparentHugePages && !HugePages::supports_thp()) { + if (!FLAG_IS_DEFAULT(UseTransparentHugePages)) { + log_warning(pagesize)("UseTransparentHugePages disabled, transparent huge pages are not supported by the operating system."); + } + UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false; + return; + } + if (!UseTransparentHugePages && !HugePages::supports_static_hugepages()) { warn_no_large_pages_configured(); - UseLargePages = false; - UseTransparentHugePages = false; - UseHugeTLBFS = false; - UseSHM = false; + UseLargePages = UseTransparentHugePages = UseHugeTLBFS = UseSHM = false; return; } - os::PageSizes all_large_pages = scan_multiple_page_support(); - // 3) Consistency check and post-processing + if (UseTransparentHugePages) { + // In THP mode: + // - os::large_page_size() is the *THP page size* + // - os::pagesizes() has two members, the THP page size and the system page size + assert(HugePages::supports_thp() && HugePages::thp_pagesize() > 0, "Missing OS info"); + _large_page_size = HugePages::thp_pagesize(); + _page_sizes.add(_large_page_size); + _page_sizes.add(os::vm_page_size()); - // It is unclear if /sys/kernel/mm/hugepages/ and /proc/meminfo could disagree. Manually - // re-add the default page size to the list of page sizes to be sure. - all_large_pages.add(default_large_page_size); - - // Check LargePageSizeInBytes matches an available page size and if so set _large_page_size - // using LargePageSizeInBytes as the maximum allowed large page size. If LargePageSizeInBytes - // doesn't match an available page size set _large_page_size to default_large_page_size - // and use it as the maximum. - if (FLAG_IS_DEFAULT(LargePageSizeInBytes) || - LargePageSizeInBytes == 0 || - LargePageSizeInBytes == default_large_page_size) { - _large_page_size = default_large_page_size; - log_info(pagesize)("Using the default large page size: " SIZE_FORMAT "%s", - byte_size_in_exact_unit(_large_page_size), - exact_unit_for_byte_size(_large_page_size)); - } else { - if (all_large_pages.contains(LargePageSizeInBytes)) { - _large_page_size = LargePageSizeInBytes; - log_info(pagesize)("Overriding default large page size (" SIZE_FORMAT "%s) " - "using LargePageSizeInBytes: " SIZE_FORMAT "%s", - byte_size_in_exact_unit(default_large_page_size), - exact_unit_for_byte_size(default_large_page_size), - byte_size_in_exact_unit(_large_page_size), - exact_unit_for_byte_size(_large_page_size)); - } else { + } else { + + // In static hugepage mode: + // - os::large_page_size() is the default static hugepage size (/proc/meminfo "Hugepagesize") + // - os::pagesizes() contains all hugepage sizes the kernel supports, regardless whether there + // are pages configured in the pool or not (from /sys/kernel/hugepages/hugepage-xxxx ...) + os::PageSizes all_large_pages = HugePages::static_info().pagesizes(); + const size_t default_large_page_size = HugePages::default_static_hugepage_size(); + + // 3) Consistency check and post-processing + + // Check LargePageSizeInBytes matches an available page size and if so set _large_page_size + // using LargePageSizeInBytes as the maximum allowed large page size. If LargePageSizeInBytes + // doesn't match an available page size set _large_page_size to default_large_page_size + // and use it as the maximum. + if (FLAG_IS_DEFAULT(LargePageSizeInBytes) || + LargePageSizeInBytes == 0 || + LargePageSizeInBytes == default_large_page_size) { _large_page_size = default_large_page_size; - log_info(pagesize)("LargePageSizeInBytes is not a valid large page size (" SIZE_FORMAT "%s) " - "using the default large page size: " SIZE_FORMAT "%s", - byte_size_in_exact_unit(LargePageSizeInBytes), - exact_unit_for_byte_size(LargePageSizeInBytes), + log_info(pagesize)("Using the default large page size: " SIZE_FORMAT "%s", byte_size_in_exact_unit(_large_page_size), exact_unit_for_byte_size(_large_page_size)); + } else { + if (all_large_pages.contains(LargePageSizeInBytes)) { + _large_page_size = LargePageSizeInBytes; + log_info(pagesize)("Overriding default large page size (" SIZE_FORMAT "%s) " + "using LargePageSizeInBytes: " SIZE_FORMAT "%s", + byte_size_in_exact_unit(default_large_page_size), + exact_unit_for_byte_size(default_large_page_size), + byte_size_in_exact_unit(_large_page_size), + exact_unit_for_byte_size(_large_page_size)); + } else { + _large_page_size = default_large_page_size; + log_info(pagesize)("LargePageSizeInBytes is not a valid large page size (" SIZE_FORMAT "%s) " + "using the default large page size: " SIZE_FORMAT "%s", + byte_size_in_exact_unit(LargePageSizeInBytes), + exact_unit_for_byte_size(LargePageSizeInBytes), + byte_size_in_exact_unit(_large_page_size), + exact_unit_for_byte_size(_large_page_size)); + } } - } - - // Populate _page_sizes with large page sizes less than or equal to - // _large_page_size. - for (size_t page_size = _large_page_size; page_size != 0; - page_size = all_large_pages.next_smaller(page_size)) { - _page_sizes.add(page_size); - } - LogTarget(Info, pagesize) lt; - if (lt.is_enabled()) { - LogStream ls(lt); - ls.print("Usable page sizes: "); - _page_sizes.print_on(&ls); + // Populate _page_sizes with large page sizes less than or equal to + // _large_page_size. + for (size_t page_size = _large_page_size; page_size != 0; + page_size = all_large_pages.next_smaller(page_size)) { + _page_sizes.add(page_size); + } } // Now determine the type of large pages to use: diff -Nru openjdk-17-17.0.9+9/src/hotspot/os/linux/os_linux.hpp openjdk-17-17.0.10+7/src/hotspot/os/linux/os_linux.hpp --- openjdk-17-17.0.9+9/src/hotspot/os/linux/os_linux.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os/linux/os_linux.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -50,8 +50,6 @@ static GrowableArray* _cpu_to_node; static GrowableArray* _nindex_to_node; - static size_t _default_large_page_size; - protected: static julong _physical_memory; @@ -75,10 +73,6 @@ static GrowableArray* cpu_to_node() { return _cpu_to_node; } static GrowableArray* nindex_to_node() { return _nindex_to_node; } - static size_t default_large_page_size(); - static size_t scan_default_large_page_size(); - static os::PageSizes scan_multiple_page_support(); - static bool setup_large_page_type(size_t page_size); static bool transparent_huge_pages_sanity_check(bool warn, size_t pages_size); static bool hugetlbfs_sanity_check(bool warn, size_t page_size); diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/atomic_linux_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -33,10 +33,23 @@ // Note that memory_order_conservative requires a full barrier after atomic stores. // See https://patchwork.kernel.org/patch/3575821/ +#if defined(__clang_major__) +#define FULL_COMPILER_ATOMIC_SUPPORT +#elif (__GNUC__ > 13) || ((__GNUC__ == 13) && (__GNUC_MINOR__ >= 2)) +#define FULL_COMPILER_ATOMIC_SUPPORT +#endif + template struct Atomic::PlatformAdd { template D add_and_fetch(D volatile* dest, I add_value, atomic_memory_order order) const { + +#ifndef FULL_COMPILER_ATOMIC_SUPPORT + // If we add add and fetch for sub word and are using older compiler + // it must be added here due to not using lib atomic. + STATIC_ASSERT(byte_size >= 4); +#endif + if (order != memory_order_relaxed) { FULL_MEM_BARRIER; } @@ -55,12 +68,65 @@ } }; +#ifndef FULL_COMPILER_ATOMIC_SUPPORT +template<> +template +inline T Atomic::PlatformCmpxchg<1>::operator()(T volatile* dest __attribute__((unused)), + T compare_value, + T exchange_value, + atomic_memory_order order) const { + STATIC_ASSERT(1 == sizeof(T)); + + if (order != memory_order_relaxed) { + FULL_MEM_BARRIER; + } + + uint32_t volatile* aligned_dst = (uint32_t volatile*)(((uintptr_t)dest) & (~((uintptr_t)0x3))); + int shift = 8 * (((uintptr_t)dest) - ((uintptr_t)aligned_dst)); // 0, 8, 16, 24 + + uint64_t mask = 0xfful << shift; // 0x00000000..FF.. + uint64_t remask = ~mask; // 0xFFFFFFFF..00.. + + uint64_t w_cv = ((uint64_t)(unsigned char)compare_value) << shift; // widen to 64-bit 0x00000000..CC.. + uint64_t w_ev = ((uint64_t)(unsigned char)exchange_value) << shift; // widen to 64-bit 0x00000000..EE.. + + uint64_t old_value; + uint64_t rc_temp; + + __asm__ __volatile__ ( + "1: lr.w %0, %2 \n\t" + " and %1, %0, %5 \n\t" // ignore unrelated bytes and widen to 64-bit 0x00000000..XX.. + " bne %1, %3, 2f \n\t" // compare 64-bit w_cv + " and %1, %0, %6 \n\t" // remove old byte + " or %1, %1, %4 \n\t" // add new byte + " sc.w %1, %1, %2 \n\t" // store new word + " bnez %1, 1b \n\t" + "2: \n\t" + : /*%0*/"=&r" (old_value), /*%1*/"=&r" (rc_temp), /*%2*/"+A" (*aligned_dst) + : /*%3*/"r" (w_cv), /*%4*/"r" (w_ev), /*%5*/"r" (mask), /*%6*/"r" (remask) + : "memory" ); + + if (order != memory_order_relaxed) { + FULL_MEM_BARRIER; + } + + return (T)((old_value & mask) >> shift); +} +#endif + template template inline T Atomic::PlatformXchg::operator()(T volatile* dest, T exchange_value, atomic_memory_order order) const { +#ifndef FULL_COMPILER_ATOMIC_SUPPORT + // If we add xchg for sub word and are using older compiler + // it must be added here due to not using lib atomic. + STATIC_ASSERT(byte_size >= 4); +#endif + STATIC_ASSERT(byte_size == sizeof(T)); + if (order != memory_order_relaxed) { FULL_MEM_BARRIER; } @@ -80,6 +146,11 @@ T compare_value, T exchange_value, atomic_memory_order order) const { + +#ifndef FULL_COMPILER_ATOMIC_SUPPORT + STATIC_ASSERT(byte_size >= 4); +#endif + STATIC_ASSERT(byte_size == sizeof(T)); T value = compare_value; if (order != memory_order_relaxed) { @@ -148,4 +219,6 @@ void operator()(volatile T* p, T v) const { release_store(p, v); OrderAccess::fence(); } }; +#undef FULL_COMPILER_ATOMIC_SUPPORT + #endif // OS_CPU_LINUX_RISCV_ATOMIC_LINUX_RISCV_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/orderAccess_linux_riscv.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -37,7 +37,7 @@ inline void OrderAccess::loadstore() { acquire(); } inline void OrderAccess::storeload() { fence(); } -#define FULL_MEM_BARRIER __sync_synchronize() +#define FULL_MEM_BARRIER __atomic_thread_fence(__ATOMIC_SEQ_CST); #define READ_MEM_BARRIER __atomic_thread_fence(__ATOMIC_ACQUIRE); #define WRITE_MEM_BARRIER __atomic_thread_fence(__ATOMIC_RELEASE); diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "logging/log.hpp" +#include "riscv_flush_icache.hpp" +#include "runtime/os.hpp" +#include "runtime/vm_version.hpp" +#include "utilities/debug.hpp" + +#include +#include + +#define check_with_errno(check_type, cond, msg) \ + do { \ + int err = errno; \ + check_type(cond, "%s; error='%s' (errno=%s)", msg, os::strerror(err), \ + os::errno_name(err)); \ +} while (false) + +#define assert_with_errno(cond, msg) check_with_errno(assert, cond, msg) +#define guarantee_with_errno(cond, msg) check_with_errno(guarantee, cond, msg) + +#ifndef NR_riscv_flush_icache +#ifndef NR_arch_specific_syscall +#define NR_arch_specific_syscall 244 +#endif +#define NR_riscv_flush_icache (NR_arch_specific_syscall + 15) +#endif + +#define SYS_RISCV_FLUSH_ICACHE_LOCAL 1UL +#define SYS_RISCV_FLUSH_ICACHE_ALL 0UL + +static long sys_flush_icache(uintptr_t start, uintptr_t end , uintptr_t flags) { + return syscall(NR_riscv_flush_icache, start, end, flags); +} + +bool RiscvFlushIcache::test() { + alignas(64) char memory[64]; + long ret = sys_flush_icache((uintptr_t)&memory[0], + (uintptr_t)&memory[sizeof(memory) - 1], + SYS_RISCV_FLUSH_ICACHE_ALL); + if (ret == 0) { + return true; + } + int err = errno; \ + log_error(os)("Syscall: RISCV_FLUSH_ICACHE not available; error='%s' (errno=%s)", + os::strerror(err), os::errno_name(err)); + return false; +} + +void RiscvFlushIcache::flush(uintptr_t start, uintptr_t end) { + long ret = sys_flush_icache(start, end, SYS_RISCV_FLUSH_ICACHE_ALL); + guarantee_with_errno(ret == 0, "riscv_flush_icache failed"); +} diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.hpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.hpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_flush_icache.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef OS_LINUX_RISCV_FLUSH_ICACHE_LINUX_HPP +#define OS_LINUX_RISCV_FLUSH_ICACHE_LINUX_HPP + +#include "memory/allStatic.hpp" +#include "runtime/vm_version.hpp" +#include "utilities/growableArray.hpp" + +class RiscvFlushIcache: public AllStatic { + public: + static bool test(); + static void flush(uintptr_t start, uintptr_t end); +}; + +#endif // OS_LINUX_RISCV_FLUSH_ICACHE_LINUX_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "logging/log.hpp" +#include "riscv_hwprobe.hpp" +#include "runtime/os.hpp" +#include "runtime/vm_version.hpp" +#include "utilities/debug.hpp" + +#include +#include +#include + +// Syscall defined in kernel 6.4 and the defines will be in asm/hwprobe.h +#define RISCV_HWPROBE_KEY_MVENDORID 0 +#define RISCV_HWPROBE_KEY_MARCHID 1 +#define RISCV_HWPROBE_KEY_MIMPID 2 + +#define RISCV_HWPROBE_KEY_BASE_BEHAVIOR 3 +#define RISCV_HWPROBE_BASE_BEHAVIOR_IMA (1 << 0) + +#define RISCV_HWPROBE_KEY_IMA_EXT_0 4 +#define RISCV_HWPROBE_IMA_FD (1 << 0) +#define RISCV_HWPROBE_IMA_C (1 << 1) +#define RISCV_HWPROBE_IMA_V (1 << 2) +#define RISCV_HWPROBE_EXT_ZBA (1 << 3) +#define RISCV_HWPROBE_EXT_ZBB (1 << 4) +#define RISCV_HWPROBE_EXT_ZBS (1 << 5) + +#define RISCV_HWPROBE_KEY_CPUPERF_0 5 +#define RISCV_HWPROBE_MISALIGNED_UNKNOWN (0 << 0) +#define RISCV_HWPROBE_MISALIGNED_EMULATED (1 << 0) +#define RISCV_HWPROBE_MISALIGNED_SLOW (2 << 0) +#define RISCV_HWPROBE_MISALIGNED_FAST (3 << 0) +#define RISCV_HWPROBE_MISALIGNED_UNSUPPORTED (4 << 0) +#define RISCV_HWPROBE_MISALIGNED_MASK (7 << 0) + +#ifndef NR_riscv_hwprobe +#ifndef NR_arch_specific_syscall +#define NR_arch_specific_syscall 244 +#endif +#define NR_riscv_hwprobe (NR_arch_specific_syscall + 14) +#endif + +struct riscv_hwprobe { + int64_t key; + uint64_t value; +}; + +long sys_riscv_hwprobe(struct riscv_hwprobe *pairs, size_t pairc, + size_t cpuc, cpu_set_t *cpus, + unsigned int flags) { + return syscall(NR_riscv_hwprobe, pairs, pairc, cpuc, cpus, 0 /* flags*/); +} + +static bool rw_hwprobe_completed = false; + +static struct riscv_hwprobe query[] = {{RISCV_HWPROBE_KEY_MVENDORID, 0}, + {RISCV_HWPROBE_KEY_MARCHID, 0}, + {RISCV_HWPROBE_KEY_MIMPID, 0}, + {RISCV_HWPROBE_KEY_BASE_BEHAVIOR, 0}, + {RISCV_HWPROBE_KEY_IMA_EXT_0, 0}, + {RISCV_HWPROBE_KEY_CPUPERF_0, 0}}; + +bool RiscvHwprobe::probe_features() { + assert(!rw_hwprobe_completed, "Called twice."); + int ret = sys_riscv_hwprobe(&query[0], sizeof(query) / sizeof(query[0]), 0, nullptr, 0); + rw_hwprobe_completed = true; + if (ret != 0) { + log_debug(os, cpu)("riscv_hwprobe unsupported"); + return false; + } + log_debug(os, cpu)("riscv_hwprobe supported"); + add_features_from_query_result(); + return true; +} + +static bool is_valid(int64_t key) { + return query[key].key != -1; +} + +static bool is_set(int64_t key, uint64_t value_mask) { + if (is_valid(key)) { + return (query[key].value & value_mask) != 0; + } + return false; +} + +void RiscvHwprobe::add_features_from_query_result() { + assert(rw_hwprobe_completed, "hwprobe not init yet."); + + if (is_valid(RISCV_HWPROBE_KEY_MVENDORID)) { + VM_Version::mvendorid.enable_feature(query[RISCV_HWPROBE_KEY_MVENDORID].value); + } + if (is_valid(RISCV_HWPROBE_KEY_MARCHID)) { + VM_Version::marchid.enable_feature(query[RISCV_HWPROBE_KEY_MARCHID].value); + } + if (is_valid(RISCV_HWPROBE_KEY_MIMPID)) { + VM_Version::mimpid.enable_feature(query[RISCV_HWPROBE_KEY_MIMPID].value); + } + if (is_set(RISCV_HWPROBE_KEY_BASE_BEHAVIOR, RISCV_HWPROBE_BASE_BEHAVIOR_IMA)) { + VM_Version::ext_I.enable_feature(); + VM_Version::ext_M.enable_feature(); + VM_Version::ext_A.enable_feature(); + } + if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_IMA_FD)) { + VM_Version::ext_F.enable_feature(); + VM_Version::ext_D.enable_feature(); + } + if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_IMA_C)) { + VM_Version::ext_C.enable_feature(); + } + if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_IMA_V)) { + VM_Version::ext_V.enable_feature(); + } + if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZBA)) { + VM_Version::ext_Zba.enable_feature(); + } + if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZBB)) { + VM_Version::ext_Zbb.enable_feature(); + } + if (is_set(RISCV_HWPROBE_KEY_IMA_EXT_0, RISCV_HWPROBE_EXT_ZBS)) { + VM_Version::ext_Zbs.enable_feature(); + } + if (is_valid(RISCV_HWPROBE_KEY_CPUPERF_0)) { + VM_Version::unaligned_access.enable_feature( + query[RISCV_HWPROBE_KEY_CPUPERF_0].value & RISCV_HWPROBE_MISALIGNED_MASK); + } +} diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.hpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.hpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/riscv_hwprobe.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef OS_LINUX_RISCV_HWPROBE_LINUX_HPP +#define OS_LINUX_RISCV_HWPROBE_LINUX_HPP + +#include "memory/allStatic.hpp" +#include "runtime/vm_version.hpp" +#include "utilities/growableArray.hpp" + +class RiscvHwprobe: public AllStatic { + static void add_features_from_query_result(); + public: + static bool probe_features(); +}; + +#endif // OS_LINUX_RISCV_HWPROBE_LINUX_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp --- openjdk-17-17.0.9+9/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/os_cpu/linux_riscv/vm_version_linux_riscv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,6 +1,7 @@ /* * Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, Huawei Technologies Co., Ltd. All rights reserved. + * Copyright (c) 2023, Rivos Inc. 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 @@ -25,39 +26,50 @@ #include "precompiled.hpp" #include "asm/register.hpp" +#include "logging/log.hpp" +#include "riscv_hwprobe.hpp" #include "runtime/os.hpp" #include "runtime/os.inline.hpp" #include "runtime/vm_version.hpp" #include +#include #include #ifndef HWCAP_ISA_I -#define HWCAP_ISA_I (1 << ('I' - 'A')) +#define HWCAP_ISA_I nth_bit('I' - 'A') #endif #ifndef HWCAP_ISA_M -#define HWCAP_ISA_M (1 << ('M' - 'A')) +#define HWCAP_ISA_M nth_bit('M' - 'A') #endif #ifndef HWCAP_ISA_A -#define HWCAP_ISA_A (1 << ('A' - 'A')) +#define HWCAP_ISA_A nth_bit('A' - 'A') #endif #ifndef HWCAP_ISA_F -#define HWCAP_ISA_F (1 << ('F' - 'A')) +#define HWCAP_ISA_F nth_bit('F' - 'A') #endif #ifndef HWCAP_ISA_D -#define HWCAP_ISA_D (1 << ('D' - 'A')) +#define HWCAP_ISA_D nth_bit('D' - 'A') #endif #ifndef HWCAP_ISA_C -#define HWCAP_ISA_C (1 << ('C' - 'A')) +#define HWCAP_ISA_C nth_bit('C' - 'A') +#endif + +#ifndef HWCAP_ISA_Q +#define HWCAP_ISA_Q nth_bit('Q' - 'A') +#endif + +#ifndef HWCAP_ISA_H +#define HWCAP_ISA_H nth_bit('H' - 'A') #endif #ifndef HWCAP_ISA_V -#define HWCAP_ISA_V (1 << ('V' - 'A')) +#define HWCAP_ISA_V nth_bit('V' - 'A') #endif #define read_csr(csr) \ @@ -70,68 +82,174 @@ __v; \ }) -uint32_t VM_Version::get_current_vector_length() { - assert(_features & CPU_V, "should not call this"); +uint32_t VM_Version::cpu_vector_length() { + assert(ext_V.enabled(), "should not call this"); return (uint32_t)read_csr(CSR_VLENB); } -VM_Version::VM_MODE VM_Version::get_satp_mode() { - if (!strcmp(_vm_mode, "sv39")) { +void VM_Version::setup_cpu_available_features() { + + assert(ext_I.feature_bit() == HWCAP_ISA_I, "Bit for I must follow Linux HWCAP"); + assert(ext_M.feature_bit() == HWCAP_ISA_M, "Bit for M must follow Linux HWCAP"); + assert(ext_A.feature_bit() == HWCAP_ISA_A, "Bit for A must follow Linux HWCAP"); + assert(ext_F.feature_bit() == HWCAP_ISA_F, "Bit for F must follow Linux HWCAP"); + assert(ext_D.feature_bit() == HWCAP_ISA_D, "Bit for D must follow Linux HWCAP"); + assert(ext_C.feature_bit() == HWCAP_ISA_C, "Bit for C must follow Linux HWCAP"); + assert(ext_Q.feature_bit() == HWCAP_ISA_Q, "Bit for Q must follow Linux HWCAP"); + assert(ext_H.feature_bit() == HWCAP_ISA_H, "Bit for H must follow Linux HWCAP"); + assert(ext_V.feature_bit() == HWCAP_ISA_V, "Bit for V must follow Linux HWCAP"); + + if (!RiscvHwprobe::probe_features()) { + os_aux_features(); + } + char* uarch = os_uarch_additional_features(); + vendor_features(); + + char buf[1024] = {}; + if (uarch != nullptr && strcmp(uarch, "") != 0) { + // Use at max half the buffer. + snprintf(buf, sizeof(buf)/2, "%s,", uarch); + } + os::free((void*) uarch); + strcat(buf, "rv64"); + int i = 0; + while (_feature_list[i] != nullptr) { + if (_feature_list[i]->enabled()) { + log_debug(os, cpu)("Enabled RV64 feature \"%s\" (%ld)", + _feature_list[i]->pretty(), + _feature_list[i]->value()); + // The feature string + if (_feature_list[i]->feature_string()) { + const char* tmp = _feature_list[i]->pretty(); + if (strlen(tmp) == 1) { + strcat(buf, tmp); + } else { + // Feature string is expected to be lower case. + // Turn Zxxx into zxxx + char prebuf[3] = {}; + assert(strlen(tmp) > 1, "Must be"); + prebuf[0] = '_'; + prebuf[1] = (char)tolower(tmp[0]); + strcat(buf, prebuf); + strcat(buf, &tmp[1]); + } + } + // Feature bit + if (_feature_list[i]->feature_bit() != 0) { + _features |= _feature_list[i]->feature_bit(); + } + // Change flag default + _feature_list[i]->update_flag(); + } + i++; + } + + _features_string = os::strdup(buf); +} + +void VM_Version::os_aux_features() { + uint64_t auxv = getauxval(AT_HWCAP); + for (int i = 0; _feature_list[i] != nullptr; i++) { + if (_feature_list[i]->feature_bit() == HWCAP_ISA_V) { + // Special case for V: some dev boards only support RVV version 0.7, while + // the OpenJDK only supports RVV version 1.0. These two versions are not + // compatible with each other. Given the V bit is set through HWCAP on + // some custom kernels, regardless of the version, it can lead to + // generating V instructions on boards that don't support RVV version 1.0 + // (ex: Sipeed LicheePi), leading to a SIGILL. + // That is an acceptable workaround as only Linux Kernel v6.5+ supports V, + // and that version already support hwprobe anyway + continue; + } + if ((_feature_list[i]->feature_bit() & auxv) != 0) { + _feature_list[i]->enable_feature(); + } + } +} + +VM_Version::VM_MODE VM_Version::parse_satp_mode(const char* vm_mode) { + if (!strcmp(vm_mode, "sv39")) { return VM_SV39; - } else if (!strcmp(_vm_mode, "sv48")) { + } else if (!strcmp(vm_mode, "sv48")) { return VM_SV48; - } else if (!strcmp(_vm_mode, "sv57")) { + } else if (!strcmp(vm_mode, "sv57")) { return VM_SV57; - } else if (!strcmp(_vm_mode, "sv64")) { + } else if (!strcmp(vm_mode, "sv64")) { return VM_SV64; } else { return VM_MBARE; } } -void VM_Version::get_os_cpu_info() { - - uint64_t auxv = getauxval(AT_HWCAP); +char* VM_Version::os_uarch_additional_features() { + char* ret = nullptr; + VM_MODE mode = VM_NOTSET; + + FILE *f = fopen("/proc/cpuinfo", "r"); + if (f == nullptr) { + return nullptr; + } - static_assert(CPU_I == HWCAP_ISA_I, "Flag CPU_I must follow Linux HWCAP"); - static_assert(CPU_M == HWCAP_ISA_M, "Flag CPU_M must follow Linux HWCAP"); - static_assert(CPU_A == HWCAP_ISA_A, "Flag CPU_A must follow Linux HWCAP"); - static_assert(CPU_F == HWCAP_ISA_F, "Flag CPU_F must follow Linux HWCAP"); - static_assert(CPU_D == HWCAP_ISA_D, "Flag CPU_D must follow Linux HWCAP"); - static_assert(CPU_C == HWCAP_ISA_C, "Flag CPU_C must follow Linux HWCAP"); - static_assert(CPU_V == HWCAP_ISA_V, "Flag CPU_V must follow Linux HWCAP"); - - // RISC-V has four bit-manipulation ISA-extensions: Zba/Zbb/Zbc/Zbs. - // Availability for those extensions could not be queried from HWCAP. - // TODO: Add proper detection for those extensions. - _features = auxv & ( - HWCAP_ISA_I | - HWCAP_ISA_M | - HWCAP_ISA_A | - HWCAP_ISA_F | - HWCAP_ISA_D | - HWCAP_ISA_C | - HWCAP_ISA_V); - - if (FILE *f = fopen("/proc/cpuinfo", "r")) { - char buf[512], *p; - while (fgets(buf, sizeof (buf), f) != NULL) { - if ((p = strchr(buf, ':')) != NULL) { + char buf[512], *p; + while (fgets(buf, sizeof (buf), f) != nullptr && + (mode == VM_NOTSET || ret == nullptr)) { + if ((p = strchr(buf, ':')) != nullptr) { + if (mode == VM_NOTSET) { if (strncmp(buf, "mmu", sizeof "mmu" - 1) == 0) { - if (_vm_mode[0] != '\0') { - continue; - } - char* vm_mode = os::strdup(p + 2); - vm_mode[strcspn(vm_mode, "\n")] = '\0'; - _vm_mode = vm_mode; - } else if (strncmp(buf, "uarch", sizeof "uarch" - 1) == 0) { - char* uarch = os::strdup(p + 2); - uarch[strcspn(uarch, "\n")] = '\0'; - _uarch = uarch; - break; + mode = VM_Version::parse_satp_mode(p); + } + } + if (ret == nullptr) { + if (strncmp(buf, "uarch", sizeof "uarch" - 1) == 0) { + ret = os::strdup(p + 2); + ret[strcspn(ret, "\n")] = '\0'; } } } - fclose(f); } + if (mode == VM_NOTSET) { + mode = VM_MBARE; + } + fclose(f); + satp_mode.enable_feature(mode); + return ret; +} + +void VM_Version::vendor_features() { + // JEDEC encoded as ((bank - 1) << 7) | (0x7f & JEDEC) + static constexpr int RIVOS_MVENDORID = 0x6cf; // JEDEC: 0x4f, Bank: 14 + + if (!mvendorid.enabled()) { + return; + } + switch (mvendorid.value()) { + case RIVOS_MVENDORID: + rivos_features(); + break; + default: + break; + } +} + +void VM_Version::rivos_features() { + // Enable common features not dependent on marchid/mimpid. + ext_Zicbom.enable_feature(); + ext_Zicboz.enable_feature(); + ext_Zicbop.enable_feature(); + + // If we running on a pre-6.5 kernel + ext_Zba.enable_feature(); + ext_Zbb.enable_feature(); + ext_Zbs.enable_feature(); + + ext_Zicsr.enable_feature(); + ext_Zifencei.enable_feature(); + ext_Zic64b.enable_feature(); + ext_Zihintpause.enable_feature(); + + unaligned_access.enable_feature(MISALIGNED_FAST); + satp_mode.enable_feature(VM_SV48); + + // Features dependent on march/mimpid. + // I.e. march.value() and mimplid.value() } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_GraphBuilder.cpp openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_GraphBuilder.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_GraphBuilder.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_GraphBuilder.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -2009,9 +2009,10 @@ assert(singleton != declared_interface, "not a unique implementor"); cha_monomorphic_target = target->find_monomorphic_target(calling_klass, declared_interface, singleton); if (cha_monomorphic_target != NULL) { - if (cha_monomorphic_target->holder() != compilation()->env()->Object_klass()) { - ciInstanceKlass* holder = cha_monomorphic_target->holder(); - ciInstanceKlass* constraint = (holder->is_subtype_of(singleton) ? holder : singleton); // avoid upcasts + ciInstanceKlass* holder = cha_monomorphic_target->holder(); + ciInstanceKlass* constraint = (holder->is_subtype_of(singleton) ? holder : singleton); // avoid upcasts + if (holder != compilation()->env()->Object_klass() && + (!type_is_exact || receiver_klass->is_subtype_of(constraint))) { actual_recv = declared_interface; // insert a check it's really the expected class. @@ -2024,7 +2025,7 @@ dependency_recorder()->assert_unique_implementor(declared_interface, singleton); } else { - cha_monomorphic_target = NULL; // subtype check against Object is useless + cha_monomorphic_target = nullptr; } } } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_LIRGenerator.cpp openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_LIRGenerator.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_LIRGenerator.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_LIRGenerator.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -77,6 +77,7 @@ PhiResolver::PhiResolver(LIRGenerator* gen) : _gen(gen) , _state(gen->resolver_state()) + , _loop(nullptr) , _temp(LIR_OprFact::illegalOpr) { // reinitialize the shared state arrays diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_RangeCheckElimination.cpp openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_RangeCheckElimination.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_RangeCheckElimination.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_RangeCheckElimination.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -404,8 +404,11 @@ aii->_max = idx; aii->_list = new AccessIndexedList(); } else if (idx >= aii->_min && idx <= aii->_max) { - remove_range_check(ai); - return; + // Guard against underflow/overflow (see 'range_cond' check in RangeCheckEliminator::in_block_motion) + if (aii->_max < 0 || (aii->_max + min_jint) <= aii->_min) { + remove_range_check(ai); + return; + } } aii->_min = MIN2(aii->_min, idx); aii->_max = MAX2(aii->_max, idx); @@ -448,9 +451,9 @@ } } } else { - int last_integer = 0; + jint last_integer = 0; Instruction *last_instruction = index; - int base = 0; + jint base = 0; ArithmeticOp *ao = index->as_ArithmeticOp(); while (ao != NULL && (ao->x()->as_Constant() || ao->y()->as_Constant()) && (ao->op() == Bytecodes::_iadd || ao->op() == Bytecodes::_isub)) { @@ -462,12 +465,12 @@ } if (c) { - int value = c->type()->as_IntConstant()->value(); + jint value = c->type()->as_IntConstant()->value(); if (value != min_jint) { if (ao->op() == Bytecodes::_isub) { value = -value; } - base += value; + base = java_add(base, value); last_integer = base; last_instruction = other; } @@ -489,12 +492,12 @@ assert(info != NULL, "Info must not be null"); // if idx < 0, max > 0, max + idx may fall between 0 and - // length-1 and if min < 0, min + idx may overflow and be >= + // length-1 and if min < 0, min + idx may underflow/overflow and be >= // 0. The predicate wouldn't trigger but some accesses could // be with a negative index. This test guarantees that for the // min and max value that are kept the predicate can't let // some incorrect accesses happen. - bool range_cond = (info->_max < 0 || info->_max + min_jint <= info->_min); + bool range_cond = (info->_max < 0 || (info->_max + min_jint) <= info->_min); // Generate code only if more than 2 range checks can be eliminated because of that. // 2 because at least 2 comparisons are done @@ -843,7 +846,7 @@ ); remove_range_check(ai); - } else if (_optimistic && loop_header) { + } else if (false && _optimistic && loop_header) { assert(ai->array(), "Array must not be null!"); assert(ai->index(), "Index must not be null!"); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_ValueMap.cpp openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_ValueMap.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/c1/c1_ValueMap.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/c1/c1_ValueMap.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -359,6 +359,33 @@ } } +class CheckInsertionPoint : public ValueVisitor { + private: + Value _insert; + bool _valid = true; + + void visit(Value* vp) { + assert(*vp != nullptr, "value should not be null"); + if (_insert->dominator_depth() < (*vp)->dominator_depth()) { + _valid = false; + } + } + + public: + bool is_valid() { return _valid; } + CheckInsertionPoint(Value insert) + : _insert(insert) { + assert(insert != nullptr, "insertion point should not be null"); + } +}; + +// Check that insertion point has higher dom depth than all inputs to cur +static bool is_dominated_by_inputs(Instruction* insertion_point, Instruction* cur) { + CheckInsertionPoint v(insertion_point); + cur->input_values_do(&v); + return v.is_valid(); +} + void LoopInvariantCodeMotion::process_block(BlockBegin* block) { TRACE_VALUE_NUMBERING(tty->print_cr("processing block B%d", block->block_id())); @@ -394,7 +421,7 @@ cur_invariant = is_invariant(cvt->value()); } - if (cur_invariant) { + if (cur_invariant && is_dominated_by_inputs(_insertion_point, cur)) { // perform value numbering and mark instruction as loop-invariant _gvn->substitute(cur); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/cds/heapShared.cpp openjdk-17-17.0.10+7/src/hotspot/share/cds/heapShared.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/cds/heapShared.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/cds/heapShared.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -658,7 +658,7 @@ } static void verify_the_heap(Klass* k, const char* which) { - if (VerifyArchivedFields) { + if (VerifyArchivedFields > 0) { ResourceMark rm; log_info(cds, heap)("Verify heap %s initializing static field(s) in %s", which, k->external_name()); @@ -666,15 +666,20 @@ VM_Verify verify_op; VMThread::execute(&verify_op); - if (!FLAG_IS_DEFAULT(VerifyArchivedFields)) { - // If VerifyArchivedFields has a non-default value (e.g., specified on the command-line), do - // more expensive checks. - if (is_init_completed()) { - FlagSetting fs1(VerifyBeforeGC, true); - FlagSetting fs2(VerifyDuringGC, true); - FlagSetting fs3(VerifyAfterGC, true); - Universe::heap()->collect(GCCause::_java_lang_system_gc); - } + if (VerifyArchivedFields > 1 && is_init_completed()) { + // At this time, the oop->klass() of some archived objects in the heap may not + // have been loaded into the system dictionary yet. Nevertheless, oop->klass() should + // have enough information (object size, oop maps, etc) so that a GC can be safely + // performed. + // + // -XX:VerifyArchivedFields=2 force a GC to happen in such an early stage + // to check for GC safety. + log_info(cds, heap)("Trigger GC %s initializing static field(s) in %s", + which, k->external_name()); + FlagSetting fs1(VerifyBeforeGC, true); + FlagSetting fs2(VerifyDuringGC, true); + FlagSetting fs3(VerifyAfterGC, true); + Universe::heap()->collect(GCCause::_java_lang_system_gc); } } } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/ci/ciEnv.cpp openjdk-17-17.0.10+7/src/hotspot/share/ci/ciEnv.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/ci/ciEnv.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/ci/ciEnv.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1250,6 +1250,7 @@ tty->print_cr("# Compiler replay data is saved as: %s", buffer); } else { tty->print_cr("# Can't open file to dump replay data."); + close(fd); } } } @@ -1273,6 +1274,7 @@ tty->print_cr("%s", buffer); } else { tty->print_cr("# Can't open file to dump inline data."); + close(fd); } } } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp openjdk-17-17.0.10+7/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -123,7 +123,7 @@ const ClassLoaderData* const _cld; LoadedClassInfo(Klass* klass, const ClassLoaderData* cld) - : _klass(klass), _cld(cld) {} + : _next(NULL), _klass(klass), _cld(cld) {} }; @@ -138,7 +138,7 @@ // this parent loader, we fill in all the other details. const oop _loader_oop; - const ClassLoaderData* _cld; + const ClassLoaderData* _cld; // May be NULL if loader never loaded anything LoaderTreeNode* _child; LoaderTreeNode* _next; @@ -155,33 +155,59 @@ // one. int _num_folded; - void print_with_childs(outputStream* st, BranchTracker& branchtracker, - bool print_classes, bool verbose) const { + // Returns Klass of loader; NULL for bootstrap loader + const Klass* loader_klass() const { + return (_loader_oop != NULL) ? _loader_oop->klass() : NULL; + } - ResourceMark rm; + // Returns ResourceArea-allocated class name of loader class; "" if there is no klass (bootstrap loader) + const char* loader_class_name() const { + const Klass* klass = loader_klass(); + return klass != NULL ? klass->external_name() : ""; + } - if (_cld == NULL) { - // Not sure how this could happen: we added a preliminary node for a parent but then never encountered - // its CLD? - return; + // Returns oop of loader name; NULL for bootstrap; NULL if no name was set + oop loader_name_oop() const { + return (_loader_oop != NULL) ? java_lang_ClassLoader::name(_loader_oop) : NULL; + } + + // Returns ResourceArea-allocated name of loader, "" if none is set + const char* loader_name() const { + oop name_oop = loader_name_oop(); + return name_oop != NULL ? java_lang_String::as_utf8_string(name_oop) : ""; + } + + bool is_bootstrap() const { + if (_loader_oop == NULL) { + assert(_cld != NULL && _cld->is_boot_class_loader_data(), "bootstrap loader must have CLD"); + return true; } + return false; + } + + void print_with_child_nodes(outputStream* st, BranchTracker& branchtracker, + bool print_classes, bool verbose) const { + + assert(SafepointSynchronize::is_at_safepoint(), "invariant"); + + ResourceMark rm; // Retrieve information. - const Klass* const loader_klass = _cld->class_loader_klass(); - const Symbol* const loader_name = _cld->name(); + const Klass* const the_loader_klass = loader_klass(); + const char* const the_loader_class_name = loader_class_name(); + const char* const the_loader_name = loader_name(); branchtracker.print(st); // e.g. "+--- jdk.internal.reflect.DelegatingClassLoader" st->print("+%.*s", BranchTracker::twig_len, "----------"); - if (_cld->is_the_null_class_loader_data()) { + if (is_bootstrap()) { st->print(" "); } else { - assert(!_cld->has_class_mirror_holder(), "_cld must be the primary cld"); - if (loader_name != NULL) { - st->print(" \"%s\",", loader_name->as_C_string()); + if (the_loader_name[0] != '\0') { + st->print(" \"%s\",", the_loader_name); } - st->print(" %s", loader_klass != NULL ? loader_klass->external_name() : "??"); + st->print(" %s", the_loader_class_name); if (_num_folded > 0) { st->print(" (+ %d more)", _num_folded); } @@ -211,7 +237,7 @@ branchtracker.print(st); st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Data:", p2i(_cld)); branchtracker.print(st); - st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Klass:", p2i(loader_klass)); + st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Klass:", p2i(the_loader_klass)); // Empty line branchtracker.print(st); @@ -220,6 +246,7 @@ if (print_classes) { if (_classes != NULL) { + assert(_cld != NULL, "we have classes, we should have a CLD"); for (LoadedClassInfo* lci = _classes; lci; lci = lci->_next) { // non-strong hidden classes should not live in // the primary CLD of their loaders. @@ -252,6 +279,7 @@ } if (_hidden_classes != NULL) { + assert(_cld != NULL, "we have classes, we should have a CLD"); for (LoadedClassInfo* lci = _hidden_classes; lci; lci = lci->_next) { branchtracker.print(st); if (lci == _hidden_classes) { // first iteration @@ -285,7 +313,7 @@ // Print children, recursively LoaderTreeNode* c = _child; while (c != NULL) { - c->print_with_childs(st, branchtracker, print_classes, verbose); + c->print_with_child_nodes(st, branchtracker, print_classes, verbose); c = c->_next; } @@ -294,10 +322,21 @@ // Helper: Attempt to fold this node into the target node. If success, returns true. // Folding can be done if both nodes are leaf nodes and they refer to the same loader class // and they have the same name or no name (note: leaf check is done by caller). - bool can_fold_into(LoaderTreeNode* target_node) const { + bool can_fold_into(const LoaderTreeNode* target_node) const { assert(is_leaf() && target_node->is_leaf(), "must be leaf"); - return _cld->class_loader_klass() == target_node->_cld->class_loader_klass() && - _cld->name() == target_node->_cld->name(); + + // Must have the same non-null klass + const Klass* k = loader_klass(); + if (k == NULL || k != target_node->loader_klass()) { + return false; + } + + // Must have the same loader name, or none + if (::strcmp(loader_name(), target_node->loader_name()) != 0) { + return false; + } + + return true; } public: @@ -309,6 +348,7 @@ {} void set_cld(const ClassLoaderData* cld) { + assert(_cld == NULL, "there should be only one primary CLD per loader"); _cld = cld; } @@ -343,14 +383,6 @@ } } - const ClassLoaderData* cld() const { - return _cld; - } - - const oop loader_oop() const { - return _loader_oop; - } - LoaderTreeNode* find(const oop loader_oop) { LoaderTreeNode* result = NULL; if (_loader_oop == loader_oop) { @@ -373,6 +405,7 @@ void fold_children() { LoaderTreeNode* node = _child; LoaderTreeNode* prev = NULL; + ResourceMark rm; while (node != NULL) { LoaderTreeNode* matching_node = NULL; if (node->is_leaf()) { @@ -398,9 +431,9 @@ } } - void print_with_childs(outputStream* st, bool print_classes, bool print_add_info) const { + void print_with_child_nodes(outputStream* st, bool print_classes, bool print_add_info) const { BranchTracker bwt; - print_with_childs(st, bwt, print_classes, print_add_info); + print_with_child_nodes(st, bwt, print_classes, print_add_info); } }; @@ -475,7 +508,7 @@ } void print_results(outputStream* st) const { - _root->print_with_childs(st, _print_classes, _verbose); + _root->print_with_child_nodes(st, _print_classes, _verbose); } void do_cld (ClassLoaderData* cld) { @@ -492,7 +525,6 @@ // Update CLD in node, but only if this is the primary CLD for this loader. if (cld->has_class_mirror_holder() == false) { - assert(info->cld() == NULL, "there should be only one primary CLD per loader"); info->set_cld(cld); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/classfile/javaClasses.cpp openjdk-17-17.0.10+7/src/hotspot/share/classfile/javaClasses.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/classfile/javaClasses.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/classfile/javaClasses.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -819,8 +819,13 @@ st->print("\""); for (int index = 0; index < length; index++) { - st->print("%c", (!is_latin1) ? value->char_at(index) : - ((jchar) value->byte_at(index)) & 0xff ); + jchar c = (!is_latin1) ? value->char_at(index) : + ((jchar) value->byte_at(index)) & 0xff; + if (c < ' ') { + st->print("\\x%02X", c); // print control characters e.g. \x0A + } else { + st->print("%c", c); + } } st->print("\""); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/classfile/verifier.cpp openjdk-17-17.0.10+7/src/hotspot/share/classfile/verifier.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/classfile/verifier.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/classfile/verifier.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -2250,11 +2250,12 @@ "low must be less than or equal to high in tableswitch"); return; } - keys = high - low + 1; - if (keys < 0) { + int64_t keys64 = ((int64_t)high - low) + 1; + if (keys64 > 65535) { // Max code length verify_error(ErrorContext::bad_code(bci), "too many keys in tableswitch"); return; } + keys = (int)keys64; delta = 1; } else { keys = (int)Bytes::get_Java_u4(aligned_bcp + jintSize); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/code/codeBlob.cpp openjdk-17-17.0.10+7/src/hotspot/share/code/codeBlob.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/code/codeBlob.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/code/codeBlob.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -189,7 +189,8 @@ if (PrintStubCode) { ttyLocker ttyl; tty->print_cr("- - - [BEGIN] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); - tty->print_cr("Decoding %s " INTPTR_FORMAT, stub_id, (intptr_t) stub); + tty->print_cr("Decoding %s " PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (%d bytes)", + stub_id, p2i(stub), p2i(stub->code_begin()), p2i(stub->code_end()), stub->code_size()); Disassembler::decode(stub->code_begin(), stub->code_end(), tty); if ((stub->oop_maps() != NULL) && AbstractDisassembler::show_structs()) { tty->print_cr("- - - [OOP MAPS]- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/code/codeCache.cpp openjdk-17-17.0.10+7/src/hotspot/share/code/codeCache.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/code/codeCache.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/code/codeCache.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -291,9 +291,20 @@ FLAG_SET_ERGO(ProfiledCodeHeapSize, profiled_size); FLAG_SET_ERGO(NonProfiledCodeHeapSize, non_profiled_size); + const size_t ps = page_size(false, 8); + // Print warning if using large pages but not able to use the size given + if (UseLargePages) { + const size_t lg_ps = page_size(false, 1); + if (ps < lg_ps) { + log_warning(codecache)("Code cache size too small for " PROPERFMT " pages. " + "Reverting to smaller page size (" PROPERFMT ").", + PROPERFMTARGS(lg_ps), PROPERFMTARGS(ps)); + } + } + // If large page support is enabled, align code heaps according to large // page size to make sure that code cache is covered by large pages. - const size_t alignment = MAX2(page_size(false, 8), (size_t) os::vm_allocation_granularity()); + const size_t alignment = MAX2(ps, (size_t) os::vm_allocation_granularity()); non_nmethod_size = align_up(non_nmethod_size, alignment); profiled_size = align_down(profiled_size, alignment); non_profiled_size = align_down(non_profiled_size, alignment); @@ -305,7 +316,7 @@ // Non-nmethods // Profiled nmethods // ---------- low ------------ - ReservedCodeSpace rs = reserve_heap_memory(cache_size); + ReservedCodeSpace rs = reserve_heap_memory(cache_size, ps); ReservedSpace profiled_space = rs.first_part(profiled_size); ReservedSpace rest = rs.last_part(profiled_size); ReservedSpace non_method_space = rest.first_part(non_nmethod_size); @@ -332,9 +343,8 @@ } } -ReservedCodeSpace CodeCache::reserve_heap_memory(size_t size) { +ReservedCodeSpace CodeCache::reserve_heap_memory(size_t size, size_t rs_ps) { // Align and reserve space for code cache - const size_t rs_ps = page_size(); const size_t rs_align = MAX2(rs_ps, (size_t) os::vm_allocation_granularity()); const size_t rs_size = align_up(size, rs_align); ReservedCodeSpace rs(rs_size, rs_align, rs_ps); @@ -354,7 +364,7 @@ if (!SegmentedCodeCache) { // No segmentation: use a single code heap return (code_blob_type == CodeBlobType::All); - } else if (Arguments::is_interpreter_only()) { + } else if (CompilerConfig::is_interpreter_only()) { // Interpreter only: we don't need any method code heaps return (code_blob_type == CodeBlobType::NonNMethod); } else if (CompilerConfig::is_c1_profiling()) { @@ -973,7 +983,7 @@ FLAG_SET_ERGO(NonNMethodCodeHeapSize, 0); FLAG_SET_ERGO(ProfiledCodeHeapSize, 0); FLAG_SET_ERGO(NonProfiledCodeHeapSize, 0); - ReservedCodeSpace rs = reserve_heap_memory(ReservedCodeCacheSize); + ReservedCodeSpace rs = reserve_heap_memory(ReservedCodeCacheSize, page_size(false, 8)); add_heap(rs, "CodeCache", CodeBlobType::All); } @@ -1253,7 +1263,9 @@ CodeHeap* heap = get_code_heap(code_blob_type); assert(heap != NULL, "heap is null"); - if ((heap->full_count() == 0) || print) { + heap->report_full(); + + if ((heap->full_count() == 1) || print) { // Not yet reported for this heap, report if (SegmentedCodeCache) { ResourceMark rm; @@ -1290,15 +1302,13 @@ tty->print("%s", s.as_string()); } - if (heap->full_count() == 0) { + if (heap->full_count() == 1) { if (PrintCodeHeapAnalytics) { CompileBroker::print_heapinfo(tty, "all", 4096); // details, may be a lot! } } } - heap->report_full(); - EventCodeCacheFull event; if (event.should_commit()) { event.set_codeBlobType((u1)code_blob_type); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/code/codeCache.hpp openjdk-17-17.0.10+7/src/hotspot/share/code/codeCache.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/code/codeCache.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/code/codeCache.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -109,7 +109,7 @@ static CodeHeap* get_code_heap(int code_blob_type); // Returns the CodeHeap for the given CodeBlobType // Returns the name of the VM option to set the size of the corresponding CodeHeap static const char* get_code_heap_flag_name(int code_blob_type); - static ReservedCodeSpace reserve_heap_memory(size_t size); // Reserves one continuous chunk of memory for the CodeHeaps + static ReservedCodeSpace reserve_heap_memory(size_t size, size_t rs_ps); // Reserves one continuous chunk of memory for the CodeHeaps // Iteration static CodeBlob* first_blob(CodeHeap* heap); // Returns the first CodeBlob on the given CodeHeap diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/code/vtableStubs.cpp openjdk-17-17.0.10+7/src/hotspot/share/code/vtableStubs.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/code/vtableStubs.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/code/vtableStubs.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -230,8 +230,9 @@ enter(is_vtable_stub, vtable_index, s); if (PrintAdapterHandlers) { - tty->print_cr("Decoding VtableStub %s[%d]@" INTX_FORMAT, - is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location())); + tty->print_cr("Decoding VtableStub %s[%d]@" PTR_FORMAT " [" PTR_FORMAT ", " PTR_FORMAT "] (" SIZE_FORMAT " bytes)", + is_vtable_stub? "vtbl": "itbl", vtable_index, p2i(VtableStub::receiver_location()), + p2i(s->code_begin()), p2i(s->code_end()), pointer_delta(s->code_end(), s->code_begin(), 1)); Disassembler::decode(s->code_begin(), s->code_end()); } // Notify JVMTI about this stub. The event will be recorded by the enclosing diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/compiler/compileBroker.cpp openjdk-17-17.0.10+7/src/hotspot/share/compiler/compileBroker.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/compiler/compileBroker.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/compiler/compileBroker.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -2753,8 +2753,8 @@ int total_bailout_count = CompileBroker::_total_bailout_count; int total_invalidated_count = CompileBroker::_total_invalidated_count; - int nmethods_size = CompileBroker::_sum_nmethod_code_size; - int nmethods_code_size = CompileBroker::_sum_nmethod_size; + int nmethods_code_size = CompileBroker::_sum_nmethod_code_size; + int nmethods_size = CompileBroker::_sum_nmethod_size; tty->cr(); tty->print_cr("Accumulated compiler times"); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/compiler/compilerDefinitions.cpp openjdk-17-17.0.10+7/src/hotspot/share/compiler/compilerDefinitions.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/compiler/compilerDefinitions.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/compiler/compilerDefinitions.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2022, 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 @@ -316,7 +316,6 @@ } } - if (CompileThresholdScaling < 0) { vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", NULL); } @@ -523,6 +522,10 @@ } FLAG_SET_CMDLINE(TieredCompilation, false); } + if (SegmentedCodeCache) { + warning("SegmentedCodeCache has no meaningful effect with -Xint"); + FLAG_SET_DEFAULT(SegmentedCodeCache, false); + } #if INCLUDE_JVMCI if (EnableJVMCI) { if (!FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)) { diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/compiler/compilerOracle.cpp openjdk-17-17.0.10+7/src/hotspot/share/compiler/compilerOracle.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/compiler/compilerOracle.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/compiler/compilerOracle.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -992,21 +992,10 @@ } } - if (*line == method_sep) { - if (className == NULL) { - className = ""; - c_match = MethodMatcher::Any; - } - } else { - // got foo or foo/bar - if (className == NULL) { - ShouldNotReachHere(); - } else { - // missing class name handled as "Any" class match - if (className[0] == '\0') { - c_match = MethodMatcher::Any; - } - } + if (className == nullptr || className[0] == '\0') { + // missing class name handled as "Any" class match + className = ""; + c_match = MethodMatcher::Any; } // each directive is terminated by , or NUL or . followed by NUL diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/g1/g1Trace.cpp openjdk-17-17.0.10+7/src/hotspot/share/gc/g1/g1Trace.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/g1/g1Trace.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/g1/g1Trace.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -163,9 +163,9 @@ // Create JFR structured failure data JfrStructCopyFailed evac_failed; evac_failed.set_objectCount(ef_info.failed_count()); - evac_failed.set_firstSize(ef_info.first_size()); - evac_failed.set_smallestSize(ef_info.smallest_size()); - evac_failed.set_totalSize(ef_info.total_size()); + evac_failed.set_firstSize(ef_info.first_size() * HeapWordSize); + evac_failed.set_smallestSize(ef_info.smallest_size() * HeapWordSize); + evac_failed.set_totalSize(ef_info.total_size() * HeapWordSize); // Add to the event e.set_gcId(GCId::current()); e.set_evacuationFailed(evac_failed); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/parallel/psPromotionManager.cpp openjdk-17-17.0.10+7/src/hotspot/share/gc/parallel/psPromotionManager.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/parallel/psPromotionManager.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/parallel/psPromotionManager.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -360,7 +360,10 @@ push_contents(obj); - _preserved_marks->push_if_necessary(obj, obj_mark); + // Save the markWord of promotion-failed objs in _preserved_marks for later + // restoration. This way we don't have to walk the young-gen to locate + // these promotion-failed objs. + _preserved_marks->push_always(obj, obj_mark); } else { // We lost, someone else "owns" this object guarantee(obj->is_forwarded(), "Object must be forwarded if the cas failed."); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/parallel/psScavenge.cpp openjdk-17-17.0.10+7/src/hotspot/share/gc/parallel/psScavenge.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/parallel/psScavenge.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/parallel/psScavenge.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -705,19 +705,11 @@ return !promotion_failure_occurred; } -// This method iterates over all objects in the young generation, -// removing all forwarding references. It then restores any preserved marks. void PSScavenge::clean_up_failed_promotion() { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - PSYoungGen* young_gen = heap->young_gen(); - - RemoveForwardedPointerClosure remove_fwd_ptr_closure; - young_gen->object_iterate(&remove_fwd_ptr_closure); - PSPromotionManager::restore_preserved_marks(); // Reset the PromotionFailureALot counters. - NOT_PRODUCT(heap->reset_promotion_should_fail();) + NOT_PRODUCT(ParallelScavengeHeap::heap()->reset_promotion_should_fail();) } bool PSScavenge::should_attempt_scavenge() { diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/gcTimer.cpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gcTimer.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/gcTimer.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gcTimer.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/shared/gcTimer.hpp" +#include "gc/shared/gc_globals.hpp" #include "utilities/growableArray.hpp" // the "time" parameter for most functions @@ -130,7 +131,7 @@ } void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time, GCPhase::PhaseType type) { - assert(_phases->length() <= 1000, "Too many recored phases?"); + assert(UseZGC || _phases->length() <= 1000, "Too many recorded phases? (count: %d)", _phases->length()); int level = _active_phases.count(); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/gcTraceSend.cpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gcTraceSend.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/gcTraceSend.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gcTraceSend.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -157,9 +157,9 @@ static JfrStructCopyFailed to_struct(const CopyFailedInfo& cf_info) { JfrStructCopyFailed failed_info; failed_info.set_objectCount(cf_info.failed_count()); - failed_info.set_firstSize(cf_info.first_size()); - failed_info.set_smallestSize(cf_info.smallest_size()); - failed_info.set_totalSize(cf_info.total_size()); + failed_info.set_firstSize(cf_info.first_size() * HeapWordSize); + failed_info.set_smallestSize(cf_info.smallest_size() * HeapWordSize); + failed_info.set_totalSize(cf_info.total_size() * HeapWordSize); return failed_info; } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/gc_globals.hpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gc_globals.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/gc_globals.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/gc_globals.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -524,8 +524,12 @@ product(bool, VerifyDuringGC, false, DIAGNOSTIC, \ "Verify memory system during GC (between phases)") \ \ - product(bool, VerifyArchivedFields, trueInDebug, DIAGNOSTIC, \ - "Verify memory when archived oop fields are loaded from CDS)") \ + product(int, VerifyArchivedFields, 0, DIAGNOSTIC, \ + "Verify memory when archived oop fields are loaded from CDS; " \ + "0: No check; " \ + "1: Basic verification with VM_Verify (no side effects); " \ + "2: Detailed verification by forcing a GC (with side effects)") \ + range(0, 2) \ \ product(ccstrlist, VerifyGCType, "", DIAGNOSTIC, \ "GC type(s) to verify when Verify*GC is enabled." \ diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/preservedMarks.cpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/preservedMarks.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -124,8 +124,10 @@ ~RestorePreservedMarksTask() { assert(_total_size == _total_size_before, "total_size = %zu before = %zu", _total_size, _total_size_before); - - log_trace(gc)("Restored %zu marks", _total_size); + size_t mem_size = _total_size * (sizeof(oop) + sizeof(markWord)); + log_trace(gc)("Restored %zu marks, occupying %zu %s", _total_size, + byte_size_in_proper_unit(mem_size), + proper_unit_for_byte_size(mem_size)); } }; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/preservedMarks.hpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/preservedMarks.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -58,6 +58,7 @@ size_t size() const { return _stack.size(); } inline void push(oop obj, markWord m); inline void push_if_necessary(oop obj, markWord m); + inline void push_always(oop obj, markWord m); // Iterate over the stack, restore all preserved marks, and // reclaim the memory taken up by the stack segments. void restore(); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/preservedMarks.inline.hpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.inline.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/preservedMarks.inline.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/preservedMarks.inline.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -47,6 +47,12 @@ } } +inline void PreservedMarks::push_always(oop obj, markWord m) { + assert(!m.is_marked(), "precondition"); + OopAndMarkWord elem(obj, m); + _stack.push(elem); +} + inline void PreservedMarks::init_forwarded_mark(oop obj) { obj->init_mark(); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/tlab_globals.hpp openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/tlab_globals.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/gc/shared/tlab_globals.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/gc/shared/tlab_globals.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -70,10 +70,13 @@ "Allocation averaging weight") \ range(0, 100) \ \ + /* At GC all TLABs are retired, and each thread's active */ \ + /* TLAB is assumed to be half full on average. The */ \ + /* remaining space is waste, proportional to TLAB size. */ \ + product(uintx, TLABWasteTargetPercent, 1, \ + "Percentage of Eden that can be wasted (half-full TLABs at GC)") \ /* Limit the lower bound of this flag to 1 as it is used */ \ /* in a division expression. */ \ - product(uintx, TLABWasteTargetPercent, 1, \ - "Percentage of Eden that can be wasted") \ range(1, 100) \ \ product(uintx, TLABRefillWasteFraction, 64, \ diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/interpreter/bytecodes.cpp openjdk-17-17.0.10+7/src/hotspot/share/interpreter/bytecodes.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/interpreter/bytecodes.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/interpreter/bytecodes.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -99,12 +99,18 @@ if (end != NULL && aligned_bcp + 3*jintSize >= end) { return -1; // don't read past end of code buffer } + // Promote calculation to signed 64 bits to do range checks, used by the verifier. jlong lo = (jint)Bytes::get_Java_u4(aligned_bcp + 1*jintSize); jlong hi = (jint)Bytes::get_Java_u4(aligned_bcp + 2*jintSize); jlong len = (aligned_bcp - bcp) + (3 + hi - lo + 1)*jintSize; - // only return len if it can be represented as a positive int; - // return -1 otherwise - return (len > 0 && len == (int)len) ? len : -1; + // Only return len if it can be represented as a positive int and lo <= hi. + // The caller checks for bytecode stream overflow. + if (lo <= hi && len == (int)len) { + assert(len > 0, "must be"); + return (int)len; + } else { + return -1; + } } case _lookupswitch: // fall through @@ -116,9 +122,13 @@ } jlong npairs = (jint)Bytes::get_Java_u4(aligned_bcp + jintSize); jlong len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize; - // only return len if it can be represented as a positive int; - // return -1 otherwise - return (len > 0 && len == (int)len) ? len : -1; + // Only return len if it can be represented as a positive int and npairs >= 0. + if (npairs >= 0 && len == (int)len) { + assert(len > 0, "must be"); + return (int)len; + } else { + return -1; + } } default: // Note: Length functions must return <=0 for invalid bytecodes. diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/jfr/metadata/metadata.xml openjdk-17-17.0.10+7/src/hotspot/share/jfr/metadata/metadata.xml --- openjdk-17-17.0.9+9/src/hotspot/share/jfr/metadata/metadata.xml 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/jfr/metadata/metadata.xml 2024-01-09 21:18:15.000000000 +0000 @@ -865,10 +865,11 @@ - + - + notify_all(); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp openjdk-17-17.0.10+7/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/jfr/recorder/storage/jfrStorage.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -38,6 +38,7 @@ #include "jfr/utilities/jfrIterator.hpp" #include "jfr/utilities/jfrLinkedList.inline.hpp" #include "jfr/utilities/jfrTime.hpp" +#include "jfr/utilities/jfrTryLock.hpp" #include "jfr/writers/jfrNativeEventWriter.hpp" #include "logging/log.hpp" #include "runtime/mutexLocker.hpp" @@ -328,7 +329,8 @@ } void JfrStorage::discard_oldest(Thread* thread) { - if (JfrBuffer_lock->try_lock()) { + JfrMutexTryLock mutex(JfrBuffer_lock); + if (mutex.acquired()) { if (!control().should_discard()) { // another thread handled it return; @@ -350,7 +352,6 @@ oldest->release(); // publish break; } - JfrBuffer_lock->unlock(); log_discard(num_full_pre_discard, control().full_count(), discarded_size); } } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/jfr/utilities/jfrTryLock.hpp openjdk-17-17.0.10+7/src/hotspot/share/jfr/utilities/jfrTryLock.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/jfr/utilities/jfrTryLock.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/jfr/utilities/jfrTryLock.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -50,25 +50,23 @@ } }; -class JfrMonitorTryLock : public StackObj { +class JfrMutexTryLock : public StackObj { private: - Monitor* _lock; + Mutex* _mutex; bool _acquired; public: - JfrMonitorTryLock(Monitor* lock) : _lock(lock), _acquired(lock->try_lock()) {} - - ~JfrMonitorTryLock() { + JfrMutexTryLock(Mutex* mutex) : _mutex(mutex), _acquired(mutex->try_lock()) {} + ~JfrMutexTryLock() { if (_acquired) { - assert(_lock->owned_by_self(), "invariant"); - _lock->unlock(); + assert(_mutex->owned_by_self(), "invariant"); + _mutex->unlock(); } } bool acquired() const { return _acquired; } - }; #endif // SHARE_JFR_UTILITIES_JFRTRYLOCK_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp openjdk-17-17.0.10+7/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/memory/metaspace/virtualSpaceList.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -200,15 +200,6 @@ return false; } -// Returns true if the vslist is not expandable and no more root chunks -// can be allocated. -bool VirtualSpaceList::is_full() const { - if (!_can_expand && _first_node != NULL && _first_node->free_words() == 0) { - return true; - } - return false; -} - // Convenience methods to return the global class-space chunkmanager // and non-class chunkmanager, respectively. VirtualSpaceList* VirtualSpaceList::vslist_class() { diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp openjdk-17-17.0.10+7/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/memory/metaspace/virtualSpaceList.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -128,10 +128,6 @@ // Returns true if this pointer is contained in one of our nodes. bool contains(const MetaWord* p) const; - // Returns true if the list is not expandable and no more root chunks - // can be allocated. - bool is_full() const; - // Convenience methods to return the global class-space vslist // and non-class vslist, respectively. static VirtualSpaceList* vslist_class(); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/opto/doCall.cpp openjdk-17-17.0.10+7/src/hotspot/share/opto/doCall.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/opto/doCall.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/opto/doCall.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -979,6 +979,8 @@ if (PrintOpto && WizardMode) { tty->print_cr(" Catching every inline exception bci:%d -> handler_bci:%d", bci(), handler_bci); } + // If this is a backwards branch in the bytecodes, add safepoint + maybe_add_safepoint(handler_bci); merge_exception(handler_bci); // jump to handler return; // No more handling to be done here! } @@ -1010,6 +1012,8 @@ klass->print_name(); tty->cr(); } + // If this is a backwards branch in the bytecodes, add safepoint + maybe_add_safepoint(handler_bci); merge_exception(handler_bci); } set_control(not_subtype_ctrl); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/opto/ifnode.cpp openjdk-17-17.0.10+7/src/hotspot/share/opto/ifnode.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/opto/ifnode.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/opto/ifnode.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1864,6 +1864,46 @@ // then we are guaranteed to fail, so just start interpreting there. // We 'expand' the top 3 range checks to include all post-dominating // checks. + // + // Example: + // a[i+x] // (1) 1 < x < 6 + // a[i+3] // (2) + // a[i+4] // (3) + // a[i+6] // max = max of all constants + // a[i+2] + // a[i+1] // min = min of all constants + // + // If x < 3: + // (1) a[i+x]: Leave unchanged + // (2) a[i+3]: Replace with a[i+max] = a[i+6]: i+x < i+3 <= i+6 -> (2) is covered + // (3) a[i+4]: Replace with a[i+min] = a[i+1]: i+1 < i+4 <= i+6 -> (3) and all following checks are covered + // Remove all other a[i+c] checks + // + // If x >= 3: + // (1) a[i+x]: Leave unchanged + // (2) a[i+3]: Replace with a[i+min] = a[i+1]: i+1 < i+3 <= i+x -> (2) is covered + // (3) a[i+4]: Replace with a[i+max] = a[i+6]: i+1 < i+4 <= i+6 -> (3) and all following checks are covered + // Remove all other a[i+c] checks + // + // We only need the top 2 range checks if x is the min or max of all constants. + // + // This, however, only works if the interval [i+min,i+max] is not larger than max_int (i.e. abs(max - min) < max_int): + // The theoretical max size of an array is max_int with: + // - Valid index space: [0,max_int-1] + // - Invalid index space: [max_int,-1] // max_int, min_int, min_int - 1 ..., -1 + // + // The size of the consecutive valid index space is smaller than the size of the consecutive invalid index space. + // If we choose min and max in such a way that: + // - abs(max - min) < max_int + // - i+max and i+min are inside the valid index space + // then all indices [i+min,i+max] must be in the valid index space. Otherwise, the invalid index space must be + // smaller than the valid index space which is never the case for any array size. + // + // Choosing a smaller array size only makes the valid index space smaller and the invalid index space larger and + // the argument above still holds. + // + // Note that the same optimization with the same maximal accepted interval size can also be found in C1. + const jlong maximum_number_of_min_max_interval_indices = (jlong)max_jint; // The top 3 range checks seen const int NRC = 3; @@ -1898,13 +1938,18 @@ found_immediate_dominator = true; break; } - // Gather expanded bounds - off_lo = MIN2(off_lo,offset2); - off_hi = MAX2(off_hi,offset2); - // Record top NRC range checks - prev_checks[nb_checks%NRC].ctl = prev_dom; - prev_checks[nb_checks%NRC].off = offset2; - nb_checks++; + + // "x - y" -> must add one to the difference for number of elements in [x,y] + const jlong diff = (jlong)MIN2(offset2, off_lo) - (jlong)MAX2(offset2, off_hi); + if (ABS(diff) < maximum_number_of_min_max_interval_indices) { + // Gather expanded bounds + off_lo = MIN2(off_lo, offset2); + off_hi = MAX2(off_hi, offset2); + // Record top NRC range checks + prev_checks[nb_checks % NRC].ctl = prev_dom; + prev_checks[nb_checks % NRC].off = offset2; + nb_checks++; + } } } prev_dom = dom; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/opto/loopTransform.cpp openjdk-17-17.0.10+7/src/hotspot/share/opto/loopTransform.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/opto/loopTransform.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/opto/loopTransform.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -2830,6 +2830,8 @@ continue; // Don't rce this check but continue looking for other candidates. } + assert(is_dominator(compute_early_ctrl(limit, limit_c), pre_end), "node pinned on loop exit test?"); + // Check for scaled induction variable plus an offset Node *offset = nullptr; @@ -2848,6 +2850,8 @@ if (is_dominator(ctrl, offset_c)) { continue; // Don't rce this check but continue looking for other candidates. } + + assert(is_dominator(compute_early_ctrl(offset, offset_c), pre_end), "node pinned on loop exit test?"); #ifdef ASSERT if (TraceRangeLimitCheck) { tty->print_cr("RC bool node%s", flip ? " flipped:" : ":"); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/opto/loopnode.cpp openjdk-17-17.0.10+7/src/hotspot/share/opto/loopnode.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/opto/loopnode.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/opto/loopnode.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -491,19 +491,19 @@ return phi; } -static int check_stride_overflow(jlong stride_con, const TypeInteger* limit_t, BasicType bt) { - if (stride_con > 0) { - if (limit_t->lo_as_long() > (max_signed_integer(bt) - stride_con)) { +static int check_stride_overflow(jlong final_correction, const TypeInteger* limit_t, BasicType bt) { + if (final_correction > 0) { + if (limit_t->lo_as_long() > (max_signed_integer(bt) - final_correction)) { return -1; } - if (limit_t->hi_as_long() > (max_signed_integer(bt) - stride_con)) { + if (limit_t->hi_as_long() > (max_signed_integer(bt) - final_correction)) { return 1; } } else { - if (limit_t->hi_as_long() < (min_signed_integer(bt) - stride_con)) { + if (limit_t->hi_as_long() < (min_signed_integer(bt) - final_correction)) { return -1; } - if (limit_t->lo_as_long() < (min_signed_integer(bt) - stride_con)) { + if (limit_t->lo_as_long() < (min_signed_integer(bt) - final_correction)) { return 1; } } @@ -1344,48 +1344,203 @@ C->print_method(PHASE_BEFORE_CLOOPS, 3); // =================================================== - // Generate loop limit check to avoid integer overflow - // in cases like next (cyclic loops): + // We can only convert this loop to a counted loop if we can guarantee that the iv phi will never overflow at runtime. + // This is an implicit assumption taken by some loop optimizations. We therefore must ensure this property at all cost. + // At this point, we've already excluded some trivial cases where an overflow could have been proven statically. + // But even though we cannot prove that an overflow will *not* happen, we still want to speculatively convert this loop + // to a counted loop. This can be achieved by adding additional iv phi overflow checks before the loop. If they fail, + // we trap and resume execution before the loop without having executed any iteration of the loop, yet. // - // for (i=0; i <= max_jint; i++) {} - // for (i=0; i < max_jint; i+=2) {} + // These additional iv phi overflow checks can be inserted as Loop Limit Check Predicates above the Loop Limit Check + // Parse Predicate which captures a JVM state just before the entry of the loop. If there is no such Parse Predicate, + // we cannot generate a Loop Limit Check Predicate and thus cannot speculatively convert the loop to a counted loop. // + // In the following, we only focus on int loops with stride > 0 to keep things simple. The argumentation and proof + // for stride < 0 is analogously. For long loops, we would replace max_int with max_long. // - // Limit check predicate depends on the loop test: // - // for(;i != limit; i++) --> limit <= (max_jint) - // for(;i < limit; i+=stride) --> limit <= (max_jint - stride + 1) - // for(;i <= limit; i+=stride) --> limit <= (max_jint - stride ) + // The loop to be converted does not always need to have the often used shape: // + // i = init + // i = init loop: + // do { ... + // // ... equivalent i+=stride + // i+=stride <==> if (i < limit) + // } while (i < limit); goto loop + // exit: + // ... + // + // where the loop exit check uses the post-incremented iv phi and a '<'-operator. + // + // We could also have '<='-operator (or '>='-operator for negative strides) or use the pre-incremented iv phi value + // in the loop exit check: + // + // i = init + // loop: + // ... + // if (i <= limit) + // i+=stride + // goto loop + // exit: + // ... + // + // Let's define the following terms: + // - iv_pre_i: The pre-incremented iv phi before the i-th iteration. + // - iv_post_i: The post-incremented iv phi after the i-th iteration. + // + // The iv_pre_i and iv_post_i have the following relation: + // iv_pre_i + stride = iv_post_i + // + // When converting a loop to a counted loop, we want to have a canonicalized loop exit check of the form: + // iv_post_i < adjusted_limit + // + // If that is not the case, we need to canonicalize the loop exit check by using different values for adjusted_limit: + // (LE1) iv_post_i < limit: Already canonicalized. We can directly use limit as adjusted_limit. + // -> adjusted_limit = limit. + // (LE2) iv_post_i <= limit: + // iv_post_i < limit + 1 + // -> adjusted limit = limit + 1 + // (LE3) iv_pre_i < limit: + // iv_pre_i + stride < limit + stride + // iv_post_i < limit + stride + // -> adjusted_limit = limit + stride + // (LE4) iv_pre_i <= limit: + // iv_pre_i < limit + 1 + // iv_pre_i + stride < limit + stride + 1 + // iv_post_i < limit + stride + 1 + // -> adjusted_limit = limit + stride + 1 + // + // Note that: + // (AL) limit <= adjusted_limit. + // + // The following loop invariant has to hold for counted loops with n iterations (i.e. loop exit check true after n-th + // loop iteration) and a canonicalized loop exit check to guarantee that no iv_post_i over- or underflows: + // (INV) For i = 1..n, min_int <= iv_post_i <= max_int + // + // To prove (INV), we require the following two conditions/assumptions: + // (i): adjusted_limit - 1 + stride <= max_int + // (ii): init < limit + // + // If we can prove (INV), we know that there can be no over- or underflow of any iv phi value. We prove (INV) by + // induction by assuming (i) and (ii). + // + // Proof by Induction + // ------------------ + // > Base case (i = 1): We show that (INV) holds after the first iteration: + // min_int <= iv_post_1 = init + stride <= max_int + // Proof: + // First, we note that (ii) implies + // (iii) init <= limit - 1 + // max_int >= adjusted_limit - 1 + stride [using (i)] + // >= limit - 1 + stride [using (AL)] + // >= init + stride [using (iii)] + // >= min_int [using stride > 0, no underflow] + // Thus, no overflow happens after the first iteration and (INV) holds for i = 1. + // + // Note that to prove the base case we need (i) and (ii). + // + // > Induction Hypothesis (i = j, j > 1): Assume that (INV) holds after the j-th iteration: + // min_int <= iv_post_j <= max_int + // > Step case (i = j + 1): We show that (INV) also holds after the j+1-th iteration: + // min_int <= iv_post_{j+1} = iv_post_j + stride <= max_int + // Proof: + // If iv_post_j >= adjusted_limit: + // We exit the loop after the j-th iteration, and we don't execute the j+1-th iteration anymore. Thus, there is + // also no iv_{j+1}. Since (INV) holds for iv_j, there is nothing left to prove. + // If iv_post_j < adjusted_limit: + // First, we note that: + // (iv) iv_post_j <= adjusted_limit - 1 + // max_int >= adjusted_limit - 1 + stride [using (i)] + // >= iv_post_j + stride [using (iv)] + // >= min_int [using stride > 0, no underflow] + // + // Note that to prove the step case we only need (i). + // + // Thus, by assuming (i) and (ii), we proved (INV). + // + // + // It is therefore enough to add the following two Loop Limit Check Predicates to check assumptions (i) and (ii): + // + // (1) Loop Limit Check Predicate for (i): + // Using (i): adjusted_limit - 1 + stride <= max_int + // + // This condition is now restated to use limit instead of adjusted_limit: + // + // To prevent an overflow of adjusted_limit -1 + stride itself, we rewrite this check to + // max_int - stride + 1 >= adjusted_limit + // We can merge the two constants into + // canonicalized_correction = stride - 1 + // which gives us + // max_int - canonicalized_correction >= adjusted_limit + // + // To directly use limit instead of adjusted_limit in the predicate condition, we split adjusted_limit into: + // adjusted_limit = limit + limit_correction + // Since stride > 0 and limit_correction <= stride + 1, we can restate this with no over- or underflow into: + // max_int - canonicalized_correction - limit_correction >= limit + // Since canonicalized_correction and limit_correction are both constants, we can replace them with a new constant: + // final_correction = canonicalized_correction + limit_correction + // which gives us: + // + // Final predicate condition: + // max_int - final_correction >= limit + // + // (2) Loop Limit Check Predicate for (ii): + // Using (ii): init < limit + // + // This Loop Limit Check Predicate is not required if we can prove at compile time that either: + // (2.1) type(init) < type(limit) + // In this case, we know: + // all possible values of init < all possible values of limit + // and we can skip the predicate. + // + // (2.2) init < limit is already checked before (i.e. found as a dominating check) + // In this case, we do not need to re-check the condition and can skip the predicate. + // This is often found for while- and for-loops which have the following shape: + // + // if (init < limit) { // Dominating test. Do not need the Loop Limit Check Predicate below. + // i = init; + // if (init >= limit) { trap(); } // Here we would insert the Loop Limit Check Predicate + // do { + // i += stride; + // } while (i < limit); + // } + // + // (2.3) init + stride <= max_int + // In this case, there is no overflow of the iv phi after the first loop iteration. + // In the proof of the base case above we showed that init + stride <= max_int by using assumption (ii): + // init < limit + // In the proof of the step case above, we did not need (ii) anymore. Therefore, if we already know at + // compile time that init + stride <= max_int then we have trivially proven the base case and that + // there is no overflow of the iv phi after the first iteration. In this case, we don't need to check (ii) + // again and can skip the predicate. + + + // Accounting for (LE3) and (LE4) where we use pre-incremented phis in the loop exit check. + const jlong limit_correction_for_pre_iv_exit_check = (phi_incr != nullptr) ? stride_con : 0; + + // Accounting for (LE2) and (LE4) where we use <= or >= in the loop exit check. + const bool includes_limit = (bt == BoolTest::le || bt == BoolTest::ge); + const jlong limit_correction_for_le_ge_exit_check = (includes_limit ? (stride_con > 0 ? 1 : -1) : 0); + + const jlong limit_correction = limit_correction_for_pre_iv_exit_check + limit_correction_for_le_ge_exit_check; + const jlong canonicalized_correction = stride_con + (stride_con > 0 ? -1 : 1); + const jlong final_correction = canonicalized_correction + limit_correction; - // Check if limit is excluded to do more precise int overflow check. - bool incl_limit = (bt == BoolTest::le || bt == BoolTest::ge); - jlong stride_m = stride_con - (incl_limit ? 0 : (stride_con > 0 ? 1 : -1)); - - // If compare points directly to the phi we need to adjust - // the compare so that it points to the incr. Limit have - // to be adjusted to keep trip count the same and the - // adjusted limit should be checked for int overflow. - Node* adjusted_limit = limit; - if (phi_incr != nullptr) { - stride_m += stride_con; - } - - Node *init_control = x->in(LoopNode::EntryControl); + int sov = check_stride_overflow(final_correction, limit_t, iv_bt); + Node* init_control = x->in(LoopNode::EntryControl); - int sov = check_stride_overflow(stride_m, limit_t, iv_bt); // If sov==0, limit's type always satisfies the condition, for // example, when it is an array length. if (sov != 0) { if (sov < 0) { return false; // Bailout: integer overflow is certain. } + // (1) Loop Limit Check Predicate is required because we could not statically prove that + // limit + final_correction = adjusted_limit - 1 + stride <= max_int assert(!x->as_Loop()->is_transformed_long_inner_loop(), "long loop was transformed"); - // Generate loop's limit check. - // Loop limit check predicate should be near the loop. ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); if (!limit_check_proj) { - // The limit check predicate is not generated if this method trapped here before. + // The Loop Limit Check Parse Predicate is not generated if this method trapped here before. #ifdef ASSERT if (TraceLoopLimitCheck) { tty->print("missing loop limit check:"); @@ -1406,65 +1561,79 @@ Node* bol; if (stride_con > 0) { - cmp_limit = CmpNode::make(limit, _igvn.integercon(max_jint - stride_m, iv_bt), iv_bt); + cmp_limit = CmpNode::make(limit, _igvn.integercon(max_signed_integer(iv_bt) - final_correction, iv_bt), iv_bt); bol = new BoolNode(cmp_limit, BoolTest::le); } else { - cmp_limit = CmpNode::make(limit, _igvn.integercon(min_jint - stride_m, iv_bt), iv_bt); + cmp_limit = CmpNode::make(limit, _igvn.integercon(min_signed_integer(iv_bt) - final_correction, iv_bt), iv_bt); bol = new BoolNode(cmp_limit, BoolTest::ge); } insert_loop_limit_check(limit_check_proj, cmp_limit, bol); } - // Now we need to canonicalize loop condition. - if (bt == BoolTest::ne) { - assert(stride_con == 1 || stride_con == -1, "simple increment only"); - if (stride_con > 0 && init_t->hi_as_long() < limit_t->lo_as_long()) { - // 'ne' can be replaced with 'lt' only when init < limit. - bt = BoolTest::lt; - } else if (stride_con < 0 && init_t->lo_as_long() > limit_t->hi_as_long()) { - // 'ne' can be replaced with 'gt' only when init > limit. - bt = BoolTest::gt; - } else { - ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); - if (!limit_check_proj) { - // The limit check predicate is not generated if this method trapped here before. + // (2.3) + const bool init_plus_stride_could_overflow = + (stride_con > 0 && init_t->hi_as_long() > max_signed_integer(iv_bt) - stride_con) || + (stride_con < 0 && init_t->lo_as_long() < min_signed_integer(iv_bt) - stride_con); + // (2.1) + const bool init_gte_limit = (stride_con > 0 && init_t->hi_as_long() >= limit_t->lo_as_long()) || + (stride_con < 0 && init_t->lo_as_long() <= limit_t->hi_as_long()); + + if (init_gte_limit && // (2.1) + ((bt == BoolTest::ne || init_plus_stride_could_overflow) && // (2.3) + !has_dominating_loop_limit_check(init_trip, limit, stride_con, iv_bt, init_control))) { // (2.2) + // (2) Iteration Loop Limit Check Predicate is required because neither (2.1), (2.2), nor (2.3) holds. + // We use the following condition: + // - stride > 0: init < limit + // - stride < 0: init > limit + // + // This predicate is always required if we have a non-equal-operator in the loop exit check (where stride = 1 is + // a requirement). We transform the loop exit check by using a less-than-operator. By doing so, we must always + // check that init < limit. Otherwise, we could have a different number of iterations at runtime. + + ProjNode *limit_check_proj = find_predicate_insertion_point(init_control, Deoptimization::Reason_loop_limit_check); + if (!limit_check_proj) { + // The limit check predicate is not generated if this method trapped here before. #ifdef ASSERT - if (TraceLoopLimitCheck) { - tty->print("missing loop limit check:"); - loop->dump_head(); - x->dump(1); - } -#endif - return false; + if (TraceLoopLimitCheck) { + tty->print("missing loop limit check:"); + loop->dump_head(); + x->dump(1); } - IfNode* check_iff = limit_check_proj->in(0)->as_If(); +#endif + return false; + } + IfNode* check_iff = limit_check_proj->in(0)->as_If(); - if (!is_dominator(get_ctrl(limit), check_iff->in(0)) || - !is_dominator(get_ctrl(init_trip), check_iff->in(0))) { - return false; - } + if (!is_dominator(get_ctrl(limit), check_iff->in(0)) || + !is_dominator(get_ctrl(init_trip), check_iff->in(0))) { + return false; + } - Node* cmp_limit; - Node* bol; + Node* cmp_limit; + Node* bol; - if (stride_con > 0) { - cmp_limit = CmpNode::make(init_trip, limit, iv_bt); - bol = new BoolNode(cmp_limit, BoolTest::lt); - } else { - cmp_limit = CmpNode::make(init_trip, limit, iv_bt); - bol = new BoolNode(cmp_limit, BoolTest::gt); - } + if (stride_con > 0) { + cmp_limit = CmpNode::make(init_trip, limit, iv_bt); + bol = new BoolNode(cmp_limit, BoolTest::lt); + } else { + cmp_limit = CmpNode::make(init_trip, limit, iv_bt); + bol = new BoolNode(cmp_limit, BoolTest::gt); + } - insert_loop_limit_check(limit_check_proj, cmp_limit, bol); + insert_loop_limit_check(limit_check_proj, cmp_limit, bol); + } - if (stride_con > 0) { - // 'ne' can be replaced with 'lt' only when init < limit. - bt = BoolTest::lt; - } else if (stride_con < 0) { - // 'ne' can be replaced with 'gt' only when init > limit. - bt = BoolTest::gt; - } + if (bt == BoolTest::ne) { + // Now we need to canonicalize the loop condition if it is 'ne'. + assert(stride_con == 1 || stride_con == -1, "simple increment only - checked before"); + if (stride_con > 0) { + // 'ne' can be replaced with 'lt' only when init < limit. This is ensured by the inserted predicate above. + bt = BoolTest::lt; + } else { + assert(stride_con < 0, "must be"); + // 'ne' can be replaced with 'gt' only when init > limit. This is ensured by the inserted predicate above. + bt = BoolTest::gt; } } @@ -1509,6 +1678,7 @@ } #endif + Node* adjusted_limit = limit; if (phi_incr != nullptr) { // If compare points directly to the phi we need to adjust // the compare so that it points to the incr. Limit have @@ -1522,7 +1692,7 @@ adjusted_limit = gvn->transform(AddNode::make(limit, stride, iv_bt)); } - if (incl_limit) { + if (includes_limit) { // The limit check guaranties that 'limit <= (max_jint - stride)' so // we can convert 'i <= limit' to 'i < limit+1' since stride != 0. // @@ -1703,6 +1873,37 @@ return true; } +// Check if there is a dominating loop limit check of the form 'init < limit' starting at the loop entry. +// If there is one, then we do not need to create an additional Loop Limit Check Predicate. +bool PhaseIdealLoop::has_dominating_loop_limit_check(Node* init_trip, Node* limit, const jlong stride_con, + const BasicType iv_bt, Node* loop_entry) { + // Eagerly call transform() on the Cmp and Bool node to common them up if possible. This is required in order to + // successfully find a dominated test with the If node below. + Node* cmp_limit; + Node* bol; + if (stride_con > 0) { + cmp_limit = _igvn.transform(CmpNode::make(init_trip, limit, iv_bt)); + bol = _igvn.transform(new BoolNode(cmp_limit, BoolTest::lt)); + } else { + cmp_limit = _igvn.transform(CmpNode::make(init_trip, limit, iv_bt)); + bol = _igvn.transform(new BoolNode(cmp_limit, BoolTest::gt)); + } + + // Check if there is already a dominating init < limit check. If so, we do not need a Loop Limit Check Predicate. + IfNode* iff = new IfNode(loop_entry, bol, PROB_MIN, COUNT_UNKNOWN); + // Also add fake IfProj nodes in order to call transform() on the newly created IfNode. + IfFalseNode* if_false = new IfFalseNode(iff); + IfTrueNode* if_true = new IfTrueNode(iff); + Node* dominated_iff = _igvn.transform(iff); + // ConI node? Found dominating test (IfNode::dominated_by() returns a ConI node). + const bool found_dominating_test = dominated_iff != nullptr && dominated_iff->is_ConI(); + + // Kill the If with its projections again in the next IGVN round by cutting it off from the graph. + _igvn.replace_input_of(iff, 0, C->top()); + _igvn.replace_input_of(iff, 1, C->top()); + return found_dominating_test; +} + //----------------------exact_limit------------------------------------------- Node* PhaseIdealLoop::exact_limit( IdealLoopTree *loop ) { assert(loop->_head->is_CountedLoop(), ""); @@ -3898,6 +4099,7 @@ NOT_PRODUCT( C->verify_graph_edges(); ) worklist.push(C->top()); build_loop_late( visited, worklist, nstack ); + if (C->failing()) { return; } if (_verify_only) { C->restore_major_progress(old_progress); @@ -5218,6 +5420,7 @@ } else { // All of n's children have been processed, complete post-processing. build_loop_late_post(n); + if (C->failing()) { return; } if (nstack.is_empty()) { // Finished all nodes on stack. // Process next node on the worklist. @@ -5363,13 +5566,15 @@ Node *legal = LCA; // Walk 'legal' up the IDOM chain Node *least = legal; // Best legal position so far while( early != legal ) { // While not at earliest legal -#ifdef ASSERT if (legal->is_Start() && !early->is_Root()) { +#ifdef ASSERT // Bad graph. Print idom path and fail. dump_bad_graph("Bad graph detected in build_loop_late", n, early, LCA); assert(false, "Bad graph detected in build_loop_late"); - } #endif + C->record_method_not_compilable("Bad graph detected in build_loop_late"); + return; + } // Find least loop nesting depth legal = idom(legal); // Bump up the IDOM tree // Check for lower nesting depth diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/opto/loopnode.hpp openjdk-17-17.0.10+7/src/hotspot/share/opto/loopnode.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/opto/loopnode.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/opto/loopnode.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -1296,6 +1296,8 @@ void rewire_cloned_nodes_to_ctrl(const ProjNode* old_ctrl, Node* new_ctrl, const Node_List& nodes_with_same_ctrl, const Dict& old_new_mapping); void rewire_inputs_of_clones_to_clones(Node* new_ctrl, Node* clone, const Dict& old_new_mapping, const Node* next); + bool has_dominating_loop_limit_check(Node* init_trip, Node* limit, jlong stride_con, BasicType iv_bt, + Node* loop_entry); public: void register_control(Node* n, IdealLoopTree *loop, Node* pred, bool update_body = true); @@ -1644,6 +1646,8 @@ void try_sink_out_of_loop(Node* n); bool safe_for_if_replacement(const Node* dom) const; + + void update_addp_chain_base(Node* x, Node* old_base, Node* new_base); }; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/opto/loopopts.cpp openjdk-17-17.0.10+7/src/hotspot/share/opto/loopopts.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/opto/loopopts.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/opto/loopopts.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1581,9 +1581,10 @@ assert(!n_loop->is_member(get_loop(x_ctrl)), "should have moved out of loop"); register_new_node(x, x_ctrl); - // Chain of AddP: (AddP base (AddP base )) must keep the same base after sinking so: - // 1- We don't add a CastPP here when the first one is sunk so if the second one is not, their bases remain - // the same. + // Chain of AddP nodes: (AddP base (AddP base (AddP base ))) + // All AddP nodes must keep the same base after sinking so: + // 1- We don't add a CastPP here until the last one of the chain is sunk: if part of the chain is not sunk, + // their bases remain the same. // (see 2- below) assert(!x->is_AddP() || !x->in(AddPNode::Address)->is_AddP() || x->in(AddPNode::Address)->in(AddPNode::Base) == x->in(AddPNode::Base) || @@ -1600,18 +1601,18 @@ cast = ConstraintCastNode::make_cast_for_type(x_ctrl, in, in_t, ConstraintCastNode::UnconditionalDependency); } if (cast != nullptr) { - register_new_node(cast, x_ctrl); + Node* prev = _igvn.hash_find_insert(cast); + if (prev != nullptr && get_ctrl(prev) == x_ctrl) { + cast->destruct(&_igvn); + cast = prev; + } else { + register_new_node(cast, x_ctrl); + } x->replace_edge(in, cast); - // Chain of AddP: - // 2- A CastPP of the base is only added now that both AddP nodes are sunk + // Chain of AddP nodes: + // 2- A CastPP of the base is only added now that all AddP nodes are sunk if (x->is_AddP() && k == AddPNode::Base) { - for (DUIterator_Fast imax, i = x->fast_outs(imax); i < imax; i++) { - Node* u = x->fast_out(i); - if (u->is_AddP() && u->in(AddPNode::Base) == n->in(AddPNode::Base)) { - _igvn.replace_input_of(u, AddPNode::Base, cast); - assert(u->find_out_with(Op_AddP) == nullptr, "more than 2 chained AddP nodes?"); - } - } + update_addp_chain_base(x, n->in(AddPNode::Base), cast); } break; } @@ -1626,6 +1627,22 @@ } } +void PhaseIdealLoop::update_addp_chain_base(Node* x, Node* old_base, Node* new_base) { + ResourceMark rm; + Node_List wq; + wq.push(x); + while (wq.size() != 0) { + Node* n = wq.pop(); + for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { + Node* u = n->fast_out(i); + if (u->is_AddP() && u->in(AddPNode::Base) == old_base) { + _igvn.replace_input_of(u, AddPNode::Base, new_base); + wq.push(u); + } + } + } +} + // Compute the early control of a node by following its inputs until we reach // nodes that are pinned. Then compute the LCA of the control of all pinned nodes. Node* PhaseIdealLoop::compute_early_ctrl(Node* n, Node* n_ctrl) { @@ -1697,6 +1714,14 @@ if (n_loop->is_member(u_loop)) { return false; // Found use in inner loop } + // Sinking a node from a pre loop to its main loop pins the node between the pre and main loops. If that node is input + // to a check that's eliminated by range check elimination, it becomes input to an expression that feeds into the exit + // test of the pre loop above the point in the graph where it's pinned. + if (n_loop->_head->is_CountedLoop() && n_loop->_head->as_CountedLoop()->is_pre_loop() && + u_loop->_head->is_CountedLoop() && u_loop->_head->as_CountedLoop()->is_main_loop() && + n_loop->_next == get_loop(u_loop->_head->as_CountedLoop()->skip_strip_mined())) { + return false; + } return true; } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/prims/jvmtiEnvBase.cpp openjdk-17-17.0.10+7/src/hotspot/share/prims/jvmtiEnvBase.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/prims/jvmtiEnvBase.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/prims/jvmtiEnvBase.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1397,6 +1397,9 @@ Thread* current_thread = Thread::current(); HandleMark hm(current_thread); + if (java_thread->is_exiting()) { + return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ + } if (!self) { if (!java_thread->is_suspended()) { _result = JVMTI_ERROR_THREAD_NOT_SUSPENDED; @@ -1527,6 +1530,10 @@ Thread* current_thread = Thread::current(); HandleMark hm(current_thread); JavaThread* java_thread = target->as_Java_thread(); + + if (java_thread->is_exiting()) { + return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ + } assert(java_thread == _state->get_thread(), "Must be"); if (!self && !java_thread->is_suspended()) { @@ -1603,14 +1610,12 @@ // It's fine to update the thread state here because no JVMTI events // shall be posted for this PopFrame. - if (!java_thread->is_exiting() && java_thread->threadObj() != NULL) { - _state->update_for_pop_top_frame(); - java_thread->set_popframe_condition(JavaThread::popframe_pending_bit); - // Set pending step flag for this popframe and it is cleared when next - // step event is posted. - _state->set_pending_step_for_popframe(); - _result = JVMTI_ERROR_NONE; - } + _state->update_for_pop_top_frame(); + java_thread->set_popframe_condition(JavaThread::popframe_pending_bit); + // Set pending step flag for this popframe and it is cleared when next + // step event is posted. + _state->set_pending_step_for_popframe(); + _result = JVMTI_ERROR_NONE; } void @@ -1618,6 +1623,9 @@ ResourceMark rm; JavaThread* java_thread = target->as_Java_thread(); + if (java_thread->is_exiting()) { + return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ + } assert(_state->get_thread() == java_thread, "Must be"); if (!self && !java_thread->is_suspended()) { @@ -1637,9 +1645,6 @@ } assert(vf->frame_pointer() != NULL, "frame pointer mustn't be NULL"); - if (java_thread->is_exiting() || java_thread->threadObj() == NULL) { - return; /* JVMTI_ERROR_THREAD_NOT_ALIVE (default) */ - } int frame_number = _state->count_frames() - _depth; _state->env_thread_state((JvmtiEnvBase*)_env)->set_frame_pop(frame_number); _result = JVMTI_ERROR_NONE; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/prims/whitebox.cpp openjdk-17-17.0.10+7/src/hotspot/share/prims/whitebox.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/prims/whitebox.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/prims/whitebox.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1962,7 +1962,7 @@ #endif WB_END -WB_ENTRY(jboolean, WB_IsJavaHeapArchiveSupported(JNIEnv* env)) +WB_ENTRY(jboolean, WB_CanWriteJavaHeapArchive(JNIEnv* env)) return HeapShared::is_heap_object_archiving_allowed(); WB_END @@ -2318,22 +2318,19 @@ WB_END WB_ENTRY(void, WB_VerifyFrames(JNIEnv* env, jobject wb, jboolean log, jboolean update_map)) - intx tty_token = -1; - if (log) { - tty_token = ttyLocker::hold_tty(); - tty->print_cr("[WhiteBox::VerifyFrames] Walking Frames"); - } ResourceMark rm; // for verify + stringStream st; for (StackFrameStream fst(JavaThread::current(), update_map, true); !fst.is_done(); fst.next()) { frame* current_frame = fst.current(); if (log) { - current_frame->print_value(); + current_frame->print_value_on(&st, NULL); } current_frame->verify(fst.register_map()); } if (log) { + tty->print_cr("[WhiteBox::VerifyFrames] Walking Frames"); + tty->print_raw(st.as_string()); tty->print_cr("[WhiteBox::VerifyFrames] Done"); - ttyLocker::release_tty(tty_token); } WB_END @@ -2585,7 +2582,7 @@ {CC"isDTraceIncluded", CC"()Z", (void*)&WB_IsDTraceIncluded }, {CC"isC2OrJVMCIIncluded", CC"()Z", (void*)&WB_isC2OrJVMCIIncluded }, {CC"isJVMCISupportedByGC", CC"()Z", (void*)&WB_IsJVMCISupportedByGC}, - {CC"isJavaHeapArchiveSupported", CC"()Z", (void*)&WB_IsJavaHeapArchiveSupported }, + {CC"canWriteJavaHeapArchive", CC"()Z", (void*)&WB_CanWriteJavaHeapArchive }, {CC"cdsMemoryMappingFailed", CC"()Z", (void*)&WB_CDSMemoryMappingFailed }, {CC"clearInlineCaches0", CC"(Z)V", (void*)&WB_ClearInlineCaches }, diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/runtime/deoptimization.cpp openjdk-17-17.0.10+7/src/hotspot/share/runtime/deoptimization.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/runtime/deoptimization.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/runtime/deoptimization.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -144,14 +144,16 @@ void Deoptimization::UnrollBlock::print() { - ttyLocker ttyl; - tty->print_cr("UnrollBlock"); - tty->print_cr(" size_of_deoptimized_frame = %d", _size_of_deoptimized_frame); - tty->print( " frame_sizes: "); + ResourceMark rm; + stringStream st; + st.print_cr("UnrollBlock"); + st.print_cr(" size_of_deoptimized_frame = %d", _size_of_deoptimized_frame); + st.print( " frame_sizes: "); for (int index = 0; index < number_of_frames(); index++) { - tty->print(INTX_FORMAT " ", frame_sizes()[index]); + st.print(INTX_FORMAT " ", frame_sizes()[index]); } - tty->cr(); + st.cr(); + tty->print_raw(st.as_string()); } @@ -180,6 +182,38 @@ JRT_END #if COMPILER2_OR_JVMCI +#ifndef PRODUCT +// print information about reallocated objects +static void print_objects(JavaThread* deoptee_thread, + GrowableArray* objects, bool realloc_failures) { + ResourceMark rm; + stringStream st; // change to logStream with logging + st.print_cr("REALLOC OBJECTS in thread " INTPTR_FORMAT, p2i(deoptee_thread)); + fieldDescriptor fd; + + for (int i = 0; i < objects->length(); i++) { + ObjectValue* sv = (ObjectValue*) objects->at(i); + Klass* k = java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()); + Handle obj = sv->value(); + + st.print(" object <" INTPTR_FORMAT "> of type ", p2i(sv->value()())); + k->print_value_on(&st); + assert(obj.not_null() || realloc_failures, "reallocation was missed"); + if (obj.is_null()) { + st.print(" allocation failed"); + } else { + st.print(" allocated (%d bytes)", obj->size() * HeapWordSize); + } + st.cr(); + + if (Verbose && !obj.is_null()) { + k->oop_print_on(obj(), &st); + } + } + tty->print_raw(st.as_string()); +} +#endif + static bool rematerialize_objects(JavaThread* thread, int exec_mode, CompiledMethod* compiled_method, frame& deoptee, RegisterMap& map, GrowableArray* chunk, bool& deoptimized_objects) { @@ -211,7 +245,6 @@ return_value = Handle(thread, result); assert(Universe::heap()->is_in_or_null(result), "must be heap pointer"); if (TraceDeoptimization) { - ttyLocker ttyl; tty->print_cr("SAVED OOP RESULT " INTPTR_FORMAT " in thread " INTPTR_FORMAT, p2i(result), p2i(thread)); } } @@ -232,9 +265,7 @@ Deoptimization::reassign_fields(&deoptee, &map, objects, realloc_failures, skip_internal); #ifndef PRODUCT if (TraceDeoptimization) { - ttyLocker ttyl; - tty->print_cr("REALLOC OBJECTS in thread " INTPTR_FORMAT, p2i(deoptee_thread)); - Deoptimization::print_objects(objects, realloc_failures); + print_objects(deoptee_thread, objects, realloc_failures); } #endif } @@ -264,29 +295,31 @@ deoptimized_objects = deoptimized_objects || relocked; #ifndef PRODUCT if (PrintDeoptimizationDetails) { - ttyLocker ttyl; + ResourceMark rm; + stringStream st; for (int j = 0; j < monitors->length(); j++) { MonitorInfo* mi = monitors->at(j); if (mi->eliminated()) { if (first) { first = false; - tty->print_cr("RELOCK OBJECTS in thread " INTPTR_FORMAT, p2i(thread)); + st.print_cr("RELOCK OBJECTS in thread " INTPTR_FORMAT, p2i(thread)); } if (exec_mode == Deoptimization::Unpack_none) { ObjectMonitor* monitor = deoptee_thread->current_waiting_monitor(); if (monitor != NULL && monitor->object() == mi->owner()) { - tty->print_cr(" object <" INTPTR_FORMAT "> DEFERRED relocking after wait", p2i(mi->owner())); + st.print_cr(" object <" INTPTR_FORMAT "> DEFERRED relocking after wait", p2i(mi->owner())); continue; } } if (mi->owner_is_scalar_replaced()) { Klass* k = java_lang_Class::as_Klass(mi->owner_klass()); - tty->print_cr(" failed reallocation for klass %s", k->external_name()); + st.print_cr(" failed reallocation for klass %s", k->external_name()); } else { - tty->print_cr(" object <" INTPTR_FORMAT "> locked", p2i(mi->owner())); + st.print_cr(" object <" INTPTR_FORMAT "> locked", p2i(mi->owner())); } } } + tty->print_raw(st.as_string()); } #endif // !PRODUCT } @@ -612,7 +645,6 @@ if (array->frames() > 1) { if (VerifyStack && TraceDeoptimization) { - ttyLocker ttyl; tty->print_cr("Deoptimizing method containing inlining"); } } @@ -721,7 +753,6 @@ #ifndef PRODUCT if (TraceDeoptimization) { - ttyLocker ttyl; tty->print_cr("DEOPT UNPACKING thread " INTPTR_FORMAT " vframeArray " INTPTR_FORMAT " mode %d", p2i(thread), p2i(array), exec_mode); } @@ -844,8 +875,6 @@ (iframe->interpreter_frame_expression_stack_size() == mask.expression_stack_size() + cur_invoke_parameter_size)) )) { { - ttyLocker ttyl; - // Print out some information that will help us debug the problem tty->print_cr("Wrong number of expression stack elements during deoptimization"); tty->print_cr(" Error occurred while verifying frame %d (0..%d, 0 is topmost)", i, cur_array->frames() - 1); @@ -870,7 +899,7 @@ tty->print_cr(" %s (bci %d)", el->method()->name_and_sig_as_C_string(), el->bci()); } cur_array->print_on_2(tty); - } // release tty lock before calling guarantee + } guarantee(false, "wrong number of expression stack elements during deopt"); } VerifyOopClosure verify; @@ -1499,34 +1528,6 @@ } return relocked_objects; } - - -#ifndef PRODUCT -// print information about reallocated objects -void Deoptimization::print_objects(GrowableArray* objects, bool realloc_failures) { - fieldDescriptor fd; - - for (int i = 0; i < objects->length(); i++) { - ObjectValue* sv = (ObjectValue*) objects->at(i); - Klass* k = java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()()); - Handle obj = sv->value(); - - tty->print(" object <" INTPTR_FORMAT "> of type ", p2i(sv->value()())); - k->print_value(); - assert(obj.not_null() || realloc_failures, "reallocation was missed"); - if (obj.is_null()) { - tty->print(" allocation failed"); - } else { - tty->print(" allocated (%d bytes)", obj->size() * HeapWordSize); - } - tty->cr(); - - if (Verbose && !obj.is_null()) { - k->oop_print_on(obj(), tty); - } - } -} -#endif #endif // COMPILER2_OR_JVMCI vframeArray* Deoptimization::create_vframeArray(JavaThread* thread, frame fr, RegisterMap *reg_map, GrowableArray* chunk, bool realloc_failures) { @@ -1534,14 +1535,15 @@ #ifndef PRODUCT if (PrintDeoptimizationDetails) { - ttyLocker ttyl; - tty->print("DEOPT PACKING thread " INTPTR_FORMAT " ", p2i(thread)); - fr.print_on(tty); - tty->print_cr(" Virtual frames (innermost first):"); + ResourceMark rm; + stringStream st; + st.print("DEOPT PACKING thread " INTPTR_FORMAT " ", p2i(thread)); + fr.print_on(&st); + st.print_cr(" Virtual frames (innermost first):"); for (int index = 0; index < chunk->length(); index++) { compiledVFrame* vf = chunk->at(index); - tty->print(" %2d - ", index); - vf->print_value(); + st.print(" %2d - ", index); + vf->print_value_on(&st); int bci = chunk->at(index)->raw_bci(); const char* code_name; if (bci == SynchronizationEntryBCI) { @@ -1550,13 +1552,14 @@ Bytecodes::Code code = vf->method()->code_at(bci); code_name = Bytecodes::name(code); } - tty->print(" - %s", code_name); - tty->print_cr(" @ bci %d ", bci); + st.print(" - %s", code_name); + st.print_cr(" @ bci %d ", bci); if (Verbose) { - vf->print(); - tty->cr(); + vf->print_on(&st); + st.cr(); } } + tty->print_raw(st.as_string()); } #endif @@ -1579,7 +1582,6 @@ #ifndef PRODUCT if (PrintDeoptimizationDetails) { - ttyLocker ttyl; tty->print_cr(" Created vframeArray " INTPTR_FORMAT, p2i(array)); } #endif // PRODUCT @@ -1980,7 +1982,6 @@ bool is_receiver_constraint_failure = COMPILER2_PRESENT(VerifyReceiverTypes &&) (reason == Deoptimization::Reason_receiver_constraint); if (TraceDeoptimization || is_receiver_constraint_failure) { - ttyLocker ttyl; tty->print_cr(" bci=%d pc=" INTPTR_FORMAT ", relative_pc=" INTPTR_FORMAT ", method=%s" JVMCI_ONLY(", debug_id=%d"), trap_scope->bci(), p2i(fr.pc()), fr.pc() - nm->code_begin(), trap_scope->method()->name_and_sig_as_C_string() #if INCLUDE_JVMCI , debug_id diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/runtime/deoptimization.hpp openjdk-17-17.0.10+7/src/hotspot/share/runtime/deoptimization.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/runtime/deoptimization.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/runtime/deoptimization.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -191,7 +191,6 @@ static bool relock_objects(JavaThread* thread, GrowableArray* monitors, JavaThread* deoptee_thread, frame& fr, int exec_mode, bool realloc_failures); static void pop_frames_failed_reallocs(JavaThread* thread, vframeArray* array); - NOT_PRODUCT(static void print_objects(GrowableArray* objects, bool realloc_failures);) #endif // COMPILER2_OR_JVMCI public: diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/runtime/os.cpp openjdk-17-17.0.10+7/src/hotspot/share/runtime/os.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/runtime/os.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/runtime/os.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -669,23 +669,19 @@ return NULL; } - const NMT_TrackingLevel level = MemTracker::tracking_level(); - const size_t nmt_overhead = - MemTracker::malloc_header_size(level) + MemTracker::malloc_footer_size(level); - - const size_t outer_size = size + nmt_overhead; + const size_t outer_size = size + MemTracker::overhead_per_malloc(); // Check for overflow. if (outer_size < size) { return NULL; } - void* const outer_ptr = (u_char*)::malloc(outer_size); + void* const outer_ptr = ::malloc(outer_size); if (outer_ptr == NULL) { return NULL; } - void* inner_ptr = MemTracker::record_malloc((address)outer_ptr, size, memflags, stack, level); + void* const inner_ptr = MemTracker::record_malloc((address)outer_ptr, size, memflags, stack); DEBUG_ONLY(::memset(inner_ptr, uninitBlockPad, size);) DEBUG_ONLY(break_if_ptr_caught(inner_ptr);) @@ -724,19 +720,17 @@ return NULL; } - const NMT_TrackingLevel level = MemTracker::tracking_level(); - const size_t nmt_overhead = - MemTracker::malloc_header_size(level) + MemTracker::malloc_footer_size(level); - - const size_t new_outer_size = size + nmt_overhead; + const size_t new_outer_size = size + MemTracker::overhead_per_malloc(); // If NMT is enabled, this checks for heap overwrites, then de-accounts the old block. - void* const old_outer_ptr = MemTracker::record_free(memblock, level); + void* const old_outer_ptr = MemTracker::record_free(memblock); void* const new_outer_ptr = ::realloc(old_outer_ptr, new_outer_size); + if (new_outer_ptr == NULL) { + return NULL; + } - // If NMT is enabled, this checks for heap overwrites, then de-accounts the old block. - void* const new_inner_ptr = MemTracker::record_malloc(new_outer_ptr, size, memflags, stack, level); + void* const new_inner_ptr = MemTracker::record_malloc(new_outer_ptr, size, memflags, stack); DEBUG_ONLY(break_if_ptr_caught(new_inner_ptr);) @@ -757,10 +751,9 @@ DEBUG_ONLY(break_if_ptr_caught(memblock);) - const NMT_TrackingLevel level = MemTracker::tracking_level(); - // If NMT is enabled, this checks for heap overwrites, then de-accounts the old block. - void* const old_outer_ptr = MemTracker::record_free(memblock, level); + void* const old_outer_ptr = MemTracker::record_free(memblock); + ::free(old_outer_ptr); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/mallocSiteTable.cpp openjdk-17-17.0.10+7/src/hotspot/share/services/mallocSiteTable.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/mallocSiteTable.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/mallocSiteTable.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -106,13 +106,11 @@ * 2. Overflow hash bucket. * Under any of above circumstances, caller should handle the situation. */ -MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, size_t* bucket_idx, - size_t* pos_idx, MEMFLAGS flags) { +MallocSite* MallocSiteTable::lookup_or_add(const NativeCallStack& key, uint32_t* marker, MEMFLAGS flags) { assert(flags != mtNone, "Should have a real memory type"); const unsigned int hash = key.calculate_hash(); const unsigned int index = hash_to_index(hash); - *bucket_idx = (size_t)index; - *pos_idx = 0; + *marker = 0; // First entry for this hash bucket if (_table[index] == NULL) { @@ -122,41 +120,47 @@ // swap in the head if (Atomic::replace_if_null(&_table[index], entry)) { + *marker = build_marker(index, 0); return entry->data(); } delete entry; } + unsigned pos_idx = 0; MallocSiteHashtableEntry* head = _table[index]; - while (head != NULL && (*pos_idx) <= MAX_BUCKET_LENGTH) { + while (head != NULL && pos_idx < MAX_BUCKET_LENGTH) { if (head->hash() == hash) { MallocSite* site = head->data(); if (site->flag() == flags && site->equals(key)) { + *marker = build_marker(index, pos_idx); return head->data(); } } - if (head->next() == NULL && (*pos_idx) < MAX_BUCKET_LENGTH) { + if (head->next() == NULL && pos_idx < (MAX_BUCKET_LENGTH - 1)) { MallocSiteHashtableEntry* entry = new_entry(key, flags); // OOM check if (entry == NULL) return NULL; if (head->atomic_insert(entry)) { - (*pos_idx) ++; + pos_idx ++; + *marker = build_marker(index, pos_idx); return entry->data(); } // contended, other thread won delete entry; } head = (MallocSiteHashtableEntry*)head->next(); - (*pos_idx) ++; + pos_idx ++; } return NULL; } // Access malloc site -MallocSite* MallocSiteTable::malloc_site(size_t bucket_idx, size_t pos_idx) { +MallocSite* MallocSiteTable::malloc_site(uint32_t marker) { + uint16_t bucket_idx = bucket_idx_from_marker(marker); assert(bucket_idx < table_size, "Invalid bucket index"); + const uint16_t pos_idx = pos_idx_from_marker(marker); MallocSiteHashtableEntry* head = _table[bucket_idx]; for (size_t index = 0; index < pos_idx && head != NULL; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/mallocSiteTable.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/mallocSiteTable.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/mallocSiteTable.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/mallocSiteTable.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -49,8 +49,12 @@ // Memory allocated from this code path size_t size() const { return _c.size(); } + // Peak memory ever allocated from this code path + size_t peak_size() const { return _c.peak_size(); } // The number of calls were made size_t count() const { return _c.count(); } + + const MemoryCounter* counter() const { return &_c; } }; // Malloc site hashtable entry @@ -114,11 +118,22 @@ table_size = (table_base_size * NMT_TrackingStackDepth - 1) }; - // The table must not be wider than the maximum value the bucket_idx field - // in the malloc header can hold. + // Table cannot be wider than a 16bit bucket idx can hold +#define MAX_MALLOCSITE_TABLE_SIZE (USHRT_MAX - 1) + // Each bucket chain cannot be longer than what a 16 bit pos idx can hold (hopefully way shorter) +#define MAX_BUCKET_LENGTH (USHRT_MAX - 1) + STATIC_ASSERT(table_size <= MAX_MALLOCSITE_TABLE_SIZE); + static uint32_t build_marker(unsigned bucket_idx, unsigned pos_idx) { + assert(bucket_idx <= MAX_MALLOCSITE_TABLE_SIZE && pos_idx < MAX_BUCKET_LENGTH, "overflow"); + return (uint32_t)bucket_idx << 16 | pos_idx; + } + static uint16_t bucket_idx_from_marker(uint32_t marker) { return marker >> 16; } + static uint16_t pos_idx_from_marker(uint32_t marker) { return marker & 0xFFFF; } + public: + static bool initialize(); // Number of hash buckets @@ -126,9 +141,8 @@ // Access and copy a call stack from this table. Shared lock should be // acquired before access the entry. - static inline bool access_stack(NativeCallStack& stack, size_t bucket_idx, - size_t pos_idx) { - MallocSite* site = malloc_site(bucket_idx, pos_idx); + static inline bool access_stack(NativeCallStack& stack, uint32_t marker) { + MallocSite* site = malloc_site(marker); if (site != NULL) { stack = *site->call_stack(); return true; @@ -137,23 +151,22 @@ } // Record a new allocation from specified call path. - // Return true if the allocation is recorded successfully, bucket_idx - // and pos_idx are also updated to indicate the entry where the allocation - // information was recorded. + // Return true if the allocation is recorded successfully and updates marker + // to indicate the entry where the allocation information was recorded. // Return false only occurs under rare scenarios: // 1. out of memory // 2. overflow hash bucket static inline bool allocation_at(const NativeCallStack& stack, size_t size, - size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) { - MallocSite* site = lookup_or_add(stack, bucket_idx, pos_idx, flags); + uint32_t* marker, MEMFLAGS flags) { + MallocSite* site = lookup_or_add(stack, marker, flags); if (site != NULL) site->allocate(size); return site != NULL; } - // Record memory deallocation. bucket_idx and pos_idx indicate where the allocation + // Record memory deallocation. marker indicates where the allocation // information was recorded. - static inline bool deallocation_at(size_t size, size_t bucket_idx, size_t pos_idx) { - MallocSite* site = malloc_site(bucket_idx, pos_idx); + static inline bool deallocation_at(size_t size, uint32_t marker) { + MallocSite* site = malloc_site(marker); if (site != NULL) { site->deallocate(size); return true; @@ -173,8 +186,8 @@ // Delete a bucket linked list static void delete_linked_list(MallocSiteHashtableEntry* head); - static MallocSite* lookup_or_add(const NativeCallStack& key, size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags); - static MallocSite* malloc_site(size_t bucket_idx, size_t pos_idx); + static MallocSite* lookup_or_add(const NativeCallStack& key, uint32_t* marker, MEMFLAGS flags); + static MallocSite* malloc_site(uint32_t marker); static bool walk(MallocSiteWalker* walker); static inline unsigned int hash_to_index(unsigned int hash) { diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/mallocTracker.cpp openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/mallocTracker.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -23,65 +23,30 @@ */ #include "precompiled.hpp" +#include "runtime/atomic.hpp" #include "runtime/os.hpp" #include "services/mallocSiteTable.hpp" #include "services/mallocTracker.hpp" -#include "services/mallocTracker.inline.hpp" #include "services/memTracker.hpp" #include "utilities/debug.hpp" #include "utilities/ostream.hpp" size_t MallocMemorySummary::_snapshot[CALC_OBJ_SIZE_IN_TYPE(MallocMemorySnapshot, size_t)]; -#ifdef ASSERT -void MemoryCounter::update_peak_count(size_t count) { - size_t peak_cnt = peak_count(); - while (peak_cnt < count) { - size_t old_cnt = Atomic::cmpxchg(&_peak_count, peak_cnt, count, memory_order_relaxed); - if (old_cnt != peak_cnt) { - peak_cnt = old_cnt; - } - } -} - -void MemoryCounter::update_peak_size(size_t sz) { +void MemoryCounter::update_peak(size_t size, size_t cnt) { size_t peak_sz = peak_size(); - while (peak_sz < sz) { - size_t old_sz = Atomic::cmpxchg(&_peak_size, peak_sz, sz, memory_order_relaxed); - if (old_sz != peak_sz) { + while (peak_sz < size) { + size_t old_sz = Atomic::cmpxchg(&_peak_size, peak_sz, size, memory_order_relaxed); + if (old_sz == peak_sz) { + // I won + _peak_count = cnt; + break; + } else { peak_sz = old_sz; } } } -size_t MemoryCounter::peak_count() const { - return Atomic::load(&_peak_count); -} - -size_t MemoryCounter::peak_size() const { - return Atomic::load(&_peak_size); -} -#endif - -// Total malloc invocation count -size_t MallocMemorySnapshot::total_count() const { - size_t amount = 0; - for (int index = 0; index < mt_number_of_types; index ++) { - amount += _malloc[index].malloc_count(); - } - return amount; -} - -// Total malloc'd memory amount -size_t MallocMemorySnapshot::total() const { - size_t amount = 0; - for (int index = 0; index < mt_number_of_types; index ++) { - amount += _malloc[index].malloc_size(); - } - amount += _tracking_header.size() + total_arena(); - return amount; -} - // Total malloc'd memory used by arenas size_t MallocMemorySnapshot::total_arena() const { size_t amount = 0; @@ -97,6 +62,7 @@ size_t arena_size = total_arena(); int chunk_idx = NMTUtil::flag_to_index(mtChunk); _malloc[chunk_idx].record_free(arena_size); + _all_mallocs.deallocate(arena_size); } @@ -112,20 +78,6 @@ set_footer(_footer_canary_dead_mark); } -void MallocHeader::release() { - assert(MemTracker::enabled(), "Sanity"); - - check_block_integrity(); - - MallocMemorySummary::record_free(size(), flags()); - MallocMemorySummary::record_free_malloc_header(sizeof(MallocHeader)); - if (MemTracker::tracking_level() == NMT_detail) { - MallocSiteTable::deallocation_at(size(), _bucket_idx, _pos_idx); - } - - mark_block_as_dead(); -} - void MallocHeader::print_block_on_error(outputStream* st, address bad_address) const { assert(bad_address >= (address)this, "sanity"); @@ -219,13 +171,8 @@ #undef PREFIX } -bool MallocHeader::record_malloc_site(const NativeCallStack& stack, size_t size, - size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const { - return MallocSiteTable::allocation_at(stack, size, bucket_idx, pos_idx, flags); -} - bool MallocHeader::get_stack(NativeCallStack& stack) const { - return MallocSiteTable::access_stack(stack, _bucket_idx, _pos_idx); + return MallocSiteTable::access_stack(stack, _mst_marker); } bool MallocTracker::initialize(NMT_TrackingLevel level) { @@ -241,29 +188,32 @@ // Record a malloc memory allocation void* MallocTracker::record_malloc(void* malloc_base, size_t size, MEMFLAGS flags, - const NativeCallStack& stack, NMT_TrackingLevel level) { - assert(level != NMT_off, "precondition"); - void* memblock; // the address for user data - MallocHeader* header = NULL; + const NativeCallStack& stack) +{ + assert(MemTracker::enabled(), "precondition"); + assert(malloc_base != NULL, "precondition"); - if (malloc_base == NULL) { - return NULL; + MallocMemorySummary::record_malloc(size, flags); + uint32_t mst_marker = 0; + if (MemTracker::tracking_level() == NMT_detail) { + MallocSiteTable::allocation_at(stack, size, &mst_marker, flags); } // Uses placement global new operator to initialize malloc header - - header = ::new (malloc_base)MallocHeader(size, flags, stack, level); - memblock = (void*)((char*)malloc_base + sizeof(MallocHeader)); + MallocHeader* const header = ::new (malloc_base)MallocHeader(size, flags, stack, mst_marker); + void* const memblock = (void*)((char*)malloc_base + sizeof(MallocHeader)); // The alignment check: 8 bytes alignment for 32 bit systems. // 16 bytes alignment for 64-bit systems. assert(((size_t)memblock & (sizeof(size_t) * 2 - 1)) == 0, "Alignment check"); #ifdef ASSERT - if (level > NMT_off) { - // Read back - assert(get_size(memblock) == size, "Wrong size"); - assert(get_flags(memblock) == flags, "Wrong flags"); + // Read back + { + MallocHeader* const header2 = malloc_header(memblock); + assert(header2->size() == size, "Wrong size"); + assert(header2->flags() == flags, "Wrong flags"); + header2->check_block_integrity(); } #endif @@ -271,8 +221,18 @@ } void* MallocTracker::record_free(void* memblock) { - assert(MemTracker::tracking_level() != NMT_off && memblock != NULL, "precondition"); - MallocHeader* header = malloc_header(memblock); - header->release(); + assert(MemTracker::enabled(), "Sanity"); + assert(memblock != NULL, "precondition"); + + MallocHeader* const header = malloc_header(memblock); + header->check_block_integrity(); + + MallocMemorySummary::record_free(header->size(), header->flags()); + if (MemTracker::tracking_level() == NMT_detail) { + MallocSiteTable::deallocation_at(header->size(), header->mst_marker()); + } + + header->mark_block_as_dead(); + return (void*)header; } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/mallocTracker.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/mallocTracker.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -43,22 +43,21 @@ volatile size_t _count; volatile size_t _size; - DEBUG_ONLY(volatile size_t _peak_count;) - DEBUG_ONLY(volatile size_t _peak_size; ) + // Peak size and count. Note: Peak count is the count at the point + // peak size was reached, not the absolute highest peak count. + volatile size_t _peak_count; + volatile size_t _peak_size; + void update_peak(size_t size, size_t cnt); public: - MemoryCounter() : _count(0), _size(0) { - DEBUG_ONLY(_peak_count = 0;) - DEBUG_ONLY(_peak_size = 0;) - } + MemoryCounter() : _count(0), _size(0), _peak_count(0), _peak_size(0) {} inline void allocate(size_t sz) { size_t cnt = Atomic::add(&_count, size_t(1), memory_order_relaxed); if (sz > 0) { size_t sum = Atomic::add(&_size, sz, memory_order_relaxed); - DEBUG_ONLY(update_peak_size(sum);) + update_peak(sum, cnt); } - DEBUG_ONLY(update_peak_count(cnt);) } inline void deallocate(size_t sz) { @@ -74,19 +73,20 @@ if (sz != 0) { assert(sz >= 0 || size() >= size_t(-sz), "Must be"); size_t sum = Atomic::add(&_size, size_t(sz), memory_order_relaxed); - DEBUG_ONLY(update_peak_size(sum);) + update_peak(sum, _count); } } inline size_t count() const { return Atomic::load(&_count); } inline size_t size() const { return Atomic::load(&_size); } -#ifdef ASSERT - void update_peak_count(size_t cnt); - void update_peak_size(size_t sz); - size_t peak_count() const; - size_t peak_size() const; -#endif // ASSERT + inline size_t peak_count() const { + return Atomic::load(&_peak_count); + } + + inline size_t peak_size() const { + return Atomic::load(&_peak_size); + } }; /* @@ -123,12 +123,14 @@ } inline size_t malloc_size() const { return _malloc.size(); } + inline size_t malloc_peak_size() const { return _malloc.peak_size(); } inline size_t malloc_count() const { return _malloc.count();} inline size_t arena_size() const { return _arena.size(); } + inline size_t arena_peak_size() const { return _arena.peak_size(); } inline size_t arena_count() const { return _arena.count(); } - DEBUG_ONLY(inline const MemoryCounter& malloc_counter() const { return _malloc; }) - DEBUG_ONLY(inline const MemoryCounter& arena_counter() const { return _arena; }) + const MemoryCounter* malloc_counter() const { return &_malloc; } + const MemoryCounter* arena_counter() const { return &_arena; } }; class MallocMemorySummary; @@ -140,7 +142,7 @@ private: MallocMemory _malloc[mt_number_of_types]; - MemoryCounter _tracking_header; + MemoryCounter _all_mallocs; public: @@ -149,14 +151,18 @@ return &_malloc[index]; } - inline MemoryCounter* malloc_overhead() { - return &_tracking_header; - } + inline size_t malloc_overhead() const; // Total malloc invocation count - size_t total_count() const; + size_t total_count() const { + return _all_mallocs.count(); + } + // Total malloc'd memory amount - size_t total() const; + size_t total() const { + return _all_mallocs.size() + malloc_overhead() + total_arena(); + } + // Total malloc'd memory used by arenas size_t total_arena() const; @@ -170,7 +176,7 @@ // copy is going on, because their size is adjusted using this // buffer in make_adjustment(). ThreadCritical tc; - s->_tracking_header = _tracking_header; + s->_all_mallocs = _all_mallocs; for (int index = 0; index < mt_number_of_types; index ++) { s->_malloc[index] = _malloc[index]; } @@ -194,10 +200,12 @@ static inline void record_malloc(size_t size, MEMFLAGS flag) { as_snapshot()->by_type(flag)->record_malloc(size); + as_snapshot()->_all_mallocs.allocate(size); } static inline void record_free(size_t size, MEMFLAGS flag) { as_snapshot()->by_type(flag)->record_free(size); + as_snapshot()->_all_mallocs.deallocate(size); } static inline void record_new_arena(MEMFLAGS flag) { @@ -217,18 +225,9 @@ s->make_adjustment(); } - // Record memory used by malloc tracking header - static inline void record_new_malloc_header(size_t sz) { - as_snapshot()->malloc_overhead()->allocate(sz); - } - - static inline void record_free_malloc_header(size_t sz) { - as_snapshot()->malloc_overhead()->deallocate(sz); - } - // The memory used by malloc tracking headers static inline size_t tracking_overhead() { - return as_snapshot()->malloc_overhead()->size(); + return as_snapshot()->malloc_overhead(); } static MallocMemorySnapshot* as_snapshot() { @@ -267,7 +266,7 @@ * * 8 9 10 11 12 13 14 15 16 ++ * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ - * ... | bucket idx | pos idx | flags | unused | canary | ... User payload .... + * ... | malloc site table marker | flags | unused | canary | ... User payload .... * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ * * Layout on 32-bit: @@ -279,7 +278,7 @@ * * 8 9 10 11 12 13 14 15 16 ++ * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ - * ... | bucket idx | pos idx | flags | unused | canary | ... User payload .... + * ... | malloc site table marker | flags | unused | canary | ... User payload .... * +--------+--------+--------+--------+--------+--------+--------+--------+ ------------------------ * * Notes: @@ -294,16 +293,12 @@ class MallocHeader { NOT_LP64(uint32_t _alt_canary); - size_t _size; - uint16_t _bucket_idx; - uint16_t _pos_idx; - uint8_t _flags; - uint8_t _unused; + const size_t _size; + const uint32_t _mst_marker; + const uint8_t _flags; + const uint8_t _unused; uint16_t _canary; -#define MAX_MALLOCSITE_TABLE_SIZE (USHRT_MAX - 1) -#define MAX_BUCKET_LENGTH (USHRT_MAX - 1) - static const uint16_t _header_canary_life_mark = 0xE99E; static const uint16_t _header_canary_dead_mark = 0xD99D; static const uint16_t _footer_canary_life_mark = 0xE88E; @@ -314,12 +309,7 @@ // We discount sizes larger than these static const size_t max_reasonable_malloc_size = LP64_ONLY(256 * G) NOT_LP64(3500 * M); - // Check block integrity. If block is broken, print out a report - // to tty (optionally with hex dump surrounding the broken block), - // then trigger a fatal error. - void check_block_integrity() const; void print_block_on_error(outputStream* st, address bad_address) const; - void mark_block_as_dead(); static uint16_t build_footer(uint8_t b1, uint8_t b2) { return ((uint16_t)b1 << 8) | (uint16_t)b2; } @@ -329,48 +319,34 @@ public: - MallocHeader(size_t size, MEMFLAGS flags, const NativeCallStack& stack, NMT_TrackingLevel level) { + MallocHeader(size_t size, MEMFLAGS flags, const NativeCallStack& stack, uint32_t mst_marker) + : _size(size), _mst_marker(mst_marker), _flags(NMTUtil::flag_to_index(flags)), + _unused(0), _canary(_header_canary_life_mark) + { assert(size < max_reasonable_malloc_size, "Too large allocation size?"); - - _flags = NMTUtil::flag_to_index(flags); - set_size(size); - if (level == NMT_detail) { - size_t bucket_idx; - size_t pos_idx; - if (record_malloc_site(stack, size, &bucket_idx, &pos_idx, flags)) { - assert(bucket_idx <= MAX_MALLOCSITE_TABLE_SIZE, "Overflow bucket index"); - assert(pos_idx <= MAX_BUCKET_LENGTH, "Overflow bucket position index"); - _bucket_idx = (uint16_t)bucket_idx; - _pos_idx = (uint16_t)pos_idx; - } - } - - _unused = 0; - _canary = _header_canary_life_mark; // On 32-bit we have some bits more, use them for a second canary // guarding the start of the header. NOT_LP64(_alt_canary = _header_alt_canary_life_mark;) set_footer(_footer_canary_life_mark); // set after initializing _size - - MallocMemorySummary::record_malloc(size, flags); - MallocMemorySummary::record_new_malloc_header(sizeof(MallocHeader)); } inline size_t size() const { return _size; } inline MEMFLAGS flags() const { return (MEMFLAGS)_flags; } + inline uint32_t mst_marker() const { return _mst_marker; } bool get_stack(NativeCallStack& stack) const; - // Cleanup tracking information and mark block as dead before the memory is released. - void release(); + void mark_block_as_dead(); - private: - inline void set_size(size_t size) { - _size = size; - } - bool record_malloc_site(const NativeCallStack& stack, size_t size, - size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const; + // Check block integrity. If block is broken, print out a report + // to tty (optionally with hex dump surrounding the broken block), + // then trigger a fatal error. + void check_block_integrity() const; }; +size_t MallocMemorySnapshot::malloc_overhead() const { + return _all_mallocs.count() * sizeof(MallocHeader); +} + // This needs to be true on both 64-bit and 32-bit platforms STATIC_ASSERT(sizeof(MallocHeader) == (sizeof(uint64_t) * 2)); @@ -381,15 +357,9 @@ // Initialize malloc tracker for specific tracking level static bool initialize(NMT_TrackingLevel level); - // malloc tracking header size for specific tracking level - static inline size_t malloc_header_size(NMT_TrackingLevel level) { - return (level == NMT_off) ? 0 : sizeof(MallocHeader); - } - - // malloc tracking footer size for specific tracking level - static inline size_t malloc_footer_size(NMT_TrackingLevel level) { - return (level == NMT_off) ? 0 : sizeof(uint16_t); - } + // The overhead that is incurred by switching on NMT (we need, per malloc allocation, + // space for header and 16-bit footer) + static const size_t overhead_per_malloc = sizeof(MallocHeader) + sizeof(uint16_t); // Parameter name convention: // memblock : the beginning address for user data @@ -401,30 +371,11 @@ // Record malloc on specified memory block static void* record_malloc(void* malloc_base, size_t size, MEMFLAGS flags, - const NativeCallStack& stack, NMT_TrackingLevel level); + const NativeCallStack& stack); // Record free on specified memory block static void* record_free(void* memblock); - // Offset memory address to header address - static inline void* get_base(void* memblock); - static inline void* get_base(void* memblock, NMT_TrackingLevel level) { - if (memblock == NULL || level == NMT_off) return memblock; - return (char*)memblock - malloc_header_size(level); - } - - // Get memory size - static inline size_t get_size(void* memblock) { - MallocHeader* header = malloc_header(memblock); - return header->size(); - } - - // Get memory type - static inline MEMFLAGS get_flags(void* memblock) { - MallocHeader* header = malloc_header(memblock); - return header->flags(); - } - static inline void record_new_arena(MEMFLAGS flags) { MallocMemorySummary::record_new_arena(flags); } @@ -439,8 +390,11 @@ private: static inline MallocHeader* malloc_header(void *memblock) { assert(memblock != NULL, "NULL pointer"); - MallocHeader* header = (MallocHeader*)((char*)memblock - sizeof(MallocHeader)); - return header; + return (MallocHeader*)((char*)memblock - sizeof(MallocHeader)); + } + static inline const MallocHeader* malloc_header(const void *memblock) { + assert(memblock != NULL, "NULL pointer"); + return (const MallocHeader*)((const char*)memblock - sizeof(MallocHeader)); } }; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/mallocTracker.inline.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.inline.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/mallocTracker.inline.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/mallocTracker.inline.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2014, 2019, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_SERVICES_MALLOCTRACKER_INLINE_HPP -#define SHARE_SERVICES_MALLOCTRACKER_INLINE_HPP - -#include "services/mallocTracker.hpp" - -#include "services/memTracker.hpp" - -inline void* MallocTracker::get_base(void* memblock){ - return get_base(memblock, MemTracker::tracking_level()); -} - -#endif // SHARE_SERVICES_MALLOCTRACKER_INLINE_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/memBaseline.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/memBaseline.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/memBaseline.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/memBaseline.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -142,7 +142,7 @@ size_t malloc_tracking_overhead() const { assert(baseline_type() != Not_baselined, "Not yet baselined"); MemBaseline* bl = const_cast(this); - return bl->_malloc_memory_snapshot.malloc_overhead()->size(); + return bl->_malloc_memory_snapshot.malloc_overhead(); } MallocMemory* malloc_memory(MEMFLAGS flag) { diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/memReporter.cpp openjdk-17-17.0.10+7/src/hotspot/share/services/memReporter.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/memReporter.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/memReporter.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -31,6 +31,16 @@ #include "services/virtualMemoryTracker.hpp" #include "utilities/globalDefinitions.hpp" +// Diff two counters, express them as signed, with range checks +static ssize_t counter_diff(size_t c1, size_t c2) { + assert(c1 <= SSIZE_MAX, "counter out of range: " SIZE_FORMAT ".", c1); + assert(c2 <= SSIZE_MAX, "counter out of range: " SIZE_FORMAT ".", c2); + if (c1 > SSIZE_MAX || c2 > SSIZE_MAX) { + return 0; + } + return c1 - c2; +} + size_t MemReporterBase::reserved_total(const MallocMemory* malloc, const VirtualMemory* vm) const { return malloc->malloc_size() + malloc->arena_size() + vm->reserved(); } @@ -45,11 +55,14 @@ amount_in_current_scale(reserved), scale, amount_in_current_scale(committed), scale); } -void MemReporterBase::print_malloc(size_t amount, size_t count, MEMFLAGS flag) const { +void MemReporterBase::print_malloc(const MemoryCounter* c, MEMFLAGS flag) const { const char* scale = current_scale(); outputStream* out = output(); const char* alloc_type = (flag == mtThreadStack) ? "" : "malloc="; + const size_t amount = c->size(); + const size_t count = c->count(); + if (flag != mtNone) { out->print("(%s" SIZE_FORMAT "%s type=%s", alloc_type, amount_in_current_scale(amount), scale, NMTUtil::flag_to_name(flag)); @@ -58,11 +71,21 @@ amount_in_current_scale(amount), scale); } + // blends out mtChunk count number if (count > 0) { out->print(" #" SIZE_FORMAT "", count); } out->print(")"); + + size_t pk_amount = c->peak_size(); + if (pk_amount == amount) { + out->print_raw(" (at peak)"); + } else if (pk_amount > amount) { + size_t pk_count = c->peak_count(); + out->print(" (peak=" SIZE_FORMAT "%s #" SIZE_FORMAT ")", + amount_in_current_scale(pk_amount), scale, pk_count); + } } void MemReporterBase::print_virtual_memory(size_t reserved, size_t committed) const { @@ -71,9 +94,9 @@ amount_in_current_scale(reserved), scale, amount_in_current_scale(committed), scale); } -void MemReporterBase::print_malloc_line(size_t amount, size_t count) const { +void MemReporterBase::print_malloc_line(const MemoryCounter* c) const { output()->print("%28s", " "); - print_malloc(amount, count); + print_malloc(c); output()->print_cr(" "); } @@ -83,10 +106,26 @@ output()->print_cr(" "); } -void MemReporterBase::print_arena_line(size_t amount, size_t count) const { +void MemReporterBase::print_arena_line(const MemoryCounter* c) const { const char* scale = current_scale(); - output()->print_cr("%27s (arena=" SIZE_FORMAT "%s #" SIZE_FORMAT ")", " ", + outputStream* out = output(); + + const size_t amount = c->size(); + const size_t count = c->count(); + + out->print("%27s (arena=" SIZE_FORMAT "%s #" SIZE_FORMAT ")", "", amount_in_current_scale(amount), scale, count); + + size_t pk_amount = c->peak_size(); + if (pk_amount == amount) { + out->print_raw(" (at peak)"); + } else if (pk_amount > amount) { + size_t pk_count = c->peak_count(); + out->print(" (peak=" SIZE_FORMAT "%s #" SIZE_FORMAT ")", + amount_in_current_scale(pk_amount), scale, pk_count); + } + + out->cr(); } void MemReporterBase::print_virtual_memory_region(const char* type, address base, size_t size) const { @@ -157,8 +196,8 @@ } } else if (flag == mtNMT) { // Count malloc headers in "NMT" category - reserved_amount += _malloc_snapshot->malloc_overhead()->size(); - committed_amount += _malloc_snapshot->malloc_overhead()->size(); + reserved_amount += _malloc_snapshot->malloc_overhead(); + committed_amount += _malloc_snapshot->malloc_overhead(); } if (amount_in_current_scale(reserved_amount) > 0) { @@ -195,24 +234,24 @@ } // report malloc'd memory - if (amount_in_current_scale(malloc_memory->malloc_size()) > 0) { - // We don't know how many arena chunks are in used, so don't report the count - size_t count = (flag == mtChunk) ? 0 : malloc_memory->malloc_count(); - print_malloc_line(malloc_memory->malloc_size(), count); + if (amount_in_current_scale(malloc_memory->malloc_size()) > 0 + || amount_in_current_scale(malloc_memory->malloc_peak_size()) > 0) { + print_malloc_line(malloc_memory->malloc_counter()); } if (amount_in_current_scale(virtual_memory->reserved()) > 0) { print_virtual_memory_line(virtual_memory->reserved(), virtual_memory->committed()); } - if (amount_in_current_scale(malloc_memory->arena_size()) > 0) { - print_arena_line(malloc_memory->arena_size(), malloc_memory->arena_count()); + if (amount_in_current_scale(malloc_memory->arena_size()) > 0 + DEBUG_ONLY(|| amount_in_current_scale(malloc_memory->arena_peak_size()) > 0)) { + print_arena_line(malloc_memory->arena_counter()); } if (flag == mtNMT && - amount_in_current_scale(_malloc_snapshot->malloc_overhead()->size()) > 0) { + amount_in_current_scale(_malloc_snapshot->malloc_overhead()) > 0) { out->print_cr("%27s (tracking overhead=" SIZE_FORMAT "%s)", " ", - amount_in_current_scale(_malloc_snapshot->malloc_overhead()->size()), scale); + amount_in_current_scale(_malloc_snapshot->malloc_overhead()), scale); } else if (flag == mtClass) { // Metadata information report_metadata(Metaspace::NonClassType); @@ -271,12 +310,9 @@ const MallocSite* malloc_site; int num_omitted = 0; while ((malloc_site = malloc_itr.next()) != NULL) { - // Don't report free sites; does not count toward omitted count. - if (malloc_site->size() == 0) { - continue; - } - // Don't report if site has allocated less than one unit of whatever our scale is - if (scale() > 1 && amount_in_current_scale(malloc_site->size()) == 0) { + // Don't report if site has never allocated less than one unit of whatever our scale is + if (scale() > 1 && amount_in_current_scale(malloc_site->size()) == 0 + DEBUG_ONLY(&& amount_in_current_scale(malloc_site->peak_size()) == 0)) { num_omitted ++; continue; } @@ -286,7 +322,7 @@ MEMFLAGS flag = malloc_site->flag(); assert(NMTUtil::flag_is_valid(flag) && flag != mtNone, "Must have a valid memory type"); - print_malloc(malloc_site->size(), malloc_site->count(),flag); + print_malloc(malloc_site->counter(), flag); out->print_cr("\n"); } return num_omitted; @@ -436,8 +472,9 @@ } if (current_count > 0) { out->print(" #" SIZE_FORMAT "", current_count); - if (current_count != early_count) { - out->print(" %+d", (int)(current_count - early_count)); + const ssize_t delta_count = counter_diff(current_count, early_count); + if (delta_count != 0) { + out->print(" " SSIZE_PLUS_FORMAT, delta_count); } } } @@ -452,8 +489,9 @@ } out->print(" #" SIZE_FORMAT "", current_count); - if (current_count != early_count) { - out->print(" %+d", (int)(current_count - early_count)); + const ssize_t delta_count = counter_diff(current_count, early_count); + if (delta_count != 0) { + out->print(" " SSIZE_PLUS_FORMAT, delta_count); } } @@ -525,30 +563,33 @@ if (flag == mtClass) { // report class count out->print("%27s (classes #" SIZE_FORMAT "", " ", _current_baseline.class_count()); - int class_count_diff = (int)(_current_baseline.class_count() - - _early_baseline.class_count()); - if (_current_baseline.class_count() != _early_baseline.class_count()) { - out->print(" %+d", (int)(_current_baseline.class_count() - _early_baseline.class_count())); + const ssize_t class_count_diff = + counter_diff(_current_baseline.class_count(), _early_baseline.class_count()); + if (class_count_diff != 0) { + out->print(" " SSIZE_PLUS_FORMAT, class_count_diff); } out->print_cr(")"); out->print("%27s ( instance classes #" SIZE_FORMAT, " ", _current_baseline.instance_class_count()); - if (_current_baseline.instance_class_count() != _early_baseline.instance_class_count()) { - out->print(" %+d", (int)(_current_baseline.instance_class_count() - _early_baseline.instance_class_count())); + const ssize_t instance_class_count_diff = + counter_diff(_current_baseline.instance_class_count(), _early_baseline.instance_class_count()); + if (instance_class_count_diff != 0) { + out->print(" " SSIZE_PLUS_FORMAT, instance_class_count_diff); } out->print(", array classes #" SIZE_FORMAT, _current_baseline.array_class_count()); - if (_current_baseline.array_class_count() != _early_baseline.array_class_count()) { - out->print(" %+d", (int)(_current_baseline.array_class_count() - _early_baseline.array_class_count())); + const ssize_t array_class_count_diff = + counter_diff(_current_baseline.array_class_count(), _early_baseline.array_class_count()); + if (array_class_count_diff != 0) { + out->print(" " SSIZE_PLUS_FORMAT, array_class_count_diff); } out->print_cr(")"); } else if (flag == mtThread) { // report thread count out->print("%27s (thread #" SIZE_FORMAT "", " ", _current_baseline.thread_count()); - int thread_count_diff = (int)(_current_baseline.thread_count() - - _early_baseline.thread_count()); + const ssize_t thread_count_diff = counter_diff(_current_baseline.thread_count(), _early_baseline.thread_count()); if (thread_count_diff != 0) { - out->print(" %+d", thread_count_diff); + out->print(" " SSIZE_PLUS_FORMAT, thread_count_diff); } out->print_cr(")"); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/memReporter.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/memReporter.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/memReporter.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/memReporter.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -82,12 +82,12 @@ // Print summary total, malloc and virtual memory void print_total(size_t reserved, size_t committed) const; - void print_malloc(size_t amount, size_t count, MEMFLAGS flag = mtNone) const; + void print_malloc(const MemoryCounter* c, MEMFLAGS flag = mtNone) const; void print_virtual_memory(size_t reserved, size_t committed) const; - void print_malloc_line(size_t amount, size_t count) const; + void print_malloc_line(const MemoryCounter* c) const; void print_virtual_memory_line(size_t reserved, size_t committed) const; - void print_arena_line(size_t amount, size_t count) const; + void print_arena_line(const MemoryCounter* c) const; void print_virtual_memory_region(const char* type, address base, size_t size) const; }; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/memTracker.cpp openjdk-17-17.0.10+7/src/hotspot/share/services/memTracker.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/memTracker.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/memTracker.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -33,7 +33,7 @@ #include "runtime/vmOperations.hpp" #include "services/memBaseline.hpp" #include "services/memReporter.hpp" -#include "services/mallocTracker.inline.hpp" +#include "services/mallocTracker.hpp" #include "services/memTracker.hpp" #include "services/nmtCommon.hpp" #include "services/nmtPreInit.hpp" @@ -90,10 +90,6 @@ } } -void* MemTracker::malloc_base(void* memblock) { - return MallocTracker::get_base(memblock); -} - void Tracker::record(address addr, size_t size) { if (MemTracker::tracking_level() < NMT_summary) return; switch(_type) { diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/memTracker.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/memTracker.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/memTracker.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/memTracker.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ #define SHARE_SERVICES_MEMTRACKER_HPP #include "services/nmtCommon.hpp" +#include "utilities/debug.hpp" #include "utilities/nativeCallStack.hpp" @@ -50,17 +51,18 @@ public: static inline NMT_TrackingLevel tracking_level() { return NMT_off; } static inline bool enabled() { return false; } + static size_t overhead_per_malloc() { return 0; } static inline void init() { } static bool check_launcher_nmt_support(const char* value) { return true; } static bool verify_nmt_option() { return true; } static inline void* record_malloc(void* mem_base, size_t size, MEMFLAGS flag, - const NativeCallStack& stack, NMT_TrackingLevel level) { return mem_base; } + const NativeCallStack& stack) { return mem_base; } static inline size_t malloc_header_size(NMT_TrackingLevel level) { return 0; } static inline size_t malloc_header_size(void* memblock) { return 0; } static inline size_t malloc_footer_size(NMT_TrackingLevel level) { return 0; } static inline void* malloc_base(void* memblock) { return memblock; } - static inline void* record_free(void* memblock, NMT_TrackingLevel level) { return memblock; } + static inline void* record_free(void* memblock) { return memblock; } static inline void record_new_arena(MEMFLAGS flag) { } static inline void record_arena_free(MEMFLAGS flag) { } @@ -88,9 +90,9 @@ #include "services/virtualMemoryTracker.hpp" #define CURRENT_PC ((MemTracker::tracking_level() == NMT_detail) ? \ - NativeCallStack(0) : NativeCallStack::empty_stack()) + NativeCallStack(0) : FAKE_CALLSTACK) #define CALLER_PC ((MemTracker::tracking_level() == NMT_detail) ? \ - NativeCallStack(1) : NativeCallStack::empty_stack()) + NativeCallStack(1) : FAKE_CALLSTACK) class MemBaseline; @@ -141,38 +143,30 @@ return _tracking_level > NMT_off; } + // Per-malloc overhead incurred by NMT, depending on the current NMT level + static size_t overhead_per_malloc() { + return enabled() ? MallocTracker::overhead_per_malloc : 0; + } + static inline void* record_malloc(void* mem_base, size_t size, MEMFLAGS flag, - const NativeCallStack& stack, NMT_TrackingLevel level) { - if (level != NMT_off) { - return MallocTracker::record_malloc(mem_base, size, flag, stack, level); + const NativeCallStack& stack) { + assert(mem_base != NULL, "caller should handle NULL"); + if (enabled()) { + return MallocTracker::record_malloc(mem_base, size, flag, stack); } return mem_base; } - static inline size_t malloc_header_size(NMT_TrackingLevel level) { - return MallocTracker::malloc_header_size(level); - } - - // malloc tracking footer size for specific tracking level - static inline size_t malloc_footer_size(NMT_TrackingLevel level) { - return MallocTracker::malloc_footer_size(level); - } - - // To malloc base address, which is the starting address - // of malloc tracking header if tracking is enabled. - // Otherwise, it returns the same address. - static void* malloc_base(void* memblock); - // Record malloc free and return malloc base address - static inline void* record_free(void* memblock, NMT_TrackingLevel level) { + static inline void* record_free(void* memblock) { // Never turned on - if (level == NMT_off || memblock == NULL) { + assert(memblock != NULL, "caller should handle NULL"); + if (!enabled()) { return memblock; } return MallocTracker::record_free(memblock); } - // Record creation of an arena static inline void record_new_arena(MEMFLAGS flag) { if (!enabled()) return; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/nmtCommon.hpp openjdk-17-17.0.10+7/src/hotspot/share/services/nmtCommon.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/nmtCommon.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/nmtCommon.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -87,7 +87,7 @@ // Map memory type to index static inline int flag_to_index(MEMFLAGS flag) { - assert(flag_is_valid(flag), "Invalid flag"); + assert(flag_is_valid(flag), "Invalid flag (%u)", (unsigned)flag); return static_cast(flag); } @@ -98,7 +98,7 @@ // Map an index to memory type static MEMFLAGS index_to_flag(int index) { - assert(flag_index_is_valid(index), "Invalid flag"); + assert(flag_index_is_valid(index), "Invalid flag index (%d)", index); return static_cast(index); } diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/services/nmtDCmd.cpp openjdk-17-17.0.10+7/src/hotspot/share/services/nmtDCmd.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/services/nmtDCmd.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/services/nmtDCmd.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -80,7 +80,7 @@ return; } - const char* scale_value = _scale.value(); + const char* scale_value = _scale.value() != nullptr ? _scale.value() : "(null)"; size_t scale_unit = get_scale(scale_value); if (scale_unit == 0) { output()->print_cr("Incorrect scale value: %s", scale_value); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/debug.cpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/debug.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/debug.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/debug.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -476,6 +476,10 @@ extern "C" JNIEXPORT void pp(void* p) { Command c("pp"); FlagSetting fl(DisplayVMOutput, true); + if (p == NULL) { + tty->print_cr("NULL"); + return; + } if (Universe::heap()->is_in(p)) { oop obj = cast_to_oop(p); obj->print(); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/globalDefinitions.hpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/globalDefinitions.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/globalDefinitions.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/globalDefinitions.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -141,6 +141,7 @@ #define INTPTR_FORMAT_W(width) "%" #width PRIxPTR #define SSIZE_FORMAT "%" PRIdPTR +#define SSIZE_PLUS_FORMAT "%+" PRIdPTR #define SIZE_FORMAT "%" PRIuPTR #define SIZE_FORMAT_HEX "0x%" PRIxPTR #define SSIZE_FORMAT_W(width) "%" #width PRIdPTR @@ -357,6 +358,9 @@ return s; } +#define EXACTFMT SIZE_FORMAT "%s" +#define EXACTFMTARGS(s) byte_size_in_exact_unit(s), exact_unit_for_byte_size(s) + // Memory size transition formatting. #define HEAP_CHANGE_FORMAT "%s: " SIZE_FORMAT "K(" SIZE_FORMAT "K)->" SIZE_FORMAT "K(" SIZE_FORMAT "K)" diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -140,4 +140,14 @@ #define USE_VECTORED_EXCEPTION_HANDLING #endif +#ifndef SSIZE_MAX +#ifdef _LP64 +#define SSIZE_MIN LLONG_MIN +#define SSIZE_MAX LLONG_MAX +#else +#define SSIZE_MIN INT_MIN +#define SSIZE_MAX INT_MAX +#endif +#endif // SSIZE_MAX missing + #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_VISCPP_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/growableArray.hpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/growableArray.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/growableArray.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/growableArray.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -142,17 +142,17 @@ } E& at(int i) { - assert(0 <= i && i < _len, "illegal index"); + assert(0 <= i && i < _len, "illegal index %d for length %d", i, _len); return _data[i]; } E const& at(int i) const { - assert(0 <= i && i < _len, "illegal index"); + assert(0 <= i && i < _len, "illegal index %d for length %d", i, _len); return _data[i]; } E* adr_at(int i) const { - assert(0 <= i && i < _len, "illegal index"); + assert(0 <= i && i < _len, "illegal index %d for length %d", i, _len); return &_data[i]; } @@ -184,7 +184,7 @@ } void at_put(int i, const E& elem) { - assert(0 <= i && i < _len, "illegal index"); + assert(0 <= i && i < _len, "illegal index %d for length %d", i, _len); _data[i] = elem; } @@ -245,7 +245,7 @@ } void remove_at(int index) { - assert(0 <= index && index < _len, "illegal index"); + assert(0 <= index && index < _len, "illegal index %d for length %d", index, _len); for (int j = index + 1; j < _len; j++) { _data[j-1] = _data[j]; } @@ -262,7 +262,7 @@ // The order is changed. void delete_at(int index) { - assert(0 <= index && index < _len, "illegal index"); + assert(0 <= index && index < _len, "illegal index %d for length %d", index, _len); if (index < --_len) { // Replace removed element with last one. _data[index] = _data[_len]; @@ -390,7 +390,7 @@ void push(const E& elem) { append(elem); } E at_grow(int i, const E& fill = E()) { - assert(0 <= i, "negative index"); + assert(0 <= i, "negative index %d", i); if (i >= this->_len) { if (i >= this->_max) grow(i); for (int j = this->_len; j <= i; j++) @@ -401,7 +401,7 @@ } void at_put_grow(int i, const E& elem, const E& fill = E()) { - assert(0 <= i, "negative index"); + assert(0 <= i, "negative index %d", i); if (i >= this->_len) { if (i >= this->_max) grow(i); for (int j = this->_len; j < i; j++) @@ -413,7 +413,7 @@ // inserts the given element before the element at index i void insert_before(const int idx, const E& elem) { - assert(0 <= idx && idx <= this->_len, "illegal index"); + assert(0 <= idx && idx <= this->_len, "illegal index %d for length %d", idx, this->_len); if (this->_len == this->_max) grow(this->_len); for (int j = this->_len - 1; j >= idx; j--) { this->_data[j + 1] = this->_data[j]; @@ -423,7 +423,7 @@ } void insert_before(const int idx, const GrowableArrayView* array) { - assert(0 <= idx && idx <= this->_len, "illegal index"); + assert(0 <= idx && idx <= this->_len, "illegal index %d for length %d", idx, this->_len); int array_len = array->length(); int new_len = this->_len + array_len; if (new_len >= this->_max) grow(new_len); diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/nativeCallStack.cpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/nativeCallStack.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/nativeCallStack.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/nativeCallStack.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -77,6 +77,7 @@ // Decode and print this call path void NativeCallStack::print_on(outputStream* out, int indent) const { + DEBUG_ONLY(assert_not_fake();) address pc; char buf[1024]; int offset; diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/nativeCallStack.hpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/nativeCallStack.hpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/nativeCallStack.hpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/nativeCallStack.hpp 2024-01-09 21:18:15.000000000 +0000 @@ -57,7 +57,29 @@ private: address _stack[NMT_TrackingStackDepth]; static const NativeCallStack _empty_stack; + public: + + enum class FakeMarker { its_fake }; +#ifdef ASSERT + static constexpr uintptr_t _fake_address = -2; // 0xFF...FE + inline void assert_not_fake() const { + assert(_stack[0] != (address)_fake_address, "Must not be a fake stack"); + } +#endif + + // This "fake" constructor is only used in the CALLER_PC and CURRENT_PC macros + // when NMT is off or in summary mode. In these cases, it does not need a + // callstack, and we can leave the constructed object uninitialized. That will + // cause the constructor call to be optimized away (see JDK-8296437). + explicit NativeCallStack(FakeMarker dummy) { +#ifdef ASSERT + for (int i = 0; i < NMT_TrackingStackDepth; i++) { + _stack[i] = (address)_fake_address; + } +#endif + } + // Default ctor creates an empty stack. // (it may make sense to remove this altogether but its used in a few places). NativeCallStack() { @@ -65,12 +87,13 @@ } explicit NativeCallStack(int toSkip); - NativeCallStack(address* pc, int frameCount); + explicit NativeCallStack(address* pc, int frameCount); static inline const NativeCallStack& empty_stack() { return _empty_stack; } // if it is an empty stack inline bool is_empty() const { + DEBUG_ONLY(assert_not_fake();) return _stack[0] == NULL; } @@ -92,6 +115,7 @@ // Helper; calculates a hash value over the stack frames in this stack unsigned int calculate_hash() const { + DEBUG_ONLY(assert_not_fake();) uintptr_t hash = 0; for (int i = 0; i < NMT_TrackingStackDepth; i++) { hash += (uintptr_t)_stack[i]; @@ -103,4 +127,6 @@ void print_on(outputStream* out, int indent) const; }; +#define FAKE_CALLSTACK NativeCallStack(NativeCallStack::FakeMarker::its_fake) + #endif // SHARE_UTILITIES_NATIVECALLSTACK_HPP diff -Nru openjdk-17-17.0.9+9/src/hotspot/share/utilities/vmError.cpp openjdk-17-17.0.10+7/src/hotspot/share/utilities/vmError.cpp --- openjdk-17-17.0.9+9/src/hotspot/share/utilities/vmError.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/hotspot/share/utilities/vmError.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1759,6 +1759,7 @@ int e = errno; out.print_raw("#\n# Can't open file to dump replay data. Error: "); out.print_raw_cr(os::strerror(e)); + close(fd); } } } diff -Nru openjdk-17-17.0.9+9/src/java.base/aix/native/libnet/aix_close.c openjdk-17-17.0.10+7/src/java.base/aix/native/libnet/aix_close.c --- openjdk-17-17.0.9+9/src/java.base/aix/native/libnet/aix_close.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/aix/native/libnet/aix_close.c 2024-01-09 21:18:15.000000000 +0000 @@ -388,50 +388,50 @@ /************** Basic I/O operations here ***************/ /* - * Macro to perform a blocking IO operation. Restarts - * automatically if interrupted by signal (other than - * our wakeup signal) + * Macro to perform a blocking IO operation. + * If interrupted by signal (other than our wakeup signal), and if RETRY is true, + * then restarts automatically */ -#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ - int ret; \ - threadEntry_t self; \ - fdEntry_t *fdEntry = getFdEntry(FD); \ - if (fdEntry == NULL) { \ - errno = EBADF; \ - return -1; \ - } \ - do { \ - startOp(fdEntry, &self); \ - ret = FUNC; \ - endOp(fdEntry, &self); \ - } while (ret == -1 && errno == EINTR); \ - return ret; \ +#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while ((RETRY) && ret == -1 && errno == EINTR); \ + return ret; \ } int NET_Read(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); } int NET_NonBlockingRead(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK)); + BLOCKING_IO_RETURN_INT(s, recv(s, buf, len, MSG_NONBLOCK), JNI_TRUE ); } int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen) { - BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); } int NET_Send(int s, void *msg, int len, unsigned int flags) { - BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); } int NET_SendTo(int s, const void *msg, int len, unsigned int flags, const struct sockaddr *to, int tolen) { - BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); } int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { - BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); } int NET_Connect(int s, struct sockaddr *addr, int addrlen) { @@ -489,7 +489,7 @@ } int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { - BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); } /* diff -Nru openjdk-17-17.0.9+9/src/java.base/linux/native/libnet/linux_close.c openjdk-17-17.0.10+7/src/java.base/linux/native/libnet/linux_close.c --- openjdk-17-17.0.9+9/src/java.base/linux/native/libnet/linux_close.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/linux/native/libnet/linux_close.c 2024-01-09 21:18:15.000000000 +0000 @@ -345,58 +345,58 @@ /************** Basic I/O operations here ***************/ /* - * Macro to perform a blocking IO operation. Restarts - * automatically if interrupted by signal (other than - * our wakeup signal) + * Macro to perform a blocking IO operation. + * If interrupted by signal (other than our wakeup signal), and if RETRY is true, + * then restarts automatically */ -#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ - int ret; \ - threadEntry_t self; \ - fdEntry_t *fdEntry = getFdEntry(FD); \ - if (fdEntry == NULL) { \ - errno = EBADF; \ - return -1; \ - } \ - do { \ - startOp(fdEntry, &self); \ - ret = FUNC; \ - endOp(fdEntry, &self); \ - } while (ret == -1 && errno == EINTR); \ - return ret; \ +#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while ((RETRY) && ret == -1 && errno == EINTR); \ + return ret; \ } int NET_Read(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); } int NET_NonBlockingRead(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT), JNI_TRUE ); } int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen) { - BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); } int NET_Send(int s, void *msg, int len, unsigned int flags) { - BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); } int NET_SendTo(int s, const void *msg, int len, unsigned int flags, const struct sockaddr *to, int tolen) { - BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); } int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { - BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); } int NET_Connect(int s, struct sockaddr *addr, int addrlen) { - BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen), JNI_TRUE ); } int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { - BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); } /* diff -Nru openjdk-17-17.0.9+9/src/java.base/macosx/native/libnet/bsd_close.c openjdk-17-17.0.10+7/src/java.base/macosx/native/libnet/bsd_close.c --- openjdk-17-17.0.9+9/src/java.base/macosx/native/libnet/bsd_close.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/macosx/native/libnet/bsd_close.c 2024-01-09 21:18:15.000000000 +0000 @@ -349,58 +349,58 @@ /************** Basic I/O operations here ***************/ /* - * Macro to perform a blocking IO operation. Restarts - * automatically if interrupted by signal (other than - * our wakeup signal) + * Macro to perform a blocking IO operation. + * If interrupted by signal (other than our wakeup signal), and if RETRY is true, + * then restarts automatically */ -#define BLOCKING_IO_RETURN_INT(FD, FUNC) { \ - int ret; \ - threadEntry_t self; \ - fdEntry_t *fdEntry = getFdEntry(FD); \ - if (fdEntry == NULL) { \ - errno = EBADF; \ - return -1; \ - } \ - do { \ - startOp(fdEntry, &self); \ - ret = FUNC; \ - endOp(fdEntry, &self); \ - } while (ret == -1 && errno == EINTR); \ - return ret; \ +#define BLOCKING_IO_RETURN_INT(FD, FUNC, RETRY) { \ + int ret; \ + threadEntry_t self; \ + fdEntry_t *fdEntry = getFdEntry(FD); \ + if (fdEntry == NULL) { \ + errno = EBADF; \ + return -1; \ + } \ + do { \ + startOp(fdEntry, &self); \ + ret = FUNC; \ + endOp(fdEntry, &self); \ + } while ((RETRY) && ret == -1 && errno == EINTR); \ + return ret; \ } int NET_Read(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0) ); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, 0), JNI_TRUE ); } int NET_NonBlockingRead(int s, void* buf, size_t len) { - BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT)); + BLOCKING_IO_RETURN_INT( s, recv(s, buf, len, MSG_DONTWAIT), JNI_TRUE); } int NET_RecvFrom(int s, void *buf, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen) { - BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen) ); + BLOCKING_IO_RETURN_INT( s, recvfrom(s, buf, len, flags, from, fromlen), JNI_TRUE ); } int NET_Send(int s, void *msg, int len, unsigned int flags) { - BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags) ); + BLOCKING_IO_RETURN_INT( s, send(s, msg, len, flags), JNI_TRUE ); } int NET_SendTo(int s, const void *msg, int len, unsigned int flags, const struct sockaddr *to, int tolen) { - BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen) ); + BLOCKING_IO_RETURN_INT( s, sendto(s, msg, len, flags, to, tolen), JNI_TRUE ); } int NET_Accept(int s, struct sockaddr *addr, socklen_t *addrlen) { - BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, accept(s, addr, addrlen), JNI_TRUE ); } int NET_Connect(int s, struct sockaddr *addr, int addrlen) { - BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) ); + BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen), JNI_TRUE ); } int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) { - BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout) ); + BLOCKING_IO_RETURN_INT( ufds[0].fd, poll(ufds, nfds, timeout), JNI_FALSE ); } /* diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java openjdk-17-17.0.10+7/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java 2024-01-09 21:18:15.000000000 +0000 @@ -1430,6 +1430,13 @@ len += buffer.remaining(); } + // Check that input data is long enough to fit the expected tag. + if (len < 0) { + throw new AEADBadTagException("Input data too short to " + + "contain an expected tag length of " + tagLenBytes + + "bytes"); + } + checkDataLength(len); // Save GHASH context to allow the tag to be checked even though diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java openjdk-17-17.0.10+7/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -98,6 +98,7 @@ // cipher parameter for OAEP padding and TLS RSA premaster secret private AlgorithmParameterSpec spec = null; + private boolean forTlsPremasterSecret = false; // buffer for the data private byte[] buffer; @@ -292,6 +293,7 @@ } spec = params; + forTlsPremasterSecret = true; this.random = random; // for TLS RSA premaster secret } int blockType = (mode <= MODE_DECRYPT) ? RSAPadding.PAD_BLOCKTYPE_2 @@ -355,21 +357,38 @@ switch (mode) { case MODE_SIGN: paddingCopy = padding.pad(buffer, 0, bufOfs); - result = RSACore.rsa(paddingCopy, privateKey, true); + if (paddingCopy != null) { + result = RSACore.rsa(paddingCopy, privateKey, true); + } else { + throw new BadPaddingException("Padding error in signing"); + } break; case MODE_VERIFY: byte[] verifyBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(verifyBuffer, publicKey); result = padding.unpad(paddingCopy); + if (result == null) { + throw new BadPaddingException + ("Padding error in verification"); + } break; case MODE_ENCRYPT: paddingCopy = padding.pad(buffer, 0, bufOfs); - result = RSACore.rsa(paddingCopy, publicKey); + if (paddingCopy != null) { + result = RSACore.rsa(paddingCopy, publicKey); + } else { + throw new BadPaddingException + ("Padding error in encryption"); + } break; case MODE_DECRYPT: byte[] decryptBuffer = RSACore.convert(buffer, 0, bufOfs); paddingCopy = RSACore.rsa(decryptBuffer, privateKey, false); result = padding.unpad(paddingCopy); + if (result == null && !forTlsPremasterSecret) { + throw new BadPaddingException + ("Padding error in decryption"); + } break; default: throw new AssertionError("Internal error"); @@ -378,9 +397,9 @@ } finally { Arrays.fill(buffer, 0, bufOfs, (byte)0); bufOfs = 0; - if (paddingCopy != null // will not happen + if (paddingCopy != null && paddingCopy != buffer // already cleaned - && paddingCopy != result) { // DO NOT CLEAN, THIS IS RESULT! + && paddingCopy != result) { // DO NOT CLEAN, THIS IS RESULT Arrays.fill(paddingCopy, (byte)0); } } @@ -455,26 +474,22 @@ boolean isTlsRsaPremasterSecret = algorithm.equals("TlsRsaPremasterSecret"); - Exception failover = null; byte[] encoded = null; update(wrappedKey, 0, wrappedKey.length); try { encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { - throw new InvalidKeyException("Unwrapping failed", e); - } - } catch (IllegalBlockSizeException e) { - // should not occur, handled with length check above + } catch (BadPaddingException | IllegalBlockSizeException e) { + // BadPaddingException cannot happen for TLS RSA unwrap. + // In that case, padding error is indicated by returning null. + // IllegalBlockSizeException cannot happen in any case, + // because of the length check above. throw new InvalidKeyException("Unwrapping failed", e); } try { if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { + if (!forTlsPremasterSecret) { throw new IllegalStateException( "No TlsRsaPremasterSecretParameterSpec specified"); } @@ -483,7 +498,7 @@ encoded = KeyUtil.checkTlsPreMasterSecretKey( ((TlsRsaPremasterSecretParameterSpec) spec).getClientVersion(), ((TlsRsaPremasterSecretParameterSpec) spec).getServerVersion(), - random, encoded, (failover != null)); + random, encoded, encoded == null); } return ConstructKeys.constructKey(encoded, algorithm, type); diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/java/lang/System.java openjdk-17-17.0.10+7/src/java.base/share/classes/java/lang/System.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/java/lang/System.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/java/lang/System.java 2024-01-09 21:18:15.000000000 +0000 @@ -66,6 +66,7 @@ import java.util.function.Supplier; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; +import jdk.internal.logger.LoggerFinderLoader.TemporaryLoggerFinder; import jdk.internal.misc.Unsafe; import jdk.internal.util.StaticProperty; import jdk.internal.module.ModuleBootstrap; @@ -1713,13 +1714,16 @@ // We do not need to synchronize: LoggerFinderLoader will // always return the same instance, so if we don't have it, // just fetch it again. - if (service == null) { + LoggerFinder finder = service; + if (finder == null) { PrivilegedAction pa = () -> LoggerFinderLoader.getLoggerFinder(); - service = AccessController.doPrivileged(pa, null, + finder = AccessController.doPrivileged(pa, null, LOGGERFINDER_PERMISSION); + if (finder instanceof TemporaryLoggerFinder) return finder; + service = finder; } - return service; + return finder; } } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java openjdk-17-17.0.10+7/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java 2024-01-09 21:18:15.000000000 +0000 @@ -327,7 +327,7 @@ */ @Override public int hashCode() { - int hash = name.hashCode() * 43 + mods.hashCode(); + int hash = name.hashCode() * 43 + modsHashCode(mods); if (compiledVersion != null) hash = hash * 43 + compiledVersion.hashCode(); if (rawCompiledVersion != null) @@ -505,7 +505,7 @@ */ @Override public int hashCode() { - int hash = mods.hashCode(); + int hash = modsHashCode(mods); hash = hash * 43 + source.hashCode(); return hash * 43 + targets.hashCode(); } @@ -708,7 +708,7 @@ */ @Override public int hashCode() { - int hash = mods.hashCode(); + int hash = modsHashCode(mods); hash = hash * 43 + source.hashCode(); return hash * 43 + targets.hashCode(); } @@ -2261,7 +2261,7 @@ int hc = hash; if (hc == 0) { hc = name.hashCode(); - hc = hc * 43 + Objects.hashCode(modifiers); + hc = hc * 43 + modsHashCode(modifiers); hc = hc * 43 + requires.hashCode(); hc = hc * 43 + Objects.hashCode(packages); hc = hc * 43 + exports.hashCode(); @@ -2546,6 +2546,18 @@ .collect(Collectors.joining(" ")); } + /** + * Generates and returns a hashcode for the enum instances. The returned hashcode + * is a value based on the {@link Enum#name() name} of each enum instance. + */ + private static int modsHashCode(Iterable> enums) { + int h = 0; + for (Enum e : enums) { + h = h * 43 + Objects.hashCode(e.name()); + } + return h; + } + private static > int compare(T obj1, T obj2) { if (obj1 != null) { diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/java/util/Formatter.java openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/Formatter.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/java/util/Formatter.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/Formatter.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -4542,10 +4542,9 @@ } // apply zero padding - if (width != -1 && f.contains(Flags.ZERO_PAD)) { - for (int k = sb.length(); k < width; k++) { - sb.insert(begin, zero); - } + if (width > sb.length() && f.contains(Flags.ZERO_PAD)) { + String zeros = String.valueOf(zero).repeat(width - sb.length()); + sb.insert(begin, zeros); } return sb; diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/java/util/jar/JarFile.java openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/jar/JarFile.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/java/util/jar/JarFile.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/jar/JarFile.java 2024-01-09 21:18:15.000000000 +0000 @@ -803,7 +803,9 @@ throw new IOException("Unsupported size: " + uncompressedSize + " for JarEntry " + ze.getName() + ". Allowed max size: " + - SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes"); + SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " + + "You can use the jdk.jar.maxSignatureFileSize " + + "system property to increase the default value."); } int len = (int)uncompressedSize; int bytesRead; diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/java/util/zip/ZipFile.java openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/zip/ZipFile.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/java/util/zip/ZipFile.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/java/util/zip/ZipFile.java 2024-01-09 21:18:15.000000000 +0000 @@ -1790,13 +1790,18 @@ // slash int entryLen = entry.length(); int nameLen = name.length(); - if ((entryLen == nameLen && entry.equals(name)) || - (addSlash && - nameLen + 1 == entryLen && - entry.startsWith(name) && - entry.charAt(entryLen - 1) == '/')) { + if (entryLen == nameLen && entry.equals(name)) { + // Found our match return pos; } + // If addSlash is true we'll now test for name+/ providing + if (addSlash && nameLen + 1 == entryLen + && entry.startsWith(name) && + entry.charAt(entryLen - 1) == '/') { + // Found the entry "name+/", now find the CEN entry pos + int exactPos = getEntryPos(name, false); + return exactPos == -1 ? pos : exactPos; + } } catch (IllegalArgumentException iae) { // Ignore } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/javax/crypto/JceSecurity.java.template openjdk-17-17.0.10+7/src/java.base/share/classes/javax/crypto/JceSecurity.java.template --- openjdk-17-17.0.9+9/src/java.base/share/classes/javax/crypto/JceSecurity.java.template 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/javax/crypto/JceSecurity.java.template 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -51,7 +51,10 @@ import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; import java.io.*; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; import java.net.URL; import java.nio.file.*; import java.security.*; @@ -86,13 +89,16 @@ // Map of the providers we already have verified. // If verified ok, value == PROVIDER_VERIFIED, otherwise // the cause of verification failure is stored as value. - private static final Map + private static final Map verificationResults = new ConcurrentHashMap<>(); // Map of the providers currently being verified private static final Map verifyingProviders = new IdentityHashMap<>(); + // weak references queued by GC + private static final ReferenceQueue queue = new ReferenceQueue<>(); + private static final boolean isRestricted; /* @@ -199,38 +205,51 @@ * Return null if ok, failure Exception if verification failed. */ static Exception getVerificationResult(Provider p) { - IdentityWrapper pKey = new IdentityWrapper(p); - Object o = verificationResults.get(pKey); - // no mapping found - if (o == null) { - synchronized (JceSecurity.class) { - // check cache again in case the result is now available - o = verificationResults.get(pKey); - if (o == null) { + expungeStaleWrappers(); + WeakIdentityWrapper pKey = new WeakIdentityWrapper(p, queue); + try { + Object o = verificationResults.computeIfAbsent(pKey, new Function<>() { + public Object apply(WeakIdentityWrapper key) { + // no mapping found if (verifyingProviders.get(p) != null) { // recursion; return failure now - return new NoSuchProviderException - ("Recursion during verification"); + throw new IllegalStateException(); } + Object result; try { verifyingProviders.put(p, Boolean.FALSE); URL providerURL = getCodeBase(p.getClass()); verifyProvider(providerURL, p); - o = PROVIDER_VERIFIED; + result = PROVIDER_VERIFIED; } catch (Exception e) { - o = e; + result = e; } finally { verifyingProviders.remove(p); } - verificationResults.put(pKey, o); if (debug != null) { debug.println("Provider " + p.getName() + - " verification result: " + o); + " verification result: " + result); } + return result; } - } + }); + return (o == PROVIDER_VERIFIED? null : (Exception) o); + + } catch (IllegalStateException ise) { + // recursive update detected + return new NoSuchProviderException + ("Recursion during verification"); + } + } + + /** + * Removes weakly reachable keys from history. + */ + static void expungeStaleWrappers() { + WeakIdentityWrapper key; + while ((key = (WeakIdentityWrapper) queue.poll()) != null) { + verificationResults.remove(key); } - return (o == PROVIDER_VERIFIED? null : (Exception) o); } // return whether this provider is properly signed and can be used by JCE @@ -403,12 +422,13 @@ return isRestricted; } - private static final class IdentityWrapper { + private static final class WeakIdentityWrapper extends WeakReference { - final Provider obj; + final int hash; - IdentityWrapper(Provider obj) { - this.obj = obj; + WeakIdentityWrapper(Provider obj, ReferenceQueue queue) { + super(obj, queue); + hash = System.identityHashCode(obj); } @Override @@ -416,15 +436,12 @@ if (this == o) { return true; } - if (!(o instanceof IdentityWrapper)) { - return false; - } - return this.obj == ((IdentityWrapper)o).obj; + return o instanceof WeakIdentityWrapper w && get() == w.get(); } @Override public int hashCode() { - return System.identityHashCode(obj); + return hash; } } } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/BootstrapLogger.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -38,7 +38,6 @@ import java.util.function.Supplier; import java.lang.System.LoggerFinder; import java.lang.System.Logger; -import java.lang.System.Logger.Level; import java.lang.ref.WeakReference; import java.util.Objects; import java.util.concurrent.ExecutionException; @@ -227,9 +226,19 @@ // The accessor in which this logger is temporarily set. final LazyLoggerAccessor holder; + // tests whether the logger is invoked by the loading thread before + // the LoggerFinder is loaded; can be null; + final BooleanSupplier isLoadingThread; - BootstrapLogger(LazyLoggerAccessor holder) { + // returns true if the logger is invoked by the loading thread before the + // LoggerFinder service is loaded + boolean isLoadingThread() { + return isLoadingThread != null && isLoadingThread.getAsBoolean(); + } + + BootstrapLogger(LazyLoggerAccessor holder, BooleanSupplier isLoadingThread) { this.holder = holder; + this.isLoadingThread = isLoadingThread; } // Temporary data object storing log events @@ -505,14 +514,15 @@ static void log(LogEvent log, PlatformLogger.Bridge logger) { final SecurityManager sm = System.getSecurityManager(); if (sm == null || log.acc == null) { - log.log(logger); + BootstrapExecutors.submit(() -> log.log(logger)); } else { // not sure we can actually use lambda here. We may need to create // an anonymous class. Although if we reach here, then it means // the VM is booted. - AccessController.doPrivileged((PrivilegedAction) () -> { - log.log(logger); return null; - }, log.acc); + BootstrapExecutors.submit(() -> + AccessController.doPrivileged((PrivilegedAction) () -> { + log.log(logger); return null; + }, log.acc)); } } @@ -559,8 +569,9 @@ * @return true if the VM is still bootstrapping. */ boolean checkBootstrapping() { - if (isBooted()) { + if (isBooted() && !isLoadingThread()) { BootstrapExecutors.flush(); + holder.getConcreteLogger(this); return false; } return true; @@ -935,10 +946,16 @@ // - the logging backend is a custom backend // - the logging backend is JUL, there is no custom config, // and the LogManager has not been initialized yet. - public static synchronized boolean useLazyLoggers() { - return !BootstrapLogger.isBooted() - || DetectBackend.detectedBackend == LoggingBackend.CUSTOM - || useSurrogateLoggers(); + public static boolean useLazyLoggers() { + // Note: avoid triggering the initialization of the DetectBackend class + // while holding the BootstrapLogger class monitor + if (!BootstrapLogger.isBooted() || + DetectBackend.detectedBackend == LoggingBackend.CUSTOM) { + return true; + } + synchronized (BootstrapLogger.class) { + return useSurrogateLoggers(); + } } // Called by LazyLoggerAccessor. This method will determine whether @@ -946,9 +963,9 @@ // a SurrogateLogger (if JUL is the default backend and there // is no custom JUL configuration and LogManager is not yet initialized), // or a logger returned by the loaded LoggerFinder (all other cases). - static Logger getLogger(LazyLoggerAccessor accessor) { - if (!BootstrapLogger.isBooted()) { - return new BootstrapLogger(accessor); + static Logger getLogger(LazyLoggerAccessor accessor, BooleanSupplier isLoading) { + if (!BootstrapLogger.isBooted() || isLoading != null && isLoading.getAsBoolean()) { + return new BootstrapLogger(accessor, isLoading); } else { if (useSurrogateLoggers()) { // JUL is the default backend, there is no custom configuration, @@ -964,6 +981,12 @@ } } + // trigger class initialization outside of holding lock + static void ensureBackendDetected() { + assert VM.isBooted() : "VM is not booted"; + // triggers detection of the backend + var backend = DetectBackend.detectedBackend; + } // If the backend is JUL, and there is no custom configuration, and // nobody has attempted to call LogManager.getLogManager() yet, then diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/LazyLoggers.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -32,6 +32,9 @@ import java.lang.System.Logger; import java.lang.ref.WeakReference; import java.util.Objects; +import java.util.function.BooleanSupplier; + +import jdk.internal.logger.LoggerFinderLoader.TemporaryLoggerFinder; import jdk.internal.misc.VM; import sun.util.logging.PlatformLogger; @@ -110,6 +113,9 @@ // We need to pass the actual caller module when creating the logger. private final WeakReference moduleRef; + // whether this is the loading thread, can be null + private final BooleanSupplier isLoadingThread; + // The name of the logger that will be created lazyly final String name; // The plain logger SPI object - null until it is accessed for the @@ -122,16 +128,24 @@ private LazyLoggerAccessor(String name, LazyLoggerFactories factories, Module module) { + this(name, factories, module, null); + } + + private LazyLoggerAccessor(String name, + LazyLoggerFactories factories, + Module module, BooleanSupplier isLoading) { + this(Objects.requireNonNull(name), Objects.requireNonNull(factories), - Objects.requireNonNull(module), null); + Objects.requireNonNull(module), isLoading, null); } private LazyLoggerAccessor(String name, LazyLoggerFactories factories, - Module module, Void unused) { + Module module, BooleanSupplier isLoading, Void unused) { this.name = name; this.factories = factories; this.moduleRef = new WeakReference<>(module); + this.isLoadingThread = isLoading; } /** @@ -162,7 +176,7 @@ // BootstrapLogger has the logic to decide whether to invoke the // SPI or use a temporary (BootstrapLogger or SimpleConsoleLogger) // logger. - wrapped = BootstrapLogger.getLogger(this); + wrapped = BootstrapLogger.getLogger(this, isLoadingThread); synchronized(this) { // if w has already been in between, simply drop 'wrapped'. setWrappedIfNotSet(wrapped); @@ -194,7 +208,7 @@ // BootstrapLogger has the logic to decide whether to invoke the // SPI or use a temporary (BootstrapLogger or SimpleConsoleLogger) // logger. - final Logger wrapped = BootstrapLogger.getLogger(this); + final Logger wrapped = BootstrapLogger.getLogger(this, isLoadingThread); synchronized(this) { // if w has already been set, simply drop 'wrapped'. setWrappedIfNotSet(wrapped); @@ -282,10 +296,10 @@ * Creates a new lazy logger accessor for the named logger. The given * factories will be use when it becomes necessary to actually create * the logger. - * @param An interface that extends {@link Logger}. * @param name The logger name. * @param factories The factories that should be used to create the * wrapped logger. + * @param module The module for which the logger is being created * @return A new LazyLoggerAccessor. */ public static LazyLoggerAccessor makeAccessor(String name, @@ -340,6 +354,7 @@ prov = sm == null ? LoggerFinder.getLoggerFinder() : AccessController.doPrivileged( (PrivilegedAction)LoggerFinder::getLoggerFinder); + if (prov instanceof TemporaryLoggerFinder) return prov; provider = prov; } return prov; @@ -359,7 +374,6 @@ new LazyLoggerFactories<>(loggerSupplier); - // A concrete implementation of Logger that delegates to a System.Logger, // but only creates the System.Logger instance lazily when it's used for // the first time. @@ -377,6 +391,11 @@ } } + static Logger makeLazyLogger(String name, Module module, BooleanSupplier isLoading) { + final LazyLoggerAccessor holder = new LazyLoggerAccessor(name, factories, module, isLoading); + return new JdkLazyLogger(holder, null); + } + /** * Gets a logger from the LoggerFinder. Creates the actual concrete * logger. diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/jdk/internal/logger/LoggerFinderLoader.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,6 +25,8 @@ package jdk.internal.logger; import java.io.FilePermission; +import java.lang.System.Logger; +import java.lang.System.LoggerFinder; import java.security.AccessController; import java.security.Permission; import java.security.PrivilegedAction; @@ -32,6 +34,9 @@ import java.util.Locale; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; +import java.util.function.BooleanSupplier; + +import jdk.internal.vm.annotation.Stable; import sun.security.util.SecurityConstants; import sun.security.action.GetPropertyAction; @@ -64,13 +69,28 @@ throw new InternalError("LoggerFinderLoader cannot be instantiated"); } - + // record the loadingThread while loading the backend + static volatile Thread loadingThread; // Return the loaded LoggerFinder, or load it if not already loaded. private static System.LoggerFinder service() { if (service != null) return service; + // ensure backend is detected before attempting to load the finder + BootstrapLogger.ensureBackendDetected(); synchronized(lock) { if (service != null) return service; - service = loadLoggerFinder(); + Thread currentThread = Thread.currentThread(); + if (loadingThread == currentThread) { + // recursive attempt to load the backend while loading the backend + // use a temporary logger finder that returns special BootstrapLogger + // which will wait until loading is finished + return TemporaryLoggerFinder.INSTANCE; + } + loadingThread = currentThread; + try { + service = loadLoggerFinder(); + } finally { + loadingThread = null; + } } // Since the LoggerFinder is already loaded - we can stop using // temporary loggers. @@ -78,6 +98,12 @@ return service; } + // returns true if called by the thread that loads the LoggerFinder, while + // loading the LoggerFinder. + static boolean isLoadingThread() { + return loadingThread != null && loadingThread == Thread.currentThread(); + } + // Get configuration error policy private static ErrorPolicy configurationErrorPolicy() { String errorPolicy = @@ -116,6 +142,34 @@ return iterator; } + public static final class TemporaryLoggerFinder extends LoggerFinder { + private TemporaryLoggerFinder() {} + @Stable + private LoggerFinder loadedService; + + private static final BooleanSupplier isLoadingThread = new BooleanSupplier() { + @Override + public boolean getAsBoolean() { + return LoggerFinderLoader.isLoadingThread(); + } + }; + private static final TemporaryLoggerFinder INSTANCE = new TemporaryLoggerFinder(); + + @Override + public Logger getLogger(String name, Module module) { + if (loadedService == null) { + loadedService = service; + if (loadedService == null) { + return LazyLoggers.makeLazyLogger(name, module, isLoadingThread); + } + } + assert loadedService != null; + assert !LoggerFinderLoader.isLoadingThread(); + assert loadedService != this; + return LazyLoggers.getLogger(name, module); + } + } + // Loads the LoggerFinder using ServiceLoader. If no LoggerFinder // is found returns the default (possibly JUL based) implementation private static System.LoggerFinder loadLoggerFinder() { diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java 2024-01-09 21:18:15.000000000 +0000 @@ -864,14 +864,14 @@ { SecretKey skey = null; + PBEKeySpec keySpec = new PBEKeySpec(password); try { - PBEKeySpec keySpec = new PBEKeySpec(password); SecretKeyFactory skFac = SecretKeyFactory.getInstance("PBE"); skey = skFac.generateSecret(keySpec); - keySpec.clearPassword(); } catch (Exception e) { - throw new IOException("getSecretKey failed: " + - e.getMessage(), e); + throw new IOException("getSecretKey failed: " + e.getMessage(), e); + } finally { + keySpec.clearPassword(); } return skey; } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/provider/certpath/ForwardBuilder.java 2024-01-09 21:18:15.000000000 +0000 @@ -336,8 +336,11 @@ } } + // Thread-local gate to prevent recursive provider lookups + private static ThreadLocal gate = new ThreadLocal<>(); + /** - * Download Certificates from the given AIA and add them to the + * Download certificates from the given AIA and add them to the * specified Collection. */ // cs.getCertificates(caSelector) returns a collection of X509Certificate's @@ -349,32 +352,47 @@ if (Builder.USE_AIA == false) { return false; } + List adList = aiaExt.getAccessDescriptions(); if (adList == null || adList.isEmpty()) { return false; } - boolean add = false; - for (AccessDescription ad : adList) { - CertStore cs = URICertStore.getInstance(ad); - if (cs != null) { - try { - if (certs.addAll((Collection) - cs.getCertificates(caSelector))) { - add = true; - if (!searchAllCertStores) { - return true; + if (gate.get() != null) { + // Avoid recursive fetching of certificates + if (debug != null) { + debug.println("Recursive fetching of certs via the AIA " + + "extension detected"); + } + return false; + } + + gate.set(gate); + try { + boolean add = false; + for (AccessDescription ad : adList) { + CertStore cs = URICertStore.getInstance(ad); + if (cs != null) { + try { + if (certs.addAll((Collection) + cs.getCertificates(caSelector))) { + add = true; + if (!searchAllCertStores) { + return true; + } + } + } catch (CertStoreException cse) { + if (debug != null) { + debug.println("exception getting certs from CertStore:"); + cse.printStackTrace(); } - } - } catch (CertStoreException cse) { - if (debug != null) { - debug.println("exception getting certs from CertStore:"); - cse.printStackTrace(); } } } + return add; + } finally { + gate.set(null); } - return add; } /** diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/rsa/RSAPadding.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/rsa/RSAPadding.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/rsa/RSAPadding.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/rsa/RSAPadding.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -30,7 +30,6 @@ import java.security.*; import java.security.spec.*; -import javax.crypto.BadPaddingException; import javax.crypto.spec.PSource; import javax.crypto.spec.OAEPParameterSpec; @@ -236,24 +235,22 @@ } /** - * Pad the data and return the padded block. + * Pad the data and return the result or null if error occurred. */ - public byte[] pad(byte[] data) throws BadPaddingException { + public byte[] pad(byte[] data) { return pad(data, 0, data.length); } /** - * Pad the data and return the padded block. + * Pad the data and return the result or null if error occurred. */ - public byte[] pad(byte[] data, int ofs, int len) - throws BadPaddingException { + public byte[] pad(byte[] data, int ofs, int len) { if (len > maxDataSize) { - throw new BadPaddingException("Data must be shorter than " - + (maxDataSize + 1) + " bytes but received " - + len + " bytes."); + return null; } switch (type) { case PAD_NONE: + // assert len == paddedSize and data.length - ofs > len? return RSACore.convert(data, ofs, len); case PAD_BLOCKTYPE_1: case PAD_BLOCKTYPE_2: @@ -266,31 +263,25 @@ } /** - * Unpad the padded block and return the data. + * Unpad the padded block and return the result or null if error occurred. */ - public byte[] unpad(byte[] padded) throws BadPaddingException { - if (padded.length != paddedSize) { - throw new BadPaddingException("Decryption error." + - "The padded array length (" + padded.length + - ") is not the specified padded size (" + paddedSize + ")"); - } - switch (type) { - case PAD_NONE: - return padded; - case PAD_BLOCKTYPE_1: - case PAD_BLOCKTYPE_2: - return unpadV15(padded); - case PAD_OAEP_MGF1: - return unpadOAEP(padded); - default: - throw new AssertionError(); + public byte[] unpad(byte[] padded) { + if (padded.length == paddedSize) { + return switch(type) { + case PAD_NONE -> padded; + case PAD_BLOCKTYPE_1, PAD_BLOCKTYPE_2 -> unpadV15(padded); + case PAD_OAEP_MGF1 -> unpadOAEP(padded); + default -> throw new AssertionError(); + }; + } else { + return null; } } /** * PKCS#1 v1.5 padding (blocktype 1 and 2). */ - private byte[] padV15(byte[] data, int ofs, int len) throws BadPaddingException { + private byte[] padV15(byte[] data, int ofs, int len) { byte[] padded = new byte[paddedSize]; System.arraycopy(data, ofs, padded, paddedSize - len, len); int psSize = paddedSize - 3 - len; @@ -327,10 +318,10 @@ /** * PKCS#1 v1.5 unpadding (blocktype 1 (signature) and 2 (encryption)). - * + * Return the result or null if error occurred. * Note that we want to make it a constant-time operation */ - private byte[] unpadV15(byte[] padded) throws BadPaddingException { + private byte[] unpadV15(byte[] padded) { int k = 0; boolean bp = false; @@ -366,10 +357,8 @@ byte[] data = new byte[n]; System.arraycopy(padded, p, data, 0, n); - BadPaddingException bpe = new BadPaddingException("Decryption error"); - if (bp) { - throw bpe; + return null; } else { return data; } @@ -378,8 +367,9 @@ /** * PKCS#1 v2.0 OAEP padding (MGF1). * Paragraph references refer to PKCS#1 v2.1 (June 14, 2002) + * Return the result or null if error occurred. */ - private byte[] padOAEP(byte[] M, int ofs, int len) throws BadPaddingException { + private byte[] padOAEP(byte[] M, int ofs, int len) { if (random == null) { random = JCAUtil.getSecureRandom(); } @@ -428,8 +418,9 @@ /** * PKCS#1 v2.1 OAEP unpadding (MGF1). + * Return the result or null if error occurred. */ - private byte[] unpadOAEP(byte[] padded) throws BadPaddingException { + private byte[] unpadOAEP(byte[] padded) { byte[] EM = padded; boolean bp = false; int hLen = lHash.length; @@ -485,12 +476,6 @@ byte [] m = new byte[EM.length - mStart]; System.arraycopy(EM, mStart, m, 0, m.length); - BadPaddingException bpe = new BadPaddingException("Decryption error"); - - if (bp) { - throw bpe; - } else { - return m; - } + return (bp? null : m); } } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/rsa/RSASignature.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/rsa/RSASignature.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/rsa/RSASignature.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/rsa/RSASignature.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -190,13 +190,15 @@ try { byte[] encoded = encodeSignature(digestOID, digest); byte[] padded = padding.pad(encoded); - byte[] encrypted = RSACore.rsa(padded, privateKey, true); - return encrypted; + if (padded != null) { + return RSACore.rsa(padded, privateKey, true); + } } catch (GeneralSecurityException e) { throw new SignatureException("Could not sign data", e); } catch (IOException e) { throw new SignatureException("Could not encode data", e); } + throw new SignatureException("Could not sign data"); } // verify the data and return the result. See JCA doc @@ -208,20 +210,29 @@ } try { if (sigBytes.length != RSACore.getByteLength(publicKey)) { - throw new SignatureException("Signature length not correct: got " + + throw new SignatureException("Bad signature length: got " + sigBytes.length + " but was expecting " + RSACore.getByteLength(publicKey)); } - byte[] digest = getDigestValue(); + + // https://www.rfc-editor.org/rfc/rfc8017.html#section-8.2.2 + // Step 4 suggests comparing the encoded message byte[] decrypted = RSACore.rsa(sigBytes, publicKey); - byte[] unpadded = padding.unpad(decrypted); - byte[] decodedDigest = decodeSignature(digestOID, unpadded); - return MessageDigest.isEqual(digest, decodedDigest); + + byte[] digest = getDigestValue(); + + byte[] encoded = encodeSignature(digestOID, digest); + byte[] padded = padding.pad(encoded); + if (MessageDigest.isEqual(padded, decrypted)) { + return true; + } + + // Some vendors might omit the NULL params in digest algorithm + // identifier. Try again. + encoded = encodeSignatureWithoutNULL(digestOID, digest); + padded = padding.pad(encoded); + return MessageDigest.isEqual(padded, decrypted); } catch (javax.crypto.BadPaddingException e) { - // occurs if the app has used the wrong RSA public key - // or if sigBytes is invalid - // return false rather than propagating the exception for - // compatibility/ease of use return false; } catch (IOException e) { throw new SignatureException("Signature encoding error", e); @@ -245,27 +256,19 @@ } /** - * Decode the signature data. Verify that the object identifier matches - * and return the message digest. + * Encode the digest without the NULL params, return the to-be-signed data. + * This is only used by SunRsaSign. */ - public static byte[] decodeSignature(ObjectIdentifier oid, byte[] sig) + static byte[] encodeSignatureWithoutNULL(ObjectIdentifier oid, byte[] digest) throws IOException { - // Enforce strict DER checking for signatures - DerInputStream in = new DerInputStream(sig, 0, sig.length, false); - DerValue[] values = in.getSequence(2); - if ((values.length != 2) || (in.available() != 0)) { - throw new IOException("SEQUENCE length error"); - } - AlgorithmId algId = AlgorithmId.parse(values[0]); - if (algId.getOID().equals(oid) == false) { - throw new IOException("ObjectIdentifier mismatch: " - + algId.getOID()); - } - if (algId.getEncodedParams() != null) { - throw new IOException("Unexpected AlgorithmId parameters"); - } - byte[] digest = values[1].getOctetString(); - return digest; + DerOutputStream out = new DerOutputStream(); + DerOutputStream oidout = new DerOutputStream(); + oidout.putOID(oid); + out.write(DerValue.tag_Sequence, oidout); + out.putOctetString(digest); + DerValue result = + new DerValue(DerValue.tag_Sequence, out.toByteArray()); + return result.toByteArray(); } // set parameter, not supported. See JCA doc diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -1043,6 +1043,7 @@ } Collection checkedKeyTypes = new HashSet<>(); + List supportedKeyTypes = new ArrayList<>(); for (SignatureScheme ss : hc.peerRequestedCertSignSchemes) { if (checkedKeyTypes.contains(ss.keyAlgorithm)) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { @@ -1051,6 +1052,7 @@ } continue; } + checkedKeyTypes.add(ss.keyAlgorithm); // Don't select a signature scheme unless we will be able to // produce a CertificateVerify message later @@ -1064,36 +1066,28 @@ "Unable to produce CertificateVerify for " + "signature scheme: " + ss.name); } - checkedKeyTypes.add(ss.keyAlgorithm); continue; } - SSLAuthentication ka = X509Authentication.valueOf(ss); + X509Authentication ka = X509Authentication.valueOf(ss); if (ka == null) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { SSLLogger.warning( "Unsupported authentication scheme: " + ss.name); } - checkedKeyTypes.add(ss.keyAlgorithm); continue; } - - SSLPossession pos = ka.createPossession(hc); - if (pos == null) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { - SSLLogger.warning( - "Unavailable authentication scheme: " + ss.name); - } - continue; - } - - return pos; + supportedKeyTypes.add(ss.keyAlgorithm); } - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { - SSLLogger.warning("No available authentication scheme"); + SSLPossession pos = X509Authentication + .createPossession(hc, supportedKeyTypes.toArray(String[]::new)); + if (pos == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available authentication scheme"); + } } - return null; + return pos; } private byte[] onProduceCertificate(ClientHandshakeContext chc, diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java 2024-01-09 21:18:15.000000000 +0000 @@ -45,7 +45,6 @@ import sun.security.ssl.CipherSuite.KeyExchange; import sun.security.ssl.SSLHandshake.HandshakeMessage; import sun.security.ssl.X509Authentication.X509Possession; -import sun.security.ssl.X509Authentication.X509PossessionGenerator; /** * Pack of the CertificateRequest handshake message. @@ -726,10 +725,11 @@ chc.handshakeSession.setPeerSupportedSignatureAlgorithms(sss); chc.peerSupportedAuthorities = crm.getAuthorities(); - // For TLS 1.2, we need to use a combination of the CR message's - // allowed key types and the signature algorithms in order to - // find a certificate chain that has the right key and all certs - // using one or more of the allowed cert signature schemes. + // For TLS 1.2, we no longer use the certificate_types field + // from the CertificateRequest message to directly determine + // the SSLPossession. Instead, the choosePossession method + // will use the accepted signature schemes in the message to + // determine the set of acceptable certificate types to select from. SSLPossession pos = choosePossession(chc, crm); if (pos == null) { return; @@ -761,6 +761,7 @@ } Collection checkedKeyTypes = new HashSet<>(); + List supportedKeyTypes = new ArrayList<>(); for (SignatureScheme ss : hc.peerRequestedCertSignSchemes) { if (checkedKeyTypes.contains(ss.keyAlgorithm)) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { @@ -769,6 +770,7 @@ } continue; } + checkedKeyTypes.add(ss.keyAlgorithm); // Don't select a signature scheme unless we will be able to // produce a CertificateVerify message later @@ -782,7 +784,6 @@ "Unable to produce CertificateVerify for " + "signature scheme: " + ss.name); } - checkedKeyTypes.add(ss.keyAlgorithm); continue; } @@ -792,45 +793,32 @@ SSLLogger.warning( "Unsupported authentication scheme: " + ss.name); } - checkedKeyTypes.add(ss.keyAlgorithm); continue; } else { - // Any auth object will have a possession generator and - // we need to make sure the key types for that generator - // share at least one common algorithm with the CR's - // allowed key types. - if (ka.possessionGenerator instanceof - X509PossessionGenerator xpg) { - if (Collections.disjoint(crKeyTypes, - Arrays.asList(xpg.keyTypes))) { - if (SSLLogger.isOn && - SSLLogger.isOn("ssl,handshake")) { - SSLLogger.warning( - "Unsupported authentication scheme: " + - ss.name); - } - checkedKeyTypes.add(ss.keyAlgorithm); - continue; + // Any auth object will have a set of allowed key types. + // This set should share at least one common algorithm with + // the CR's allowed key types. + if (Collections.disjoint(crKeyTypes, + Arrays.asList(ka.keyTypes))) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unsupported authentication scheme: " + + ss.name); } + continue; } } - - SSLPossession pos = ka.createPossession(hc); - if (pos == null) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { - SSLLogger.warning( - "Unavailable authentication scheme: " + ss.name); - } - continue; - } - - return pos; + supportedKeyTypes.add(ss.keyAlgorithm); } - if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { - SSLLogger.warning("No available authentication scheme"); + SSLPossession pos = X509Authentication + .createPossession(hc, supportedKeyTypes.toArray(String[]::new)); + if (pos == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available authentication scheme"); + } } - return null; + return pos; } } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/SessionTicketExtension.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2022, 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 @@ -403,11 +403,13 @@ chc.statelessResumption = true; // If resumption is not in progress, return an empty value - if (!chc.isResumption || chc.resumingSession == null) { + if (!chc.isResumption || chc.resumingSession == null + || chc.resumingSession.getPskIdentity() == null + || chc.resumingSession.getProtocolVersion().useTLS13PlusSpec()) { if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { SSLLogger.fine("Stateless resumption supported"); } - return new SessionTicketSpec().getEncoded(); + return new byte[0]; } if (chc.localSupportedSignAlgs == null) { diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/X509Authentication.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/X509Authentication.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/ssl/X509Authentication.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/ssl/X509Authentication.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -35,52 +35,46 @@ import java.security.spec.ECParameterSpec; import java.security.spec.NamedParameterSpec; import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.Arrays; import java.util.Map; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLSocket; import javax.net.ssl.X509ExtendedKeyManager; + import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; enum X509Authentication implements SSLAuthentication { // Require rsaEncryption public key - RSA ("RSA", new X509PossessionGenerator( - new String[]{"RSA"})), + RSA ("RSA", "RSA"), // Require RSASSA-PSS public key - RSASSA_PSS ("RSASSA-PSS", new X509PossessionGenerator( - new String[] {"RSASSA-PSS"})), + RSASSA_PSS ("RSASSA-PSS", "RSASSA-PSS"), // Require rsaEncryption or RSASSA-PSS public key // // Note that this is a specifical scheme for TLS 1.2. (EC)DHE_RSA cipher // suites of TLS 1.2 can use either rsaEncryption or RSASSA-PSS public // key for authentication and handshake. - RSA_OR_PSS ("RSA_OR_PSS", new X509PossessionGenerator( - new String[] {"RSA", "RSASSA-PSS"})), + RSA_OR_PSS ("RSA_OR_PSS", "RSA", "RSASSA-PSS"), // Require DSA public key - DSA ("DSA", new X509PossessionGenerator( - new String[] {"DSA"})), + DSA ("DSA", "DSA"), // Require EC public key - EC ("EC", new X509PossessionGenerator( - new String[] {"EC"})), + EC ("EC", "EC"), // Edwards-Curve key - EDDSA ("EdDSA", new X509PossessionGenerator( - new String[] {"EdDSA"})); + EDDSA ("EdDSA", "EdDSA"); - final String keyType; - final SSLPossessionGenerator possessionGenerator; + final String keyAlgorithm; + final String[] keyTypes; - private X509Authentication(String keyType, - SSLPossessionGenerator possessionGenerator) { - this.keyType = keyType; - this.possessionGenerator = possessionGenerator; + private X509Authentication(String keyAlgorithm, + String... keyTypes) { + this.keyAlgorithm = keyAlgorithm; + this.keyTypes = keyTypes; } static X509Authentication valueOf(SignatureScheme signatureScheme) { for (X509Authentication au : X509Authentication.values()) { - if (au.keyType.equals(signatureScheme.keyAlgorithm)) { + if (au.keyAlgorithm.equals(signatureScheme.keyAlgorithm)) { return au; } } @@ -90,7 +84,7 @@ @Override public SSLPossession createPossession(HandshakeContext handshakeContext) { - return possessionGenerator.createPossession(handshakeContext); + return X509Authentication.createPossession(handshakeContext, keyTypes); } @Override @@ -194,116 +188,109 @@ } } - static final class X509PossessionGenerator - implements SSLPossessionGenerator { - final String[] keyTypes; - - private X509PossessionGenerator(String[] keyTypes) { - this.keyTypes = keyTypes; - } - - @Override - public SSLPossession createPossession(HandshakeContext context) { - if (context.sslConfig.isClientMode) { - for (String keyType : keyTypes) { - SSLPossession poss = createClientPossession( - (ClientHandshakeContext)context, keyType); - if (poss != null) { - return poss; - } - } - } else { - for (String keyType : keyTypes) { - SSLPossession poss = createServerPossession( - (ServerHandshakeContext)context, keyType); - if (poss != null) { - return poss; - } - } - } - - return null; + public static SSLPossession createPossession( + HandshakeContext context, String[] keyTypes) { + if (context.sslConfig.isClientMode) { + return createClientPossession( + (ClientHandshakeContext) context, keyTypes); + } else { + return createServerPossession( + (ServerHandshakeContext) context, keyTypes); } + } - // Used by TLS 1.2 and TLS 1.3. - private SSLPossession createClientPossession( - ClientHandshakeContext chc, String keyType) { - X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager(); - String clientAlias = null; - if (chc.conContext.transport instanceof SSLSocketImpl) { - clientAlias = km.chooseClientAlias( - new String[] { keyType }, - chc.peerSupportedAuthorities == null ? null : - chc.peerSupportedAuthorities.clone(), - (SSLSocket)chc.conContext.transport); - } else if (chc.conContext.transport instanceof SSLEngineImpl) { - clientAlias = km.chooseEngineClientAlias( - new String[] { keyType }, - chc.peerSupportedAuthorities == null ? null : - chc.peerSupportedAuthorities.clone(), - (SSLEngine)chc.conContext.transport); - } + // Used by TLS 1.2 and TLS 1.3. + private static SSLPossession createClientPossession( + ClientHandshakeContext chc, String[] keyTypes) { + X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager(); + String clientAlias = null; + if (chc.conContext.transport instanceof SSLSocketImpl socket) { + clientAlias = km.chooseClientAlias( + keyTypes, + chc.peerSupportedAuthorities == null ? null : + chc.peerSupportedAuthorities.clone(), + socket); + } else if (chc.conContext.transport instanceof SSLEngineImpl engine) { + clientAlias = km.chooseEngineClientAlias( + keyTypes, + chc.peerSupportedAuthorities == null ? null : + chc.peerSupportedAuthorities.clone(), + engine); + } - if (clientAlias == null) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { - SSLLogger.finest("No X.509 cert selected for " + keyType); - } - return null; + if (clientAlias == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("No X.509 cert selected for " + + Arrays.toString(keyTypes)); } + return null; + } - PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); - if (clientPrivateKey == null) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { - SSLLogger.finest( - clientAlias + " is not a private key entry"); - } - return null; + PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); + if (clientPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest( + clientAlias + " is not a private key entry"); } + return null; + } - X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); - if ((clientCerts == null) || (clientCerts.length == 0)) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { - SSLLogger.finest(clientAlias + + X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); + if ((clientCerts == null) || (clientCerts.length == 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest(clientAlias + " is a private key entry with no cert chain stored"); - } - return null; } + return null; + } - PublicKey clientPublicKey = clientCerts[0].getPublicKey(); - if ((!clientPrivateKey.getAlgorithm().equals(keyType)) - || (!clientPublicKey.getAlgorithm().equals(keyType))) { - if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { - SSLLogger.fine( - clientAlias + " private or public key is not of " + - keyType + " algorithm"); - } - return null; + String privateKeyAlgorithm = clientPrivateKey.getAlgorithm(); + if (!Arrays.asList(keyTypes).contains(privateKeyAlgorithm)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + clientAlias + " private key algorithm " + + privateKeyAlgorithm + " not in request list"); } + return null; + } - return new X509Possession(clientPrivateKey, clientCerts); + String publicKeyAlgorithm = clientCerts[0].getPublicKey().getAlgorithm(); + if (!privateKeyAlgorithm.equals(publicKeyAlgorithm)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + clientAlias + " private or public key is not of " + + "same algorithm: " + + privateKeyAlgorithm + " vs " + + publicKeyAlgorithm); + } + return null; } - private SSLPossession createServerPossession( - ServerHandshakeContext shc, String keyType) { - X509ExtendedKeyManager km = shc.sslContext.getX509KeyManager(); - String serverAlias = null; - if (shc.conContext.transport instanceof SSLSocketImpl) { + return new X509Possession(clientPrivateKey, clientCerts); + } + + private static SSLPossession createServerPossession( + ServerHandshakeContext shc, String[] keyTypes) { + X509ExtendedKeyManager km = shc.sslContext.getX509KeyManager(); + String serverAlias = null; + for (String keyType : keyTypes) { + if (shc.conContext.transport instanceof SSLSocketImpl socket) { serverAlias = km.chooseServerAlias(keyType, shc.peerSupportedAuthorities == null ? null : shc.peerSupportedAuthorities.clone(), - (SSLSocket)shc.conContext.transport); - } else if (shc.conContext.transport instanceof SSLEngineImpl) { + socket); + } else if (shc.conContext.transport instanceof SSLEngineImpl engine) { serverAlias = km.chooseEngineServerAlias(keyType, shc.peerSupportedAuthorities == null ? null : shc.peerSupportedAuthorities.clone(), - (SSLEngine)shc.conContext.transport); + engine); } if (serverAlias == null) { if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { SSLLogger.finest("No X.509 cert selected for " + keyType); } - return null; + continue; } PrivateKey serverPrivateKey = km.getPrivateKey(serverAlias); @@ -312,7 +299,7 @@ SSLLogger.finest( serverAlias + " is not a private key entry"); } - return null; + continue; } X509Certificate[] serverCerts = km.getCertificateChain(serverAlias); @@ -321,7 +308,7 @@ SSLLogger.finest( serverAlias + " is not a certificate entry"); } - return null; + continue; } PublicKey serverPublicKey = serverCerts[0].getPublicKey(); @@ -330,9 +317,9 @@ if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { SSLLogger.fine( serverAlias + " private or public key is not of " + - keyType + " algorithm"); + keyType + " algorithm"); } - return null; + continue; } // For TLS 1.2 and prior versions, the public key of a EC cert @@ -344,9 +331,9 @@ if (!(serverPublicKey instanceof ECPublicKey)) { if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { SSLLogger.warning(serverAlias + - " public key is not an instance of ECPublicKey"); + " public key is not an instance of ECPublicKey"); } - return null; + continue; } // For ECC certs, check whether we support the EC domain @@ -354,24 +341,25 @@ // ClientHello extension, check against that too for // TLS 1.2 and prior versions. ECParameterSpec params = - ((ECPublicKey)serverPublicKey).getParams(); + ((ECPublicKey) serverPublicKey).getParams(); NamedGroup namedGroup = NamedGroup.valueOf(params); if ((namedGroup == null) || (!SupportedGroups.isSupported(namedGroup)) || ((shc.clientRequestedNamedGroups != null) && - !shc.clientRequestedNamedGroups.contains(namedGroup))) { + !shc.clientRequestedNamedGroups.contains(namedGroup))) { if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { SSLLogger.warning( - "Unsupported named group (" + namedGroup + - ") used in the " + serverAlias + " certificate"); + "Unsupported named group (" + namedGroup + + ") used in the " + serverAlias + " certificate"); } - return null; + continue; } } return new X509Possession(serverPrivateKey, serverCerts); } + return null; } } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/util/KeyUtil.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/util/KeyUtil.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/util/KeyUtil.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/util/KeyUtil.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -144,17 +144,19 @@ */ public static final int getKeySize(AlgorithmParameters parameters) { - String algorithm = parameters.getAlgorithm(); - switch (algorithm) { + switch (parameters.getAlgorithm()) { case "EC": - try { - ECKeySizeParameterSpec ps = parameters.getParameterSpec( + // ECKeySizeParameterSpec is SunEC internal only + if (parameters.getProvider().getName().equals("SunEC")) { + try { + ECKeySizeParameterSpec ps = parameters.getParameterSpec( ECKeySizeParameterSpec.class); - if (ps != null) { - return ps.getKeySize(); + if (ps != null) { + return ps.getKeySize(); + } + } catch (InvalidParameterSpecException ipse) { + // ignore } - } catch (InvalidParameterSpecException ipse) { - // ignore } try { @@ -286,13 +288,14 @@ * contains the lower of that suggested by the client in the client * hello and the highest supported by the server. * @param encoded the encoded key in its "RAW" encoding format - * @param isFailOver whether or not the previous decryption of the - * encrypted PreMasterSecret message run into problem + * @param failure true if encoded is incorrect according to previous checks * @return the polished PreMasterSecret key in its "RAW" encoding format */ public static byte[] checkTlsPreMasterSecretKey( int clientVersion, int serverVersion, SecureRandom random, - byte[] encoded, boolean isFailOver) { + byte[] encoded, boolean failure) { + + byte[] tmp; if (random == null) { random = JCAUtil.getSecureRandom(); @@ -300,30 +303,38 @@ byte[] replacer = new byte[48]; random.nextBytes(replacer); - if (!isFailOver && (encoded != null)) { - // check the length - if (encoded.length != 48) { - // private, don't need to clone the byte array. - return replacer; - } - - int encodedVersion = - ((encoded[0] & 0xFF) << 8) | (encoded[1] & 0xFF); - if (clientVersion != encodedVersion) { - if (clientVersion > 0x0301 || // 0x0301: TLSv1 - serverVersion != encodedVersion) { - encoded = replacer; - } // Otherwise, For compatibility, we maintain the behavior - // that the version in pre_master_secret can be the - // negotiated version for TLS v1.0 and SSL v3.0. - } + if (failure) { + tmp = replacer; + } else { + tmp = encoded; + } + if (tmp == null) { + encoded = replacer; + } else { + encoded = tmp; + } + // check the length + if (encoded.length != 48) { // private, don't need to clone the byte array. - return encoded; + tmp = replacer; + } else { + tmp = encoded; } - // private, don't need to clone the byte array. - return replacer; + int encodedVersion = + ((tmp[0] & 0xFF) << 8) | (tmp[1] & 0xFF); + int check1 = 0; + int check2 = 0; + int check3 = 0; + if (clientVersion != encodedVersion) check1 = 1; + if (clientVersion > 0x0301) check2 = 1; + if (serverVersion != encodedVersion) check3 = 1; + if ((check1 & (check2 | check3)) == 1) { + return replacer; + } else { + return tmp; + } } /** diff -Nru openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java --- openjdk-17-17.0.9+9/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java 2024-01-09 21:18:15.000000000 +0000 @@ -856,16 +856,16 @@ * the maximum allowed number of bytes for the signature-related files * in a JAR file. */ - Integer tmp = GetIntegerAction.privilegedGetProperty( - "jdk.jar.maxSignatureFileSize", 8000000); + int tmp = GetIntegerAction.privilegedGetProperty( + "jdk.jar.maxSignatureFileSize", 16000000); if (tmp < 0 || tmp > MAX_ARRAY_SIZE) { if (debug != null) { - debug.println("Default signature file size 8000000 bytes " + - "is used as the specified size for the " + - "jdk.jar.maxSignatureFileSize system property " + + debug.println("The default signature file size of 16000000 bytes " + + "will be used for the jdk.jar.maxSignatureFileSize " + + "system property since the specified value " + "is out of range: " + tmp); } - tmp = 8000000; + tmp = 16000000; } return tmp; } diff -Nru openjdk-17-17.0.9+9/src/java.base/share/native/libverify/check_code.c openjdk-17-17.0.10+7/src/java.base/share/native/libverify/check_code.c --- openjdk-17-17.0.9+9/src/java.base/share/native/libverify/check_code.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/share/native/libverify/check_code.c 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 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 @@ -81,6 +81,7 @@ #include #include #include +#include #include "jni.h" #include "jni_util.h" @@ -1195,7 +1196,7 @@ } } if (opcode == JVM_OPC_tableswitch) { - keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; + keys = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]) + 1; delta = 1; } else { keys = _ck_ntohl(lpc[1]); /* number of pairs */ @@ -1677,11 +1678,13 @@ switch (instruction) { case JVM_OPC_tableswitch: { int *lpc = (int *)UCALIGN(iptr + 1); - int index; if (lpc + 2 >= (int *)end) { return -1; /* do not read pass the end */ } - index = _ck_ntohl(lpc[2]) - _ck_ntohl(lpc[1]); + int64_t low = _ck_ntohl(lpc[1]); + int64_t high = _ck_ntohl(lpc[2]); + int64_t index = high - low; + // The value of low must be less than or equal to high - i.e. index >= 0 if ((index < 0) || (index > 65535)) { return -1; /* illegal */ } else { diff -Nru openjdk-17-17.0.9+9/src/java.base/unix/native/jspawnhelper/jspawnhelper.c openjdk-17-17.0.10+7/src/java.base/unix/native/jspawnhelper/jspawnhelper.c --- openjdk-17-17.0.9+9/src/java.base/unix/native/jspawnhelper/jspawnhelper.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/unix/native/jspawnhelper/jspawnhelper.c 2024-01-09 21:18:15.000000000 +0000 @@ -134,10 +134,10 @@ ChildStuff c; int t; struct stat buf; - /* argv[0] contains the fd number to read all the child info */ + /* argv[1] contains the fd number to read all the child info */ int r, fdin, fdout; - r = sscanf (argv[argc-1], "%d:%d", &fdin, &fdout); + r = sscanf (argv[1], "%d:%d", &fdin, &fdout); if (r == 2 && fcntl(fdin, F_GETFD) != -1) { fstat(fdin, &buf); if (!S_ISFIFO(buf.st_mode)) diff -Nru openjdk-17-17.0.9+9/src/java.base/unix/native/libjava/ProcessImpl_md.c openjdk-17-17.0.10+7/src/java.base/unix/native/libjava/ProcessImpl_md.c --- openjdk-17-17.0.9+9/src/java.base/unix/native/libjava/ProcessImpl_md.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.base/unix/native/libjava/ProcessImpl_md.c 2024-01-09 21:18:15.000000000 +0000 @@ -491,16 +491,20 @@ jboolean isCopy; int i, offset, rval, bufsize, magic; char *buf, buf1[16]; - char *hlpargs[2]; + char *hlpargs[3]; SpawnInfo sp; /* need to tell helper which fd is for receiving the childstuff * and which fd to send response back on */ snprintf(buf1, sizeof(buf1), "%d:%d", c->childenv[0], c->fail[1]); - /* put the fd string as argument to the helper cmd */ - hlpargs[0] = buf1; - hlpargs[1] = 0; + /* NULL-terminated argv array. + * argv[0] contains path to jspawnhelper, to follow conventions. + * argv[1] contains the fd string as argument to jspawnhelper + */ + hlpargs[0] = (char*)helperpath; + hlpargs[1] = buf1; + hlpargs[2] = NULL; /* Following items are sent down the pipe to the helper * after it is spawned. diff -Nru openjdk-17-17.0.9+9/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java openjdk-17-17.0.10+7/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java --- openjdk-17-17.0.9+9/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/share/classes/com/sun/media/sound/JARSoundbankReader.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -32,6 +32,7 @@ import java.io.InputStreamReader; import java.net.URL; import java.net.URLClassLoader; +import java.security.AccessController; import java.util.ArrayList; import java.util.Objects; @@ -40,6 +41,7 @@ import javax.sound.midi.spi.SoundbankReader; import sun.reflect.misc.ReflectUtil; +import sun.security.action.GetBooleanAction; /** * JarSoundbankReader is used to read soundbank object from jar files. @@ -48,12 +50,15 @@ */ public final class JARSoundbankReader extends SoundbankReader { - /* - * Name of the system property that enables the Jar soundbank loading - * true if jar sound bank is allowed to be loaded - * default is false + /** + * Value of the system property that enables the Jar soundbank loading + * {@code true} if jar sound bank is allowed to be loaded default is + * {@code false}. */ - private final static String JAR_SOUNDBANK_ENABLED = "jdk.sound.jarsoundbank"; + @SuppressWarnings("removal") + private static final boolean JAR_SOUNDBANK_ENABLED = + AccessController.doPrivileged( + new GetBooleanAction("jdk.sound.jarsoundbank")); private static boolean isZIP(URL url) { boolean ok = false; @@ -81,7 +86,7 @@ public Soundbank getSoundbank(URL url) throws InvalidMidiDataException, IOException { Objects.requireNonNull(url); - if (!Boolean.getBoolean(JAR_SOUNDBANK_ENABLED) || !isZIP(url)) + if (!JAR_SOUNDBANK_ENABLED || !isZIP(url)) return null; ArrayList soundbanks = new ArrayList<>(); diff -Nru openjdk-17-17.0.9+9/src/java.desktop/share/classes/javax/imageio/ImageIO.java openjdk-17-17.0.10+7/src/java.desktop/share/classes/javax/imageio/ImageIO.java --- openjdk-17-17.0.9+9/src/java.desktop/share/classes/javax/imageio/ImageIO.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/share/classes/javax/imageio/ImageIO.java 2024-01-09 21:18:15.000000000 +0000 @@ -1468,6 +1468,8 @@ BufferedImage bi; try { bi = reader.read(0, param); + } catch (RuntimeException e) { + throw new IIOException(e.toString(), e); } finally { reader.dispose(); stream.close(); diff -Nru openjdk-17-17.0.9+9/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java openjdk-17-17.0.10+7/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java --- openjdk-17-17.0.9+9/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/share/classes/javax/swing/ProgressMonitorInputStream.java 2024-01-09 21:18:15.000000000 +0000 @@ -67,7 +67,8 @@ private ProgressMonitor monitor; private int nread = 0; private int size = 0; - + Component parentComponent; + Object message; /** * Constructs an object to monitor the progress of an input stream. @@ -88,6 +89,8 @@ catch(IOException ioe) { size = 0; } + this.parentComponent = parentComponent; + this.message = message; monitor = new ProgressMonitor(parentComponent, message, null, 0, size); } @@ -119,6 +122,25 @@ return c; } + private void setProgress(int nr) throws IOException { + if (nr > 0) { + if (nread + nr > nread) { + monitor.setProgress(nread += nr); + } else { + size = in.available(); + nread = 0; + monitor.close(); + monitor = new ProgressMonitor(this.parentComponent, + this.message, null, 0, size); + } + } + if (monitor.isCanceled()) { + InterruptedIOException exc = + new InterruptedIOException("progress"); + exc.bytesTransferred = nread; + throw exc; + } + } /** * Overrides FilterInputStream.read @@ -126,13 +148,7 @@ */ public int read(byte[] b) throws IOException { int nr = in.read(b); - if (nr > 0) monitor.setProgress(nread += nr); - if (monitor.isCanceled()) { - InterruptedIOException exc = - new InterruptedIOException("progress"); - exc.bytesTransferred = nread; - throw exc; - } + setProgress(nr); return nr; } @@ -145,13 +161,7 @@ int off, int len) throws IOException { int nr = in.read(b, off, len); - if (nr > 0) monitor.setProgress(nread += nr); - if (monitor.isCanceled()) { - InterruptedIOException exc = - new InterruptedIOException("progress"); - exc.bytesTransferred = nread; - throw exc; - } + setProgress(nr); return nr; } @@ -162,7 +172,13 @@ */ public long skip(long n) throws IOException { long nr = in.skip(n); - if (nr > 0) monitor.setProgress(nread += nr); + if (nr > 0) { + if ((int)(nread + nr) > nread) { + monitor.setProgress(nread += nr); + } else { + monitor.setProgress(monitor.getMaximum()); + } + } return nr; } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/share/classes/sun/swing/CachedPainter.java openjdk-17-17.0.10+7/src/java.desktop/share/classes/sun/swing/CachedPainter.java --- openjdk-17-17.0.9+9/src/java.desktop/share/classes/sun/swing/CachedPainter.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/share/classes/sun/swing/CachedPainter.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -314,8 +314,9 @@ @Override public Image getResolutionVariant(double destWidth, double destHeight) { - int w = (int) Math.ceil(destWidth); - int h = (int) Math.ceil(destHeight); + int w = (int) Math.floor(destWidth + 0.5); + int h = (int) Math.floor(destHeight + 0.5); + return getImage(PainterMultiResolutionCachedImage.class, c, baseWidth, baseHeight, w, h, args); } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/share/native/libfontmanager/freetypeScaler.c openjdk-17-17.0.10+7/src/java.desktop/share/native/libfontmanager/freetypeScaler.c --- openjdk-17-17.0.9+9/src/java.desktop/share/native/libfontmanager/freetypeScaler.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/share/native/libfontmanager/freetypeScaler.c 2024-01-09 21:18:15.000000000 +0000 @@ -507,10 +507,10 @@ ptsz = 1.0; } context->ptsz = (int)(ptsz * 64); - context->transform.xx = FloatToFTFixed((float)dmat[0]/ptsz); - context->transform.yx = -FloatToFTFixed((float)dmat[1]/ptsz); - context->transform.xy = -FloatToFTFixed((float)dmat[2]/ptsz); - context->transform.yy = FloatToFTFixed((float)dmat[3]/ptsz); + context->transform.xx = FloatToFTFixed((float)(dmat[0]/ptsz)); + context->transform.yx = -FloatToFTFixed((float)(dmat[1]/ptsz)); + context->transform.xy = -FloatToFTFixed((float)(dmat[2]/ptsz)); + context->transform.yy = FloatToFTFixed((float)(dmat[3]/ptsz)); context->aaType = aa; context->fmType = fm; diff -Nru openjdk-17-17.0.9+9/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java openjdk-17-17.0.10+7/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java --- openjdk-17-17.0.9+9/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/unix/classes/sun/print/PrintServiceLookupProvider.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,10 +26,8 @@ package sun.print; import java.io.BufferedReader; -import java.io.FileInputStream; -import java.io.InputStream; -import java.io.InputStreamReader; import java.io.IOException; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.Vector; import java.security.AccessController; @@ -54,6 +52,8 @@ import java.net.URL; import java.nio.file.Files; +import sun.awt.util.ThreadGroupUtils; + /* * Remind: This class uses solaris commands. We also need a linux * version @@ -204,14 +204,18 @@ return BSD_LPD; } - + @SuppressWarnings("removal") public PrintServiceLookupProvider() { // start the printer listener thread if (pollServices) { - Thread thr = new Thread(null, new PrinterChangeListener(), - "PrinterListener", 0, false); - thr.setDaemon(true); - thr.start(); + AccessController.doPrivileged((PrivilegedAction) () -> { + Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(), + new PrinterChangeListener(), + "PrinterListener", 0, false); + thr.setContextClassLoader(null); + thr.setDaemon(true); + return thr; + }).start(); IPPPrintService.debug_println(debugPrefix+"polling turned on"); } } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java openjdk-17-17.0.10+7/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java --- openjdk-17-17.0.9+9/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/TMSchema.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -40,10 +40,13 @@ package com.sun.java.swing.plaf.windows; -import java.awt.*; -import java.util.*; - -import javax.swing.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Insets; +import java.awt.Point; +import java.util.EnumMap; +import javax.swing.JComponent; import sun.awt.windows.ThemeReader; @@ -55,7 +58,7 @@ * * @author Leif Samuelsson */ -class TMSchema { +public final class TMSchema { /** * An enumeration of the various Windows controls (also known as diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java openjdk-17-17.0.10+7/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java --- openjdk-17-17.0.9+9/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/classes/com/sun/java/swing/plaf/windows/XPStyle.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -40,14 +40,41 @@ package com.sun.java.swing.plaf.windows; -import java.awt.*; -import java.awt.image.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.Image; +import java.awt.Insets; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.awt.image.DataBufferInt; +import java.awt.image.WritableRaster; import java.security.AccessController; -import java.util.*; +import java.util.HashMap; -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.plaf.*; +import javax.swing.AbstractButton; +import javax.swing.CellRendererPane; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JComponent; +import javax.swing.JRadioButton; +import javax.swing.JToolBar; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.border.AbstractBorder; +import javax.swing.border.Border; +import javax.swing.border.EmptyBorder; +import javax.swing.border.LineBorder; +import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.InsetsUIResource; +import javax.swing.plaf.UIResource; import javax.swing.text.JTextComponent; import sun.awt.image.SunWritableRaster; @@ -55,8 +82,10 @@ import sun.security.action.GetPropertyAction; import sun.swing.CachedPainter; -import static com.sun.java.swing.plaf.windows.TMSchema.*; - +import static com.sun.java.swing.plaf.windows.TMSchema.Part; +import static com.sun.java.swing.plaf.windows.TMSchema.Prop; +import static com.sun.java.swing.plaf.windows.TMSchema.State; +import static com.sun.java.swing.plaf.windows.TMSchema.TypeEnum; /** * Implements Windows XP Styles for the Windows Look and Feel. @@ -675,6 +704,11 @@ w = bi.getWidth(); h = bi.getHeight(); + // Get DPI to pass further to ThemeReader.paintBackground() + Graphics2D g2d = (Graphics2D) g; + AffineTransform at = g2d.getTransform(); + int dpi = (int)(at.getScaleX() * 96); + WritableRaster raster = bi.getRaster(); DataBufferInt dbi = (DataBufferInt)raster.getDataBuffer(); // Note that stealData() requires a markDirty() afterwards @@ -682,7 +716,8 @@ ThemeReader.paintBackground(SunWritableRaster.stealData(dbi, 0), part.getControlName(c), part.getValue(), State.getValue(part, state), - 0, 0, w, h, w); + 0, 0, w, h, w, dpi); + SunWritableRaster.markDirty(dbi); } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java openjdk-17-17.0.10+7/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java --- openjdk-17-17.0.9+9/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/classes/sun/awt/windows/ThemeReader.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -30,11 +30,14 @@ import java.awt.Insets; import java.awt.Point; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import static com.sun.java.swing.plaf.windows.TMSchema.Part; + /** * Implements Theme Support for Windows XP. * @@ -44,7 +47,24 @@ */ public final class ThemeReader { - private static final Map widgetToTheme = new HashMap<>(); + private static final int defaultDPI = 96; + + /** + * List of widgets for which we need to get the part size for the current DPI. + */ + private static final List partSizeWidgets = + List.of("MENU", "BUTTON"); + + /** + * List of widget parts for which we need to get the part size for the current DPI. + */ + private static final List partSizeWidgetParts = + List.of(Part.BP_RADIOBUTTON.getValue(), + Part.BP_CHECKBOX.getValue(), + Part.MP_POPUPCHECK.getValue()); + + private static final Map> dpiAwareWidgetToTheme + = new HashMap<>(); // lock for the cache // reading should be done with readLock @@ -80,28 +100,30 @@ return xpStyleEnabled; } + private static Long openThemeImpl(String widget, int dpi) { + Long theme; + int i = widget.indexOf("::"); + if (i > 0) { + // We're using the syntax "subAppName::controlName" here, as used by msstyles. + // See documentation for SetWindowTheme on MSDN. + setWindowTheme(widget.substring(0, i)); + theme = openTheme(widget.substring(i + 2), dpi); + setWindowTheme(null); + } else { + theme = openTheme(widget, dpi); + } + return theme; + } + // this should be called only with writeLock held - private static Long getThemeImpl(String widget) { - Long theme = widgetToTheme.get(widget); - if (theme == null) { - int i = widget.indexOf("::"); - if (i > 0) { - // We're using the syntax "subAppName::controlName" here, as used by msstyles. - // See documentation for SetWindowTheme on MSDN. - setWindowTheme(widget.substring(0, i)); - theme = openTheme(widget.substring(i+2)); - setWindowTheme(null); - } else { - theme = openTheme(widget); - } - widgetToTheme.put(widget, theme); - } - return theme; + private static Long getThemeImpl(String widget, int dpi) { + return dpiAwareWidgetToTheme.computeIfAbsent(dpi, key -> new HashMap<>()) + .computeIfAbsent(widget, w -> openThemeImpl(widget, dpi)); } // returns theme value // this method should be invoked with readLock locked - private static Long getTheme(String widget) { + private static Long getTheme(String widget, int dpi) { if (!isThemed) { throw new IllegalStateException("Themes are not loaded"); } @@ -111,10 +133,12 @@ try { if (!valid) { // Close old themes. - for (Long value : widgetToTheme.values()) { - closeTheme(value); + for (Map dpiVal : dpiAwareWidgetToTheme.values()) { + for (Long value : dpiVal.values()) { + closeTheme(value); + } } - widgetToTheme.clear(); + dpiAwareWidgetToTheme.clear(); valid = true; } } finally { @@ -123,13 +147,20 @@ } } + Long theme = null; + + Map widgetToTheme = dpiAwareWidgetToTheme.get(dpi); + + if (widgetToTheme != null) { + theme = widgetToTheme.get(widget); + } + // mostly copied from the javadoc for ReentrantReadWriteLock - Long theme = widgetToTheme.get(widget); if (theme == null) { readLock.unlock(); writeLock.lock(); try { - theme = getThemeImpl(widget); + theme = getThemeImpl(widget, dpi); } finally { readLock.lock(); writeLock.unlock();// Unlock write, still hold read @@ -139,14 +170,23 @@ } private static native void paintBackground(int[] buffer, long theme, - int part, int state, int x, - int y, int w, int h, int stride); + int part, int state, + int rectRight, int rectBottom, + int w, int h, int stride); public static void paintBackground(int[] buffer, String widget, - int part, int state, int x, int y, int w, int h, int stride) { + int part, int state, int x, int y, int w, int h, int stride, int dpi) { readLock.lock(); try { - paintBackground(buffer, getTheme(widget), part, state, x, y, w, h, stride); + /* For widgets and parts in the lists, we get the part size + for the current screen DPI to scale them better. */ + Dimension d = (partSizeWidgets.contains(widget) + && partSizeWidgetParts.contains(Integer.valueOf(part))) + ? getPartSize(getTheme(widget, dpi), part, state) + : new Dimension(w, h); + + paintBackground(buffer, getTheme(widget, dpi), part, state, + d.width, d.height, w, h, stride); } finally { readLock.unlock(); } @@ -158,7 +198,7 @@ public static Insets getThemeMargins(String widget, int part, int state, int marginType) { readLock.lock(); try { - return getThemeMargins(getTheme(widget), part, state, marginType); + return getThemeMargins(getTheme(widget, defaultDPI), part, state, marginType); } finally { readLock.unlock(); } @@ -169,7 +209,7 @@ public static boolean isThemePartDefined(String widget, int part, int state) { readLock.lock(); try { - return isThemePartDefined(getTheme(widget), part, state); + return isThemePartDefined(getTheme(widget, defaultDPI), part, state); } finally { readLock.unlock(); } @@ -181,7 +221,7 @@ public static Color getColor(String widget, int part, int state, int property) { readLock.lock(); try { - return getColor(getTheme(widget), part, state, property); + return getColor(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -193,7 +233,7 @@ public static int getInt(String widget, int part, int state, int property) { readLock.lock(); try { - return getInt(getTheme(widget), part, state, property); + return getInt(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -205,7 +245,7 @@ public static int getEnum(String widget, int part, int state, int property) { readLock.lock(); try { - return getEnum(getTheme(widget), part, state, property); + return getEnum(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -218,7 +258,7 @@ int property) { readLock.lock(); try { - return getBoolean(getTheme(widget), part, state, property); + return getBoolean(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -229,7 +269,7 @@ public static boolean getSysBoolean(String widget, int property) { readLock.lock(); try { - return getSysBoolean(getTheme(widget), property); + return getSysBoolean(getTheme(widget, defaultDPI), property); } finally { readLock.unlock(); } @@ -241,7 +281,7 @@ public static Point getPoint(String widget, int part, int state, int property) { readLock.lock(); try { - return getPoint(getTheme(widget), part, state, property); + return getPoint(getTheme(widget, defaultDPI), part, state, property); } finally { readLock.unlock(); } @@ -254,7 +294,7 @@ int property) { readLock.lock(); try { - return getPosition(getTheme(widget), part,state,property); + return getPosition(getTheme(widget, defaultDPI), part,state,property); } finally { readLock.unlock(); } @@ -266,13 +306,13 @@ public static Dimension getPartSize(String widget, int part, int state) { readLock.lock(); try { - return getPartSize(getTheme(widget), part, state); + return getPartSize(getTheme(widget, defaultDPI), part, state); } finally { readLock.unlock(); } } - private static native long openTheme(String widget); + private static native long openTheme(String widget, int dpi); private static native void closeTheme(long theme); @@ -285,8 +325,9 @@ int stateFrom, int stateTo, int propId) { readLock.lock(); try { - return getThemeTransitionDuration(getTheme(widget), - part, stateFrom, stateTo, propId); + return getThemeTransitionDuration(getTheme(widget, defaultDPI), + part, stateFrom, stateTo, + propId); } finally { readLock.unlock(); } @@ -299,8 +340,9 @@ int part, int state, int boundingWidth, int boundingHeight) { readLock.lock(); try { - return getThemeBackgroundContentMargins(getTheme(widget), - part, state, boundingWidth, boundingHeight); + return getThemeBackgroundContentMargins(getTheme(widget, defaultDPI), + part, state, + boundingWidth, boundingHeight); } finally { readLock.unlock(); } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java openjdk-17-17.0.10+7/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java --- openjdk-17-17.0.9+9/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,8 @@ package sun.print; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import javax.print.DocFlavor; @@ -41,6 +43,8 @@ import javax.print.attribute.PrintServiceAttributeSet; import javax.print.attribute.standard.PrinterName; +import sun.awt.util.ThreadGroupUtils; + public class PrintServiceLookupProvider extends PrintServiceLookup { private PrintService defaultPrintService; @@ -81,22 +85,31 @@ return win32PrintLUS; } + @SuppressWarnings("removal") public PrintServiceLookupProvider() { if (win32PrintLUS == null) { win32PrintLUS = this; // start the local printer listener thread - Thread thr = new Thread(null, new PrinterChangeListener(), - "PrinterListener", 0, false); - thr.setDaemon(true); - thr.start(); + AccessController.doPrivileged((PrivilegedAction) () -> { + Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(), + new PrinterChangeListener(), + "PrinterListener", 0, false); + thr.setContextClassLoader(null); + thr.setDaemon(true); + return thr; + }).start(); // start the remote printer listener thread - Thread remThr = new Thread(null, new RemotePrinterChangeListener(), - "RemotePrinterListener", 0, false); - remThr.setDaemon(true); - remThr.start(); + AccessController.doPrivileged((PrivilegedAction) () -> { + Thread thr = new Thread(ThreadGroupUtils.getRootThreadGroup(), + new RemotePrinterChangeListener(), + "RemotePrinterListener", 0, false); + thr.setContextClassLoader(null); + thr.setDaemon(true); + return thr; + }).start(); } /* else condition ought to never happen! */ } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp --- openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -52,7 +52,7 @@ typedef HRESULT(__stdcall *PFNDRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect); -typedef HTHEME(__stdcall *PFNOPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList); +typedef HTHEME(__stdcall *PFNOPENTHEMEDATAFORDPI)(HWND hwnd, LPCWSTR pszClassList, UINT dpi); typedef HRESULT (__stdcall *PFNDRAWTHEMETEXT)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, @@ -96,7 +96,7 @@ (HTHEME hTheme, int iPartId, int iStateIdFrom, int iStateIdTo, int iPropId, DWORD *pdwDuration); -static PFNOPENTHEMEDATA OpenThemeDataFunc = NULL; +static PFNOPENTHEMEDATAFORDPI OpenThemeDataForDpiFunc = NULL; static PFNDRAWTHEMEBACKGROUND DrawThemeBackgroundFunc = NULL; static PFNCLOSETHEMEDATA CloseThemeDataFunc = NULL; static PFNDRAWTHEMETEXT DrawThemeTextFunc = NULL; @@ -122,8 +122,8 @@ DTRACE_PRINTLN1("InitThemes hModThemes = %x\n", hModThemes); if(hModThemes) { DTRACE_PRINTLN("Loaded UxTheme.dll\n"); - OpenThemeDataFunc = (PFNOPENTHEMEDATA)GetProcAddress(hModThemes, - "OpenThemeData"); + OpenThemeDataForDpiFunc = (PFNOPENTHEMEDATAFORDPI)GetProcAddress( + hModThemes, "OpenThemeDataForDpi"); DrawThemeBackgroundFunc = (PFNDRAWTHEMEBACKGROUND)GetProcAddress( hModThemes, "DrawThemeBackground"); CloseThemeDataFunc = (PFNCLOSETHEMEDATA)GetProcAddress( @@ -158,7 +158,7 @@ (PFNGETTHEMETRANSITIONDURATION)GetProcAddress(hModThemes, "GetThemeTransitionDuration"); - if(OpenThemeDataFunc + if(OpenThemeDataForDpiFunc && DrawThemeBackgroundFunc && CloseThemeDataFunc && DrawThemeTextFunc @@ -177,9 +177,12 @@ && GetThemeTransitionDurationFunc ) { DTRACE_PRINTLN("Loaded function pointers.\n"); - // We need to make sure we can load the Theme. This may not be - // the case on a WinXP machine with classic mode enabled. - HTHEME hTheme = OpenThemeDataFunc(AwtToolkit::GetInstance().GetHWnd(), L"Button"); + // We need to make sure we can load the Theme. + // Use the default DPI value of 96 on windows. + constexpr unsigned int defaultDPI = 96; + HTHEME hTheme = OpenThemeDataForDpiFunc ( + AwtToolkit::GetInstance().GetHWnd(), + L"Button", defaultDPI); if(hTheme) { DTRACE_PRINTLN("Loaded Theme data.\n"); CloseThemeDataFunc(hTheme); @@ -242,7 +245,7 @@ * Signature: (Ljava/lang/String;)J */ JNIEXPORT jlong JNICALL Java_sun_awt_windows_ThemeReader_openTheme -(JNIEnv *env, jclass klass, jstring widget) { +(JNIEnv *env, jclass klass, jstring widget, jint dpi) { LPCTSTR str = (LPCTSTR) JNU_GetStringPlatformChars(env, widget, NULL); if (str == NULL) { @@ -251,7 +254,9 @@ } // We need to open the Theme on a Window that will stick around. // The best one for that purpose is the Toolkit window. - HTHEME htheme = OpenThemeDataFunc(AwtToolkit::GetInstance().GetHWnd(), str); + HTHEME htheme = OpenThemeDataForDpiFunc( + AwtToolkit::GetInstance().GetHWnd(), + str, dpi); JNU_ReleaseStringPlatformChars(env, widget, str); return (jlong) htheme; } @@ -384,7 +389,7 @@ */ JNIEXPORT void JNICALL Java_sun_awt_windows_ThemeReader_paintBackground (JNIEnv *env, jclass klass, jintArray array, jlong theme, jint part, jint state, - jint x, jint y, jint w, jint h, jint stride) { + jint rectRight, jint rectBottom, jint w, jint h, jint stride) { int *pDstBits=NULL; int *pSrcBits=NULL; @@ -422,6 +427,7 @@ NULL, 0); if (hDibSection == NULL) { DTRACE_PRINTLN("Error creating DIB section"); + DeleteDC(memDC); ReleaseDC(NULL,defaultDC); return; } @@ -430,8 +436,8 @@ rect.left = 0; rect.top = 0; - rect.bottom = h; - rect.right = w; + rect.bottom = rectBottom; + rect.right = rectRight; ZeroMemory(pSrcBits,(BITS_PER_PIXEL>>3)*w*h); @@ -720,27 +726,6 @@ return NULL; } -void rescale(SIZE *size) { - static int dpiX = -1; - static int dpiY = -1; - if (dpiX == -1 || dpiY == -1) { - HWND hWnd = ::GetDesktopWindow(); - HDC hDC = ::GetDC(hWnd); - dpiX = ::GetDeviceCaps(hDC, LOGPIXELSX); - dpiY = ::GetDeviceCaps(hDC, LOGPIXELSY); - ::ReleaseDC(hWnd, hDC); - } - - if (dpiX !=0 && dpiX != 96) { - float invScaleX = 96.0f / dpiX; - size->cx = ROUND_TO_INT(size->cx * invScaleX); - } - if (dpiY != 0 && dpiY != 96) { - float invScaleY = 96.0f / dpiY; - size->cy = ROUND_TO_INT(size->cy * invScaleY); - } -} - /* * Class: sun_awt_windows_ThemeReader * Method: getPartSize @@ -767,7 +752,6 @@ CHECK_NULL_RETURN(dimMID, NULL); } - rescale(&size); jobject dimObj = env->NewObject(dimClassID, dimMID, size.cx, size.cy); if (safe_ExceptionOccurred(env)) { env->ExceptionDescribe(); diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp --- openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Font.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1790,10 +1790,16 @@ DWORD dwBytes = sizeof(szFileName); // try Typeface-specific EUDC font char szTmpName[80]; - VERIFY(::WideCharToMultiByte(CP_ACP, 0, szFamilyName, -1, - szTmpName, sizeof(szTmpName), NULL, NULL)); - LONG lStatus = ::RegQueryValueExA(hKey, (LPCSTR) szTmpName, - NULL, &dwType, szFileName, &dwBytes); + int nb = ::WideCharToMultiByte(CP_ACP, 0, szFamilyName, -1, + szTmpName, sizeof(szTmpName), NULL, NULL); + VERIFY(nb); + + LONG lStatus = 1; + if (nb > 0) { + lStatus = ::RegQueryValueExA(hKey, (LPCSTR) szTmpName, + NULL, &dwType, szFileName, &dwBytes); + } + BOOL fUseDefault = FALSE; if (lStatus != ERROR_SUCCESS){ // try System default EUDC font if (m_fTTEUDCFileExist == FALSE) diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp --- openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_PrintJob.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -3925,9 +3925,13 @@ sizeof(t_errStr), NULL ); - WideCharToMultiByte(CP_UTF8, 0, t_errStr, -1, + int nb = WideCharToMultiByte(CP_UTF8, 0, t_errStr, -1, errStr, sizeof(errStr), NULL, NULL); - JNU_ThrowByName(env, PRINTEREXCEPTION_STR, errStr); + if (nb > 0) { + JNU_ThrowByName(env, PRINTEREXCEPTION_STR, errStr); + } else { + JNU_ThrowByName(env, PRINTEREXCEPTION_STR, "secondary error during OS message extraction"); + } } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp --- openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Robot.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -170,6 +170,8 @@ // create an offscreen bitmap hbitmap = ::CreateCompatibleBitmap(hdcScreen, width, height); if (hbitmap == NULL) { + ::DeleteDC(hdcMem); + ::DeleteDC(hdcScreen); throw std::bad_alloc(); } hOldBitmap = (HBITMAP)::SelectObject(hdcMem, hbitmap); @@ -189,9 +191,21 @@ static const int BITS_PER_PIXEL = 32; static const int BYTES_PER_PIXEL = BITS_PER_PIXEL/8; - if (!IS_SAFE_SIZE_MUL(width, height)) throw std::bad_alloc(); + if (!IS_SAFE_SIZE_MUL(width, height)) { + ::DeleteObject(hbitmap); + ::DeleteDC(hdcMem); + ::DeleteDC(hdcScreen); + throw std::bad_alloc(); + } + int numPixels = width*height; - if (!IS_SAFE_SIZE_MUL(BYTES_PER_PIXEL, numPixels)) throw std::bad_alloc(); + if (!IS_SAFE_SIZE_MUL(BYTES_PER_PIXEL, numPixels)) { + ::DeleteObject(hbitmap); + ::DeleteDC(hdcMem); + ::DeleteDC(hdcScreen); + throw std::bad_alloc(); + } + int pixelDataSize = BYTES_PER_PIXEL*numPixels; DASSERT(pixelDataSize > 0 && pixelDataSize % 4 == 0); // allocate memory for BITMAPINFO + pixel data @@ -202,6 +216,9 @@ // See MSDN docs for BITMAPINFOHEADER -bchristi if (!IS_SAFE_SIZE_ADD(sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD), pixelDataSize)) { + ::DeleteObject(hbitmap); + ::DeleteDC(hdcMem); + ::DeleteDC(hdcScreen); throw std::bad_alloc(); } BITMAPINFO * pinfo = (BITMAPINFO *)(new BYTE[sizeof(BITMAPINFOHEADER) + 3 * sizeof(RGBQUAD) + pixelDataSize]); diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp --- openjdk-17-17.0.9+9/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,6 @@ */ #include "awt.h" - #include #include "awt_Component.h" @@ -1394,7 +1393,9 @@ */ RECT outside; RECT inside; - int extraBottomInsets = 0; + + // extra padded border for captioned windows + int extraPaddedBorderInsets = ::GetSystemMetrics(SM_CXPADDEDBORDER); ::GetClientRect(GetHWnd(), &inside); ::GetWindowRect(GetHWnd(), &outside); @@ -1403,12 +1404,13 @@ if (outside.right - outside.left > 0 && outside.bottom - outside.top > 0) { ::MapWindowPoints(GetHWnd(), 0, (LPPOINT)&inside, 2); m_insets.top = inside.top - outside.top; - m_insets.bottom = outside.bottom - inside.bottom + extraBottomInsets; + m_insets.bottom = outside.bottom - inside.bottom; m_insets.left = inside.left - outside.left; m_insets.right = outside.right - inside.right; } else { m_insets.top = -1; } + if (m_insets.left < 0 || m_insets.top < 0 || m_insets.right < 0 || m_insets.bottom < 0) { @@ -1416,20 +1418,11 @@ jobject target = GetTarget(env); if (IsUndecorated() == FALSE) { /* Get outer frame sizes. */ - LONG style = GetStyle(); - if (style & WS_THICKFRAME) { - m_insets.left = m_insets.right = - ::GetSystemMetrics(SM_CXSIZEFRAME); - m_insets.top = m_insets.bottom = - ::GetSystemMetrics(SM_CYSIZEFRAME); - } else { - m_insets.left = m_insets.right = - ::GetSystemMetrics(SM_CXDLGFRAME); - m_insets.top = m_insets.bottom = - ::GetSystemMetrics(SM_CYDLGFRAME); - } - - + // System metrics are same for resizable & non-resizable frame. + m_insets.left = m_insets.right = + ::GetSystemMetrics(SM_CXFRAME) + extraPaddedBorderInsets; + m_insets.top = m_insets.bottom = + ::GetSystemMetrics(SM_CYFRAME) + extraPaddedBorderInsets; /* Add in title. */ m_insets.top += ::GetSystemMetrics(SM_CYCAPTION); } @@ -1437,7 +1430,7 @@ /* fix for 4418125: Undecorated frames are off by one */ /* undo the -1 set above */ /* Additional fix for 5059656 */ - /* Also, 5089312: Window insets should be 0. */ + /* Also, 5089312: Window insets should be 0. */ ::memset(&m_insets, 0, sizeof(m_insets)); } @@ -1450,7 +1443,6 @@ env->DeleteLocalRef(target); return FALSE; } - m_insets.bottom += extraBottomInsets; env->DeleteLocalRef(target); } diff -Nru openjdk-17-17.0.9+9/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.cpp openjdk-17-17.0.10+7/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.cpp --- openjdk-17-17.0.9+9/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.desktop/windows/native/libjsound/PLATFORM_API_WinOS_Charset_Util.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -35,16 +35,25 @@ { DWORD dwUTF8Len = WideCharToMultiByte(CP_UTF8, 0, lpUnicodeStr, -1, nullptr, 0, nullptr, nullptr); LPSTR lpUTF8Str = new CHAR[dwUTF8Len]; + if (lpUTF8Str == NULL) return NULL; memset(lpUTF8Str, 0, sizeof(CHAR) * (dwUTF8Len)); - WideCharToMultiByte(CP_UTF8, 0, lpUnicodeStr, -1, lpUTF8Str, dwUTF8Len, nullptr, nullptr); - return lpUTF8Str; + int nb = WideCharToMultiByte(CP_UTF8, 0, lpUnicodeStr, -1, lpUTF8Str, dwUTF8Len, nullptr, nullptr); + if (nb > 0) { + return lpUTF8Str; + } + delete[] lpUTF8Str; + return NULL; } void UnicodeToUTF8AndCopy(LPSTR dest, LPCWSTR src, SIZE_T maxLength) { LPSTR utf8EncodedName = UnicodeToUTF8(src); - strncpy(dest, utf8EncodedName, maxLength - 1); - delete[] utf8EncodedName; - dest[maxLength - 1] = '\0'; + if (utf8EncodedName != NULL) { + strncpy(dest, utf8EncodedName, maxLength - 1); + delete[] utf8EncodedName; + dest[maxLength - 1] = '\0'; + } else { + if (maxLength > 0) dest[0] = '\0'; + } } #ifdef __cplusplus diff -Nru openjdk-17-17.0.9+9/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java openjdk-17-17.0.10+7/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java --- openjdk-17-17.0.9+9/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -280,79 +280,79 @@ private Socket createSocket(String host, int port, String socketFactory, int connectTimeout) throws Exception { - Socket socket = null; - - if (socketFactory != null) { - - // create the factory + SocketFactory factory = getSocketFactory(socketFactory); + assert factory != null; + Socket socket = createConnectionSocket(host, port, factory, connectTimeout); + + // the handshake for SSL connection with server and reset timeout for the socket + if (socket instanceof SSLSocket sslSocket) { + try { + initialSSLHandshake(sslSocket, connectTimeout); + } catch (Exception e) { + // 8314063 the socket is not closed after the failure of handshake + // close the socket while the error happened + closeOpenedSocket(socket); + throw e; + } + } + return socket; + } + private SocketFactory getSocketFactory(String socketFactoryName) throws Exception { + if (socketFactoryName == null) { + if (debug) { + System.err.println("Connection: using default SocketFactory"); + } + return SocketFactory.getDefault(); + } else { + if (debug) { + System.err.println("Connection: loading supplied SocketFactory: " + socketFactoryName); + } @SuppressWarnings("unchecked") Class socketFactoryClass = - (Class)Obj.helper.loadClass(socketFactory); + (Class) Obj.helper.loadClass(socketFactoryName); Method getDefault = - socketFactoryClass.getMethod("getDefault", new Class[]{}); + socketFactoryClass.getMethod("getDefault"); SocketFactory factory = (SocketFactory) getDefault.invoke(null, new Object[]{}); + return factory; + } + } - // create the socket - - if (connectTimeout > 0) { - - InetSocketAddress endpoint = - createInetSocketAddress(host, port); - - // unconnected socket - socket = factory.createSocket(); - - if (debug) { - System.err.println("Connection: creating socket with " + - "a timeout using supplied socket factory"); - } - - // connected socket - socket.connect(endpoint, connectTimeout); - } - - // continue (but ignore connectTimeout) - if (socket == null) { - if (debug) { - System.err.println("Connection: creating socket using " + - "supplied socket factory"); - } - // connected socket - socket = factory.createSocket(host, port); - } - } else { - - if (connectTimeout > 0) { - - InetSocketAddress endpoint = createInetSocketAddress(host, port); - - socket = new Socket(); + private Socket createConnectionSocket(String host, int port, SocketFactory factory, + int connectTimeout) throws Exception { + Socket socket = null; - if (debug) { - System.err.println("Connection: creating socket with " + - "a timeout"); - } - socket.connect(endpoint, connectTimeout); + if (connectTimeout > 0) { + // create unconnected socket and then connect it if timeout + // is supplied + InetSocketAddress endpoint = + createInetSocketAddress(host, port); + // unconnected socket + socket = factory.createSocket(); + // connect socket with a timeout + socket.connect(endpoint, connectTimeout); + if (debug) { + System.err.println("Connection: creating socket with " + + "a connect timeout"); } - - // continue (but ignore connectTimeout) - - if (socket == null) { - if (debug) { - System.err.println("Connection: creating socket"); - } - // connected socket - socket = new Socket(host, port); + } + if (socket == null) { + // create connected socket + socket = factory.createSocket(host, port); + if (debug) { + System.err.println("Connection: creating connected socket with" + + " no connect timeout"); } } + return socket; + } + + // For LDAP connect timeouts on LDAP over SSL connections must treat + // the SSL handshake following socket connection as part of the timeout. + // So explicitly set a socket read timeout, trigger the SSL handshake, + // then reset the timeout. + private void initialSSLHandshake(SSLSocket sslSocket , int connectTimeout) throws Exception { - // For LDAP connect timeouts on LDAP over SSL connections must treat - // the SSL handshake following socket connection as part of the timeout. - // So explicitly set a socket read timeout, trigger the SSL handshake, - // then reset the timeout. - if (socket instanceof SSLSocket) { - SSLSocket sslSocket = (SSLSocket) socket; if (!IS_HOSTNAME_VERIFICATION_DISABLED) { SSLParameters param = sslSocket.getSSLParameters(); param.setEndpointIdentificationAlgorithm("LDAPS"); @@ -365,8 +365,6 @@ sslSocket.startHandshake(); sslSocket.setSoTimeout(socketTimeout); } - } - return socket; } //////////////////////////////////////////////////////////////////////////// @@ -639,14 +637,12 @@ ldapUnbind(reqCtls); } } finally { - try { - outStream.flush(); - sock.close(); - unpauseReader(); - } catch (IOException ie) { - if (debug) - System.err.println("Connection: problem closing socket: " + ie); - } + + flushAndCloseOutputStream(); + // 8313657 socket is not closed until GC is run + closeOpenedSocket(sock); + tryUnpauseReader(); + if (!notifyParent) { LdapRequest ldr = pendingRequests; while (ldr != null) { @@ -680,6 +676,44 @@ } } + // flush and close output stream + private void flushAndCloseOutputStream() { + try { + outStream.flush(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.flushOutputStream: OutputStream flush problem " + ioEx); + } + try { + outStream.close(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.closeOutputStream: OutputStream close problem " + ioEx); + } + } + + // close socket + private void closeOpenedSocket(Socket socket) { + try { + if (socket != null && !socket.isClosed()) + socket.close(); + } catch (IOException ioEx) { + if (debug) { + System.err.println("Connection.closeConnectionSocket: Socket close problem: " + ioEx); + System.err.println("Socket isClosed: " + sock.isClosed()); + } + } + } + + // unpause reader + private void tryUnpauseReader() { + try { + unpauseReader(); + } catch (IOException ioEx) { + if (debug) + System.err.println("Connection.tryUnpauseReader: unpauseReader problem " + ioEx); + } + } // Assume everything is "quiet" // "synchronize" might lead to deadlock so don't synchronize method diff -Nru openjdk-17-17.0.9+9/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java openjdk-17-17.0.10+7/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java --- openjdk-17-17.0.9+9/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.naming/share/classes/sun/security/provider/certpath/ldap/LDAPCertStoreImpl.java 2024-01-09 21:18:15.000000000 +0000 @@ -779,9 +779,13 @@ } catch (IllegalArgumentException e) { continue; } - } else { + } else if (nameObject instanceof String) { issuerName = (String)nameObject; + } else { + throw new CertStoreException( + "unrecognized issuerName: must be String or byte[]"); } + // If all we want is CA certs, try to get the (probably shorter) ARL Collection entryCRLs = Collections.emptySet(); if (certChecking == null || certChecking.getBasicConstraints() != -1) { diff -Nru openjdk-17-17.0.9+9/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java openjdk-17-17.0.10+7/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java --- openjdk-17-17.0.9+9/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 2024-01-09 21:18:15.000000000 +0000 @@ -468,10 +468,11 @@ CompletableFuture cf = new MinimalFuture<>(); SSLEngine engine = aconn.getEngine(); String engineAlpn = engine.getApplicationProtocol(); - assert Objects.equals(alpn, engineAlpn) - : "alpn: %s, engine: %s".formatted(alpn, engineAlpn); - - DEBUG_LOGGER.log("checkSSLConfig: alpn: %s", alpn ); + DEBUG_LOGGER.log("checkSSLConfig: alpn: '%s', engine: '%s'", alpn, engineAlpn); + if (alpn == null && engineAlpn != null) { + alpn = engineAlpn; + } + DEBUG_LOGGER.log("checkSSLConfig: alpn: '%s'", alpn ); if (alpn == null || !alpn.equals("h2")) { String msg; @@ -494,6 +495,8 @@ cf.completeExceptionally(new ALPNException(msg, aconn)); return cf; } + assert Objects.equals(alpn, engineAlpn) + : "alpn: %s, engine: %s".formatted(alpn, engineAlpn); cf.complete(null); return cf; }; diff -Nru openjdk-17-17.0.9+9/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c openjdk-17-17.0.10+7/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c --- openjdk-17-17.0.9+9/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.prefs/unix/native/libprefs/FileSystemPreferences.c 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -71,7 +71,7 @@ jclass thisclass, jstring java_fname, jint permission, jboolean shared) { const char *fname = JNU_GetStringPlatformChars(env, java_fname, NULL); int fd, rc; - int result[2]; + int result[2] = {0, 0}; jintArray javaResult = NULL; int old_umask; FLOCK fl; @@ -90,6 +90,7 @@ if (shared == JNI_TRUE) { fd = open(fname, O_RDONLY, 0); + result[1] = errno; } else { old_umask = umask(0); fd = open(fname, O_WRONLY|O_CREAT, permission); diff -Nru openjdk-17-17.0.9+9/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java openjdk-17-17.0.10+7/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java --- openjdk-17-17.0.9+9/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMRSAPSSSignatureMethod.java 2024-01-09 21:18:15.000000000 +0000 @@ -318,7 +318,6 @@ throw new XMLSignatureException(e); } LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { diff -Nru openjdk-17-17.0.9+9/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java openjdk-17-17.0.10+7/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java --- openjdk-17-17.0.9+9/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/java.xml.crypto/share/classes/org/jcp/xml/dsig/internal/dom/DOMSignatureMethod.java 2024-01-09 21:18:15.000000000 +0000 @@ -334,7 +334,6 @@ } signature.initSign((PrivateKey)key); LOG.debug("Signature provider: {}", signature.getProvider()); - LOG.debug("Signing with key: {}", key); LOG.debug("JCA Algorithm: {}", getJCAAlgorithm()); try (SignerOutputStream outputStream = new SignerOutputStream(signature)) { diff -Nru openjdk-17-17.0.9+9/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java openjdk-17-17.0.10+7/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java --- openjdk-17-17.0.9+9/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/InferenceContext.java 2024-01-09 21:18:15.000000000 +0000 @@ -338,6 +338,17 @@ if (roots.length() == inferencevars.length()) { return this; } + /* if any of the inference vars is a captured variable bail out, this is because + * we could end up generating more than necessary captured variables in an outer + * inference context and then when we need to propagate back to an inner inference + * context that has been minimized it could be that some bounds constraints doesn't + * hold like subtyping constraints between bonds etc. + */ + for (Type iv : inferencevars) { + if (iv.hasTag(TypeTag.TYPEVAR) && ((TypeVar)iv).isCaptured()) { + return this; + } + } ReachabilityVisitor rv = new ReachabilityVisitor(); rv.scan(roots); if (rv.min.size() == inferencevars.length()) { diff -Nru openjdk-17-17.0.9+9/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java openjdk-17-17.0.10+7/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java --- openjdk-17-17.0.9+9/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java 2024-01-09 21:18:15.000000000 +0000 @@ -3007,7 +3007,8 @@ // is qualified, pass qualifier as first argument in front of // the explicit constructor arguments. If the call // is not qualified, pass the correct outer instance as - // first argument. + // first argument. If we are a static class, there is no + // such outer instance, so generate an error. if (c.hasOuterInstance()) { JCExpression thisArg; if (tree.meth.hasTag(SELECT)) { @@ -3018,6 +3019,11 @@ } else if (c.isDirectlyOrIndirectlyLocal() || methName == names._this){ // local class or this() call thisArg = makeThis(tree.meth.pos(), c.type.getEnclosingType().tsym); + } else if (currentClass.isStatic()) { + // super() call from static nested class - invalid + log.error(tree.pos(), + Errors.NoEnclInstanceOfTypeInScope(c.type.getEnclosingType().tsym)); + thisArg = make.Literal(BOT, null).setType(syms.botType); } else { // super() call of nested class - never pick 'this' thisArg = makeOwnerThisN(tree.meth.pos(), c, false); diff -Nru openjdk-17-17.0.9+9/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java openjdk-17-17.0.10+7/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java --- openjdk-17-17.0.9+9/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Key.java 2024-01-09 21:18:15.000000000 +0000 @@ -117,7 +117,7 @@ } P11Key(String type, Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { + int keyLength, CK_ATTRIBUTE[] attrs) { this.type = type; this.token = session.token; this.algorithm = algorithm; @@ -125,15 +125,15 @@ boolean tokenObject = false; boolean sensitive = false; boolean extractable = true; - int n = (attributes == null) ? 0 : attributes.length; - for (int i = 0; i < n; i++) { - CK_ATTRIBUTE attr = attributes[i]; - if (attr.type == CKA_TOKEN) { - tokenObject = attr.getBoolean(); - } else if (attr.type == CKA_SENSITIVE) { - sensitive = attr.getBoolean(); - } else if (attr.type == CKA_EXTRACTABLE) { - extractable = attr.getBoolean(); + if (attrs != null) { + for (CK_ATTRIBUTE attr : attrs) { + if (attr.type == CKA_TOKEN) { + tokenObject = attr.getBoolean(); + } else if (attr.type == CKA_SENSITIVE) { + sensitive = attr.getBoolean(); + } else if (attr.type == CKA_EXTRACTABLE) { + extractable = attr.getBoolean(); + } } } this.tokenObject = tokenObject; @@ -250,7 +250,7 @@ public String toString() { token.ensureValid(); String s1 = token.provider.getName() + " " + algorithm + " " + type - + " key, " + keyLength + " bits"; + + " key, " + keyLength + " bits "; s1 += (tokenObject ? "token" : "session") + " object"; if (isPublic()) { s1 += ")"; @@ -281,19 +281,31 @@ return type == SECRET; } - void fetchAttributes(CK_ATTRIBUTE[] attributes) { + CK_ATTRIBUTE[] fetchAttributes(CK_ATTRIBUTE[] attrs) { + Objects.requireNonNull(attrs, "attrs must be non-null"); Session tempSession = null; long keyID = this.getKeyID(); try { tempSession = token.getOpSession(); token.p11.C_GetAttributeValue(tempSession.id(), keyID, - attributes); + attrs); } catch (PKCS11Exception e) { throw new ProviderException(e); } finally { this.releaseKeyID(); token.releaseSession(tempSession); } + return attrs; + } + + // convenience method which returns the attribute values as BigInteger[] + BigInteger[] fetchAttributesAsInts(CK_ATTRIBUTE[] attrs) { + attrs = fetchAttributes(attrs); + BigInteger[] res = new BigInteger[attrs.length]; + for (int i = 0; i < attrs.length; i++) { + res[i] = attrs[i].getBigInteger(); + } + return res; } private static final CK_ATTRIBUTE[] A0 = new CK_ATTRIBUTE[0]; @@ -332,44 +344,43 @@ } static SecretKey secretKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - attributes = getAttributes(session, keyID, attributes, new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_TOKEN), - new CK_ATTRIBUTE(CKA_SENSITIVE), - new CK_ATTRIBUTE(CKA_EXTRACTABLE), + int keyLength, CK_ATTRIBUTE[] attrs) { + attrs = getAttributes(session, keyID, attrs, new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_TOKEN), + new CK_ATTRIBUTE(CKA_SENSITIVE), + new CK_ATTRIBUTE(CKA_EXTRACTABLE), }); - return new P11SecretKey(session, keyID, algorithm, keyLength, - attributes); + return new P11SecretKey(session, keyID, algorithm, keyLength, attrs); } - static SecretKey masterSecretKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes, int major, int minor) { - attributes = getAttributes(session, keyID, attributes, new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_TOKEN), - new CK_ATTRIBUTE(CKA_SENSITIVE), - new CK_ATTRIBUTE(CKA_EXTRACTABLE), + static SecretKey masterSecretKey(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs, + int major, int minor) { + attrs = getAttributes(session, keyID, attrs, new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_TOKEN), + new CK_ATTRIBUTE(CKA_SENSITIVE), + new CK_ATTRIBUTE(CKA_EXTRACTABLE), }); - return new P11TlsMasterSecretKey( - session, keyID, algorithm, keyLength, attributes, major, - minor); + return new P11TlsMasterSecretKey(session, keyID, algorithm, keyLength, + attrs, major, minor); } // we assume that all components of public keys are always accessible static PublicKey publicKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { + int keyLength, CK_ATTRIBUTE[] attrs) { switch (algorithm) { case "RSA": return new P11RSAPublicKey(session, keyID, algorithm, - keyLength, attributes); + keyLength, attrs); case "DSA": return new P11DSAPublicKey(session, keyID, algorithm, - keyLength, attributes); + keyLength, attrs); case "DH": return new P11DHPublicKey(session, keyID, algorithm, - keyLength, attributes); + keyLength, attrs); case "EC": return new P11ECPublicKey(session, keyID, algorithm, - keyLength, attributes); + keyLength, attrs); default: throw new ProviderException ("Unknown public key algorithm " + algorithm); @@ -377,73 +388,45 @@ } static PrivateKey privateKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - attributes = getAttributes(session, keyID, attributes, new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_TOKEN), - new CK_ATTRIBUTE(CKA_SENSITIVE), - new CK_ATTRIBUTE(CKA_EXTRACTABLE), + int keyLength, CK_ATTRIBUTE[] attrs) { + attrs = getAttributes(session, keyID, attrs, new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_TOKEN), + new CK_ATTRIBUTE(CKA_SENSITIVE), + new CK_ATTRIBUTE(CKA_EXTRACTABLE), }); - if (attributes[1].getBoolean() || (attributes[2].getBoolean() == false)) { - return new P11PrivateKey - (session, keyID, algorithm, keyLength, attributes); - } else { - switch (algorithm) { - case "RSA": - // In order to decide if this is RSA CRT key, we first query - // and see if all extra CRT attributes are available. - CK_ATTRIBUTE[] attrs2 = new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT), - new CK_ATTRIBUTE(CKA_PRIME_1), - new CK_ATTRIBUTE(CKA_PRIME_2), - new CK_ATTRIBUTE(CKA_EXPONENT_1), - new CK_ATTRIBUTE(CKA_EXPONENT_2), - new CK_ATTRIBUTE(CKA_COEFFICIENT), - }; - boolean crtKey; - try { - session.token.p11.C_GetAttributeValue - (session.id(), keyID, attrs2); - crtKey = ((attrs2[0].pValue instanceof byte[]) && - (attrs2[1].pValue instanceof byte[]) && - (attrs2[2].pValue instanceof byte[]) && - (attrs2[3].pValue instanceof byte[]) && - (attrs2[4].pValue instanceof byte[]) && - (attrs2[5].pValue instanceof byte[])) ; - } catch (PKCS11Exception e) { - // ignore, assume not available - crtKey = false; - } - if (crtKey) { - return new P11RSAPrivateKey(session, keyID, algorithm, - keyLength, attributes, attrs2); - } else { - return new P11RSAPrivateNonCRTKey(session, keyID, - algorithm, keyLength, attributes); - } - case "DSA": - return new P11DSAPrivateKey(session, keyID, algorithm, - keyLength, attributes); - case "DH": - return new P11DHPrivateKey(session, keyID, algorithm, - keyLength, attributes); - case "EC": - return new P11ECPrivateKey(session, keyID, algorithm, - keyLength, attributes); - default: - throw new ProviderException - ("Unknown private key algorithm " + algorithm); - } + + boolean keySensitive = (attrs[0].getBoolean() || + attrs[1].getBoolean() || !attrs[2].getBoolean()); + + switch (algorithm) { + case "RSA": + return P11RSAPrivateKeyInternal.of(session, keyID, algorithm, + keyLength, attrs, keySensitive); + case "DSA": + return P11DSAPrivateKeyInternal.of(session, keyID, algorithm, + keyLength, attrs, keySensitive); + case "DH": + return P11DHPrivateKeyInternal.of(session, keyID, algorithm, + keyLength, attrs, keySensitive); + case "EC": + return P11ECPrivateKeyInternal.of(session, keyID, algorithm, + keyLength, attrs, keySensitive); + default: + throw new ProviderException + ("Unknown private key algorithm " + algorithm); } } - // class for sensitive and unextractable private keys - private static final class P11PrivateKey extends P11Key - implements PrivateKey { + // base class for all PKCS11 private keys + private static abstract class P11PrivateKey extends P11Key implements + PrivateKey { private static final long serialVersionUID = -2138581185214187615L; + protected byte[] encoded; // guard by synchronized + P11PrivateKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PRIVATE, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(PRIVATE, session, keyID, algorithm, keyLength, attrs); } // XXX temporary encoding for serialization purposes public String getFormat() { @@ -458,11 +441,14 @@ private static class P11SecretKey extends P11Key implements SecretKey { private static final long serialVersionUID = -7828241727014329084L; - private volatile byte[] encoded; + + private volatile byte[] encoded; // guard by double-checked locking + P11SecretKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(SECRET, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(SECRET, session, keyID, algorithm, keyLength, attrs); } + public String getFormat() { token.ensureValid(); if (sensitive || !extractable || (isNSS && tokenObject)) { @@ -471,32 +457,21 @@ return "RAW"; } } + byte[] getEncodedInternal() { token.ensureValid(); if (getFormat() == null) { return null; } + byte[] b = encoded; if (b == null) { synchronized (this) { b = encoded; if (b == null) { - Session tempSession = null; - long keyID = this.getKeyID(); - try { - tempSession = token.getOpSession(); - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { + b = fetchAttributes(new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_VALUE), - }; - token.p11.C_GetAttributeValue - (tempSession.id(), keyID, attributes); - b = attributes[0].getByteArray(); - } catch (PKCS11Exception e) { - throw new ProviderException(e); - } finally { - this.releaseKeyID(); - token.releaseSession(tempSession); - } + })[0].getByteArray(); encoded = b; } } @@ -505,6 +480,19 @@ } } + // base class for all PKCS11 public keys + private static abstract class P11PublicKey extends P11Key implements + PublicKey { + private static final long serialVersionUID = 1L; + + protected byte[] encoded; // guard by synchronized + + P11PublicKey(Session session, long keyID, String algorithm, + int keyLength, CK_ATTRIBUTE[] attrs) { + super(PUBLIC, session, keyID, algorithm, keyLength, attrs); + } + } + @SuppressWarnings("deprecation") private static class P11TlsMasterSecretKey extends P11SecretKey implements TlsMasterSecret { @@ -512,8 +500,8 @@ private final int majorVersion, minorVersion; P11TlsMasterSecretKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes, int major, int minor) { - super(session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs, int major, int minor) { + super(session, keyID, algorithm, keyLength, attrs); this.majorVersion = major; this.minorVersion = minor; } @@ -526,17 +514,92 @@ } } + // impl class for sensitive/unextractable RSA private keys + static class P11RSAPrivateKeyInternal extends P11PrivateKey { + private static final long serialVersionUID = -2138581185214187615L; + + static P11RSAPrivateKeyInternal of(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs, + boolean keySensitive) { + if (keySensitive) { + return new P11RSAPrivateKeyInternal(session, keyID, algorithm, + keyLength, attrs); + } else { + CK_ATTRIBUTE[] rsaAttrs = new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_MODULUS), + new CK_ATTRIBUTE(CKA_PRIVATE_EXPONENT), + new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT), + new CK_ATTRIBUTE(CKA_PRIME_1), + new CK_ATTRIBUTE(CKA_PRIME_2), + new CK_ATTRIBUTE(CKA_EXPONENT_1), + new CK_ATTRIBUTE(CKA_EXPONENT_2), + new CK_ATTRIBUTE(CKA_COEFFICIENT), + }; + boolean isCRT = true; + Session tempSession = null; + try { + tempSession = session.token.getOpSession(); + session.token.p11.C_GetAttributeValue(tempSession.id(), + keyID, rsaAttrs); + for (CK_ATTRIBUTE attr : rsaAttrs) { + isCRT &= (attr.pValue instanceof byte[]); + if (!isCRT) break; + } + } catch (PKCS11Exception e) { + // ignore, assume not available + isCRT = false; + } finally { + session.token.releaseSession(tempSession); + } + BigInteger n = rsaAttrs[0].getBigInteger(); + BigInteger d = rsaAttrs[1].getBigInteger(); + if (isCRT) { + return new P11RSAPrivateKey(session, keyID, algorithm, + keyLength, attrs, n, d, + Arrays.copyOfRange(rsaAttrs, 2, rsaAttrs.length)); + } else { + return new P11RSAPrivateNonCRTKey(session, keyID, + algorithm, keyLength, attrs, n, d); + } + } + } + + protected transient BigInteger n; + + private P11RSAPrivateKeyInternal(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); + } + + private synchronized void fetchValues() { + token.ensureValid(); + if (n != null) return; + + n = fetchAttributesAsInts(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_MODULUS) + })[0]; + } + + public BigInteger getModulus() { + fetchValues(); + return n; + } + } + // RSA CRT private key - private static final class P11RSAPrivateKey extends P11Key - implements RSAPrivateCrtKey { + private static final class P11RSAPrivateKey extends P11RSAPrivateKeyInternal + implements RSAPrivateCrtKey { private static final long serialVersionUID = 9215872438913515220L; - private BigInteger n, e, d, p, q, pe, qe, coeff; - private byte[] encoded; - P11RSAPrivateKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attrs, CK_ATTRIBUTE[] crtAttrs) { - super(PRIVATE, session, keyID, algorithm, keyLength, attrs); + private transient BigInteger e, d, p, q, pe, qe, coeff; + + private P11RSAPrivateKey(Session session, long keyID, String algorithm, + int keyLength, CK_ATTRIBUTE[] attrs, BigInteger n, BigInteger d, + CK_ATTRIBUTE[] crtAttrs) { + super(session, keyID, algorithm, keyLength, attrs); + this.n = n; + this.d = d; for (CK_ATTRIBUTE a : crtAttrs) { if (a.type == CKA_PUBLIC_EXPONENT) { e = a.getBigInteger(); @@ -553,28 +616,15 @@ } } } - private synchronized void fetchValues() { - token.ensureValid(); - if (n != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_MODULUS), - new CK_ATTRIBUTE(CKA_PRIVATE_EXPONENT), - }; - fetchAttributes(attributes); - n = attributes[0].getBigInteger(); - d = attributes[1].getBigInteger(); - } public String getFormat() { token.ensureValid(); return "PKCS#8"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { - fetchValues(); try { Key newKey = RSAPrivateCrtKeyImpl.newKey (KeyType.RSA, null, n, e, d, p, q, pe, qe, coeff); @@ -585,15 +635,15 @@ } return encoded; } + + @Override public BigInteger getModulus() { - fetchValues(); return n; } public BigInteger getPublicExponent() { return e; } public BigInteger getPrivateExponent() { - fetchValues(); return d; } public BigInteger getPrimeP() { @@ -614,37 +664,28 @@ } // RSA non-CRT private key - private static final class P11RSAPrivateNonCRTKey extends P11Key - implements RSAPrivateKey { + private static final class P11RSAPrivateNonCRTKey extends + P11RSAPrivateKeyInternal implements RSAPrivateKey { private static final long serialVersionUID = 1137764983777411481L; - private BigInteger n, d; - private byte[] encoded; + private transient BigInteger d; + P11RSAPrivateNonCRTKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PRIVATE, session, keyID, algorithm, keyLength, attributes); - } - private synchronized void fetchValues() { - token.ensureValid(); - if (n != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_MODULUS), - new CK_ATTRIBUTE(CKA_PRIVATE_EXPONENT), - }; - fetchAttributes(attributes); - n = attributes[0].getBigInteger(); - d = attributes[1].getBigInteger(); + int keyLength, CK_ATTRIBUTE[] attrs, BigInteger n, + BigInteger d) { + super(session, keyID, algorithm, keyLength, attrs); + this.n = n; + this.d = d; } + public String getFormat() { token.ensureValid(); return "PKCS#8"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { - fetchValues(); try { // XXX make constructor in SunRsaSign provider public // and call it directly @@ -658,42 +699,43 @@ } return encoded; } + + @Override public BigInteger getModulus() { - fetchValues(); return n; } public BigInteger getPrivateExponent() { - fetchValues(); return d; } } - private static final class P11RSAPublicKey extends P11Key + private static final class P11RSAPublicKey extends P11PublicKey implements RSAPublicKey { private static final long serialVersionUID = -826726289023854455L; - private BigInteger n, e; - private byte[] encoded; + private transient BigInteger n, e; + P11RSAPublicKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PUBLIC, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (n != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { + if (n != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_MODULUS), - new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT), - }; - fetchAttributes(attributes); - n = attributes[0].getBigInteger(); - e = attributes[1].getBigInteger(); + new CK_ATTRIBUTE(CKA_PUBLIC_EXPONENT) + }); + n = res[0]; + e = res[1]; } + public String getFormat() { token.ensureValid(); return "X.509"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { @@ -707,6 +749,7 @@ } return encoded; } + public BigInteger getModulus() { fetchValues(); return n; @@ -722,40 +765,37 @@ } } - private static final class P11DSAPublicKey extends P11Key + private static final class P11DSAPublicKey extends P11PublicKey implements DSAPublicKey { private static final long serialVersionUID = 5989753793316396637L; - private BigInteger y; - private DSAParams params; - private byte[] encoded; + private transient BigInteger y; + private transient DSAParams params; + P11DSAPublicKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PUBLIC, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (y != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { + if (y != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_VALUE), new CK_ATTRIBUTE(CKA_PRIME), new CK_ATTRIBUTE(CKA_SUBPRIME), - new CK_ATTRIBUTE(CKA_BASE), - }; - fetchAttributes(attributes); - y = attributes[0].getBigInteger(); - params = new DSAParameterSpec( - attributes[1].getBigInteger(), - attributes[2].getBigInteger(), - attributes[3].getBigInteger() - ); + new CK_ATTRIBUTE(CKA_BASE) + }); + y = res[0]; + params = new DSAParameterSpec(res[1], res[2], res[3]); } + public String getFormat() { token.ensureValid(); return "X.509"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { @@ -785,40 +825,76 @@ } } - private static final class P11DSAPrivateKey extends P11Key - implements DSAPrivateKey { + static class P11DSAPrivateKeyInternal extends P11PrivateKey { private static final long serialVersionUID = 3119629997181999389L; - private BigInteger x; - private DSAParams params; - private byte[] encoded; + protected transient DSAParams params; + + static P11DSAPrivateKeyInternal of(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs, + boolean keySensitive) { + if (keySensitive) { + return new P11DSAPrivateKeyInternal(session, keyID, algorithm, + keyLength, attrs); + } else { + return new P11DSAPrivateKey(session, keyID, algorithm, + keyLength, attrs); + } + } + + private P11DSAPrivateKeyInternal(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); + } + + private synchronized void fetchValues() { + token.ensureValid(); + if (params != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_PRIME), + new CK_ATTRIBUTE(CKA_SUBPRIME), + new CK_ATTRIBUTE(CKA_BASE), + }); + params = new DSAParameterSpec(res[0], res[1], res[2]); + } + + protected DSAParams getParams() { + fetchValues(); + return params; + } + } + + private static final class P11DSAPrivateKey extends P11DSAPrivateKeyInternal + implements DSAPrivateKey { + private static final long serialVersionUID = 3119629997181999389L; + + private transient BigInteger x; // params inside P11DSAPrivateKeyInternal + P11DSAPrivateKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PRIVATE, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (x != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_VALUE), - new CK_ATTRIBUTE(CKA_PRIME), - new CK_ATTRIBUTE(CKA_SUBPRIME), - new CK_ATTRIBUTE(CKA_BASE), - }; - fetchAttributes(attributes); - x = attributes[0].getBigInteger(); - params = new DSAParameterSpec( - attributes[1].getBigInteger(), - attributes[2].getBigInteger(), - attributes[3].getBigInteger() - ); + if (x != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_VALUE), + new CK_ATTRIBUTE(CKA_PRIME), + new CK_ATTRIBUTE(CKA_SUBPRIME), + new CK_ATTRIBUTE(CKA_BASE), + }); + x = res[0]; + params = new DSAParameterSpec(res[1], res[2], res[3]); } + public String getFormat() { token.ensureValid(); return "PKCS#8"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { @@ -829,48 +905,87 @@ } return encoded; } + public BigInteger getX() { fetchValues(); return x; } + + @Override public DSAParams getParams() { fetchValues(); return params; } } - private static final class P11DHPrivateKey extends P11Key + static class P11DHPrivateKeyInternal extends P11PrivateKey { + private static final long serialVersionUID = 1L; + + protected transient DHParameterSpec params; + + static P11DHPrivateKeyInternal of(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs, + boolean keySensitive) { + if (keySensitive) { + return new P11DHPrivateKeyInternal(session, keyID, algorithm, + keyLength, attrs); + } else { + return new P11DHPrivateKey(session, keyID, algorithm, + keyLength, attrs); + } + } + + private P11DHPrivateKeyInternal(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); + } + + private synchronized void fetchValues() { + token.ensureValid(); + if (params != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_PRIME), + new CK_ATTRIBUTE(CKA_BASE), + }); + params = new DHParameterSpec(res[0], res[1]); + } + + public DHParameterSpec getParams() { + fetchValues(); + return params; + } + } + + private static final class P11DHPrivateKey extends P11DHPrivateKeyInternal implements DHPrivateKey { private static final long serialVersionUID = -1698576167364928838L; - private BigInteger x; - private DHParameterSpec params; - private byte[] encoded; + private transient BigInteger x; // params in P11DHPrivateKeyInternal + P11DHPrivateKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PRIVATE, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (x != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_VALUE), - new CK_ATTRIBUTE(CKA_PRIME), - new CK_ATTRIBUTE(CKA_BASE), - }; - fetchAttributes(attributes); - x = attributes[0].getBigInteger(); - params = new DHParameterSpec( - attributes[1].getBigInteger(), - attributes[2].getBigInteger() - ); + if (x != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_VALUE), + new CK_ATTRIBUTE(CKA_PRIME), + new CK_ATTRIBUTE(CKA_BASE), + }); + x = res[0]; + params = new DHParameterSpec(res[1], res[2]); } + public String getFormat() { token.ensureValid(); return "PKCS#8"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { @@ -897,10 +1012,10 @@ return params; } public int hashCode() { + fetchValues(); if (!token.isValid()) { return 0; } - fetchValues(); return Objects.hash(x, params.getP(), params.getG()); } public boolean equals(Object obj) { @@ -921,38 +1036,36 @@ } } - private static final class P11DHPublicKey extends P11Key + private static final class P11DHPublicKey extends P11PublicKey implements DHPublicKey { static final long serialVersionUID = -598383872153843657L; - private BigInteger y; - private DHParameterSpec params; - private byte[] encoded; + private transient BigInteger y; + private transient DHParameterSpec params; + P11DHPublicKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PUBLIC, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (y != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { - new CK_ATTRIBUTE(CKA_VALUE), - new CK_ATTRIBUTE(CKA_PRIME), - new CK_ATTRIBUTE(CKA_BASE), - }; - fetchAttributes(attributes); - y = attributes[0].getBigInteger(); - params = new DHParameterSpec( - attributes[1].getBigInteger(), - attributes[2].getBigInteger() - ); + if (y != null) return; + + BigInteger[] res = fetchAttributesAsInts(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_VALUE), + new CK_ATTRIBUTE(CKA_PRIME), + new CK_ATTRIBUTE(CKA_BASE), + }); + y = res[0]; + params = new DHParameterSpec(res[1], res[2]); } + public String getFormat() { token.ensureValid(); return "X.509"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { @@ -1008,44 +1121,88 @@ } } - private static final class P11ECPrivateKey extends P11Key + static class P11ECPrivateKeyInternal extends P11PrivateKey { + + private static final long serialVersionUID = 1L; + + protected transient ECParameterSpec params; + + static P11ECPrivateKeyInternal of(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs, + boolean keySensitive) { + if (keySensitive) { + return new P11ECPrivateKeyInternal(session, keyID, algorithm, + keyLength, attrs); + } else { + return new P11ECPrivateKey(session, keyID, algorithm, + keyLength, attrs); + } + } + + private P11ECPrivateKeyInternal(Session session, long keyID, + String algorithm, int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); + } + + private synchronized void fetchValues() { + token.ensureValid(); + if (params != null) return; + + try { + byte[] paramBytes = fetchAttributes(new CK_ATTRIBUTE[] { + new CK_ATTRIBUTE(CKA_EC_PARAMS) + })[0].getByteArray(); + + params = P11ECKeyFactory.decodeParameters(paramBytes); + } catch (Exception e) { + throw new RuntimeException("Could not parse key values", e); + } + } + + protected ECParameterSpec getParams() { + fetchValues(); + return params; + } + } + + private static final class P11ECPrivateKey extends P11ECPrivateKeyInternal implements ECPrivateKey { private static final long serialVersionUID = -7786054399510515515L; - private BigInteger s; - private ECParameterSpec params; - private byte[] encoded; + private transient BigInteger s; // params in P11ECPrivateKeyInternal + P11ECPrivateKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PRIVATE, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (s != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { + if (s != null) return; + + CK_ATTRIBUTE[] attrs = fetchAttributes(new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_VALUE), - new CK_ATTRIBUTE(CKA_EC_PARAMS, params), - }; - fetchAttributes(attributes); - s = attributes[0].getBigInteger(); + new CK_ATTRIBUTE(CKA_EC_PARAMS), + }); + + s = attrs[0].getBigInteger(); try { params = P11ECKeyFactory.decodeParameters - (attributes[1].getByteArray()); + (attrs[1].getByteArray()); } catch (Exception e) { throw new RuntimeException("Could not parse key values", e); } } + public String getFormat() { token.ensureValid(); return "PKCS#8"; } + synchronized byte[] getEncodedInternal() { - token.ensureValid(); if (encoded == null) { - fetchValues(); try { + fetchValues(); Key key = ECUtil.generateECPrivateKey(s, params); encoded = key.getEncoded(); } catch (InvalidKeySpecException e) { @@ -1054,42 +1211,43 @@ } return encoded; } + public BigInteger getS() { fetchValues(); return s; } + public ECParameterSpec getParams() { fetchValues(); return params; } } - private static final class P11ECPublicKey extends P11Key + private static final class P11ECPublicKey extends P11PublicKey implements ECPublicKey { private static final long serialVersionUID = -6371481375154806089L; - private ECPoint w; - private ECParameterSpec params; - private byte[] encoded; + private transient ECPoint w; + private transient ECParameterSpec params; + P11ECPublicKey(Session session, long keyID, String algorithm, - int keyLength, CK_ATTRIBUTE[] attributes) { - super(PUBLIC, session, keyID, algorithm, keyLength, attributes); + int keyLength, CK_ATTRIBUTE[] attrs) { + super(session, keyID, algorithm, keyLength, attrs); } + private synchronized void fetchValues() { token.ensureValid(); - if (w != null) { - return; - } - CK_ATTRIBUTE[] attributes = new CK_ATTRIBUTE[] { + if (w != null) return; + + CK_ATTRIBUTE[] attrs = fetchAttributes(new CK_ATTRIBUTE[] { new CK_ATTRIBUTE(CKA_EC_POINT), new CK_ATTRIBUTE(CKA_EC_PARAMS), - }; - fetchAttributes(attributes); + }); try { params = P11ECKeyFactory.decodeParameters - (attributes[1].getByteArray()); - byte[] ecKey = attributes[0].getByteArray(); + (attrs[1].getByteArray()); + byte[] ecKey = attrs[0].getByteArray(); // Check whether the X9.63 encoding of an EC point is wrapped // in an ASN.1 OCTET STRING @@ -1111,10 +1269,12 @@ throw new RuntimeException("Could not parse key values", e); } } + public String getFormat() { token.ensureValid(); return "X.509"; } + synchronized byte[] getEncodedInternal() { token.ensureValid(); if (encoded == null) { @@ -1413,3 +1573,4 @@ this.clear(); } } + diff -Nru openjdk-17-17.0.9+9/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java openjdk-17-17.0.10+7/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java --- openjdk-17-17.0.9+9/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -119,6 +119,9 @@ // key instance used, if init*() was called private P11Key p11Key; + // signature length expected or 0 for unknown + private int sigLen; + // message digest, if we do the digesting ourselves private final MessageDigest md; @@ -285,7 +288,7 @@ try { if (mode == M_SIGN) { if (type == T_UPDATE) { - token.p11.C_SignFinal(session.id(), 0); + token.p11.C_SignFinal(session.id(), sigLen); } else { byte[] digest; if (type == T_DIGEST) { @@ -296,12 +299,7 @@ token.p11.C_Sign(session.id(), digest); } } else { // M_VERIFY - byte[] signature; - if (mechanism == CKM_DSA) { - signature = new byte[64]; // assume N = 256 - } else { - signature = new byte[(p11Key.length() + 7) >> 3]; - } + byte[] signature = new byte[sigLen]; if (type == T_UPDATE) { token.p11.C_VerifyFinal(session.id(), signature); } else { @@ -373,6 +371,15 @@ md.reset(); } } + sigLen = 0; + if ("DSA".equals(p11Key.getAlgorithm())) { + if (p11Key instanceof P11Key.P11DSAPrivateKeyInternal) { + sigLen = ((P11Key.P11DSAPrivateKeyInternal)p11Key).getParams() + .getQ().bitLength() >> 2; + } else if (p11Key instanceof DSAKey) { + sigLen = ((DSAKey)p11Key).getParams().getQ().bitLength() >> 2; + } + } initialized = true; } @@ -618,7 +625,7 @@ try { byte[] signature; if (type == T_UPDATE) { - signature = token.p11.C_SignFinal(session.id(), 0); + signature = token.p11.C_SignFinal(session.id(), sigLen); } else { byte[] digest; if (type == T_DIGEST) { @@ -685,7 +692,7 @@ try { if (!p1363Format) { if (keyAlgorithm.equals("DSA")) { - signature = asn1ToDSA(signature); + signature = asn1ToDSA(signature, sigLen); } else if (keyAlgorithm.equals("EC")) { signature = asn1ToECDSA(signature); } @@ -752,9 +759,12 @@ int len = (p11Key.length() + 7) >> 3; RSAPadding padding = RSAPadding.getInstance (RSAPadding.PAD_BLOCKTYPE_1, len); - byte[] padded = padding.pad(data); - return padded; - } catch (GeneralSecurityException e) { + byte[] result = padding.pad(data); + if (result == null) { + throw new ProviderException("Error padding data"); + } + return result; + } catch (InvalidKeyException | InvalidAlgorithmParameterException e) { throw new ProviderException(e); } } @@ -809,7 +819,8 @@ } } - private static byte[] asn1ToDSA(byte[] sig) throws SignatureException { + private static byte[] asn1ToDSA(byte[] sig, int sigLen) + throws SignatureException { try { // Enforce strict DER checking for signatures DerInputStream in = new DerInputStream(sig, 0, sig.length, false); @@ -824,8 +835,8 @@ BigInteger r = values[0].getPositiveBigInteger(); BigInteger s = values[1].getPositiveBigInteger(); - byte[] br = toByteArray(r, 20); - byte[] bs = toByteArray(s, 20); + byte[] br = toByteArray(r, sigLen/2); + byte[] bs = toByteArray(s, sigLen/2); if ((br == null) || (bs == null)) { throw new SignatureException("Out of range value for R or S"); } @@ -837,7 +848,7 @@ } } - private byte[] asn1ToECDSA(byte[] sig) throws SignatureException { + private static byte[] asn1ToECDSA(byte[] sig) throws SignatureException { try { // Enforce strict DER checking for signatures DerInputStream in = new DerInputStream(sig, 0, sig.length, false); @@ -917,3 +928,4 @@ return null; } } + diff -Nru openjdk-17-17.0.9+9/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java openjdk-17-17.0.10+7/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java --- openjdk-17-17.0.9+9/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CRSACipher.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -30,6 +30,7 @@ import java.security.Key; import java.security.interfaces.*; import java.security.spec.*; +import java.util.Arrays; import javax.crypto.*; import javax.crypto.spec.*; @@ -61,6 +62,9 @@ */ public final class CRSACipher extends CipherSpi { + private static final int ERROR_INVALID_PARAMETER = 0x57; + private static final int NTE_INVALID_PARAMETER = 0x80090027; + // constant for an empty byte array private static final byte[] B0 = new byte[0]; @@ -101,6 +105,8 @@ // cipher parameter for TLS RSA premaster secret private AlgorithmParameterSpec spec = null; + private boolean forTlsPremasterSecret = false; + // the source of randomness private SecureRandom random; @@ -171,6 +177,9 @@ } spec = params; this.random = random; // for TLS RSA premaster secret + this.forTlsPremasterSecret = true; + } else { + this.forTlsPremasterSecret = false; } init(opmode, key); } @@ -278,8 +287,7 @@ } // internal doFinal() method. Here we perform the actual RSA operation - private byte[] doFinal() throws BadPaddingException, - IllegalBlockSizeException { + private byte[] doFinal() throws IllegalBlockSizeException { if (bufOfs > buffer.length) { throw new IllegalBlockSizeException("Data must not be longer " + "than " + (buffer.length - paddingLength) + " bytes"); @@ -308,7 +316,7 @@ throw new AssertionError("Internal error"); } - } catch (KeyException e) { + } catch (KeyException | BadPaddingException e) { throw new ProviderException(e); } finally { @@ -331,14 +339,14 @@ // see JCE spec protected byte[] engineDoFinal(byte[] in, int inOfs, int inLen) - throws BadPaddingException, IllegalBlockSizeException { + throws IllegalBlockSizeException { update(in, inOfs, inLen); return doFinal(); } // see JCE spec protected int engineDoFinal(byte[] in, int inOfs, int inLen, byte[] out, - int outOfs) throws ShortBufferException, BadPaddingException, + int outOfs) throws ShortBufferException, IllegalBlockSizeException { if (outputSize > out.length - outOfs) { throw new ShortBufferException @@ -354,6 +362,7 @@ // see JCE spec protected byte[] engineWrap(Key key) throws InvalidKeyException, IllegalBlockSizeException { + byte[] encoded = key.getEncoded(); // TODO - unextractable key if ((encoded == null) || (encoded.length == 0)) { throw new InvalidKeyException("Could not obtain encoded key"); @@ -362,12 +371,7 @@ throw new InvalidKeyException("Key is too long for wrapping"); } update(encoded, 0, encoded.length); - try { - return doFinal(); - } catch (BadPaddingException e) { - // should not occur - throw new InvalidKeyException("Wrapping failed", e); - } + return doFinal(); } // see JCE spec @@ -388,31 +392,31 @@ update(wrappedKey, 0, wrappedKey.length); try { encoded = doFinal(); - } catch (BadPaddingException e) { - if (isTlsRsaPremasterSecret) { - failover = e; - } else { - throw new InvalidKeyException("Unwrapping failed", e); - } } catch (IllegalBlockSizeException e) { // should not occur, handled with length check above throw new InvalidKeyException("Unwrapping failed", e); } - if (isTlsRsaPremasterSecret) { - if (!(spec instanceof TlsRsaPremasterSecretParameterSpec)) { - throw new IllegalStateException( - "No TlsRsaPremasterSecretParameterSpec specified"); + try { + if (isTlsRsaPremasterSecret) { + if (!forTlsPremasterSecret) { + throw new IllegalStateException( + "No TlsRsaPremasterSecretParameterSpec specified"); + } + + // polish the TLS premaster secret + encoded = KeyUtil.checkTlsPreMasterSecretKey( + ((TlsRsaPremasterSecretParameterSpec) spec).getClientVersion(), + ((TlsRsaPremasterSecretParameterSpec) spec).getServerVersion(), + random, encoded, encoded == null); } - // polish the TLS premaster secret - encoded = KeyUtil.checkTlsPreMasterSecretKey( - ((TlsRsaPremasterSecretParameterSpec)spec).getClientVersion(), - ((TlsRsaPremasterSecretParameterSpec)spec).getServerVersion(), - random, encoded, (failover != null)); + return constructKey(encoded, algorithm, type); + } finally { + if (encoded != null) { + Arrays.fill(encoded, (byte) 0); + } } - - return constructKey(encoded, algorithm, type); } // see JCE spec @@ -496,7 +500,23 @@ * Encrypt/decrypt a data buffer using Microsoft Crypto API with HCRYPTKEY. * It expects and returns ciphertext data in big-endian form. */ - private native static byte[] encryptDecrypt(byte[] data, int dataSize, - long hCryptKey, boolean doEncrypt) throws KeyException; + private byte[] encryptDecrypt(byte[] data, int dataSize, + long hCryptKey, boolean doEncrypt) throws KeyException, BadPaddingException { + int[] returnStatus = new int[1]; + byte[] result= encryptDecrypt(returnStatus, data, dataSize, hCryptKey, doEncrypt); + if ((returnStatus[0] == ERROR_INVALID_PARAMETER) || (returnStatus[0] == NTE_INVALID_PARAMETER)) { + if (forTlsPremasterSecret) { + result = null; + } else { + throw new BadPaddingException("Error " + returnStatus[0] + " returned by MSCAPI"); + } + } else if (returnStatus[0] != 0) { + throw new KeyException("Error " + returnStatus[0] + " returned by MSCAPI"); + } + + return result; + } + private static native byte[] encryptDecrypt(int[] returnStatus, byte[] data, int dataSize, + long key, boolean doEncrypt) throws KeyException; } diff -Nru openjdk-17-17.0.9+9/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp openjdk-17-17.0.10+7/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp --- openjdk-17-17.0.9+9/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -523,7 +523,11 @@ else { if (bCallerFreeProv == TRUE) { - ::CryptReleaseContext(hCryptProv, NULL); // deprecated + if ((dwKeySpec & CERT_NCRYPT_KEY_SPEC) == CERT_NCRYPT_KEY_SPEC) { + NCryptFreeObject(hCryptProv); + } else { + ::CryptReleaseContext(hCryptProv, NULL); // deprecated + } bCallerFreeProv = FALSE; } @@ -1885,18 +1889,25 @@ /* * Class: sun_security_mscapi_CRSACipher * Method: encryptDecrypt - * Signature: ([BIJZ)[B + * Signature: ([I[BIJZ)[B */ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CRSACipher_encryptDecrypt - (JNIEnv *env, jclass clazz, jbyteArray jData, jint jDataSize, jlong hKey, + (JNIEnv *env, jclass clazz, jintArray jResultStatus, jbyteArray jData, jint jDataSize, jlong hKey, jboolean doEncrypt) { jbyteArray result = NULL; jbyte* pData = NULL; + jbyte* resultData = NULL; DWORD dwDataLen = jDataSize; DWORD dwBufLen = env->GetArrayLength(jData); DWORD i; BYTE tmp; + BOOL success; + DWORD ss = ERROR_SUCCESS; + DWORD lastError = ERROR_SUCCESS; + DWORD resultLen = 0; + DWORD pmsLen = 48; + jbyte pmsArr[48] = {0}; __try { @@ -1923,6 +1934,8 @@ pData[i] = pData[dwBufLen - i -1]; pData[dwBufLen - i - 1] = tmp; } + resultData = pData; + resultLen = dwBufLen; } else { // convert to little-endian for (i = 0; i < dwBufLen / 2; i++) { @@ -1932,21 +1945,28 @@ } // decrypt - if (! ::CryptDecrypt((HCRYPTKEY) hKey, 0, TRUE, 0, (BYTE *)pData, //deprecated - &dwBufLen)) { - - ThrowException(env, KEY_EXCEPTION, GetLastError()); - __leave; + success = ::CryptDecrypt((HCRYPTKEY) hKey, 0, TRUE, 0, (BYTE *)pData, //deprecated + &dwBufLen); + lastError = GetLastError(); + if (success) { + ss = ERROR_SUCCESS; + resultData = pData; + resultLen = dwBufLen; + } else { + ss = lastError; + resultData = pmsArr; + resultLen = pmsLen; } + env->SetIntArrayRegion(jResultStatus, 0, 1, (jint*) &ss); } - // Create new byte array - if ((result = env->NewByteArray(dwBufLen)) == NULL) { + // Create new byte array + if ((result = env->NewByteArray(resultLen)) == NULL) { __leave; } // Copy data from native buffer to Java buffer - env->SetByteArrayRegion(result, 0, dwBufLen, (jbyte*) pData); + env->SetByteArrayRegion(result, 0, resultLen, (jbyte*) resultData); } __finally { diff -Nru openjdk-17-17.0.9+9/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java --- openjdk-17-17.0.9+9/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FileMapInfo.java 2024-01-09 21:18:15.000000000 +0000 @@ -83,6 +83,8 @@ } private static void initialize(TypeDataBase db) { + vTableTypeMap = null; // force vTableTypeMap to get re-initialized later + Type FileMapInfo_type = db.lookupType("FileMapInfo"); Type FileMapHeader_type = db.lookupType("FileMapHeader"); Type CDSFileMapRegion_type = db.lookupType("CDSFileMapRegion"); diff -Nru openjdk-17-17.0.9+9/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java --- openjdk-17-17.0.9+9/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2021, 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 @@ -146,7 +146,7 @@ Assert.that(0 <= i && i < regCount, "sanity check"); Assert.that(0 <= index && index < locationValidSize, "sanity check"); } - if ((locationValid[index] & (1 << i % locationValidTypeSize)) != 0) { + if ((locationValid[index] & (1L << i % locationValidTypeSize)) != 0) { return location[i]; } else { return getLocationPD(reg); @@ -162,7 +162,7 @@ Assert.that(updateMap, "updating map that does not need updating"); } location[i] = loc; - locationValid[index] |= (1 << (i % locationValidTypeSize)); + locationValid[index] |= (1L << (i % locationValidTypeSize)); } public boolean getIncludeArgumentOops() { diff -Nru openjdk-17-17.0.9+9/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java --- openjdk-17-17.0.9+9/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2019, Red Hat Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -70,7 +70,7 @@ // Native frames private static final int NATIVE_FRAME_INITIAL_PARAM_OFFSET = 2; - private static VMReg fp = new VMReg(29); + private static VMReg fp = new VMReg(29 << 1); static { VM.registerVMInitializedObserver(new Observer() { diff -Nru openjdk-17-17.0.9+9/src/jdk.internal.le/share/legal/jline.md openjdk-17-17.0.10+7/src/jdk.internal.le/share/legal/jline.md --- openjdk-17-17.0.9+9/src/jdk.internal.le/share/legal/jline.md 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.internal.le/share/legal/jline.md 2024-01-09 21:18:15.000000000 +0000 @@ -38,257 +38,4 @@ IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -4th Party Dependency -============= -org.fusesource.jansi version 2.4.0 -org.apache.sshd 2.9.2 -org.apache.felix.gogo.runtime 1.1.6 -org.apache.felix.gogo.jline 1.1.8 -============= -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -============= -juniversalchardet - -The library is subject to the Mozilla Public License Version 1.1. - -Alternatively, the library may be used under the terms of either the GNU General Public License Version 2 or later, or the GNU Lesser General Public License 2.1 or later. - -================ - -slf4j - -SLF4J source code and binaries are distributed under the MIT license. - - -Copyright (c) 2004-2023 QOS.ch -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -These terms are identical to those of the MIT License, also called the X License -or the X11 License, which is a simple, permissive non-copyleft free software license. -It is deemed compatible with virtually all types of licenses, commercial or otherwise. -In particular, the Free Software Foundation has declared it compatible with GNU GPL. -It is also known to be approved by the Apache Software Foundation as compatible with -Apache Software License. - diff -Nru openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/TargetDescription.java openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/TargetDescription.java --- openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/TargetDescription.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/code/TargetDescription.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.services.Services; /** * Represents the target machine for a compiler, including the CPU architecture, the size of @@ -32,6 +33,9 @@ */ public class TargetDescription { + public final boolean linuxOs = Services.getSavedProperty("os.name", "").startsWith("Linux"); + public final boolean macOs = Services.getSavedProperty("os.name", "").startsWith("Mac"); + public final Architecture arch; /** diff -Nru openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java --- openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java 2024-01-09 21:18:15.000000000 +0000 @@ -93,7 +93,7 @@ // ARMv8 defines r18 as being available to the platform ABI. Windows // and Darwin use it for such. Linux doesn't assign it and thus r18 can // be used as an additional register. - boolean canUsePlatformRegister = config.linuxOs; + boolean canUsePlatformRegister = target.linuxOs; return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops, canUsePlatformRegister); } diff -Nru openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java --- openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java 2024-01-09 21:18:15.000000000 +0000 @@ -228,6 +228,27 @@ } } + private int parseStackArg(ValueKind valueKind, AllocatableValue[] locations, int index, int currentStackOffset, HotSpotCallingConventionType type) { + int kindSize = valueKind.getPlatformKind().getSizeInBytes(); + locations[index] = StackSlot.get(valueKind, currentStackOffset, !type.out); + currentStackOffset += Math.max(kindSize, target.wordSize); + return currentStackOffset; + } + + private int parseDarwinNativeStackArg(ValueKind valueKind, AllocatableValue[] locations, int index, int currentStackOffset, HotSpotCallingConventionType type) { + int kindSize = valueKind.getPlatformKind().getSizeInBytes(); + if (currentStackOffset % kindSize != 0) { + // In MacOS natural alignment is used + // See https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms + currentStackOffset += kindSize - currentStackOffset % kindSize; + } + locations[index] = StackSlot.get(valueKind, currentStackOffset, !type.out); + // In MacOS "Function arguments may consume slots on the stack that are not multiples of 8 bytes" + // See https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms + currentStackOffset += kindSize; + return currentStackOffset; + } + private CallingConvention callingConvention(RegisterArray generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, HotSpotCallingConventionType type, ValueKindFactory valueKindFactory) { AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; @@ -264,9 +285,11 @@ } if (locations[i] == null) { - ValueKind valueKind = valueKindFactory.getValueKind(kind); - locations[i] = StackSlot.get(valueKind, currentStackOffset, !type.out); - currentStackOffset += Math.max(valueKind.getPlatformKind().getSizeInBytes(), target.wordSize); + if (target.macOs && type == HotSpotCallingConventionType.NativeCall) { + currentStackOffset = parseDarwinNativeStackArg(valueKindFactory.getValueKind(kind), locations, i, currentStackOffset, type); + } else { + currentStackOffset = parseStackArg(valueKindFactory.getValueKind(kind), locations, i, currentStackOffset, type); + } } } diff -Nru openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java --- openjdk-17-17.0.9+9/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,6 @@ import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; -import jdk.vm.ci.services.Services; /** * Used to access native configuration details. @@ -37,8 +36,6 @@ super(config); } - final boolean linuxOs = Services.getSavedProperty("os.name", "").startsWith("Linux"); - final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class); // CPU Capabilities diff -Nru openjdk-17-17.0.9+9/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c openjdk-17-17.0.10+7/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c --- openjdk-17-17.0.9+9/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c 2024-01-09 21:18:15.000000000 +0000 @@ -102,7 +102,7 @@ static void JNICALL cbEarlyException(jvmtiEnv*, JNIEnv *, jthread, jmethodID, jlocation, jobject, jmethodID, jlocation); -static void initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei); +static void initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei, EventInfo *opt_info); static jboolean parseOptions(char *str); /* @@ -438,7 +438,7 @@ EXIT_ERROR(AGENT_ERROR_INTERNAL,"VM dead at VM_INIT time"); } if (initOnStartup) - initialize(env, thread, EI_VM_INIT); + initialize(env, thread, EI_VM_INIT, NULL); vmInitialized = JNI_TRUE; LOG_MISC(("END cbEarlyVMInit")); } @@ -491,6 +491,16 @@ LOG_MISC(("VM is not initialized yet")); return; } + EventInfo info; + info.ei = EI_EXCEPTION; + info.thread = thread; + info.clazz = getMethodClass(jvmti_env, method); + info.method = method; + info.location = location; + info.object = exception; + info.u.exception.catch_clazz = getMethodClass(jvmti_env, catch_method); + info.u.exception.catch_method = catch_method; + info.u.exception.catch_location = catch_location; /* * We want to preserve any current exception that might get wiped @@ -505,24 +515,22 @@ if (initOnUncaught && catch_method == NULL) { LOG_MISC(("Initializing on uncaught exception")); - initialize(env, thread, EI_EXCEPTION); + initialize(env, thread, EI_EXCEPTION, &info); } else if (initOnException != NULL) { - jclass clazz; - - /* Get class of exception thrown */ - clazz = JNI_FUNC_PTR(env,GetObjectClass)(env, exception); - if ( clazz != NULL ) { + jclass exception_clazz = JNI_FUNC_PTR(env, GetObjectClass)(env, exception); + /* check class of exception thrown */ + if ( exception_clazz != NULL ) { char *signature = NULL; /* initing on throw, check */ - error = classSignature(clazz, &signature, NULL); + error = classSignature(exception_clazz, &signature, NULL); LOG_MISC(("Checking specific exception: looking for %s, got %s", initOnException, signature)); if ( (error==JVMTI_ERROR_NONE) && (strcmp(signature, initOnException) == 0)) { LOG_MISC(("Initializing on specific exception")); - initialize(env, thread, EI_EXCEPTION); + initialize(env, thread, EI_EXCEPTION, &info); } else { error = AGENT_ERROR_INTERNAL; /* Just to cause restore */ } @@ -663,9 +671,11 @@ /* * Initialize debugger back end modules + * + * @param opt_info optional event info to use, might be null */ static void -initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei) +initialize(JNIEnv *env, jthread thread, EventIndex triggering_ei, EventInfo *opt_info) { jvmtiError error; EnumerateArg arg; @@ -753,13 +763,13 @@ * can get in the queue (from other not-yet-suspended threads) * before this one does. (Also need to handle allocation error below?) */ - EventInfo info; struct bag *initEventBag; - LOG_MISC(("triggering_ei != EI_VM_INIT")); + LOG_MISC(("triggering_ei == EI_EXCEPTION")); + JDI_ASSERT(triggering_ei == EI_EXCEPTION); + JDI_ASSERT(opt_info != NULL); initEventBag = eventHelper_createEventBag(); - (void)memset(&info,0,sizeof(info)); - info.ei = triggering_ei; - eventHelper_recordEvent(&info, 0, suspendPolicy, initEventBag); + threadControl_onEventHandlerEntry(currentSessionID, opt_info, NULL); + eventHelper_recordEvent(opt_info, 0, suspendPolicy, initEventBag); (void)eventHelper_reportEvents(currentSessionID, initEventBag); bagDestroyBag(initEventBag); } @@ -1394,7 +1404,7 @@ if (!startedViaJcmd) { startedViaJcmd = JNI_TRUE; is_first_start = JNI_TRUE; - initialize(env, thread, EI_VM_INIT); + initialize(env, thread, EI_VM_INIT, NULL); } bagEnumerateOver(transports, getFirstTransport, &spec); diff -Nru openjdk-17-17.0.9+9/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c openjdk-17-17.0.10+7/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c --- openjdk-17-17.0.9+9/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jdwp.agent/share/native/libjdwp/invoker.c 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2022, 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 @@ -753,7 +753,9 @@ } id = request->id; exc = request->exception; + request->exception = NULL; returnValue = request->returnValue; + request->returnValue.l = NULL; /* Release return value and exception references, but delay the release * until after the return packet was sent. */ @@ -796,23 +798,20 @@ (void)outStream_writeObjectTag(env, &out, exc); (void)outStream_writeObjectRef(env, &out, exc); outStream_sendReply(&out); + /* + * Delete potentially saved global references for return value + * and exception. This must be done before sending the reply or + * these objects will briefly be viewable by the debugger as live + * when they shouldn't be. + */ + if (mustReleaseReturnValue && returnValue.l != NULL) { + tossGlobalRef(env, &returnValue.l); + } + if (exc != NULL) { + tossGlobalRef(env, &exc); + } outStream_destroy(&out); } - - /* - * Delete potentially saved global references of return value - * and exception - */ - eventHandler_lock(); // for proper lock order - debugMonitorEnter(invokerLock); - if (mustReleaseReturnValue && returnValue.l != NULL) { - tossGlobalRef(env, &returnValue.l); - } - if (exc != NULL) { - tossGlobalRef(env, &exc); - } - debugMonitorExit(invokerLock); - eventHandler_unlock(); } jboolean diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec openjdk-17-17.0.10+7/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec --- openjdk-17-17.0.9+9/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/linux/classes/jdk/jpackage/internal/resources/template.spec 2024-01-09 21:18:15.000000000 +0000 @@ -30,9 +30,12 @@ #build time will substantially increase and it may require unpack200/system java to install %define __jar_repack %{nil} -%define package_filelist %{_tmppath}/%{name}.files -%define app_filelist %{_tmppath}/%{name}.app.files -%define filesystem_filelist %{_tmppath}/%{name}.filesystem.files +# on RHEL we got unwanted improved debugging enhancements +%define _build_id_links none + +%define package_filelist %{_builddir}/%{name}.files +%define app_filelist %{_builddir}/%{name}.app.files +%define filesystem_filelist %{_builddir}/%{name}.filesystem.files %define default_filesystem / /opt /usr /usr/bin /usr/lib /usr/local /usr/local/bin /usr/local/lib diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java openjdk-17-17.0.10+7/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java --- openjdk-17-17.0.9+9/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java 2024-01-09 21:18:15.000000000 +0000 @@ -99,7 +99,7 @@ } private void verifyIsModular(boolean isModular) { - if ((moduleInfo != null) != isModular) { + if ((moduleInfo == null) == isModular) { throw new IllegalStateException(); } } @@ -259,14 +259,10 @@ private static String getStringParam(Map params, String paramName) { Optional value = Optional.ofNullable(params.get(paramName)); - if (value.isPresent()) { - return value.get().toString(); - } - return null; + return value.map(Object::toString).orElse(null); } - private static T getPathParam(Map params, - String paramName, Supplier func) throws ConfigException { + private static T getPathParam(String paramName, Supplier func) throws ConfigException { try { return func.get(); } catch (InvalidPathException ex) { @@ -278,7 +274,7 @@ private static Path getPathParam(Map params, String paramName) throws ConfigException { - return getPathParam(params, paramName, () -> { + return getPathParam(paramName, () -> { String value = getStringParam(params, paramName); Path result = null; if (value != null) { @@ -297,7 +293,7 @@ runtimePath = runtimePath.resolve("lib"); modulePath = Stream.of(modulePath, List.of(runtimePath)) .flatMap(List::stream) - .collect(Collectors.toUnmodifiableList()); + .toList(); } return modulePath; @@ -305,13 +301,9 @@ private static List getPathListParameter(String paramName, Map params) throws ConfigException { - return getPathParam(params, paramName, () -> { - String value = (String) params.get(paramName); - return (value == null) ? List.of() : - List.of(value.split(File.pathSeparator)).stream() - .map(Path::of) - .collect(Collectors.toUnmodifiableList()); - }); + return getPathParam(paramName, () -> + params.get(paramName) instanceof String value ? + Stream.of(value.split(File.pathSeparator)).map(Path::of).toList() : List.of()); } private String qualifiedClassName; diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp --- openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/applauncher/WinLauncher.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -34,6 +34,7 @@ #include "Dll.h" #include "WinApp.h" #include "Toolbox.h" +#include "Executor.h" #include "FileUtils.h" #include "UniqueHandle.h" #include "ErrorHandling.h" @@ -157,29 +158,29 @@ jvm = std::unique_ptr(); - STARTUPINFOW si; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - - PROCESS_INFORMATION pi; - ZeroMemory(&pi, sizeof(pi)); - - if (!CreateProcessW(launcherPath.c_str(), GetCommandLineW(), - NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { - JP_THROW(SysError(tstrings::any() << "CreateProcessW() failed", - CreateProcessW)); + UniqueHandle jobHandle(CreateJobObject(NULL, NULL)); + if (jobHandle.get() == NULL) { + JP_THROW(SysError(tstrings::any() << "CreateJobObject() failed", + CreateJobObject)); + } + JOBOBJECT_EXTENDED_LIMIT_INFORMATION jobInfo = { }; + jobInfo.BasicLimitInformation.LimitFlags = + JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; + if (!SetInformationJobObject(jobHandle.get(), + JobObjectExtendedLimitInformation, &jobInfo, sizeof(jobInfo))) { + JP_THROW(SysError(tstrings::any() << + "SetInformationJobObject() failed", + SetInformationJobObject)); } - WaitForSingleObject(pi.hProcess, INFINITE); - - UniqueHandle childProcessHandle(pi.hProcess); - UniqueHandle childThreadHandle(pi.hThread); + Executor exec(launcherPath); + exec.visible(true).withJobObject(jobHandle.get()).suspended(true).inherit(true); + const auto args = SysInfo::getCommandArgs(); + std::for_each(args.begin(), args.end(), [&exec] (const tstring& arg) { + exec.arg(arg); + }); - DWORD exitCode; - if (!GetExitCodeProcess(pi.hProcess, &exitCode)) { - JP_THROW(SysError(tstrings::any() << "GetExitCodeProcess() failed", - GetExitCodeProcess)); - } + DWORD exitCode = static_cast(exec.execAndWaitForExit()); exit(exitCode); return; diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/common/Executor.cpp openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/common/Executor.cpp --- openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/common/Executor.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/common/Executor.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include "Executor.h" +#include "Log.h" +#include "WinErrorHandling.h" + + +namespace { + +void escapeArg(std::wstring& str) { + if (str.empty()) { + return; + } + + if (str.front() == L'\"' && str.back() == L'\"' && str.size() > 1) { + return; + } + + if (str.find_first_of(L" \t") != std::wstring::npos) { + str = L'"' + str + L'"'; + } +} + +} // namespace + + +std::wstring Executor::args() const { + tstring_array tmpArgs; + // argv[0] is the module name. + tmpArgs.push_back(appPath); + tmpArgs.insert(tmpArgs.end(), argsArray.begin(), argsArray.end()); + + std::for_each(tmpArgs.begin(), tmpArgs.end(), escapeArg); + return tstrings::join(tmpArgs.begin(), tmpArgs.end(), _T(" ")); +} + + +int Executor::execAndWaitForExit() const { + UniqueHandle threadHandle; + UniqueHandle h = startProcess(&threadHandle); + + if (theSuspended) { + LOG_TRACE(tstrings::any() << "ResumeThread()"); + if (((DWORD)-1) == ResumeThread(threadHandle.get())) { + JP_THROW(SysError("ResumeThread() failed", ResumeThread)); + } + } + + const DWORD res = ::WaitForSingleObject(h.get(), INFINITE); + if (WAIT_FAILED == res) { + JP_THROW(SysError("WaitForSingleObject() failed", WaitForSingleObject)); + } + + DWORD exitCode = 0; + if (!GetExitCodeProcess(h.get(), &exitCode)) { + // Error reading process's exit code. + JP_THROW(SysError("GetExitCodeProcess() failed", GetExitCodeProcess)); + } + + const DWORD processId = GetProcessId(h.get()); + if (!processId) { + JP_THROW(SysError("GetProcessId() failed.", GetProcessId)); + } + + LOG_TRACE(tstrings::any() << "Process with PID=" << processId + << " terminated. Exit code=" << exitCode); + + return static_cast(exitCode); +} + + +UniqueHandle Executor::startProcess(UniqueHandle* threadHandle) const { + const std::wstring argsStr = args(); + + std::vector argsBuffer(argsStr.begin(), argsStr.end()); + argsBuffer.push_back(0); // terminating '\0' + + STARTUPINFO startupInfo; + ZeroMemory(&startupInfo, sizeof(startupInfo)); + startupInfo.cb = sizeof(startupInfo); + + PROCESS_INFORMATION processInfo; + ZeroMemory(&processInfo, sizeof(processInfo)); + + DWORD creationFlags = 0; + + if (theSuspended) { + creationFlags |= CREATE_SUSPENDED; + } + + if (!theVisible) { + // For GUI applications. + startupInfo.dwFlags |= STARTF_USESHOWWINDOW; + startupInfo.wShowWindow = SW_HIDE; + + // For console applications. + creationFlags |= CREATE_NO_WINDOW; + } + + tstrings::any msg; + msg << "CreateProcess"; + if (theSuspended) { + msg << "[suspended]"; + } + if (theVisible) { + msg << "[visible]"; + } + if (theInherit) { + msg << "[inherit]"; + } + msg << "(" << appPath << ", " << argsStr << ")"; + + if (!CreateProcess(appPath.c_str(), argsBuffer.data(), NULL, NULL, + theInherit ? TRUE : FALSE, creationFlags, NULL, NULL, + &startupInfo, &processInfo)) { + msg << " failed"; + JP_THROW(SysError(msg, CreateProcess)); + } + + msg << " succeeded; PID=" << processInfo.dwProcessId; + LOG_TRACE(msg); + + if (threadHandle) { + *threadHandle = UniqueHandle(processInfo.hThread); + } else { + // Close unneeded handle immediately. + UniqueHandle(processInfo.hThread); + } + + if (jobHandle != NULL) { + LOG_TRACE(tstrings::any() << "AssignProcessToJobObject(PID=" + << processInfo.dwProcessId << ")"); + if (!AssignProcessToJobObject(jobHandle, processInfo.hProcess)) { + JP_THROW(SysError(tstrings::any() << + "AssignProcessToJobObject() failed", + AssignProcessToJobObject)); + } + } + + // Return process handle. + return UniqueHandle(processInfo.hProcess); +} diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/common/Executor.h openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/common/Executor.h --- openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/common/Executor.h 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/common/Executor.h 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2019, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#ifndef EXECUTOR_H +#define EXECUTOR_H + +#include "tstrings.h" +#include "UniqueHandle.h" + + +class Executor { +public: + explicit Executor(const std::wstring& appPath=std::wstring()) { + app(appPath).visible(false).suspended(false).withJobObject(NULL).inherit(false); + } + + /** + * Returns command line configured with arg() calls so far. + */ + std::wstring args() const; + + /** + * Set path to application to execute. + */ + Executor& app(const std::wstring& v) { + appPath = v; + return *this; + } + + /** + * Adds another command line argument. + */ + Executor& arg(const std::wstring& v) { + argsArray.push_back(v); + return *this; + } + + /** + * Controls if application window should be visible. + */ + Executor& visible(bool v) { + theVisible = v; + return *this; + } + + /** + * Controls if the process should inherit handles. + */ + Executor& inherit(bool v) { + theInherit = v; + return *this; + } + + /** + * Controls if the process should be started suspended. + */ + Executor& suspended(bool v) { + theSuspended = v; + return *this; + } + + /** + * Use the given job object with started process. + */ + Executor& withJobObject(HANDLE v) { + jobHandle = v; + return *this; + } + + /** + * Starts application process and blocks waiting when the started + * process terminates. + * Returns process exit code. + * Throws exception if process start failed. + */ + int execAndWaitForExit() const; + +private: + UniqueHandle startProcess(UniqueHandle* threadHandle=0) const; + + bool theVisible; + bool theInherit; + bool theSuspended; + HANDLE jobHandle; + tstring_array argsArray; + std::wstring appPath; +}; + +#endif // #ifndef EXECUTOR_H diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp --- openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/msiwrapper/Executor.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2019, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#include -#include "Executor.h" -#include "Log.h" -#include "WinErrorHandling.h" - - -namespace { - -void escapeArg(std::wstring& str) { - if (str.empty()) { - return; - } - - if (str.front() == L'\"' && str.back() == L'\"' && str.size() > 1) { - return; - } - - if (str.find_first_of(L" \t") != std::wstring::npos) { - str = L'"' + str + L'"'; - } -} - -} // namespace - - -std::wstring Executor::args() const { - tstring_array tmpArgs; - // argv[0] is the module name. - tmpArgs.push_back(appPath); - tmpArgs.insert(tmpArgs.end(), argsArray.begin(), argsArray.end()); - - std::for_each(tmpArgs.begin(), tmpArgs.end(), escapeArg); - return tstrings::join(tmpArgs.begin(), tmpArgs.end(), _T(" ")); -} - - -int Executor::execAndWaitForExit() const { - UniqueHandle h = startProcess(); - - const DWORD res = ::WaitForSingleObject(h.get(), INFINITE); - if (WAIT_FAILED == res) { - JP_THROW(SysError("WaitForSingleObject() failed", WaitForSingleObject)); - } - - DWORD exitCode = 0; - if (!GetExitCodeProcess(h.get(), &exitCode)) { - // Error reading process's exit code. - JP_THROW(SysError("GetExitCodeProcess() failed", GetExitCodeProcess)); - } - - const DWORD processId = GetProcessId(h.get()); - if (!processId) { - JP_THROW(SysError("GetProcessId() failed.", GetProcessId)); - } - - LOG_TRACE(tstrings::any() << "Process with PID=" << processId - << " terminated. Exit code=" << exitCode); - - return static_cast(exitCode); -} - - -UniqueHandle Executor::startProcess() const { - const std::wstring argsStr = args(); - - std::vector argsBuffer(argsStr.begin(), argsStr.end()); - argsBuffer.push_back(0); // terminating '\0' - - STARTUPINFO startupInfo; - ZeroMemory(&startupInfo, sizeof(startupInfo)); - startupInfo.cb = sizeof(startupInfo); - - PROCESS_INFORMATION processInfo; - ZeroMemory(&processInfo, sizeof(processInfo)); - - DWORD creationFlags = 0; - - if (!theVisible) { - // For GUI applications. - startupInfo.dwFlags |= STARTF_USESHOWWINDOW; - startupInfo.wShowWindow = SW_HIDE; - - // For console applications. - creationFlags |= CREATE_NO_WINDOW; - } - - tstrings::any msg; - msg << "CreateProcess(" << appPath << ", " << argsStr << ")"; - - if (!CreateProcess(appPath.c_str(), argsBuffer.data(), NULL, NULL, FALSE, - creationFlags, NULL, NULL, &startupInfo, &processInfo)) { - msg << " failed"; - JP_THROW(SysError(msg, CreateProcess)); - } - - msg << " succeeded; PID=" << processInfo.dwProcessId; - LOG_TRACE(msg); - - // Close unneeded handles immediately. - UniqueHandle(processInfo.hThread); - - // Return process handle. - return UniqueHandle(processInfo.hProcess); -} diff -Nru openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/msiwrapper/Executor.h openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/msiwrapper/Executor.h --- openjdk-17-17.0.9+9/src/jdk.jpackage/windows/native/msiwrapper/Executor.h 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.jpackage/windows/native/msiwrapper/Executor.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2019, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -#ifndef EXECUTOR_H -#define EXECUTOR_H - -#include "tstrings.h" -#include "UniqueHandle.h" - - -class Executor { -public: - explicit Executor(const std::wstring& appPath=std::wstring()) { - app(appPath).visible(false); - } - - /** - * Returns command line configured with arg() calls so far. - */ - std::wstring args() const; - - /** - * Set path to application to execute. - */ - Executor& app(const std::wstring& v) { - appPath = v; - return *this; - } - - /** - * Adds another command line argument. - */ - Executor& arg(const std::wstring& v) { - argsArray.push_back(v); - return *this; - } - - /** - * Controls if application window should be visible. - */ - Executor& visible(bool v) { - theVisible = v; - return *this; - } - - /** - * Starts application process and blocks waiting when the started - * process terminates. - * Returns process exit code. - * Throws exception if process start failed. - */ - int execAndWaitForExit() const; - -private: - UniqueHandle startProcess() const; - - bool theVisible; - tstring_array argsArray; - std::wstring appPath; -}; - -#endif // #ifndef EXECUTOR_H diff -Nru openjdk-17-17.0.9+9/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java openjdk-17-17.0.10+7/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java --- openjdk-17-17.0.9+9/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/linux/classes/jdk/net/LinuxSocketOptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -63,8 +63,8 @@ } @Override - void setTcpkeepAliveProbes(int fd, final int value) throws SocketException { - setTcpkeepAliveProbes0(fd, value); + void setTcpKeepAliveProbes(int fd, final int value) throws SocketException { + setTcpKeepAliveProbes0(fd, value); } @Override @@ -78,8 +78,8 @@ } @Override - int getTcpkeepAliveProbes(int fd) throws SocketException { - return getTcpkeepAliveProbes0(fd); + int getTcpKeepAliveProbes(int fd) throws SocketException { + return getTcpKeepAliveProbes0(fd); } @Override @@ -112,10 +112,10 @@ return new UnixDomainPrincipal(user, group); } - private static native void setTcpkeepAliveProbes0(int fd, int value) throws SocketException; + private static native void setTcpKeepAliveProbes0(int fd, int value) throws SocketException; private static native void setTcpKeepAliveTime0(int fd, int value) throws SocketException; private static native void setTcpKeepAliveIntvl0(int fd, int value) throws SocketException; - private static native int getTcpkeepAliveProbes0(int fd) throws SocketException; + private static native int getTcpKeepAliveProbes0(int fd) throws SocketException; private static native int getTcpKeepAliveTime0(int fd) throws SocketException; private static native int getTcpKeepAliveIntvl0(int fd) throws SocketException; private static native void setQuickAck0(int fd, boolean on) throws SocketException; diff -Nru openjdk-17-17.0.9+9/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c openjdk-17-17.0.10+7/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c --- openjdk-17-17.0.9+9/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/linux/native/libextnet/LinuxSocketOptions.c 2024-01-09 21:18:15.000000000 +0000 @@ -147,10 +147,10 @@ /* * Class: jdk_net_LinuxSocketOptions - * Method: setTcpkeepAliveProbes0 + * Method: setTcpKeepAliveProbes0 * Signature: (II)V */ -JNIEXPORT void JNICALL Java_jdk_net_LinuxSocketOptions_setTcpkeepAliveProbes0 +JNIEXPORT void JNICALL Java_jdk_net_LinuxSocketOptions_setTcpKeepAliveProbes0 (JNIEnv *env, jobject unused, jint fd, jint optval) { jint rv = setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &optval, sizeof (optval)); handleError(env, rv, "set option TCP_KEEPCNT failed"); @@ -180,10 +180,10 @@ /* * Class: jdk_net_LinuxSocketOptions - * Method: getTcpkeepAliveProbes0 + * Method: getTcpKeepAliveProbes0 * Signature: (I)I; */ -JNIEXPORT jint JNICALL Java_jdk_net_LinuxSocketOptions_getTcpkeepAliveProbes0 +JNIEXPORT jint JNICALL Java_jdk_net_LinuxSocketOptions_getTcpKeepAliveProbes0 (JNIEnv *env, jobject unused, jint fd) { jint optval, rv; socklen_t sz = sizeof (optval); diff -Nru openjdk-17-17.0.9+9/src/jdk.net/macosx/classes/jdk/net/MacOSXSocketOptions.java openjdk-17-17.0.10+7/src/jdk.net/macosx/classes/jdk/net/MacOSXSocketOptions.java --- openjdk-17-17.0.9+9/src/jdk.net/macosx/classes/jdk/net/MacOSXSocketOptions.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/macosx/classes/jdk/net/MacOSXSocketOptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -44,8 +44,8 @@ } @Override - void setTcpkeepAliveProbes(int fd, final int value) throws SocketException { - setTcpkeepAliveProbes0(fd, value); + void setTcpKeepAliveProbes(int fd, final int value) throws SocketException { + setTcpKeepAliveProbes0(fd, value); } @Override @@ -64,8 +64,8 @@ } @Override - int getTcpkeepAliveProbes(int fd) throws SocketException { - return getTcpkeepAliveProbes0(fd); + int getTcpKeepAliveProbes(int fd) throws SocketException { + return getTcpKeepAliveProbes0(fd); } @Override @@ -88,10 +88,10 @@ return new UnixDomainPrincipal(user, group); } - private static native void setTcpkeepAliveProbes0(int fd, int value) throws SocketException; + private static native void setTcpKeepAliveProbes0(int fd, int value) throws SocketException; private static native void setTcpKeepAliveTime0(int fd, int value) throws SocketException; private static native void setTcpKeepAliveIntvl0(int fd, int value) throws SocketException; - private static native int getTcpkeepAliveProbes0(int fd) throws SocketException; + private static native int getTcpKeepAliveProbes0(int fd) throws SocketException; private static native int getTcpKeepAliveTime0(int fd) throws SocketException; private static native int getTcpKeepAliveIntvl0(int fd) throws SocketException; private static native long getSoPeerCred0(int fd) throws SocketException; diff -Nru openjdk-17-17.0.9+9/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c openjdk-17-17.0.10+7/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c --- openjdk-17-17.0.9+9/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/macosx/native/libextnet/MacOSXSocketOptions.c 2024-01-09 21:18:15.000000000 +0000 @@ -79,10 +79,10 @@ /* * Class: jdk_net_MacOSXSocketOptions - * Method: setTcpkeepAliveProbes0 + * Method: setTcpKeepAliveProbes0 * Signature: (II)V */ -JNIEXPORT void JNICALL Java_jdk_net_MacOSXSocketOptions_setTcpkeepAliveProbes0 +JNIEXPORT void JNICALL Java_jdk_net_MacOSXSocketOptions_setTcpKeepAliveProbes0 (JNIEnv *env, jobject unused, jint fd, jint optval) { jint rv = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &optval, sizeof (optval)); handleError(env, rv, "set option TCP_KEEPCNT failed"); @@ -112,10 +112,10 @@ /* * Class: jdk_net_MacOSXSocketOptions - * Method: getTcpkeepAliveProbes0 + * Method: getTcpKeepAliveProbes0 * Signature: (I)I; */ -JNIEXPORT jint JNICALL Java_jdk_net_MacOSXSocketOptions_getTcpkeepAliveProbes0 +JNIEXPORT jint JNICALL Java_jdk_net_MacOSXSocketOptions_getTcpKeepAliveProbes0 (JNIEnv *env, jobject unused, jint fd) { jint optval, rv; socklen_t sz = sizeof (optval); diff -Nru openjdk-17-17.0.9+9/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java openjdk-17-17.0.10+7/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java --- openjdk-17-17.0.9+9/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/share/classes/jdk/net/ExtendedSocketOptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -247,7 +247,7 @@ if (option == TCP_QUICKACK) { setQuickAckOption(fd, (boolean) value); } else if (option == TCP_KEEPCOUNT) { - setTcpkeepAliveProbes(fd, (Integer) value); + setTcpKeepAliveProbes(fd, (Integer) value); } else if (option == TCP_KEEPIDLE) { setTcpKeepAliveTime(fd, (Integer) value); } else if (option == TCP_KEEPINTERVAL) { @@ -276,7 +276,7 @@ if (option == TCP_QUICKACK) { return getQuickAckOption(fd); } else if (option == TCP_KEEPCOUNT) { - return getTcpkeepAliveProbes(fd); + return getTcpKeepAliveProbes(fd); } else if (option == TCP_KEEPIDLE) { return getTcpKeepAliveTime(fd); } else if (option == TCP_KEEPINTERVAL) { @@ -310,9 +310,9 @@ return platformSocketOptions.getQuickAck(fdAccess.get(fd)); } - private static void setTcpkeepAliveProbes(FileDescriptor fd, int value) + private static void setTcpKeepAliveProbes(FileDescriptor fd, int value) throws SocketException { - platformSocketOptions.setTcpkeepAliveProbes(fdAccess.get(fd), value); + platformSocketOptions.setTcpKeepAliveProbes(fdAccess.get(fd), value); } private static void setTcpKeepAliveTime(FileDescriptor fd, int value) @@ -325,8 +325,8 @@ platformSocketOptions.setTcpKeepAliveIntvl(fdAccess.get(fd), value); } - private static int getTcpkeepAliveProbes(FileDescriptor fd) throws SocketException { - return platformSocketOptions.getTcpkeepAliveProbes(fdAccess.get(fd)); + private static int getTcpKeepAliveProbes(FileDescriptor fd) throws SocketException { + return platformSocketOptions.getTcpKeepAliveProbes(fdAccess.get(fd)); } private static int getTcpKeepAliveTime(FileDescriptor fd) throws SocketException { @@ -368,6 +368,8 @@ return newInstance("jdk.net.LinuxSocketOptions"); } else if (osname.startsWith("Mac")) { return newInstance("jdk.net.MacOSXSocketOptions"); + } else if (osname.startsWith("Windows")) { + return newInstance("jdk.net.WindowsSocketOptions"); } else { return new PlatformSocketOptions(); } @@ -399,7 +401,7 @@ return false; } - void setTcpkeepAliveProbes(int fd, final int value) throws SocketException { + void setTcpKeepAliveProbes(int fd, final int value) throws SocketException { throw new UnsupportedOperationException("unsupported TCP_KEEPCNT option"); } @@ -415,7 +417,7 @@ throw new UnsupportedOperationException("unsupported TCP_KEEPINTVL option"); } - int getTcpkeepAliveProbes(int fd) throws SocketException { + int getTcpKeepAliveProbes(int fd) throws SocketException { throw new UnsupportedOperationException("unsupported TCP_KEEPCNT option"); } diff -Nru openjdk-17-17.0.9+9/src/jdk.net/windows/classes/jdk/net/WindowsSocketOptions.java openjdk-17-17.0.10+7/src/jdk.net/windows/classes/jdk/net/WindowsSocketOptions.java --- openjdk-17-17.0.9+9/src/jdk.net/windows/classes/jdk/net/WindowsSocketOptions.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/windows/classes/jdk/net/WindowsSocketOptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.net; + +import java.net.SocketException; +import java.security.AccessController; +import java.security.PrivilegedAction; +import jdk.net.ExtendedSocketOptions.PlatformSocketOptions; + + +@SuppressWarnings("removal") +class WindowsSocketOptions extends PlatformSocketOptions { + + public WindowsSocketOptions() { + } + + @Override + boolean keepAliveOptionsSupported() { + return keepAliveOptionsSupported0(); + } + + @Override + void setTcpKeepAliveProbes(int fd, final int value) throws SocketException { + setTcpKeepAliveProbes0(fd, value); + } + + @Override + int getTcpKeepAliveProbes(int fd) throws SocketException { + return getTcpKeepAliveProbes0(fd); + } + + @Override + void setTcpKeepAliveTime(int fd, final int value) throws SocketException { + setTcpKeepAliveTime0(fd, value); + } + + @Override + int getTcpKeepAliveTime(int fd) throws SocketException { + return getTcpKeepAliveTime0(fd); + } + + @Override + void setTcpKeepAliveIntvl(int fd, final int value) throws SocketException { + setTcpKeepAliveIntvl0(fd, value); + } + + @Override + int getTcpKeepAliveIntvl(int fd) throws SocketException { + return getTcpKeepAliveIntvl0(fd); + } + + private static native boolean keepAliveOptionsSupported0(); + private static native void setTcpKeepAliveProbes0(int fd, int value) throws SocketException; + private static native int getTcpKeepAliveProbes0(int fd) throws SocketException; + private static native void setTcpKeepAliveTime0(int fd, int value) throws SocketException; + private static native int getTcpKeepAliveTime0(int fd) throws SocketException; + private static native void setTcpKeepAliveIntvl0(int fd, int value) throws SocketException; + private static native int getTcpKeepAliveIntvl0(int fd) throws SocketException; + + static { + if (System.getSecurityManager() == null) { + System.loadLibrary("extnet"); + } else { + AccessController.doPrivileged((PrivilegedAction) () -> { + System.loadLibrary("extnet"); + return null; + }); + } + } +} diff -Nru openjdk-17-17.0.9+9/src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c openjdk-17-17.0.10+7/src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c --- openjdk-17-17.0.9+9/src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/src/jdk.net/windows/native/libextnet/WindowsSocketOptions.c 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include +#include + +#include + +#include "jni.h" +#include "jni_util.h" +#include "jvm.h" + +static void handleError(JNIEnv *env, jint rv, const char *errmsg) { + if (rv < 0) { + int error = WSAGetLastError(); + if (error == WSAENOPROTOOPT) { + JNU_ThrowByName(env, "java/lang/UnsupportedOperationException", + "unsupported socket option"); + } else { + JNU_ThrowByNameWithLastError(env, "java/net/SocketException", errmsg); + } + } +} + +static jint socketOptionSupported(jint level, jint optname) { + WSADATA wsaData; + jint error = WSAStartup(MAKEWORD(2, 2), &wsaData); + + if (error != 0) { + return 0; + } + + SOCKET sock; + jint one = 1; + jint rv; + socklen_t sz = sizeof(one); + + /* First try IPv6; fall back to IPv4. */ + sock = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP); + if (sock == INVALID_SOCKET) { + error = WSAGetLastError(); + if (error == WSAEPFNOSUPPORT || error == WSAEAFNOSUPPORT) { + sock = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + } + if (sock == INVALID_SOCKET) { + return 0; + } + } + + rv = getsockopt(sock, level, optname, (char*) &one, &sz); + error = WSAGetLastError(); + + if (rv != 0 && error == WSAENOPROTOOPT) { + rv = 0; + } else { + rv = 1; + } + + closesocket(sock); + WSACleanup(); + + return rv; +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: keepAliveOptionsSupported0 + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_jdk_net_WindowsSocketOptions_keepAliveOptionsSupported0 +(JNIEnv *env, jobject unused) { + return socketOptionSupported(IPPROTO_TCP, TCP_KEEPIDLE) && socketOptionSupported(IPPROTO_TCP, TCP_KEEPCNT) + && socketOptionSupported(IPPROTO_TCP, TCP_KEEPINTVL); +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: setTcpKeepAliveProbes0 + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_jdk_net_WindowsSocketOptions_setTcpKeepAliveProbes0 +(JNIEnv *env, jobject unused, jint fd, jint optval) { + jint rv = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, (char*) &optval, sizeof(optval)); + handleError(env, rv, "set option TCP_KEEPCNT failed"); +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: getTcpKeepAliveProbes0 + * Signature: (I)I; + */ +JNIEXPORT jint JNICALL Java_jdk_net_WindowsSocketOptions_getTcpKeepAliveProbes0 +(JNIEnv *env, jobject unused, jint fd) { + jint optval, rv; + socklen_t sz = sizeof(optval); + rv = getsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, (char*) &optval, &sz); + handleError(env, rv, "get option TCP_KEEPCNT failed"); + return optval; +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: setTcpKeepAliveTime0 + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_jdk_net_WindowsSocketOptions_setTcpKeepAliveTime0 +(JNIEnv *env, jobject unused, jint fd, jint optval) { + jint rv = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &optval, sizeof(optval)); + handleError(env, rv, "set option TCP_KEEPIDLE failed"); +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: getTcpKeepAliveTime0 + * Signature: (I)I; + */ +JNIEXPORT jint JNICALL Java_jdk_net_WindowsSocketOptions_getTcpKeepAliveTime0 +(JNIEnv *env, jobject unused, jint fd) { + jint optval, rv; + socklen_t sz = sizeof(optval); + rv = getsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &optval, &sz); + handleError(env, rv, "get option TCP_KEEPIDLE failed"); + return optval; +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: setTcpKeepAliveIntvl0 + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_jdk_net_WindowsSocketOptions_setTcpKeepAliveIntvl0 +(JNIEnv *env, jobject unused, jint fd, jint optval) { + jint rv = setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &optval, sizeof(optval)); + handleError(env, rv, "set option TCP_KEEPINTVL failed"); +} + +/* + * Class: jdk_net_WindowsSocketOptions + * Method: getTcpKeepAliveIntvl0 + * Signature: (I)I; + */ +JNIEXPORT jint JNICALL Java_jdk_net_WindowsSocketOptions_getTcpKeepAliveIntvl0 +(JNIEnv *env, jobject unused, jint fd) { + jint optval, rv; + socklen_t sz = sizeof(optval); + rv = getsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &optval, &sz); + handleError(env, rv, "get option TCP_KEEPINTVL failed"); + return optval; +} diff -Nru openjdk-17-17.0.9+9/test/failure_handler/src/share/conf/common.properties openjdk-17-17.0.10+7/test/failure_handler/src/share/conf/common.properties --- openjdk-17-17.0.9+9/test/failure_handler/src/share/conf/common.properties 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/failure_handler/src/share/conf/common.properties 2024-01-09 21:18:15.000000000 +0000 @@ -33,7 +33,7 @@ jcmd.compiler.queue \ jcmd.vm.classloader_stats jcmd.vm.stringtable \ jcmd.vm.symboltable jcmd.vm.uptime jcmd.vm.dynlibs \ - jcmd.vm.system_properties \ + jcmd.vm.system_properties jcmd.vm.info \ jcmd.gc.heap_info jcmd.gc.class_histogram jcmd.gc.finalizer_info \ jstack diff -Nru openjdk-17-17.0.9+9/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp openjdk-17-17.0.10+7/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp --- openjdk-17-17.0.9+9/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/gtest/metaspace/test_chunkManager_stress.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -61,9 +61,9 @@ return max_chunks; } - // Return true if, after an allocation error happened, a reserve error seems likely. + // Return true if, after an allocation error happened, a reserve error seems possible. bool could_be_reserve_error() { - return _context.vslist().is_full(); + return _context.reserve_limit() < max_uintx; } // Return true if, after an allocation error happened, a commit error seems likely. diff -Nru openjdk-17-17.0.9+9/test/hotspot/gtest/runtime/test_os.cpp openjdk-17-17.0.10+7/test/hotspot/gtest/runtime/test_os.cpp --- openjdk-17-17.0.9+9/test/hotspot/gtest/runtime/test_os.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/gtest/runtime/test_os.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -373,6 +373,15 @@ #define PRINT_MAPPINGS(s) { tty->print_cr("%s", s); os::print_memory_mappings((char*)p, total_range_len, tty); } //#define PRINT_MAPPINGS +// Release a range allocated with reserve_multiple carefully, to not trip mapping +// asserts on Windows in os::release_memory() +static void carefully_release_multiple(address start, int num_stripes, size_t stripe_len) { + for (int stripe = 0; stripe < num_stripes; stripe++) { + address q = start + (stripe * stripe_len); + EXPECT_TRUE(os::release_memory((char*)q, stripe_len)); + } +} + #ifndef _AIX // JDK-8257041 // Reserve an area consisting of multiple mappings // (from multiple calls to os::reserve_memory) @@ -385,25 +394,34 @@ const bool exec_supported = can_reserve_executable_memory(); #endif - size_t total_range_len = num_stripes * stripe_len; - // Reserve a large contiguous area to get the address space... - address p = (address)os::reserve_memory(total_range_len); - EXPECT_NE(p, (address)NULL); - // .. release it... - EXPECT_TRUE(os::release_memory((char*)p, total_range_len)); - // ... re-reserve in the same spot multiple areas... - for (int stripe = 0; stripe < num_stripes; stripe++) { - address q = p + (stripe * stripe_len); - // Commit, alternatingly with or without exec permission, - // to prevent kernel from folding these mappings. + address p = NULL; + for (int tries = 0; tries < 256 && p == NULL; tries ++) { + size_t total_range_len = num_stripes * stripe_len; + // Reserve a large contiguous area to get the address space... + p = (address)os::reserve_memory(total_range_len); + EXPECT_NE(p, (address)NULL); + // .. release it... + EXPECT_TRUE(os::release_memory((char*)p, total_range_len)); + // ... re-reserve in the same spot multiple areas... + for (int stripe = 0; stripe < num_stripes; stripe++) { + address q = p + (stripe * stripe_len); + // Commit, alternatingly with or without exec permission, + // to prevent kernel from folding these mappings. #ifdef __APPLE__ - const bool executable = exec_supported ? (stripe % 2 == 0) : false; + const bool executable = exec_supported ? (stripe % 2 == 0) : false; #else - const bool executable = stripe % 2 == 0; + const bool executable = stripe % 2 == 0; #endif - q = (address)os::attempt_reserve_memory_at((char*)q, stripe_len, executable); - EXPECT_NE(q, (address)NULL); - EXPECT_TRUE(os::commit_memory((char*)q, stripe_len, executable)); + q = (address)os::attempt_reserve_memory_at((char*)q, stripe_len, executable); + if (q == NULL) { + // Someone grabbed that area concurrently. Cleanup, then retry. + tty->print_cr("reserve_multiple: retry (%d)...", stripe); + carefully_release_multiple(p, stripe, stripe_len); + p = NULL; + } else { + EXPECT_TRUE(os::commit_memory((char*)q, stripe_len, executable)); + } + } } return p; } @@ -426,14 +444,6 @@ } #ifdef _WIN32 -// Release a range allocated with reserve_multiple carefully, to not trip mapping -// asserts on Windows in os::release_memory() -static void carefully_release_multiple(address start, int num_stripes, size_t stripe_len) { - for (int stripe = 0; stripe < num_stripes; stripe++) { - address q = start + (stripe * stripe_len); - EXPECT_TRUE(os::release_memory((char*)q, stripe_len)); - } -} struct NUMASwitcher { const bool _b; NUMASwitcher(bool v): _b(UseNUMAInterleaving) { UseNUMAInterleaving = v; } diff -Nru openjdk-17-17.0.9+9/test/hotspot/gtest/utilities/test_globalDefinitions.cpp openjdk-17-17.0.10+7/test/hotspot/gtest/utilities/test_globalDefinitions.cpp --- openjdk-17-17.0.9+9/test/hotspot/gtest/utilities/test_globalDefinitions.cpp 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/gtest/utilities/test_globalDefinitions.cpp 2024-01-09 21:18:15.000000000 +0000 @@ -22,6 +22,7 @@ */ #include "precompiled.hpp" +#include "memory/resourceArea.hpp" #include "runtime/os.hpp" #include "utilities/align.hpp" #include "utilities/globalDefinitions.hpp" @@ -216,3 +217,24 @@ } } + +#define check_format(format, value, expected) \ + do { \ + ResourceMark rm; \ + stringStream out; \ + out.print((format), (value)); \ + const char* result = out.as_string(); \ + EXPECT_STREQ((result), (expected)) << "Failed with" \ + << " format '" << (format) << "'" \ + << " value '" << (value); \ + } while (false) + +TEST(globalDefinitions, format_specifiers) { + check_format(SSIZE_FORMAT, (ssize_t)-123, "-123"); + check_format(SSIZE_FORMAT, (ssize_t)2147483647, "2147483647"); + check_format(SSIZE_FORMAT, (ssize_t)-2147483647, "-2147483647"); + check_format(SSIZE_PLUS_FORMAT, (ssize_t)123, "+123"); + check_format(SSIZE_PLUS_FORMAT, (ssize_t)-123, "-123"); + check_format(SSIZE_PLUS_FORMAT, (ssize_t)2147483647, "+2147483647"); + check_format(SSIZE_PLUS_FORMAT, (ssize_t)-2147483647, "-2147483647"); +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/ProblemList-zgc.txt openjdk-17-17.0.10+7/test/hotspot/jtreg/ProblemList-zgc.txt --- openjdk-17-17.0.9+9/test/hotspot/jtreg/ProblemList-zgc.txt 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/ProblemList-zgc.txt 2024-01-09 21:18:15.000000000 +0000 @@ -44,7 +44,3 @@ serviceability/sa/TestJhsdbJstackMixed.java 8248912 generic-all serviceability/sa/ClhsdbPstack.java#id0 8248912 generic-all serviceability/sa/ClhsdbPstack.java#id1 8248912 generic-all - -serviceability/dcmd/framework/HelpTest.java 8268433 windows-x64 -serviceability/dcmd/framework/InvalidCommandTest.java 8268433 windows-x64 -serviceability/dcmd/framework/VMVersionTest.java 8268433 windows-x64 diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/ProblemList.txt openjdk-17-17.0.10+7/test/hotspot/jtreg/ProblemList.txt --- openjdk-17-17.0.9+9/test/hotspot/jtreg/ProblemList.txt 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/ProblemList.txt 2024-01-09 21:18:15.000000000 +0000 @@ -43,7 +43,6 @@ compiler/ciReplay/TestSAServer.java 8029528 generic-all compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all -compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java 8262901 macosx-aarch64 compiler/tiered/LevelTransitionTest.java 8067651 generic-all compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all @@ -112,16 +111,14 @@ serviceability/sa/sadebugd/DebugdConnectTest.java 8239062,8270326 macosx-x64,macosx-aarch64 serviceability/sa/TestRevPtrsForInvokeDynamic.java 8241235 generic-all -serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 8214032 generic-all -serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 8224150 generic-all serviceability/jvmti/ModuleAwareAgents/ThreadStart/MAAThreadStart.java 8225354 windows-all serviceability/dcmd/gc/RunFinalizationTest.java 8227120 linux-all,windows-x64 -serviceability/sa/ClhsdbCDSCore.java 8294316,8269982,8267433 macosx-aarch64,macosx-x64 -serviceability/sa/ClhsdbFindPC.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64 -serviceability/sa/ClhsdbFindPC.java#id3 8294316,8269982,8267433 macosx-aarch64,macosx-x64 +serviceability/sa/ClhsdbCDSCore.java 8294316,8267433 macosx-x64 +serviceability/sa/ClhsdbFindPC.java#id1 8294316,8267433 macosx-x64 +serviceability/sa/ClhsdbFindPC.java#id3 8294316,8267433 macosx-x64 serviceability/sa/ClhsdbPmap.java#id1 8294316,8267433 macosx-x64 -serviceability/sa/ClhsdbPstack.java#id1 8294316,8269982,8267433 macosx-aarch64,macosx-x64 +serviceability/sa/ClhsdbPstack.java#id1 8294316,8267433 macosx-x64 serviceability/sa/TestJmapCore.java 8294316,8267433 macosx-x64 serviceability/sa/TestJmapCoreMetaspace.java 8294316,8267433 macosx-x64 @@ -138,11 +135,6 @@ ############################################################################# -vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001/TestDescription.java 8198668 generic-all -vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded002/TestDescription.java 8153598 generic-all -vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded003/TestDescription.java 8198668 generic-all -vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded004/TestDescription.java 8153598 generic-all -vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded005/TestDescription.java 8153598 generic-all vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock001/TestDescription.java 8060733 generic-all vmTestbase/nsk/jdi/HiddenClass/events/events001.java 8257705 generic-all @@ -157,7 +149,6 @@ vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java 8219652 aix-ppc64 vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java 8219652 aix-ppc64 -vmTestbase/nsk/jvmti/PopFrame/popframe011/TestDescription.java 8266593 generic-all vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8192647 generic-all diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/TEST.ROOT openjdk-17-17.0.10+7/test/hotspot/jtreg/TEST.ROOT --- openjdk-17-17.0.9+9/test/hotspot/jtreg/TEST.ROOT 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/TEST.ROOT 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 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 @@ -68,7 +68,7 @@ vm.rtm.compiler \ vm.cds \ vm.cds.custom.loaders \ - vm.cds.archived.java.heap \ + vm.cds.write.archived.java.heap \ vm.jvmti \ vm.graal.enabled \ vm.compiler1.enabled \ @@ -79,7 +79,7 @@ jdk.containerized # Minimum jtreg version -requiredVersion=6+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../../ notation to reach them diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/applications/scimark/Scimark.java openjdk-17-17.0.10+7/test/hotspot/jtreg/applications/scimark/Scimark.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/applications/scimark/Scimark.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/applications/scimark/Scimark.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -24,7 +24,6 @@ /* * @test * @library /test/lib - * @requires vm.flagless * @run driver Scimark */ @@ -47,7 +46,9 @@ + Scimark.class.getName(), e); } - OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createJavaProcessBuilder( + System.setProperty("test.noclasspath", "true"); + + OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJvm( "-cp", artifacts.get("gov.nist.math.scimark-2.0").toString(), "jnt.scimark2.commandline", "-large") .start()); diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/c1/Test8301489.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/Test8301489.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/c1/Test8301489.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/Test8301489.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8301489 + * @summary ShortLoopOptimizer might lift instructions before their inputs + * @requires vm.compiler1.enabled + * @run main/othervm -Xcomp -XX:TieredStopAtLevel=1 + * -XX:CompileOnly=compiler.c1.Test8301489::* + * compiler.c1.Test8301489 + */ + + +package compiler.c1; + +public class Test8301489 { + static int c = 0; + static int[] arr = {}; + + static void op2Test(int a, int b) { + // Implicit edges created during dom calculation to exception handler + if (a < 0) { + b = 0; + } + // Create two branches into next loop header block + try { + int l = arr.length; + for (int i = 0; i < l; i++) { + int d = arr[i] + arr[i]; + } + } + // Exception handler as predecessor of the next loop header block + catch (ArithmeticException e) {} + + // op2(a, b) as candidate for hoisting: operands are loop invariant + while (a + b < b) {} + // op2(a, b) should not be hoisted above 'if (a < 0) {...}' block + } + + static void arrayLengthTest() { + float [] newArr = new float[c]; + + try { + for (float f : newArr) {} + } + catch (ArrayIndexOutOfBoundsException e) {} + + while (54321 < newArr.length) { + newArr[c] = 123.45f; + } + } + + static void negateTest(int a) { + if (a <= 111) { + a = -111; + } + + int f = 0; + try { + int l = arr.length; + f--; + } + catch (NegativeArraySizeException e) {} + + while (-a < f) { + f--; + } + } + + static void convertTest(int a) { + if (c == 0) { + a = 0; + } + + long tgt = 10; + + try { + String s = String.valueOf(c); + } + catch (NumberFormatException e) {} + + while ((long)a != tgt) { + tgt--; + } + } + + public static void main(String[] args) { + for (int i = 0; i < 3; i++) { + op2Test(12, 34); + arrayLengthTest(); + negateTest(-778); + convertTest(4812); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiver.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiver.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiver.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiver.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8312909 + * @summary Test monomorphic interface call to with invalid receiver. + * @modules java.base/jdk.internal.vm.annotation + * @compile TestInvokeinterfaceWithBadReceiverHelper.jasm + * @run main/bootclasspath/othervm -XX:CompileCommand=compileonly,TestInvokeinterfaceWithBadReceiverHelper::test + * -Xcomp -XX:TieredStopAtLevel=1 TestInvokeinterfaceWithBadReceiver + */ + +import jdk.internal.vm.annotation.Stable; + +interface MyInterface { + public String get(); +} + +// Single implementor +class MyClass implements MyInterface { + @Stable + String field = "42"; + + public String get() { + return field; + } +} + +public class TestInvokeinterfaceWithBadReceiver { + + public static void main(String[] args) { + try { + TestInvokeinterfaceWithBadReceiverHelper.test(new MyClass()); + throw new RuntimeException("No IncompatibleClassChangeError thrown!"); + } catch (IncompatibleClassChangeError e) { + // Expected + } + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiverHelper.jasm openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiverHelper.jasm --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiverHelper.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/c1/TestInvokeinterfaceWithBadReceiverHelper.jasm 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +super public class TestInvokeinterfaceWithBadReceiverHelper + version 51:0 +{ + public Method "":"()V" + stack 1 locals 1 + { + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; + } + + public static Method test:"(LMyInterface;)Ljava/lang/String;" + stack 1 locals 2 + { + ldc String "42"; + invokeinterface InterfaceMethod MyInterface.get:"()Ljava/lang/String;", 1; + areturn; + } + +} // end Class TestInvokeinterfaceWithBadReceiverHelper diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/CheckLargePages.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8304954 + * @summary Code cache reservation should gracefully downgrade to using smaller pages if the code cache size is too small to host the requested page size. + * @requires os.family == "linux" + * @requires vm.gc != "Z" + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UseLargePages -XX:LargePageSizeInBytes=1g compiler.codecache.CheckLargePages + */ + +package compiler.codecache; + +import jdk.test.lib.Asserts; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.whitebox.WhiteBox; + +import java.util.Arrays; +import java.util.List; + +public class CheckLargePages { + private final static WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + + public static void main(String[] args) throws Exception { + final boolean largePages = WHITE_BOX.getBooleanVMFlag("UseLargePages"); + final long largePageSize = WHITE_BOX.getVMLargePageSize(); + if (largePages && (largePageSize == 1024 * 1024 * 1024)) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+UseLargePages", + "-XX:+SegmentedCodeCache", + "-XX:InitialCodeCacheSize=2g", + "-XX:ReservedCodeCacheSize=2g", + "-XX:LargePageSizeInBytes=1g", + "-Xlog:pagesize=info", + "-version"); + OutputAnalyzer out = new OutputAnalyzer(pb.start()); + out.shouldMatch("Code cache size too small for \\S* pages\\. Reverting to smaller page size \\((\\S*)\\)\\."); + out.shouldHaveExitValue(0); + // Parse page sizes to find next biggest page + String sizes = out.firstMatch("Usable page sizes:(.*)", 1); + List sizeList = Arrays.stream(sizes.trim().split("\\s*,\\s*")).map(CheckLargePages::parseMemoryString).sorted().toList(); + final int smallerPageSizeIndex = sizeList.indexOf(largePageSize) - 1; + Asserts.assertGreaterThanOrEqual(smallerPageSizeIndex, 0); + final long smallerPageSize = sizeList.get(smallerPageSizeIndex); + // Retrieve reverted page size from code cache warning + String revertedSizeString = out.firstMatch("Code cache size too small for (\\S*) pages. Reverting to smaller page size \\((\\S*)\\)\\.", 2); + Asserts.assertEquals(parseMemoryString(revertedSizeString), smallerPageSize); + } else { + System.out.println("1GB large pages not supported: UseLargePages=" + largePages + + (largePages ? ", largePageSize=" + largePageSize : "") + ". Skipping"); + } + } + + public static long parseMemoryString(String value) { + value = value.toUpperCase(); + long multiplier = 1; + if (value.endsWith("B")) { + multiplier = 1; + } else if (value.endsWith("K")) { + multiplier = 1024; + } else if (value.endsWith("M")) { + multiplier = 1024 * 1024; + } else if (value.endsWith("G")) { + multiplier = 1024 * 1024 * 1024; + } else { + throw new IllegalArgumentException("Expected memory string '" + value + "'to end with either of: B, K, M, G"); + } + + long longValue = Long.parseUnsignedLong(value.substring(0, value.length() - 1)); + + return longValue * multiplier; + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/TestSegmentedCodeCacheOption.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -56,6 +56,9 @@ private static final String[] UNEXPECTED_MESSAGES = new String[] { ".*" + SEGMENTED_CODE_CACHE + ".*" }; + private static final String[] XINT_EXPECTED_MESSAGE = new String[] { + "SegmentedCodeCache has no meaningful effect with -Xint" + }; private static enum TestCase { @@ -86,10 +89,11 @@ // ... and even w/ Xint. testCaseExitCodeMessage = "It should be possible to use " + USE_SEGMENTED_CODE_CACHE + " in interpreted mode " - + "without any errors."; + + "but it produces a warning that it is ignored."; CommandLineOptionTest.verifyJVMStartup( - /* expected messages */ null, UNEXPECTED_MESSAGES, + XINT_EXPECTED_MESSAGE, + /* unexpected messages */ null, testCaseExitCodeMessage, testCaseWarningMessage, ExitCode.OK, false, INT_MODE, USE_SEGMENTED_CODE_CACHE); } @@ -117,14 +121,6 @@ CommandLineOptionTest.prepareNumericFlag( BlobType.All.sizeOptionName, BELOW_THRESHOLD_CC_SIZE)); - // SCC could be explicitly enabled w/ Xint - errorMessage = String.format("It should be possible to " - + "explicitly enable %s in interpreted mode.", - SEGMENTED_CODE_CACHE); - - CommandLineOptionTest.verifyOptionValue(SEGMENTED_CODE_CACHE, - "true", errorMessage, false, INT_MODE, - USE_SEGMENTED_CODE_CACHE); // SCC could be explicitly enabled w/o TieredCompilation and w/ // small ReservedCodeCacheSize value errorMessage = String.format("It should be possible to " diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/codeheapsize/TestCodeHeapSizeOptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -64,15 +64,9 @@ private TestCodeHeapSizeOptions() { super(CodeCacheCLITestBase.OPTIONS_SET, new CodeCacheCLITestCase(CodeCacheCLITestCase - .CommonDescriptions.INT_MODE.description, - GENERIC_RUNNER), - new CodeCacheCLITestCase(CodeCacheCLITestCase .CommonDescriptions.NON_TIERED.description, GENERIC_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase - .CommonDescriptions.TIERED_LEVEL_0.description, - GENERIC_RUNNER), - new CodeCacheCLITestCase(CodeCacheCLITestCase .CommonDescriptions.TIERED_LEVEL_1.description, GENERIC_RUNNER), new CodeCacheCLITestCase(CodeCacheCLITestCase diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/codecache/cli/common/CodeCacheCLITestCase.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -66,9 +66,9 @@ public enum CommonDescriptions { /** * Verifies that in interpreted mode PrintCodeCache output contains - * only NonNMethod code heap. + * the whole code cache. Int mode disables SegmentedCodeCache with a warning. */ - INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.NonNMethod), USE_INT_MODE), + INT_MODE(ONLY_SEGMENTED, EnumSet.of(BlobType.All), USE_INT_MODE), /** * Verifies that with disabled SegmentedCodeCache PrintCodeCache output * contains only CodeCache's entry. @@ -87,11 +87,11 @@ false)), /** * Verifies that with TieredStopAtLevel=0 PrintCodeCache output will - * contain information about non-nmethods and non-profiled nmethods + * warn about SegmentedCodeCache and contain information about all * heaps only. */ TIERED_LEVEL_0(SEGMENTED_SERVER, - EnumSet.of(BlobType.NonNMethod, BlobType.MethodNonProfiled), + EnumSet.of(BlobType.All), CommandLineOptionTest.prepareBooleanFlag(TIERED_COMPILATION, true), CommandLineOptionTest.prepareNumericFlag(TIERED_STOP_AT, 0)), diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/compilercontrol/parser/TestCompileOnly.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,52 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8312573 + * @summary Test -XX:CompileOnly= with invalid arguments + * @library /test/lib / + * @run driver compiler.compilercontrol.parser.TestCompileOnly + */ + +package compiler.compilercontrol.parser; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class TestCompileOnly { + + public static void main(String[] args) throws Exception { + test(","); + test(" "); + test(", "); + test(" ,"); + test(",,"); + test(" "); + } + + public static void test(String compileOnlyCommand) throws Exception { + OutputAnalyzer output = ProcessTools.executeTestJvm("-XX:CompileOnly=" + compileOnlyCommand, "-version"); + output.shouldHaveExitValue(0); + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/intrinsics/string/TestStringCompareToDifferentLength.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,20 +24,20 @@ /* * @test - * @requires os.arch=="aarch64" + * @requires os.arch=="aarch64" | os.arch=="riscv64" * @summary String::compareTo implementation uses different algorithms for * different string length. This test creates string with specified * size and longer string, which is same at beginning. * Expecting length delta to be returned. Test class takes 2 * parameters: , - * Input parameters for this test are set according to Aarch64 + * Input parameters for this test are set according to Aarch64/RISC-V * String::compareTo intrinsic implementation specifics. Aarch64 * implementation has 1, 4, 8 -bytes loops for length < 72 and - * 16, 32, 64 -characters loops for length >= 72. Code is also affected + * 16, 32, 64 -characters loops for length >= 72. Aarch64 Code is also affected * by SoftwarePrefetchHintDistance vm flag value. - * @run main/othervm -XX:SoftwarePrefetchHintDistance=192 compiler.intrinsics.string.TestStringCompareToDifferentLength 4 2 5 10 13 17 20 23 24 25 71 72 73 88 90 192 193 208 209 - * @run main/othervm -XX:SoftwarePrefetchHintDistance=16 compiler.intrinsics.string.TestStringCompareToDifferentLength 4 2 5 10 13 17 20 23 24 25 71 72 73 88 90 - * @run main/othervm -XX:SoftwarePrefetchHintDistance=-1 compiler.intrinsics.string.TestStringCompareToDifferentLength 4 2 5 10 13 17 20 23 24 25 71 72 73 88 90 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:SoftwarePrefetchHintDistance=192 compiler.intrinsics.string.TestStringCompareToDifferentLength 4 2 5 10 13 17 20 23 24 25 71 72 73 88 90 192 193 208 209 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:SoftwarePrefetchHintDistance=16 compiler.intrinsics.string.TestStringCompareToDifferentLength 4 2 5 10 13 17 20 23 24 25 71 72 73 88 90 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:SoftwarePrefetchHintDistance=-1 compiler.intrinsics.string.TestStringCompareToDifferentLength 4 2 5 10 13 17 20 23 24 25 71 72 73 88 90 */ package compiler.intrinsics.string; diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jsr292/ContinuousCallSiteTargetChange.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -28,7 +28,7 @@ * * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox - * @run driver compiler.jsr292.ContinuousCallSiteTargetChange + * @run driver/timeout=180 compiler.jsr292.ContinuousCallSiteTargetChange */ package compiler.jsr292; diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/events/JvmciShutdownEventTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -35,9 +35,9 @@ * * @build compiler.jvmci.common.JVMCIHelpers * compiler.jvmci.events.JvmciShutdownEventListener - * @run driver jdk.test.lib.FileInstaller ./JvmciShutdownEventTest.config + * @run main/othervm jdk.test.lib.FileInstaller ./JvmciShutdownEventTest.config * ./META-INF/services/jdk.vm.ci.services.JVMCIServiceLocator - * @run driver jdk.test.lib.helpers.ClassFileInstaller + * @run main/othervm jdk.test.lib.helpers.ClassFileInstaller * compiler.jvmci.common.JVMCIHelpers$EmptyHotspotCompiler * compiler.jvmci.common.JVMCIHelpers$EmptyCompilerFactory * compiler.jvmci.common.JVMCIHelpers$EmptyCompilationRequestResult diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/libNativeCallTest.c 2024-01-09 21:18:15.000000000 +0000 @@ -189,6 +189,39 @@ a, b, c, d, e, f); } +jint JNICALL I32I(jint i00, jint i01, jint i02, jint i03, jint i04, jint i05, jint i06, jint i07, + jint i08, jint i09, jint i0a, jint i0b, jint i0c, jint i0d, jint i0e, jint i0f, + jint i10, jint i11, jint i12, jint i13, jint i14, jint i15, jint i16, jint i17, + jint i18, jint i19, jint i1a, jint i1b, jint i1c, jint i1d, jint i1e, jint i1f, + jint a) { + return i00 + i01 + i02 + i03 + i04 + i05 + i06 + i07 + + i08 + i09 + i0a + i0b + i0c + i0d + i0e + i0f + + i10 + i11 + i12 + i13 + i14 + i15 + i16 + i17 + + i18 + i19 + i1a + i1b + i1c + i1d + i1e + i1f + + a; +} + +JNIEXPORT jlong JNICALL Java_jdk_vm_ci_code_test_NativeCallTest_getI32I(JNIEnv *env, jclass clazz) { + return (jlong) (intptr_t) I32I; +} + +JNIEXPORT jint JNICALL Java_jdk_vm_ci_code_test_NativeCallTest__1I32I(JNIEnv *env, jclass clazz, + jint i00, jint i01, jint i02, jint i03, + jint i04, jint i05, jint i06, jint i07, + jint i08, jint i09, jint i0a, jint i0b, + jint i0c, jint i0d, jint i0e, jint i0f, + jint i10, jint i11, jint i12, jint i13, + jint i14, jint i15, jint i16, jint i17, + jint i18, jint i19, jint i1a, jint i1b, + jint i1c, jint i1d, jint i1e, jint i1f, + jint a) { + return I32I(i00, i01, i02, i03, i04, i05, i06, i07, + i08, i09, i0a, i0b, i0c, i0d, i0e, i0f, + i10, i11, i12, i13, i14, i15, i16, i17, + i18, i19, i1a, i1b, i1c, i1d, i1e, i1f, + a); +} + #ifdef __cplusplus } #endif diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -125,6 +125,26 @@ test("I32SDILDS", getI32SDILDS(), float.class, argClazz, argValues); } + @Test + public void testI32I() { + int sCount = 32; + // Pairs of , + Object[] remainingArgs = new Object[]{ + 12, int.class + }; + Class[] argClazz = new Class[sCount + remainingArgs.length / 2]; + Object[] argValues = new Object[sCount + remainingArgs.length / 2]; + for (int i = 0; i < sCount; i++) { + argValues[i] = i; + argClazz[i] = int.class; + } + for (int i = 0; i < remainingArgs.length; i += 2) { + argValues[sCount + i / 2] = remainingArgs[i + 0]; + argClazz[sCount + i / 2] = (Class) remainingArgs[i + 1]; + } + test("I32I", getI32I(), int.class, argClazz, argValues); + } + public void test(String name, long addr, Class returnClazz, Class[] types, Object[] values) { try { test(asm -> { @@ -138,7 +158,13 @@ asm.emitCallPrologue(cc, values); asm.emitCall(addr); asm.emitCallEpilogue(cc); - asm.emitFloatRet(((RegisterValue) cc.getReturn()).getRegister()); + if (returnClazz == float.class) { + asm.emitFloatRet(((RegisterValue) cc.getReturn()).getRegister()); + } else if (returnClazz == int.class) { + asm.emitIntRet(((RegisterValue) cc.getReturn()).getRegister()); + } else { + assert false : "Unimplemented return type: " + returnClazz; + } }, getMethod(name, types), values); } catch (Throwable e) { e.printStackTrace(); @@ -244,4 +270,24 @@ l18, l19, l1a, l1b, l1c, l1d, l1e, l1f, a, b, c, d, e, f); } + + public static native long getI32I(); + + public static native int _I32I(int i00, int i01, int i02, int i03, int i04, int i05, int i06, int i07, + int i08, int i09, int i0a, int i0b, int i0c, int i0d, int i0e, int i0f, + int i10, int i11, int i12, int i13, int i14, int i15, int i16, int i17, + int i18, int i19, int i1a, int i1b, int i1c, int i1d, int i1e, int i1f, + int a); + + public static int I32I(int i00, int i01, int i02, int i03, int i04, int i05, int i06, int i07, + int i08, int i09, int i0a, int i0b, int i0c, int i0d, int i0e, int i0f, + int i10, int i11, int i12, int i13, int i14, int i15, int i16, int i17, + int i18, int i19, int i1a, int i1b, int i1c, int i1d, int i1e, int i1f, + int a) { + return _I32I(i00, i01, i02, i03, i04, i05, i06, i07, + i08, i09, i0a, i0b, i0c, i0d, i0e, i0f, + i10, i11, i12, i13, i14, i15, i16, i17, + i18, i19, i1a, i1b, i1c, i1d, i1e, i1f, + a); + } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/aarch64/AArch64TestAssembler.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/aarch64/AArch64TestAssembler.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/aarch64/AArch64TestAssembler.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/aarch64/AArch64TestAssembler.java 2024-01-09 21:18:15.000000000 +0000 @@ -269,8 +269,7 @@ @Override public void emitCallPrologue(CallingConvention cc, Object... prim) { - emitGrowStack(cc.getStackSize()); - frameSize += cc.getStackSize(); + growFrame(cc.getStackSize()); AllocatableValue[] args = cc.getArguments(); for (int i = 0; i < args.length; i++) { emitLoad(args[i], prim[i]); @@ -279,8 +278,7 @@ @Override public void emitCallEpilogue(CallingConvention cc) { - emitGrowStack(-cc.getStackSize()); - frameSize -= cc.getStackSize(); + growFrame(-cc.getStackSize()); } @Override diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/amd64/AMD64TestAssembler.java 2024-01-09 21:18:15.000000000 +0000 @@ -403,8 +403,7 @@ @Override public void emitCallPrologue(CallingConvention cc, Object... prim) { - emitGrowStack(cc.getStackSize()); - frameSize += cc.getStackSize(); + growFrame(cc.getStackSize()); AllocatableValue[] args = cc.getArguments(); // Do the emission in reverse, this avoids register collisons of xmm0 - which is used a // scratch register when putting arguments on the stack. @@ -427,7 +426,6 @@ @Override public void emitCallEpilogue(CallingConvention cc) { - emitGrowStack(-cc.getStackSize()); - frameSize -= cc.getStackSize(); + growFrame(-cc.getStackSize()); } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -31,7 +31,7 @@ * java.base/jdk.internal.misc * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src * @build jdk.vm.ci.hotspot.test.DummyClass - * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.vm.ci.hotspot.test.DummyClass + * @run main/othervm jdk.test.lib.helpers.ClassFileInstaller jdk.vm.ci.hotspot.test.DummyClass * @run testng/othervm/timeout=300 -Xbootclasspath/a:. * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:-UseJVMCICompiler jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/meta/StableFieldTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/meta/StableFieldTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/jvmci/meta/StableFieldTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/jvmci/meta/StableFieldTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -33,7 +33,7 @@ * jdk.internal.vm.ci/jdk.vm.ci.runtime * * @compile StableFieldTest.java - * @run driver jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest + * @run main/othervm jdk.test.lib.helpers.ClassFileInstaller compiler.jvmci.meta.StableFieldTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler -Xbootclasspath/a:. compiler.jvmci.meta.StableFieldTest */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/lib/ir_framework/test/TestVM.java 2024-01-09 21:18:15.000000000 +0000 @@ -281,7 +281,7 @@ BaseTest baseTest = new BaseTest(test, shouldExcludeTest(m.getName())); allTests.add(baseTest); if (PRINT_VALID_IR_RULES) { - irMatchRulePrinter.emitRuleEncoding(m, baseTest.isSkipped()); + irMatchRulePrinter.emitRuleEncoding(m, baseTest.isSkipped()); } } catch (TestFormatException e) { // Failure logged. Continue and report later. @@ -462,19 +462,20 @@ private void applyForceCompileCommand(Executable ex) { ForceCompile forceCompileAnno = getAnnotation(ex, ForceCompile.class); if (forceCompileAnno != null) { - CompLevel complevel = forceCompileAnno.value(); - TestFormat.check(complevel != CompLevel.SKIP && complevel != CompLevel.WAIT_FOR_COMPILATION, + CompLevel compLevel = forceCompileAnno.value(); + TestFormat.check(compLevel != CompLevel.SKIP && compLevel != CompLevel.WAIT_FOR_COMPILATION, "Cannot define compilation level SKIP or WAIT_FOR_COMPILATION in @ForceCompile at " + ex); - complevel = restrictCompLevel(forceCompileAnno.value()); + compLevel = restrictCompLevel(forceCompileAnno.value()); if (FLIP_C1_C2) { - complevel = complevel.flipCompLevel(); + compLevel = compLevel.flipCompLevel(); + compLevel = restrictCompLevel(compLevel.flipCompLevel()); } if (EXCLUDE_RANDOM) { - complevel = complevel.excludeCompilationRandomly(ex); + compLevel = compLevel.excludeCompilationRandomly(ex); } - if (complevel != CompLevel.SKIP) { - enqueueForCompilation(ex, complevel); - forceCompileMap.put(ex, complevel); + if (compLevel != CompLevel.SKIP) { + enqueueForCompilation(ex, compLevel); + forceCompileMap.put(ex, compLevel); } } } @@ -504,7 +505,7 @@ } else { TestFormat.checkNoThrow(!m.isAnnotationPresent(IR.class), "Found @IR annotation on non-@Test method " + m); TestFormat.checkNoThrow(!m.isAnnotationPresent(Warmup.class) || getAnnotation(m, Run.class) != null, - "Found @Warmup annotation on non-@Test or non-@Run method " + m); + "Found @Warmup annotation on non-@Test or non-@Run method " + m); } } catch (TestFormatException e) { // Failure logged. Continue and report later. @@ -530,6 +531,7 @@ CompLevel compLevel = restrictCompLevel(testAnno.compLevel()); if (FLIP_C1_C2) { compLevel = compLevel.flipCompLevel(); + compLevel = restrictCompLevel(compLevel.flipCompLevel()); } if (EXCLUDE_RANDOM) { compLevel = compLevel.excludeCompilationRandomly(m); @@ -727,8 +729,8 @@ "Cannot use @Arguments at test method " + testMethod + " in combination with @Run method " + m); Warmup warmupAnno = getAnnotation(testMethod, Warmup.class); TestFormat.checkNoThrow(warmupAnno == null, - "Cannot set @Warmup at @Test method " + testMethod + " when used with its @Run method " - + m + ". Use @Warmup at @Run method instead."); + "Cannot set @Warmup at @Test method " + testMethod + " when used with its @Run method " + + m + ". Use @Warmup at @Run method instead."); Test testAnno = getAnnotation(testMethod, Test.class); TestFormat.checkNoThrow(runMode != RunMode.STANDALONE || testAnno.compLevel() == CompLevel.ANY, "Setting explicit compilation level for @Test method " + testMethod + " has no effect " @@ -864,7 +866,7 @@ public static void compile(Method m, CompLevel compLevel) { TestRun.check(compLevel != CompLevel.SKIP && compLevel != CompLevel.WAIT_FOR_COMPILATION, - "Invalid compilation request with level " + compLevel); + "Invalid compilation request with level " + compLevel); enqueueForCompilation(m, compLevel); } @@ -907,7 +909,7 @@ */ private static boolean notUnstableDeoptAssertion(Method m, CompLevel level) { return (USE_COMPILER && !XCOMP && !IGNORE_COMPILER_CONTROLS && !TEST_C1 && - (!EXCLUDE_RANDOM || WHITE_BOX.isMethodCompilable(m, level.getValue(), false))); + (!EXCLUDE_RANDOM || WHITE_BOX.isMethodCompilable(m, level.getValue(), false))); } public static void assertCompiledByC1(Method m) { @@ -962,7 +964,7 @@ default -> throw new TestRunException("compiledAtLevel() should not be called with " + level); } } - if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS || + if (!USE_COMPILER || XCOMP || TEST_C1 || IGNORE_COMPILER_CONTROLS || FLIP_C1_C2 || (EXCLUDE_RANDOM && !WHITE_BOX.isMethodCompilable(m, level.getValue(), false))) { return TriState.Maybe; } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/locks/TestUnlockOSR.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2023 SAP SE. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8316746 + * @summary During OSR, locks get transferred from interpreter frame. + * Check that unlocking 2 such locks works in the OSR compiled nmethod. + * Some platforms verify that the unlocking happens in the corrent order. + * + * @run main/othervm -Xbatch TestUnlockOSR + */ + +public class TestUnlockOSR { + static void test_method(Object a, Object b, int limit) { + synchronized(a) { // allocate space for monitors + synchronized(b) { + } + } // free space to test allocation in reused space + synchronized(a) { // reuse the space + synchronized(b) { + for (int i = 0; i < limit; i++) {} + } + } + } + + public static void main(String[] args) { + Object a = new TestUnlockOSR(), + b = new TestUnlockOSR(); + // avoid uncommon trap before last unlocks + for (int i = 0; i < 100; i++) { test_method(a, b, 0); } + // trigger OSR + test_method(a, b, 100000); + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestNodeSunkFromPreLoop.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestNodeSunkFromPreLoop.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestNodeSunkFromPreLoop.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestNodeSunkFromPreLoop.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8314024 + * @requires vm.compiler2.enabled + * @summary Node used in check in main loop sunk from pre loop before RC elimination + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseLoopPredicate TestNodeSunkFromPreLoop + * + */ + +public class TestNodeSunkFromPreLoop { + private static int unusedField; + + public static void main(String[] args) { + A object = new A(); + for (int i = 0; i < 20_000; i++) { + test(object, 1000, 0); + } + } + + private static int test(A object, int stop, int inv) { + int res = 0; + // pre/main/post loops created for this loop + for (int i = 0; i < stop; i++) { + // Optimized out. Delay transformation of loop above. + for (int j = 0; j < 10; j++) { + for (int k = 0; k < 10; k++) { + } + } + // null check in pre loop so field load also in pre loop + int v = object.field; + int v2 = (v + inv); + if (i > 1000) { + // never taken. v + inv has a use out of loop at an unc. + unusedField = v2; + } + // transformed in the main loop to i + (v + inv) + int v3 = (v + (i + inv)); + if (v3 > 1000) { + break; + } + } + return res; + } + + private static class A { + public int field; + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestSinkingMoreThan2AddPNodes.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSinkingMoreThan2AddPNodes.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestSinkingMoreThan2AddPNodes.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSinkingMoreThan2AddPNodes.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8315377 + * @requires vm.compiler2.enabled + * @summary C2: assert(u->find_out_with(Op_AddP) == nullptr) failed: more than 2 chained AddP nodes? + * @library /test/lib + * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:CompileOnly=TestSinkingMoreThan2AddPNodes::test TestSinkingMoreThan2AddPNodes + * + */ + +import jdk.test.lib.Utils; + +public class TestSinkingMoreThan2AddPNodes { + public static void main(String[] strArr) throws Exception { + Thread t = new Thread(new Runnable() { + public void run() { + test(); + } + }); + t.setDaemon(true); + t.start(); + Thread.sleep(Utils.adjustTimeout(500)); + } + + static void test() { + double dArr[] = new double[10]; + int i4 = 5, i11, i12 = 2, iArr[] = new int[400]; + long l1; + byte by1 = 0; + short s1 = 8; + + for (int i = 0; i < iArr.length; i++) { + iArr[i] = (i % 2 == 0) ? 23 : 34; + } + + for (i11 = 10; i11 > 9; ) { + l1 = 1; + do { + try { + i4 = 6 % i4; + i12 = iArr[(int) l1]; + } catch (ArithmeticException a_e) { + } + by1 += 8; + iArr = iArr; + } while (++l1 < 11); + } + + long meth_res = i12; + } +} + diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestSinkingNodesCausesLongCompilation.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSinkingNodesCausesLongCompilation.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestSinkingNodesCausesLongCompilation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSinkingNodesCausesLongCompilation.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8308103 + * @summary Massive (up to ~30x) increase in C2 compilation time since JDK 17 + * @run main/othervm -Xcomp -XX:CompileOnly=TestSinkingNodesCausesLongCompilation::mainTest -XX:+UnlockDiagnosticVMOptions + * -XX:RepeatCompilation=30 TestSinkingNodesCausesLongCompilation + */ + +public class TestSinkingNodesCausesLongCompilation { + public static final int N = 400; + public static int iFld=41489; + + public void mainTest(String[] strArr1) { + int i9=-13, i10=-248, i11=-4, i13=33, i15=-171, i18=-58, iArr2[]=new int[N]; + + for (i9 = 7; i9 < 256; i9++) { + i11 = 1; + do { + } while (++i11 < 101); + } + for (int i14 : iArr2) { + for (i15 = 63; 0 < i15; i15 -= 2) { + i10 *= i13; + i10 >>= i14; + } + for (i18 = 2; 63 > i18; i18++) { + i10 = iFld; + iArr2[i18] |= i11; + } + } + System.out.println("i9 = " + i9); + } + + public static void main(String[] strArr) { + TestSinkingNodesCausesLongCompilation _instance = new TestSinkingNodesCausesLongCompilation(); + for (int i = 0; i < 10; i++) { + _instance.mainTest(strArr); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestSunkNodeMissingCastAssert.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSunkNodeMissingCastAssert.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/loopopts/TestSunkNodeMissingCastAssert.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/loopopts/TestSunkNodeMissingCastAssert.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2023, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * bug 8312440 + * @summary assert(cast != nullptr) failed: must have added a cast to pin the node + * @run main/othervm -XX:-BackgroundCompilation TestSunkNodeMissingCastAssert + */ + + +public class TestSunkNodeMissingCastAssert { + private static int N = 500; + private static int ia[] = new int[N]; + private static volatile int ib[] = new int[N]; + + private static void test() { + for (int k = 1; k < 200; k++) + switch (k % 5) { + case 0: + ia[k - 1] -= 15; + case 2: + for (int m = 0; m < 1000; m++); + case 3: + ib[k - 1] <<= 5; + case 4: + ib[k + 1] <<= 3; + } + } + + public static void main(String[] args) { + for (int i = 0; i < 20000; i++) { + test(); + } + } +} + diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/parsing/MissingSafepointOnTryCatch.jasm 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class MissingSafepointOnTryCatch version 52:0 { + + static Method m:"()V" { + return; + } + + static Method test1:"()V" stack 1 { + try t; + invokestatic m:"()V"; + return; + + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t; + } + + static Method test2:"()V" stack 1 { + try t0; + try t1; + invokestatic m:"()V"; + endtry t1; + return; + + catch t1 java/lang/Exception; + stack_map class java/lang/Exception; + return; + + catch t0 java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t0; + } + + public static Method th:"()V" + throws java/lang/Exception + stack 2 locals 0 + { + new class java/lang/Exception; + dup; + invokespecial Method java/lang/Exception."":"()V"; + athrow; + } + + static Method test3:"()V" stack 1 locals 2 { + try t; + invokestatic m:"()V"; + iconst_1; + istore_0; + iconst_0; + istore_1; + return; + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + invokestatic th:"()V"; + return; + endtry t; + } + + static Method test4:"()V" stack 2 locals 2 { + try t; + invokestatic m:"()V"; + iconst_1; + istore_0; + iconst_0; + istore_1; + return; + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + iconst_1; + istore_0; + invokestatic th:"()V"; + return; + endtry t; + } + + static Method testInfinite:"()V" stack 1 { + try t; + invokestatic th:"()V"; + return; + + catch t java/lang/Throwable; + stack_map class java/lang/Throwable; + athrow; + endtry t; + } + +} // end Class MissingSafepointOnTryCatch diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/parsing/TestMissingSafepointOnTryCatch.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8313626 + * @summary assert(false) failed: malformed control flow to missing safepoint on backedge of a try-catch + * @library /test/lib + * @compile MissingSafepointOnTryCatch.jasm + * @run main/othervm -XX:CompileCommand=quiet + * -XX:CompileCommand=compileonly,MissingSafepointOnTryCatch::test* + * -XX:CompileCommand=dontinline,MissingSafepointOnTryCatch::m + * -XX:CompileCommand=inline,MissingSafepointOnTryCatch::th + * -XX:-TieredCompilation -Xcomp TestMissingSafepointOnTryCatch + */ + +import jdk.test.lib.Utils; + +public class TestMissingSafepointOnTryCatch { + + public static void infiniteLoop() { + try { + Thread thread = new Thread() { + public void run() { + MissingSafepointOnTryCatch.testInfinite(); + } + }; + thread.setDaemon(true); + thread.start(); + Thread.sleep(Utils.adjustTimeout(500)); + } catch (Exception e) {} + } + + public static void main(String[] args) { + try { + // to make sure java/lang/Exception class is resolved + MissingSafepointOnTryCatch.th(); + } catch (Exception e) {} + MissingSafepointOnTryCatch.test1(); + MissingSafepointOnTryCatch.test2(); + MissingSafepointOnTryCatch.test3(); + MissingSafepointOnTryCatch.test4(); + infiniteLoop(); + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/uncommontrap/TestDeoptOOM.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -33,6 +33,19 @@ * compiler.uncommontrap.TestDeoptOOM */ +/* + * @test + * @bug 8273456 + * @summary Test that ttyLock isn't held when taking StackWatermark_lock + * @requires !vm.graal.enabled & vm.gc.Z + * @run main/othervm -XX:-BackgroundCompilation -Xmx128M -XX:+IgnoreUnrecognizedVMOptions -XX:+VerifyStack + * -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::main + * -XX:CompileCommand=exclude,compiler.uncommontrap.TestDeoptOOM::m9_1 + * -XX:+UnlockDiagnosticVMOptions + * -XX:+UseZGC -XX:+LogCompilation -XX:+PrintDeoptimizationDetails -XX:+TraceDeoptimization -XX:+Verbose + * compiler.uncommontrap.TestDeoptOOM + */ + package compiler.uncommontrap; public class TestDeoptOOM { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -224,12 +224,12 @@ } static void testMismatched(Callable c, Runnable setDefaultAction) throws Exception { - testMismatched(c, setDefaultAction, false); + testMismatched(c, setDefaultAction, false, true); } - static void testMismatched(Callable c, Runnable setDefaultAction, boolean objectArray) throws Exception { - if (Compiler.isGraalEnabled() && !objectArray) { - // Graal will constant fold mismatched reads from primitive stable arrays + static void testMismatched(Callable c, Runnable setDefaultAction, boolean objectArray, boolean aligned) throws Exception { + if (Compiler.isGraalEnabled() && !objectArray && aligned) { + // Graal will constant fold mismatched reads from primitive stable arrays, except unaligned ones run(c, setDefaultAction, null); } else { run(c, null, setDefaultAction); @@ -319,15 +319,15 @@ testMatched( Test::testD_D, Test::changeD); // Object[], aligned accesses - testMismatched(Test::testL_J, Test::changeL, true); // long & double are always as large as an OOP - testMismatched(Test::testL_D, Test::changeL, true); + testMismatched(Test::testL_J, Test::changeL, true, true); // long & double are always as large as an OOP + testMismatched(Test::testL_D, Test::changeL, true, true); testMatched( Test::testL_L, Test::changeL); // Unaligned accesses - testMismatched(Test::testS_U, Test::changeS); - testMismatched(Test::testC_U, Test::changeC); - testMismatched(Test::testI_U, Test::changeI); - testMismatched(Test::testJ_U, Test::changeJ); + testMismatched(Test::testS_U, Test::changeS, false, false); + testMismatched(Test::testC_U, Test::changeC, false, false); + testMismatched(Test::testI_U, Test::changeI, false, false); + testMismatched(Test::testJ_U, Test::changeJ, true, false); // No way to reliably check the expected behavior: // (1) OOPs change during GC; diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/g1/ihop/TestIHOPErgo.java 2024-01-09 21:18:15.000000000 +0000 @@ -30,6 +30,7 @@ * @requires !vm.flightRecorder * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @requires vm.opt.MaxGCPauseMillis == "null" + * @requires vm.compMode != "Xcomp" * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/g1/ihop/TestIHOPStatic.java 2024-01-09 21:18:15.000000000 +0000 @@ -28,7 +28,8 @@ * @requires vm.gc.G1 * @requires !vm.flightRecorder * @requires vm.opt.ExplicitGCInvokesConcurrent != true - * @requires !(vm.graal.enabled & vm.compMode == "Xcomp") + * @requires !vm.graal.enabled + * @requires vm.compMode != "Xcomp" * @requires os.maxMemory > 1G * @library /test/lib / * @modules java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java 2024-01-09 21:18:15.000000000 +0000 @@ -58,7 +58,13 @@ // Do this once here. // Scan for Metaspace update notices as part of the GC log, e.g. in this form: // [gc,metaspace ] GC(0) Metaspace: 11895K(14208K)->11895K(14208K) NonClass: 10552K(12544K)->10552K(12544K) Class: 1343K(1664K)->1343K(1664K) - metaSpaceRegexp = Pattern.compile(".*Metaspace: ([0-9]+).*->([0-9]+).*"); + // This regex has to be up-to-date with the format used in hotspot to print metaspace change. + final String NUM_K = "\\d+K"; + final String GP_NUM_K = "(\\d+)K"; + final String BR_NUM_K = "\\(" + NUM_K + "\\)"; + final String SIZE_CHG = NUM_K + BR_NUM_K + "->" + NUM_K + BR_NUM_K; + metaSpaceRegexp = Pattern.compile(".* Metaspace: " + GP_NUM_K + BR_NUM_K + "->" + GP_NUM_K + BR_NUM_K + + "( NonClass: " + SIZE_CHG + " Class: " + SIZE_CHG + ")?$"); } public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stress/TestStressIHOPMultiThread.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -24,7 +24,7 @@ package gc.stress; /* - * @test TestStressIHOPMultiThread + * @test * @bug 8148397 * @key stress * @summary Stress test for IHOP @@ -34,21 +34,41 @@ * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread1.log * -Dtimeout=2 -DheapUsageMinBound=30 -DheapUsageMaxBound=80 * -Dthreads=2 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx256m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=2m -XX:+G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread2.log * -Dtimeout=2 -DheapUsageMinBound=60 -DheapUsageMaxBound=90 * -Dthreads=3 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx256m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=4m -XX:-G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread3.log * -Dtimeout=2 -DheapUsageMinBound=40 -DheapUsageMaxBound=90 * -Dthreads=5 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx128m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=8m -XX:+G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread4.log * -Dtimeout=2 -DheapUsageMinBound=20 -DheapUsageMaxBound=90 * -Dthreads=10 gc.stress.TestStressIHOPMultiThread + */ + +/* + * @test + * @requires vm.gc.G1 * @run main/othervm/timeout=200 -Xmx512m -XX:G1HeapWastePercent=0 -XX:G1MixedGCCountTarget=1 * -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:+G1UseAdaptiveIHOP * -Xlog:gc+ihop=debug,gc+ihop+ergo=debug,gc+ergo=debug:TestStressIHOPMultiThread5.log diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stress/TestStressRSetCoarsening.java 2024-01-09 21:18:15.000000000 +0000 @@ -27,13 +27,12 @@ import jdk.test.whitebox.WhiteBox; /* - * @test TestStressRSetCoarsening.java + * @test * @key stress * @bug 8146984 8147087 * @requires vm.gc.G1 * @requires os.maxMemory > 3G * @requires vm.opt.MaxGCPauseMillis == "null" - * * @summary Stress G1 Remembered Set by creating a lot of cross region links * @modules java.base/jdk.internal.misc * @library /test/lib @@ -42,27 +41,82 @@ * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 1 0 300 + * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 1 0 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx500m -XX:G1HeapRegionSize=8m gc.stress.TestStressRSetCoarsening 1 10 300 + * -Xmx500m -XX:G1HeapRegionSize=8m gc.stress.TestStressRSetCoarsening 1 10 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 * -Xmx500m -XX:G1HeapRegionSize=32m gc.stress.TestStressRSetCoarsening 42 10 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm/timeout=300 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 2 0 300 + * -Xmx500m -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 2 0 300 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm/timeout=1800 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 500 0 1800 + * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 500 0 1800 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires os.maxMemory > 3G + * @requires vm.opt.MaxGCPauseMillis == "null" + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build jdk.test.whitebox.WhiteBox + * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * @run main/othervm/timeout=1800 * -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UseG1GC -Xlog:gc* -XX:MaxGCPauseMillis=1000 - * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 10 10 1800 + * -Xmx1G -XX:G1HeapRegionSize=1m gc.stress.TestStressRSetCoarsening 10 10 1800 */ /** @@ -95,7 +149,7 @@ } int objectsPerRegion = Integer.parseInt(args[0]); // 1 means humongous int regsToRefresh = Integer.parseInt(args[1]); // 0 means no regions to refresh at the end of cycle - int timeout = Integer.parseInt(args[2]); // in seconds, test should stop working eariler + int timeout = Integer.parseInt(args[2]); // in seconds, test should stop working earlier new TestStressRSetCoarsening(objectsPerRegion, regsToRefresh, timeout).go(); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java 2024-01-09 21:18:15.000000000 +0000 @@ -333,9 +333,8 @@ // Create duplicate of baseString StringBuilder sb1 = new StringBuilder(baseString); String dupString1 = sb1.toString(); - if (getValue(dupString1) == getValue(baseString)) { - throw new RuntimeException("Values should not match"); - } + + checkNotDeduplicated(getValue(dupString1), getValue(baseString)); // Force baseString to be inspected for deduplication // and be inserted into the deduplication hashtable. @@ -348,9 +347,8 @@ // Create a new duplicate of baseString StringBuilder sb2 = new StringBuilder(baseString); String dupString2 = sb2.toString(); - if (getValue(dupString2) == getValue(baseString)) { - throw new RuntimeException("Values should not match"); - } + + checkNotDeduplicated(getValue(dupString2), getValue(baseString)); // Intern the new duplicate Object beforeInternedValue = getValue(dupString2); @@ -369,16 +367,13 @@ // Check original value of interned string, to make sure // deduplication happened on the interned string and not // on the base string - if (beforeInternedValue == getValue(baseString)) { - throw new RuntimeException("Values should not match"); - } + checkNotDeduplicated(beforeInternedValue, getValue(baseString)); // Create duplicate of baseString StringBuilder sb3 = new StringBuilder(baseString); String dupString3 = sb3.toString(); - if (getValue(dupString3) == getValue(baseString)) { - throw new RuntimeException("Values should not match"); - } + + checkNotDeduplicated(dupString3, getValue(baseString)); forceDeduplication(ageThreshold, FullGC); @@ -395,6 +390,15 @@ System.out.println("End: InternedTest"); } + private static void checkNotDeduplicated(Object value1, Object value2) { + // Note that the following check is invalid since a GC + // can run and actually deduplicate the strings. + // + // if (value1 == value2) { + // throw new RuntimeException("Values should not match"); + // } + } + public static OutputAnalyzer run() throws Exception { return runTest("-Xlog:gc=debug,stringdedup*=debug", "-XX:+UseStringDeduplication", diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/CDSCompressedKPtrs.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -25,6 +25,7 @@ * @test * @requires vm.cds * @requires vm.bits == 64 + * @requires vm.flagless * @bug 8003424 * @summary Testing UseCompressedClassPointers with CDS * @library /test/lib diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CDSCompressedKPtrs/XShareAuto.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -24,6 +24,7 @@ /** * @test * @requires vm.cds + * @requires vm.flagless * @bug 8005933 * @summary -Xshare:auto is the default when -Xshare is not specified * @library /test/lib diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/FormatCheckingTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8148854 * @summary Ensure class name loaded by app class loader is format checked by default + * @requires vm.flagless * @library /test/lib * @compile BadHelloWorld.jcod * @modules java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/JsrRewriting.java 2024-01-09 21:18:15.000000000 +0000 @@ -32,6 +32,7 @@ * @bug 7053586 * @bug 7185550 * @bug 7149464 + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.desktop diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/OomWhileParsingRepeatedJsr.java 2024-01-09 21:18:15.000000000 +0000 @@ -33,6 +33,7 @@ * @bug 7037122 * @bug 7123945 * @bug 8016029 + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.desktop diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/ClassFile/TestCheckedExceptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -29,6 +29,7 @@ * clause does not cause the JVM to assert nor throw an exception. * Also, test that logging can be used to print a message about bogus * classes in method throws clauses. + * @requires vm.flagless * @library /test/lib * @compile CheckedExceptions.jcod * @run driver TestCheckedExceptions diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassPointers.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8024927 * @summary Testing address of compressed class pointer space as best as possible. * @requires vm.bits == 64 & !vm.graal.enabled + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedClassSpaceSize.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -26,6 +26,7 @@ * @bug 8022865 * @summary Tests for the -XX:CompressedClassSpaceSize command line option * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/CompressedKlassPointerAndOops.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2021, 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 @@ -29,6 +29,7 @@ * @modules java.base/jdk.internal.misc * java.management * @requires vm.bits == 64 + * @requires vm.flagless * @run driver CompressedKlassPointerAndOops */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/ObjectAlignment.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8022865 * @summary Tests for the -XX:ObjectAlignmentInBytes command line option + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/CompressedOops/UseCompressedOops.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8022865 * @summary Tests for different combination of UseCompressedOops options + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Dictionary/CleanProtectionDomain.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /* * @test * @summary Verifies the creation and cleaup of entries in the Protection Domain Table + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * @build jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Dictionary/ProtectionDomainCacheTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8151486 8218266 * @summary Call Class.forName() on the system classloader from a class loaded * from a custom classloader, using the current class's protection domain. + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * @build jdk.test.lib.Utils diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -26,6 +26,7 @@ * @test id=special * @bug 8226956 * @summary Run invocation tests against C1 compiler + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invocationOldCHATests.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ /* * @test id=special * @summary Run invocation tests with old CHA (-XX:-UseVtableBasedCHA) + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -26,6 +26,7 @@ * @test id=current-int * @bug 8224137 * @summary Run invokeinterface invocation tests + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -26,6 +26,7 @@ * @test id=current-int * @bug 8224137 * @summary Run invokespecial invocation tests + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -26,6 +26,7 @@ * @test id=current-int * @bug 8224137 * @summary Run invokevirtual invocation tests + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeEnvVarTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8260349 * @summary test that setting via the env-var and options file shows up as expected + * @requires vm.flagless * @library /test/lib * @run driver MaxMetaspaceSizeEnvVarTest */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -27,6 +27,7 @@ /* * @test MaxMetaspaceSizeTest * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true + * @requires vm.flagless * @bug 8087291 * @library /test/lib * @run driver MaxMetaspaceSizeTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Monitor/MonitorUsedDeflationThresholdTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -29,6 +29,7 @@ * @test * @bug 8226416 * @summary Test the MonitorUsedDeflationThreshold and NoAsyncDeflationProgressMax options. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver MonitorUsedDeflationThresholdTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Monitor/SyncOnValueBasedClassTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -30,6 +30,7 @@ * @test * @bug 8242263 * @summary Exercise DiagnoseSyncOnValueBasedClasses diagnostic flag + * @requires vm.flagless * @library /test/lib * @run driver/timeout=180000 SyncOnValueBasedClassTest */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/PerfMemDestroy/PerfMemDestroy.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8030955 * @summary Allow multiple calls to PerfMemory::destroy() without asserting. + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/PrintStringTableStats/PrintStringTableStatsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -27,6 +27,7 @@ /* * @test PrintStringTableStatsTest * @bug 8211821 + * @requires vm.flagless * @library /test/lib * @run driver PrintStringTableStatsTest */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortOnVMOperationTimeout.java 2024-01-09 21:18:15.000000000 +0000 @@ -28,6 +28,7 @@ * @test TestAbortOnVMOperationTimeout * @bug 8181143 8269523 8307653 * @summary Check abort on VM timeout is working + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Safepoint/TestAbortVMOnSafepointTimeout.java 2024-01-09 21:18:15.000000000 +0000 @@ -30,6 +30,7 @@ * @test TestAbortVMOnSafepointTimeout * @summary Check if VM can kill thread which doesn't reach safepoint. * @bug 8219584 8227528 + * @requires vm.flagless * @library /testlibrary /test/lib * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/StackTraceLogging.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8150778 * @summary check stacktrace logging + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/TestCatchThrowableOOM.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8267118 * @summary Test catching Throwable doesn't trigger OOME + * @requires vm.flagless * @library /test/lib * @run driver TestCatchThrowableOOM */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/Throwable/TestMaxJavaStackTraceDepth.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 7179701 * @summary MaxJavaStackTraceDepth of zero is not handled correctly/consistently in the VM + * @requires vm.flagless * @modules java.base/jdk.internal.misc:open * @modules java.base/java.lang:open * @library /test/lib diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/MaxMetaspaceSize.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /** * @test * @requires vm.cds + * @requires vm.flagless * @bug 8067187 8200078 * @summary Testing CDS dumping with the -XX:MaxMetaspaceSize= option * @library /test/lib diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/SharedStrings.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStrings.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/SharedStrings.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStrings.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,8 @@ * @test * @summary Check to make sure that shared strings in the bootstrap CDS archive * are actually shared - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap + * @requires vm.flagless * @library /test/lib * @build SharedStringsWb jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStringsDedup.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,7 @@ /** * @test SharedStringsDedup * @summary Test -Xshare:auto with shared strings and -XX:+UseStringDeduplication - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib * @run driver SharedStringsDedup */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/SharedStringsRunAuto.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,7 @@ /** * @test SharedStringsAuto * @summary Test -Xshare:auto with shared strings. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib * @run driver SharedStringsRunAuto */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/CommandLineFlagCombo.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,7 @@ /* * @test CommandLineFlagCombo - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed * vm options. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/MoveJDKTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -27,6 +27,7 @@ * @summary Test that CDS still works when the JDK is moved to a new directory * @bug 8272345 * @requires vm.cds + * @requires vm.flagless * @comment This test doesn't work on Windows because it depends on symlinks * @requires os.family != "windows" * @library /test/lib diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java 2024-01-09 21:18:15.000000000 +0000 @@ -412,6 +412,8 @@ cmd.add(opts.appJar); } + CDSTestUtils.addVerifyArchivedFields(cmd); + for (String s : opts.suffix) cmd.add(s); if (RUN_WITH_JFR) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/VerifyWithDefaultArchive.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @test * @bug 8264337 * @summary test default cds archive when turning on VerifySharedSpaces + * @requires vm.flagless * @requires vm.cds * @library /test/lib * @run driver VerifyWithDefaultArchive diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedIntegerCacheTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test primitive box caches integrity in various scenarios (IntegerCache etc) - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile CheckIntegerCacheApp.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleComboTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test archived system module sub-graph and verify objects are archived. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile CheckArchivedModuleApp.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleCompareTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Compare archived system modules with non-archived. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile PrintSystemModulesApp.java * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar app.jar PrintSystemModulesApp diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedModuleWithCustomImageTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,8 @@ /* * @test * @summary Test archived module graph with custom runtime image - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap + * @requires vm.flagless * @library /test/jdk/lib/testlibrary /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile CheckArchivedModuleApp.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/CheckCachedMirrorTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test archived mirror - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.cds.custom.loaders * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DifferentHeapSizes.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test automatic relocation of archive heap regions dur to heap size changes. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile ../test-classes/Hello.java * @build jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/DumpTimeVerifyFailure.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -26,7 +26,7 @@ * @test * @summary Dump time should not crash if any class with shared strings fails verification due to missing dependencies. * @bug 8186789 - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @compile MyOuter.java MyException.java * @run driver DumpTimeVerifyFailure diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/GCStressTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @key randomness * @summary - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox jdk.test.lib.Utils * @compile GCStressApp.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/HeapFragmentationTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Relocate CDS archived regions to the top of the G1 heap * @bug 8214455 - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires (sun.arch.data.model == "64" & os.maxMemory > 4g) * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HeapFragmentationApp diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/MirrorWithReferenceFieldsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test archived mirror with reference fields - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile MirrorWithReferenceFieldsApp.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/OpenArchiveRegion.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2021, 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 @@ -25,7 +25,7 @@ /* * @test * @summary Test open archive heap regions - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed * vm options. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/PrimitiveTypesTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test archived primitive type mirrors - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox * @compile PrimitiveTypesApp.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/RedefineClassTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Redefine shared class. GC should not cause crash with cached resolved_references. * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes /test/hotspot/jtreg/runtime/cds/appcds/jvmti - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @build jdk.test.whitebox.WhiteBox * RedefineClassApp diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/VerifyArchivedFields.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/VerifyArchivedFields.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/VerifyArchivedFields.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/cacheObject/VerifyArchivedFields.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2021, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @summary run with -XX:VerifyArchivedFields=2 for more expensive verification + * of the archived heap objects. + * @requires vm.cds.write.archived.java.heap + * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes + * @build Hello + * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar Hello.jar Hello + * @run driver VerifyArchivedFields + */ + +import jdk.test.lib.helpers.ClassFileInstaller; + +public class VerifyArchivedFields { + // Note: -XX:VerifyArchivedFields=2 will force a GC every time when + // HeapShared::initialize_from_archived_subgraph(Klass* k, ...) is called. This ensures + // that it's safe to do a GC even when the oop->klass() of some archived heap objects + // are not yet loaded into the system dictionary. + public static void main(String[] args) throws Exception { + TestCommon.test(ClassFileInstaller.getJarPath("Hello.jar"), + TestCommon.list("Hello"), + "-XX:+UnlockDiagnosticVMOptions", + "-XX:VerifyArchivedFields=2", + "-Xlog:cds=debug", + "-Xlog:cds+heap=debug", + "-Xlog:gc*=debug", + "Hello"); + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/ExceptionDuringDumpAtObjectsInitPhase.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Out of memory When dumping the CDS archive * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @run driver ExceptionDuringDumpAtObjectsInitPhase */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/GCSharedStringsDuringDump.java 2024-01-09 21:18:15.000000000 +0000 @@ -27,7 +27,7 @@ * @summary Similar to GCDuringDumping.java, this test adds the -XX:SharedArchiveConfigFile * option for testing the interaction with GC and shared strings. * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/javaldr/HumongousDuringDump.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Test how CDS dumping handles the existence of humongous G1 regions. * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds /test/hotspot/jtreg/runtime/cds/appcds/test-classes - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires vm.jvmti * @run driver/timeout=240 HumongousDuringDump */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/jcmd/JCmdTestDynamicDump.java 2024-01-09 21:18:15.000000000 +0000 @@ -27,6 +27,7 @@ * @bug 8259070 * @summary Test jcmd to dump dynamic shared archive. * @requires vm.cds + * @requires vm.flagless * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @modules jdk.jcmd/sun.tools.common:+open * @compile ../test-classes/Hello.java JCmdTestDumpBase.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/ExerciseGC.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Exercise GC with shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloStringGC jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/FlagCombo.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /** * @test * @summary Test relevant combinations of command line flags with shared strings - * @requires vm.cds.archived.java.heap & vm.hasJFR + * @requires vm.cds.write.archived.java.heap & vm.hasJFR * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver FlagCombo @@ -35,7 +35,7 @@ * @test * @summary Test relevant combinations of command line flags with shared strings * @comment A special test excluding the case that requires JFR - * @requires vm.cds.archived.java.heap & !vm.hasJFR + * @requires vm.cds.write.archived.java.heap & !vm.hasJFR * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver FlagCombo noJfr diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java 2024-01-09 21:18:15.000000000 +0000 @@ -31,7 +31,7 @@ * @test * @summary Test options that are incompatible with use of shared strings * Also test mismatch in oops encoding between dump time and run time - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @comment This test explicitly chooses the type of GC to be used by sub-processes. It may conflict with the GC type set * via the -vmoptions command line option of JTREG. vm.gc==null will help the test case to discard the explicitly passed * vm options. @@ -46,7 +46,7 @@ /* * @test - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires (vm.gc=="null") * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox @@ -57,7 +57,7 @@ /* * @test - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @requires (vm.gc=="null") * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InternSharedString.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test shared strings together with string intern operation - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @compile InternStringTest.java * @build jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/InvalidFileFormat.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,7 +25,7 @@ /* * @test * @summary Check most common errors in file format - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver InvalidFileFormat diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LargePages.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Basic shared string test with large pages - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build HelloString * @run driver LargePages diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/LockSharedStrings.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Test locking on shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @compile LockStringTest.java LockStringValueTest.java * @build jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Basic test for shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString * @run driver SharedStringsBasic diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasicPlus.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Basic plus test for shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloStringPlus jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsHumongous.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Use a shared string allocated in a humongous G1 region. * @comment -- the following implies that G1 is used (by command-line or by default) - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsStress.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary Write a lots of shared strings. - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/hotspot/jtreg/runtime/cds/appcds /test/lib * @build HelloString * @run driver/timeout=500 SharedStringsStress diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsWbTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test * @summary White box test for shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @build jdk.test.whitebox.WhiteBox SharedStringsWb * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Regression test for JDK-8098821 * @bug 8098821 - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @library /test/lib /test/hotspot/jtreg/runtime/cds/appcds * @run driver SysDictCrash */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/cds/serviceability/ReplaceCriticalClassesForSubgraphs.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,7 +26,7 @@ * @test * @summary Tests how CDS works when critical library classes are replaced with JVMTI ClassFileLoadHook * @library /test/lib - * @requires vm.cds.archived.java.heap + * @requires vm.cds.write.archived.java.heap * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller -jar whitebox.jar jdk.test.whitebox.WhiteBox * @run main/othervm/native ReplaceCriticalClassesForSubgraphs diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/ClassFileParserBug.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2021, 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 @@ -26,6 +26,7 @@ * @bug 8040018 * @library /test/lib * @summary Check for exception instead of assert. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * java.management * @compile LambdaMath.jcod diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/TestBadPackageWithInterface.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -26,6 +26,7 @@ * @bug 8245487 * @summary Check that if the VM rejects classes from packages starting with "java/", it will exit * cleanly after InstanceKlass::verify_on(), and not leave freed memory in _local_interfaces. + * @requires vm.flagless * @library /test/lib * @compile BadClassPackage.jasm * @run driver TestBadPackageWithInterface diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/classFileParserBug/TestEmptyBootstrapMethodsAttr.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8041918 * @library /test/lib * @summary Test empty bootstrap_methods table within BootstrapMethods attribute + * @requires vm.flagless * @modules java.base/jdk.internal.misc * java.management * @compile emptynumbootstrapmethods1.jcod emptynumbootstrapmethods2.jcod diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/BadBSMUseTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8186211 * @summary CONSTANT_Dynamic_info structure's tries to use a BSM index whose signature is for an invokedynamic and vice versa. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyUsesIndyBSM.jcod diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/CondyLDCTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8186211 * @summary Tests various ldc, ldc_w, ldc2_w instructions of CONSTANT_Dynamic. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyUseLDC_W.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/CondyNewInvokeSpecialTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8186211 * @summary Test CONSTANT_Dynamic where the BSM is invoked via a REF_newInvokeSpecial. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyNewInvokeSpecial.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/escapeAnalysis/TestEscapeCondy.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -26,6 +26,7 @@ * @bug 8216970 * @summary Ensure escape analysis can handle an ldc of a dynamic * constant whose return type is an array of boolean. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile TestEscapeThroughInvokeWithCondy$A.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/condy/staticInit/TestInitException.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8228485 * @summary Correctly handle initialization error for Condy BSM. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile Example.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/jni/nativeStack/libnativeStack.c 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 @@ -85,6 +85,13 @@ (*env)->ExceptionDescribe(env); exit(1); } + + res = (*jvm)->DetachCurrentThread(jvm); + if (res != JNI_OK) { + fprintf(stderr, "Test ERROR. Can't detach current thread: %d\n", res); + exit(1); + } + printf("Native thread terminating\n"); return NULL; diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassInitializationTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ /* * @test ClassInitializationTest * @bug 8142976 + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile BadMap50.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassLoadUnloadTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ /* * @test ClassLoadUnloadTest * @bug 8142506 - * @requires vm.opt.final.ClassUnloading + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @library classes @@ -78,6 +78,7 @@ Collections.addAll(argsList, args); Collections.addAll(argsList, "-Xmn8m"); Collections.addAll(argsList, "-Dtest.class.path=" + System.getProperty("test.class.path", ".")); + Collections.addAll(argsList, "-XX:+ClassUnloading"); Collections.addAll(argsList, ClassUnloadTestMain.class.getName()); return ProcessTools.createJavaProcessBuilder(argsList); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ClassResolutionTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ /* * @test ClassResolutionTest * @bug 8144874 + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver ClassResolutionTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/CompressedOopsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -24,7 +24,8 @@ /* * @test * @bug 8149991 - * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true + * @requires vm.bits == 64 + * @requires vm.flagless * @summary -Xlog:gc+heap+coops=info should have output from the code * @library /test/lib * @modules java.base/jdk.internal.misc diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/CondyIndyTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /* * @test * @summary Test -Xlog:methodhandles with a test that contains both a condy and indy. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile CondyIndyMathOperation.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/DefaultMethodsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8139564 8203960 * @summary defaultmethods=debug should have logging from each of the statements in the code + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ExceptionsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8141211 8147477 * @summary exceptions=info output should have an exception message for interpreter methods + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ItablesTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ItablesTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ItablesTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ItablesTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -27,6 +27,7 @@ * @summary itables=trace should have logging from each of the statements * in the code * @requires vm.debug + * @requires vm.flagless * @library /test/lib * @compile ClassB.java * ItablesVtableTest.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/LoaderConstraintsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ /* * @test LoaderConstraintsTest * @bug 8149996 + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib classes * @build test.Empty diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ModulesTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ModulesTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ModulesTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ModulesTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -24,6 +24,7 @@ /* * @test * @summary -Xlog:module should emit logging output + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/MonitorInflationTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8133885 * @summary monitorinflation=trace should have logging from each of the statements in the code + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/MonitorMismatchTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ /* * @test MonitorMismatchTest * @bug 8150084 + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile MonitorMismatchHelper.jasm diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/OsCpuLoggingTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8151939 * @summary os+cpu output should contain some os,cpu information + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ProtectionDomainVerificationTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /* * @test ProtectionDomainVerificationTest * @bug 8149064 + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver ProtectionDomainVerificationTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/SafepointCleanupTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8149991 * @summary safepoint+cleanup=info should have output from the code + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/SafepointTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/SafepointTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/SafepointTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/SafepointTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8140348 * @summary safepoint=trace should have output from each log statement in the code + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/StackWalkTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/StackWalkTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/StackWalkTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/StackWalkTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -26,6 +26,7 @@ * @test StackWalkTest * @bug 8160064 * @summary -Xlog:stackwalk should produce logging from the source code + * @requires vm.flagless * @library /test/lib * @run driver StackWalkTest */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/StartupTimeTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8148630 * @summary -Xlog:startuptime should produce logging from the source code + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/ThreadLoggingTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @test * @bug 8149036 8150619 * @summary os+thread output should contain logging calls for thread start stop attaches detaches + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/VMOperationTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VMOperationTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/VMOperationTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VMOperationTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8143157 * @summary vmoperation=debug should have logging output + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/VerificationTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VerificationTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/VerificationTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VerificationTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8150083 8234656 * @summary test enabling and disabling verification logging and verification log levels + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/VtablesTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VtablesTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/VtablesTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/VtablesTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -27,6 +27,7 @@ * @summary vtables=trace should have logging from each of the statements in the code * @library /test/lib * @requires vm.debug + * @requires vm.flagless * @compile ClassB.java * p1/A.java * p2/B.jcod diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/logging/loadLibraryTest/LoadLibraryTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8187305 * @summary Tests logging of shared library loads and unloads. + * @requires vm.flagless * @library /test/lib * @build jdk.test.whitebox.WhiteBox * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ClassLoaderNoUnnamedModuleTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8202758 * @summary Ensure that if the JVM encounters a ClassLoader whose unnamedModule field is not set an InternalError results. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile ClassLoaderNoUnnamedModule.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/IgnoreModulePropertiesTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8136930 * @summary Test that the VM ignores explicitly specified module internal properties. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver IgnoreModulePropertiesTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -26,6 +26,7 @@ * @bug 8136930 * @summary Test that the VM only recognizes the last specified --list-modules * options but accumulates --add-module values. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver ModuleOptionsTest diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleOptionsWarn.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8162415 * @summary Test warnings for ignored properties. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver ModuleOptionsWarn diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ExportModuleStressTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -25,6 +25,7 @@ * @test * @bug 8156871 * @summary package in the boot layer is repeatedly exported to unique module created in layers on top of the boot layer + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile ../CompilerUtils.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8159262 * @summary Test differing scenarios where a module's readability list and a package's exportability list should be walked + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile ../AccessCheck/ModuleLibrary.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStressGC.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8159262 * @summary layers over the boot layer are repeatedly created, during this iteration, GCs are forced to verify correct walk of module and package lists. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile ../CompilerUtils.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/ModulesSymLink.java 2024-01-09 21:18:15.000000000 +0000 @@ -28,6 +28,7 @@ * @summary Test with symbolic linked lib/modules * @bug 8220095 * @requires os.family == "linux" | os.family == "mac" + * @requires vm.flagless * @library /test/lib * @modules java.management * jdk.jlink diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModule2Dirs.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /* * @test * @summary Make sure --patch-module works with multiple directories. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile PatchModule2DirsMain.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleCDS.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @requires vm.cds * @summary test that --patch-module works with CDS + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.jartool/sun.tools.jar diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupJavaBase.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -24,6 +24,7 @@ /* * @test * @summary VM exit initialization results if java.base is specificed more than once to --patch-module. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver PatchModuleDupJavaBase diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleDupModule.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2021, 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 @@ -24,6 +24,7 @@ /* * @test * @summary Module system initialization exception results if a module is specificed twice to --patch-module. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @run driver PatchModuleDupModule diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleJavaBase.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8130399 * @summary Make sure --patch-module works for java.base. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile PatchModuleMain.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8130399 * @summary Make sure --patch-module works for modules besides java.base. + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile PatchModuleMain.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJar.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /* * @test * @summary Make sure --patch-module works when a jar file is specified for a module + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.jartool/sun.tools.jar diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTestJarDir.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,6 +24,7 @@ /* * @test * @summary Make sure --patch-module works when a jar file and a directory is specified for a module + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.jartool/sun.tools.jar diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleTraceCL.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @bug 8069469 * @summary Make sure -Xlog:class+load=info works properly with "modules" jimage, --patch-module, and with -Xbootclasspath/a + * @requires vm.flagless * @modules java.base/jdk.internal.misc * @library /test/lib * @compile PatchModuleMain.java diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/PatchModuleVisibility.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @summary Ensure that a newly introduced java.base package placed within the --patch-module * directory is considered part of the boot loader's visibility boundary * @requires !(os.family == "windows") + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpNoVisibility.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @summary Ensure that a class defined within a java.base package can not * be located via -Xbootclasspath/a + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/modules/Visibility/XbootcpVisibility.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ * @summary Ensure that a package whose module has not been defined to the boot loader * is correctly located with -Xbootclasspath/a * @requires !(os.family == "windows") + * @requires vm.flagless * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/HugePageConfiguration.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/HugePageConfiguration.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/HugePageConfiguration.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/HugePageConfiguration.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * 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. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.process.OutputAnalyzer; + +import java.io.*; +import java.util.Set; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +// This class allows us to parse system hugepage config from +// - a) the Operating System (the truth) +// - b) the JVM log (-Xlog:pagesize) +// This is used e.g. in TestHugePageDetection to determine if the JVM detects the correct settings from the OS. +class HugePageConfiguration { + + public static class StaticHugePageConfig implements Comparable { + public long pageSize = -1; + public long nr_hugepages = -1; + public long nr_overcommit_hugepages = -1; + + @Override + public int hashCode() { + return Objects.hash(pageSize); + } + + @Override + public String toString() { + return "StaticHugePageConfig{" + + "pageSize=" + pageSize + + ", nr_hugepages=" + nr_hugepages + + ", nr_overcommit_hugepages=" + nr_overcommit_hugepages + + '}'; + } + + @Override + public int compareTo(StaticHugePageConfig o) { + return (int) (pageSize - o.pageSize); + } + } + + Set _staticHugePageConfigurations; + long _staticDefaultHugePageSize = -1; + + enum THPMode {always, never, madvise} + THPMode _thpMode; + long _thpPageSize; + + public Set getStaticHugePageConfigurations() { + return _staticHugePageConfigurations; + } + + public long getStaticDefaultHugePageSize() { + return _staticDefaultHugePageSize; + } + + public THPMode getThpMode() { + return _thpMode; + } + + public long getThpPageSize() { + return _thpPageSize; + } + + // Returns true if the THP support is enabled + public boolean supportsTHP() { + return _thpMode == THPMode.always || _thpMode == THPMode.madvise; + } + + // Returns true if static huge pages are supported (whether or not we have configured the pools) + public boolean supportsStaticHugePages() { + return _staticDefaultHugePageSize > 0 && _staticHugePageConfigurations.size() > 0; + } + + public HugePageConfiguration(Set _staticHugePageConfigurations, long _staticDefaultHugePageSize, THPMode _thpMode, long _thpPageSize) { + this._staticHugePageConfigurations = _staticHugePageConfigurations; + this._staticDefaultHugePageSize = _staticDefaultHugePageSize; + this._thpMode = _thpMode; + this._thpPageSize = _thpPageSize; + } + + @Override + public String toString() { + return "Configuration{" + + "_staticHugePageConfigurations=" + _staticHugePageConfigurations + + ", _staticDefaultHugePageSize=" + _staticDefaultHugePageSize + + ", _thpMode=" + _thpMode + + ", _thpPageSize=" + _thpPageSize + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + HugePageConfiguration that = (HugePageConfiguration) o; + return _staticDefaultHugePageSize == that._staticDefaultHugePageSize && _thpPageSize == that._thpPageSize && + Objects.equals(_staticHugePageConfigurations, that._staticHugePageConfigurations) && _thpMode == that._thpMode; + } + + private static long readDefaultHugePageSizeFromOS() { + Pattern pat = Pattern.compile("Hugepagesize: *(\\d+) +kB"); + long result = 0; + try (Scanner scanner = new Scanner(new File("/proc/meminfo"))) { + while (scanner.hasNextLine()) { + Matcher mat = pat.matcher(scanner.nextLine()); + if (mat.matches()) { + scanner.close(); + return Long.parseLong(mat.group(1)) * 1024; + } + } + } catch (FileNotFoundException e) { + System.out.println("Could not open /proc/meminfo"); + } + return 0; + } + + private static Set readSupportedHugePagesFromOS() throws IOException { + TreeSet hugePageConfigs = new TreeSet<>(); + Pattern pat = Pattern.compile("hugepages-(\\d+)kB"); + File[] subdirs = new File("/sys/kernel/mm/hugepages").listFiles(); + if (subdirs != null) { + for (File subdir : subdirs) { + String name = subdir.getName(); + Matcher mat = pat.matcher(name); + if (mat.matches()) { + StaticHugePageConfig config = new StaticHugePageConfig(); + config.pageSize = Long.parseLong(mat.group(1)) * 1024; + try (FileReader fr = new FileReader(subdir.getAbsolutePath() + "/nr_hugepages"); + BufferedReader reader = new BufferedReader(fr)) { + String s = reader.readLine(); + config.nr_hugepages = Long.parseLong(s); + } + try (FileReader fr = new FileReader(subdir.getAbsolutePath() + "/nr_overcommit_hugepages"); + BufferedReader reader = new BufferedReader(fr)) { + String s = reader.readLine(); + config.nr_overcommit_hugepages = Long.parseLong(s); + } + hugePageConfigs.add(config); + } + } + } + return hugePageConfigs; + } + + private static THPMode readTHPModeFromOS() { + THPMode mode = THPMode.never; + String file = "/sys/kernel/mm/transparent_hugepage/enabled"; + try (FileReader fr = new FileReader(file); + BufferedReader reader = new BufferedReader(fr)) { + String s = reader.readLine(); + if (s.contains("[never]")) { + mode = THPMode.never; + } else if (s.contains("[always]")) { + mode = THPMode.always; + } else if (s.contains("[madvise]")) { + mode = THPMode.madvise; + } else { + throw new RuntimeException("Unexpected content of " + file + ": " + s); + } + } catch (IOException e) { + System.out.println("Failed to read " + file); + // Happens when the kernel is not built to support THPs. + mode = THPMode.never; + } + return mode; + } + + private static long readTHPPageSizeFromOS() { + long pagesize = 0; + String file = "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size"; + try (FileReader fr = new FileReader(file); + BufferedReader reader = new BufferedReader(fr)) { + String s = reader.readLine(); + pagesize = Long.parseLong(s); + } catch (IOException | NumberFormatException e) { } // ignored + return pagesize; + } + + // Fill object with info read from proc file system + public static HugePageConfiguration readFromOS() throws IOException { + return new HugePageConfiguration(readSupportedHugePagesFromOS(), + readDefaultHugePageSizeFromOS(), + readTHPModeFromOS(), + readTHPPageSizeFromOS()); + } + + public static long parseSIUnit(String num, String unit) { + long n = Long.parseLong(num); + return switch (unit) { + case "K" -> n * 1024; + case "M" -> n * 1024 * 1024; + case "G" -> n * 1024 * 1024 * 1024; + default -> throw new RuntimeException("Invalid unit " + unit); + }; + } + + public static HugePageConfiguration readFromJVMLog(OutputAnalyzer output) { + // Expects output from -Xlog:pagesize + // Example: + // [0.001s][info][pagesize] Static hugepage support: + // [0.001s][info][pagesize] hugepage size: 2M + // [0.001s][info][pagesize] hugepage size: 1G + // [0.001s][info][pagesize] default hugepage size: 2M + // [0.001s][info][pagesize] Transparent hugepage (THP) support: + // [0.001s][info][pagesize] THP mode: madvise + // [0.001s][info][pagesize] THP pagesize: 2M + TreeSet staticHugePageConfigs = new TreeSet<>(); + long defaultHugepageSize = 0; + THPMode thpMode = THPMode.never; + long thpPageSize = 0; + Pattern patternHugepageSize = Pattern.compile(".*\\[pagesize] *hugepage size: (\\d+)([KMG])"); + Pattern patternDefaultHugepageSize = Pattern.compile(".*\\[pagesize] *default hugepage size: (\\d+)([KMG]) *"); + Pattern patternTHPPageSize = Pattern.compile(".*\\[pagesize] *THP pagesize: (\\d+)([KMG])"); + Pattern patternTHPMode = Pattern.compile(".*\\[pagesize] *THP mode: (\\S+)"); + List lines = output.asLines(); + for (String s : lines) { + Matcher mat = patternHugepageSize.matcher(s); + if (mat.matches()) { + StaticHugePageConfig config = new StaticHugePageConfig(); + config.pageSize = parseSIUnit(mat.group(1), mat.group(2)); + staticHugePageConfigs.add(config); + continue; + } + if (defaultHugepageSize == 0) { + mat = patternDefaultHugepageSize.matcher(s); + if (mat.matches()) { + defaultHugepageSize = parseSIUnit(mat.group(1), mat.group(2)); + continue; + } + } + if (thpPageSize == 0) { + mat = patternTHPPageSize.matcher(s); + if (mat.matches()) { + thpPageSize = parseSIUnit(mat.group(1), mat.group(2)); + continue; + } + } + mat = patternTHPMode.matcher(s); + if (mat.matches()) { + thpMode = THPMode.valueOf(mat.group(1)); + } + } + + return new HugePageConfiguration(staticHugePageConfigs, defaultHugepageSize, thpMode, thpPageSize); + } + +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/THPsInThreadStackPreventionTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * 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. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test id=ENABLED + * @bug 8303215 8312182 + * @summary On THP=always systems, we prevent THPs from forming within thread stacks + * @library /test/lib + * @requires os.family == "linux" + * @requires vm.debug + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" + * @modules java.base/jdk.internal.misc + * java.management + * @run driver THPsInThreadStackPreventionTest PATCH-ENABLED + */ + +/* + * @test id=DISABLED + * @bug 8303215 8312182 + * @summary On THP=always systems, we prevent THPs from forming within thread stacks (negative test) + * @library /test/lib + * @requires os.family == "linux" + * @requires vm.debug + * @requires os.arch=="amd64" | os.arch=="x86_64" | os.arch=="aarch64" + * @modules java.base/jdk.internal.misc + * java.management + * @run main/manual THPsInThreadStackPreventionTest PATCH-DISABLED + */ +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jtreg.SkippedException; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Objects; +import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.CyclicBarrier; + +public class THPsInThreadStackPreventionTest { + + // We test the mitigation for "huge rss for THP=always" introduced with JDK-8312182 and JDK-8302015: + // + // We start a program that spawns a ton of threads with a stack size close to THP page size. The threads + // are idle and should not build up a lot of stack. The threads are started with an artificial delay + // between thread start and stack guardpage creation, which exacerbates the RSS bloat (for explanation + // please see 8312182). + // + // We then observe RSS of that program. We expect it to stay below a reasonable maximum. The unpatched + // version should show an RSS of ~2 GB (paying for the fully paged in thread stacks). The fixed variant should + // cost only ~200-400 MB. + + static final int numThreads = 1000; + static final long threadStackSizeMB = 2; // must be 2M + static final long heapSizeMB = 64; + static final long basicRSSOverheadMB = heapSizeMB + 150; + // A successful completion of this test would show not more than X KB per thread stack. + static final long acceptableRSSPerThreadStack = 128 * 1024; + static final long acceptableRSSForAllThreadStacks = numThreads * acceptableRSSPerThreadStack; + static final long acceptableRSSLimitMB = (acceptableRSSForAllThreadStacks / (1024 * 1024)) + basicRSSOverheadMB; + + private static class TestMain { + + static class Sleeper extends Thread { + CyclicBarrier barrier; + public Sleeper(CyclicBarrier barrier) { + this.barrier = barrier; + } + @Override + public void run() { + try { + barrier.await(); // wait for all siblings + barrier.await(); // wait main thread to print status + } catch (InterruptedException | BrokenBarrierException e) { + e.printStackTrace(); + } + } + } + + public static void main(String[] args) throws BrokenBarrierException, InterruptedException { + + // Fire up 1000 threads with 2M stack size each. + Sleeper[] threads = new Sleeper[numThreads]; + CyclicBarrier barrier = new CyclicBarrier(numThreads + 1); + + for (int i = 0; i < numThreads; i++) { + threads[i] = new Sleeper(barrier); + threads[i].start(); + } + + // Wait for all threads to come up + barrier.await(); + + // print status + String file = "/proc/self/status"; + try (FileReader fr = new FileReader(file); + BufferedReader reader = new BufferedReader(fr)) { + String line; + while ((line = reader.readLine()) != null) { + System.out.println(line); + } + } catch (IOException | NumberFormatException e) { /* ignored */ } + + // Signal threads to stop + barrier.await(); + + } + } + + static class ProcSelfStatus { + + public long rssMB; + public long swapMB; + public int numLifeThreads; + + // Parse output from /proc/self/status + public static ProcSelfStatus parse(OutputAnalyzer o) { + ProcSelfStatus status = new ProcSelfStatus(); + String s = o.firstMatch("Threads:\\s*(\\d+)", 1); + Objects.requireNonNull(s); + status.numLifeThreads = Integer.parseInt(s); + s = o.firstMatch("VmRSS:\\s*(\\d+) kB", 1); + Objects.requireNonNull(s); + status.rssMB = Long.parseLong(s) / 1024; + s = o.firstMatch("VmSwap:\\s*(\\d+) kB", 1); + Objects.requireNonNull(s); + status.swapMB = Long.parseLong(s) / 1024; + return status; + } + } + + public static void main(String[] args) throws Exception { + + HugePageConfiguration config = HugePageConfiguration.readFromOS(); + // This issue is bound to THP=always + if (config.getThpMode() != HugePageConfiguration.THPMode.always) { + throw new SkippedException("Test only makes sense in THP \"always\" mode"); + } + + String[] defaultArgs = { + "-Xlog:pagesize", + "-Xmx" + heapSizeMB + "m", "-Xms" + heapSizeMB + "m", "-XX:+AlwaysPreTouch", // stabilize RSS + "-Xss" + threadStackSizeMB + "m", + "-XX:-CreateCoredumpOnCrash", + // Limits the number of JVM-internal threads, which depends on the available cores of the + // machine. RSS+Swap could exceed acceptableRSSLimitMB when JVM creates many internal threads. + "-XX:ActiveProcessorCount=2", + // This will delay the child threads before they create guard pages, thereby greatly increasing the + // chance of large VMA formation + hugepage coalescation; see JDK-8312182 + "-XX:+DelayThreadStartALot" + }; + ArrayList finalargs = new ArrayList<>(Arrays.asList(defaultArgs)); + + switch (args[0]) { + case "PATCH-ENABLED": { + finalargs.add(TestMain.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + + // this line indicates the mitigation is active: + output.shouldContain("[pagesize] JVM will attempt to prevent THPs in thread stacks."); + + ProcSelfStatus status = ProcSelfStatus.parse(output); + if (status.numLifeThreads < numThreads) { + throw new RuntimeException("Number of live threads lower than expected: " + status.numLifeThreads + ", expected " + numThreads); + } else { + System.out.println("Found " + status.numLifeThreads + " to be alive. Ok."); + } + + long rssPlusSwapMB = status.swapMB + status.rssMB; + + if (rssPlusSwapMB > acceptableRSSLimitMB) { + throw new RuntimeException("RSS+Swap larger than expected: " + rssPlusSwapMB + "m, expected at most " + acceptableRSSLimitMB + "m"); + } else { + if (rssPlusSwapMB < heapSizeMB) { // we pretouch the java heap, so we expect to see at least that: + throw new RuntimeException("RSS+Swap suspiciously low: " + rssPlusSwapMB + "m, expected at least " + heapSizeMB + "m"); + } + System.out.println("Okay: RSS+Swap=" + rssPlusSwapMB + ", within acceptable limit of " + acceptableRSSLimitMB); + } + } + break; + + case "PATCH-DISABLED": { + + // Only execute manually! this will allocate ~2gb of memory! + + // explicitly disable the no-THP-workaround: + finalargs.add("-XX:+UnlockDiagnosticVMOptions"); + finalargs.add("-XX:-THPStackMitigation"); + + finalargs.add(TestMain.class.getName()); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(finalargs); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldHaveExitValue(0); + + // We deliberately switched off mitigation, VM should tell us: + output.shouldContain("[pagesize] JVM will *not* prevent THPs in thread stacks. This may cause high RSS."); + + // Parse output from self/status + ProcSelfStatus status = ProcSelfStatus.parse(output); + if (status.numLifeThreads < numThreads) { + throw new RuntimeException("Number of live threads lower than expected (" + status.numLifeThreads + ", expected " + numThreads +")"); + } else { + System.out.println("Found " + status.numLifeThreads + " to be alive. Ok."); + } + + long rssPlusSwapMB = status.swapMB + status.rssMB; + + if (rssPlusSwapMB < acceptableRSSLimitMB) { + throw new RuntimeException("RSS+Swap lower than expected: " + rssPlusSwapMB + "m, expected more than " + acceptableRSSLimitMB + "m"); + } + break; + } + + default: throw new RuntimeException("Bad argument: " + args[0]); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/TestHugePageDecisionsAtVMStartup.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * 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. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test id=Default + * @summary Test JVM large page setup (default options) + * @library /test/lib + * @requires os.family == "linux" + * @modules java.base/jdk.internal.misc + * java.management + * @run driver TestHugePageDecisionsAtVMStartup + */ + +/* + * @test id=LP_enabled + * @summary Test JVM large page setup (+LP) + * @library /test/lib + * @requires os.family == "linux" + * @modules java.base/jdk.internal.misc + * java.management + * @run driver TestHugePageDecisionsAtVMStartup -XX:+UseLargePages + */ + +/* + * @test id=THP_enabled + * @summary Test JVM large page setup (+THP) + * @library /test/lib + * @requires os.family == "linux" + * @modules java.base/jdk.internal.misc + * java.management + * @run driver TestHugePageDecisionsAtVMStartup -XX:+UseTransparentHugePages + */ + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; + +public class TestHugePageDecisionsAtVMStartup { + + // End user warnings, printing with Xlog:pagesize at warning level, should be unconditional + static final String warningNoTHP = "[warning][pagesize] UseTransparentHugePages disabled, transparent huge pages are not supported by the operating system."; + static final String warningNoLP = "[warning][pagesize] UseLargePages disabled, no large pages configured and available on the system."; + + static final String buildSizeString(long l) { + String units[] = { "K", "M", "G" }; + long factor = 1024 * 1024 * 1024; + for (int i = 2; i >= 0; i--) { + if (l >= factor) { + return Long.toString(l / factor) + units[i]; + } + factor /= 1024; + } + return Long.toString(l) + "B"; + } + + static void testOutput(boolean useLP, boolean useTHP, OutputAnalyzer out, HugePageConfiguration configuration) { + + // Note: If something goes wrong, the JVM warns but continues, so we should never see an exit value != 0 + out.shouldHaveExitValue(0); + + // Static hugepages: + // Let X = the default hugepage size of the system (the one in /proc/meminfo). + // The JVM will cycle through page sizes, starting at X, down to the smallest hugepage size. + // + // Example 1: a system with 1GB and 2MB pages, the default hugepage size is 1GB (can only be done + // via kernel parameter). the JVM should first attempt to use 1GB pages, failing that should try 2MB, failing + // that give up and disable -UseLargePages. + // + // Example 1: same system, but the default hugepage size is 2MB. The JVM should not attempt to use 1GB pages. + // + // This picture gets more complex with -XX:LargePageSizeInBytes, which overrides the default + // large page size; but we ignore this for now (feel free to extend the test to cover LBSiB too). + + boolean haveUsableStaticHugePages = false; + if (configuration.supportsStaticHugePages()) { + long defaultLargePageSize = configuration.getStaticDefaultHugePageSize(); + Set configs = configuration.getStaticHugePageConfigurations(); + for (HugePageConfiguration.StaticHugePageConfig config: configs) { + if (config.pageSize <= defaultLargePageSize) { + if (config.nr_hugepages > 0 || config.nr_overcommit_hugepages > 0) { + haveUsableStaticHugePages = true; break; + } + } + } + } + + if (useTHP && !useLP) { + useLP = true; // its implicit + } + + if (!useLP) { + out.shouldContain("[info][pagesize] Large page support disabled"); + } else if (useLP && !useTHP && + (!configuration.supportsStaticHugePages() || !haveUsableStaticHugePages)) { + out.shouldContain(warningNoLP); + } else if (useLP && useTHP && !configuration.supportsTHP()) { + out.shouldContain(warningNoTHP); + } else if (useLP && !useTHP && + configuration.supportsStaticHugePages() && haveUsableStaticHugePages) { + out.shouldContain("[info][pagesize] Using the default large page size: " + buildSizeString(configuration.getStaticDefaultHugePageSize())); + out.shouldContain("[info][pagesize] UseLargePages=1, UseTransparentHugePages=0"); + out.shouldContain("[info][pagesize] Large page support enabled"); + } else if (useLP && useTHP && configuration.supportsTHP()) { + String thpPageSizeString = buildSizeString(configuration.getThpPageSize()); + // We expect to see exactly two "Usable page sizes" : the system page size and the THP page size. The system + // page size differs, but its always in KB). + out.shouldContain("[info][pagesize] UseLargePages=1, UseTransparentHugePages=1"); + out.shouldMatch(".*\\[info]\\[pagesize] Large page support enabled. Usable page sizes: \\d+[kK], " + thpPageSizeString + ". Default large page size: " + thpPageSizeString + ".*"); + } + } + + public static void main(String[] extraOptions) throws Exception { + List allOptions = new ArrayList(); + if (extraOptions != null) { + allOptions.addAll(Arrays.asList(extraOptions)); + } + allOptions.add("-Xmx128m"); + allOptions.add("-Xlog:pagesize"); + allOptions.add("-version"); + + boolean useLP = allOptions.contains("-XX:+UseLargePages"); + boolean useTHP = allOptions.contains("-XX:+UseTransparentHugePages"); + System.out.println("useLP: " + useLP + " useTHP: " + useTHP); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(allOptions.toArray(new String[0])); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.reportDiagnosticSummary(); + HugePageConfiguration configuration = HugePageConfiguration.readFromOS(); + System.out.println("configuration read from OS:" + configuration); + + testOutput(useLP, useTHP, output, configuration); + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/runtime/os/TestHugePageDetection.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, Red Hat Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * 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. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test that the JVM detects the OS hugepage/THP settings correctly. + * @library /test/lib + * @requires os.family == "linux" + * @modules java.base/jdk.internal.misc + * java.management + * @run driver TestHugePageDetection + */ + +import java.util.*; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class TestHugePageDetection { + + public static void main(String[] args) throws Exception { + + ArrayList finalargs = new ArrayList(); + String[] defaultArgs = { + "-Xlog:pagesize", "-Xmx64M", "-XX:-CreateCoredumpOnCrash" + }; + finalargs.addAll(Arrays.asList(defaultArgs)); + finalargs.add("-version"); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + new String[] {"-Xlog:pagesize", "-Xmx64M", "-version"}); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.reportDiagnosticSummary(); + output.shouldHaveExitValue(0); + + // The configuration detected by the JVM should match the OS settings + + HugePageConfiguration configurationFromOS = HugePageConfiguration.readFromOS(); + System.out.println("Configuration read from OS: " + configurationFromOS); + + HugePageConfiguration configurationFromLog = HugePageConfiguration.readFromJVMLog(output); + System.out.println("Configuration read from JVM log: " + configurationFromLog); + + if (configurationFromOS.equals(configurationFromLog)) { + System.out.println("Okay"); + } else { + throw new RuntimeException("Configurations differ"); + } + + // If we want to run + + } + +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/framework/TestProcessLauncher.java 2024-01-09 21:18:15.000000000 +0000 @@ -77,7 +77,11 @@ public void quit() { if (pipe != null) { - pipe.println("quit"); + if (pipe.isConnected()) { + pipe.println("quit"); + } else { + System.out.println("WARNING: IOPipe is not connected"); + } } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/vm/ClassLoaderHierarchyTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -47,6 +47,19 @@ public class ClassLoaderHierarchyTest { + class EmptyDelegatingLoader extends ClassLoader { + EmptyDelegatingLoader(String name, ClassLoader parent) { + super(name, parent); + } + } + + static void loadTestClassInLoaderAndCheck(String classname, ClassLoader loader) throws ClassNotFoundException { + Class c = Class.forName(classname, true, loader); + if (c.getClassLoader() != loader) { + Assert.fail(classname + " defined by wrong classloader: " + c.getClassLoader()); + } + } + //+-- // | // +-- "platform", jdk.internal.loader.ClassLoaders$PlatformClassLoader @@ -63,39 +76,76 @@ public void run(CommandExecutor executor) throws ClassNotFoundException { + // A) one unnamed, two named loaders ClassLoader unnamed_cl = new TestClassLoader(null, null); - Class c1 = Class.forName("TestClass2", true, unnamed_cl); - if (c1.getClassLoader() != unnamed_cl) { - Assert.fail("TestClass defined by wrong classloader: " + c1.getClassLoader()); - } - ClassLoader named_cl = new TestClassLoader("Kevin", null); - Class c2 = Class.forName("TestClass2", true, named_cl); - if (c2.getClassLoader() != named_cl) { - Assert.fail("TestClass defined by wrong classloader: " + c2.getClassLoader()); - } - ClassLoader named_child_cl = new TestClassLoader("Bill", unnamed_cl); - Class c3 = Class.forName("TestClass2", true, named_child_cl); - if (c3.getClassLoader() != named_child_cl) { - Assert.fail("TestClass defined by wrong classloader: " + c3.getClassLoader()); - } + loadTestClassInLoaderAndCheck("TestClass2", unnamed_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_cl); + + // B) A named CL with empty loaders as parents (JDK-8293156) + EmptyDelegatingLoader emptyLoader1 = new EmptyDelegatingLoader("EmptyLoader1", null); + EmptyDelegatingLoader emptyLoader2 = new EmptyDelegatingLoader("EmptyLoader2", emptyLoader1); + ClassLoader named_child_2_cl = new TestClassLoader("Child2", emptyLoader2); + loadTestClassInLoaderAndCheck("TestClass2", named_child_2_cl); + + // C) Test output for several class loaders, same class, same name, empty parents, + // and all these should be folded by default. + EmptyDelegatingLoader emptyLoader3 = new EmptyDelegatingLoader("EmptyLoader3", null); + EmptyDelegatingLoader emptyLoader4 = new EmptyDelegatingLoader("EmptyLoader4", emptyLoader3); + ClassLoader named_child_3_cl = new TestClassLoader("ChildX", emptyLoader4); // Same names + ClassLoader named_child_4_cl = new TestClassLoader("ChildX", emptyLoader4); + ClassLoader named_child_5_cl = new TestClassLoader("ChildX", emptyLoader4); + ClassLoader named_child_6_cl = new TestClassLoader("ChildX", emptyLoader4); + loadTestClassInLoaderAndCheck("TestClass2", named_child_3_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_4_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_5_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_6_cl); + + // D) Test output for several *unnamed* class loaders, same class, same parents, + // and all these should be folded by default too. + EmptyDelegatingLoader emptyLoader5 = new EmptyDelegatingLoader(null, null); + EmptyDelegatingLoader emptyLoader6 = new EmptyDelegatingLoader(null, emptyLoader5); + ClassLoader named_child_7_cl = new TestClassLoader(null, emptyLoader6); // Same names + ClassLoader named_child_8_cl = new TestClassLoader(null, emptyLoader6); + ClassLoader named_child_9_cl = new TestClassLoader(null, emptyLoader6); + ClassLoader named_child_10_cl = new TestClassLoader(null, emptyLoader6); + loadTestClassInLoaderAndCheck("TestClass2", named_child_7_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_8_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_9_cl); + loadTestClassInLoaderAndCheck("TestClass2", named_child_10_cl); // First test: simple output, no classes displayed OutputAnalyzer output = executor.execute("VM.classloaders"); - output.shouldContain(""); - output.shouldMatch(".*TestClassLoader"); - output.shouldMatch("Kevin.*TestClassLoader"); - output.shouldMatch("Bill.*TestClassLoader"); + // (A) + output.shouldContain("+-- "); + output.shouldContain(" +-- \"platform\", jdk.internal.loader.ClassLoaders$PlatformClassLoader"); + output.shouldContain(" | +-- \"app\", jdk.internal.loader.ClassLoaders$AppClassLoader"); + output.shouldContain(" +-- \"Kevin\", ClassLoaderHierarchyTest$TestClassLoader"); + output.shouldContain(" +-- ClassLoaderHierarchyTest$TestClassLoader"); + output.shouldContain(" | +-- \"Bill\", ClassLoaderHierarchyTest$TestClassLoader"); + // (B) + output.shouldContain(" +-- \"EmptyLoader1\", ClassLoaderHierarchyTest$EmptyDelegatingLoader"); + output.shouldContain(" | +-- \"EmptyLoader2\", ClassLoaderHierarchyTest$EmptyDelegatingLoader"); + output.shouldContain(" | +-- \"Child2\", ClassLoaderHierarchyTest$TestClassLoader"); + // (C) + output.shouldContain(" +-- \"EmptyLoader3\", ClassLoaderHierarchyTest$EmptyDelegatingLoader"); + output.shouldContain(" | +-- \"EmptyLoader4\", ClassLoaderHierarchyTest$EmptyDelegatingLoader"); + output.shouldContain(" | +-- \"ChildX\", ClassLoaderHierarchyTest$TestClassLoader (+ 3 more)"); + // (D) + output.shouldContain(" +-- ClassLoaderHierarchyTest$EmptyDelegatingLoader"); + output.shouldContain(" +-- ClassLoaderHierarchyTest$EmptyDelegatingLoader"); + output.shouldContain(" +-- ClassLoaderHierarchyTest$TestClassLoader (+ 3 more)"); // Second test: print with classes. output = executor.execute("VM.classloaders show-classes"); output.shouldContain(""); output.shouldContain("java.lang.Object"); - output.shouldMatch(".*TestClassLoader"); - output.shouldMatch("Kevin.*TestClassLoader"); - output.shouldMatch("Bill.*TestClassLoader"); + output.shouldContain("java.lang.Enum"); + output.shouldContain("java.lang.NullPointerException"); output.shouldContain("TestClass2"); + output.shouldContain("Hidden Classes:"); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/dcmd/vm/TrimLibcHeapTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/vm/TrimLibcHeapTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/dcmd/vm/TrimLibcHeapTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/dcmd/vm/TrimLibcHeapTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -46,7 +46,7 @@ if (Platform.isMusl()) { output.shouldContain("Not available"); } else { - output.shouldMatch("Trim native heap: RSS\\+Swap: \\d+[BKMG]->\\d+[BKMG] \\(-\\d+[BKMG]\\)"); + output.shouldMatch("Trim native heap: RSS\\+Swap: \\d+[BKMG]->\\d+[BKMG] \\([+-]\\d+[BKMG]\\)"); } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, 2019, Google and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -36,10 +36,16 @@ public class HeapMonitorStatArrayCorrectnessTest { private static final int maxCount = 10; - // Do 100000 iterations and expect maxIteration / multiplier samples. - private static final int maxIteration = 100000; + // Do 200000 iterations and expect maxIteration / multiplier samples. + private static final int maxIteration = 200_000; private static int array[]; + // 15% error ensures a sanity test without becoming flaky. + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be + // unlucky and not achieve the mean average fast enough for the test case. + private static final int acceptedErrorPercentage = 15; + private static void allocate(int size) { for (int j = 0; j < maxIteration; j++) { array = new int[size]; @@ -85,11 +91,7 @@ expected *= 4; expected /= samplingMultiplier; - // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a - // statistical geometric variable around the sampling interval. This means that the test could be - // unlucky and not achieve the mean average fast enough for the test case. - if (HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) { + if (HeapMonitor.statsHaveExpectedNumberSamples((int) expected, acceptedErrorPercentage)) { break; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -42,7 +42,7 @@ HeapMonitor.enableSamplingEvents(); int allocationTotal = 10 * 1024 * 1024; - int allocationIterations = 10; + int allocationIterations = 20; double actualCount = 0; for (int i = 0; i < allocationIterations; i++) { @@ -58,13 +58,13 @@ double error = Math.abs(actualCount - expectedCount); double errorPercentage = error / expectedCount * 100; - boolean success = (errorPercentage < 10.0); + boolean success = (errorPercentage < 15.0); System.out.println("Interval: " + interval + ", throw if failure: " + throwIfFailure + " - Expected count: " + expectedCount + ", allocationIterations: " + allocationIterations + ", actualCount: " + actualCount + " -> " + success); if (!success && throwIfFailure) { - throw new RuntimeException("Interval average over 10% for interval " + interval + " -> " + throw new RuntimeException("Interval average over 15% for interval " + interval + " -> " + actualCount + ", " + expectedCount); } @@ -74,7 +74,7 @@ private static void testInterval(int interval) { // Test the interval twice, it can happen that the test is "unlucky" and the interval just goes above - // the 10% mark. So try again to squash flakiness. + // the 15% mark. So try again to squash flakiness. // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a // statistical geometric variable around the sampling interval. This means that the test could be // unlucky and not achieve the mean average fast enough for the test case. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -36,11 +36,15 @@ /** This test is checking the object allocation path works with heap sampling. */ public class HeapMonitorStatObjectCorrectnessTest { - // Do 200000 iterations and expect maxIteration / multiplier samples. - private static final int maxIteration = 200000; + // Do 400000 iterations and expect maxIteration / multiplier samples. + private static final int maxIteration = 400_000; private static BigObject obj; - private native static boolean statsHaveExpectedNumberSamples(int expected, int percentError); + // 15% error ensures a sanity test without becoming flaky. + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be + // unlucky and not achieve the mean average fast enough for the test case. + private static final int acceptedErrorPercentage = 15; private static void allocate() { emptyStorage(); @@ -83,11 +87,7 @@ double expected = maxIteration; expected /= samplingMultiplier; - // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a - // statistical geometric variable around the sampling interval. This means that the test could be - // unlucky and not achieve the mean average fast enough for the test case. - if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) { + if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, acceptedErrorPercentage)) { throw new RuntimeException("Statistics should show about " + expected + " samples."); } } @@ -108,11 +108,7 @@ double expected = maxIteration; - // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a - // statistical geometric variable around the sampling interval. This means that the test could be - // unlucky and not achieve the mean average fast enough for the test case. - if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) { + if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, acceptedErrorPercentage)) { throw new RuntimeException("Statistics should show about " + expected + " samples."); } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbAttachDifferentJVMs.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jdk.test.lib.apps.LingeredApp; +import jtreg.SkippedException; + +/** + * @test + * @bug 8314679 + * @summary Test clhsdb attach, detach, and then attach to different JVM + * @requires vm.hasSA + * @library /test/lib + * @run main/othervm ClhsdbAttachDifferentJVMs + */ + +public class ClhsdbAttachDifferentJVMs { + + public static void main(String[] args) throws Exception { + System.out.println("Starting ClhsdbAttach test"); + + LingeredApp theApp1 = null; + LingeredApp theApp2 = null; + try { + ClhsdbLauncher test = new ClhsdbLauncher(); + theApp1 = LingeredApp.startApp(); + System.out.println("Started LingeredApp with pid " + theApp1.getPid()); + theApp2 = LingeredApp.startApp(); + System.out.println("Started LingeredApp with pid " + theApp2.getPid()); + String attach1 = "attach " + theApp1.getPid(); + String attach2 = "attach " + theApp2.getPid(); + + List cmds = List.of( + "where", + attach1, + "threads", + "detach", + attach2, + "jstack"); + + Map> expStrMap = new HashMap<>(); + expStrMap.put("where", List.of( + "Command not valid until attached to a VM")); + expStrMap.put(attach1, List.of( + "Attaching to process " + theApp1.getPid())); + expStrMap.put("threads", List.of( + "Reference Handler")); + expStrMap.put(attach2, List.of( + "Attaching to process " + theApp2.getPid())); + expStrMap.put("jstack", List.of( + "Reference Handler")); + + Map> unexpStrMap = new HashMap<>(); + unexpStrMap.put("jstack", List.of( + "WARNING")); + + test.run(-1, cmds, expStrMap, unexpStrMap); + } catch (SkippedException se) { + throw se; + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } finally { + LingeredApp.stopApp(theApp1); + LingeredApp.stopApp(theApp2); + } + System.out.println("Test PASSED"); + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, 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 @@ -82,6 +82,7 @@ "-Xshare:auto", "-XX:+ProfileInterpreter", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", + CoreUtils.getAlwaysPretouchArg(true), CrashApp.class.getName() }; diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java 2024-01-09 21:18:15.000000000 +0000 @@ -93,9 +93,9 @@ theApp = new LingeredApp(); theApp.setForceCrash(withCore); if (withXcomp) { - LingeredApp.startApp(theApp, "-Xcomp"); + LingeredApp.startApp(theApp, "-Xcomp", CoreUtils.getAlwaysPretouchArg(withCore)); } else { - LingeredApp.startApp(theApp, "-Xint"); + LingeredApp.startApp(theApp, "-Xint", CoreUtils.getAlwaysPretouchArg(withCore)); } System.out.print("Started LingeredApp "); if (withXcomp) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022, 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 @@ -60,7 +60,7 @@ ClhsdbLauncher test = new ClhsdbLauncher(); theApp = new LingeredApp(); theApp.setForceCrash(withCore); - LingeredApp.startApp(theApp); + LingeredApp.startApp(theApp, CoreUtils.getAlwaysPretouchArg(withCore)); System.out.println("Started LingeredApp with pid " + theApp.getPid()); if (withCore) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022, 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 @@ -60,7 +60,7 @@ ClhsdbLauncher test = new ClhsdbLauncher(); theApp = new LingeredApp(); theApp.setForceCrash(withCore); - LingeredApp.startApp(theApp); + LingeredApp.startApp(theApp, CoreUtils.getAlwaysPretouchArg(withCore)); System.out.println("Started LingeredApp with pid " + theApp.getPid()); if (withCore) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, 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 @@ -73,6 +73,10 @@ static void test(String type) throws Throwable { ProcessBuilder pb = ProcessTools.createTestJvm("-XX:+CreateCoredumpOnCrash", "-Xmx512m", "-XX:MaxMetaspaceSize=64m", "-XX:+CrashOnOutOfMemoryError", + // The test loads lots of small classes to exhaust Metaspace, skip method + // dependency verification to improve performance in debug builds. + CoreUtils.getAlwaysPretouchArg(true), + Platform.isDebugBuild() ? "-XX:-VerifyDependencies" : "--show-version", TestJmapCore.class.getName(), type); // If we are going to force a core dump, apply "ulimit -c unlimited" if we can. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -42,7 +42,7 @@ public final static int threadCount = 3; private static Log log; - Thready [] thrds = new Thready [threadCount]; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -76,7 +76,7 @@ tc01x001a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } @@ -90,7 +90,7 @@ log.display(caller + "::bar_step"); // checkStepLine } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -38,7 +38,7 @@ static Log log; public final static int checkClassBrkpLine = 93; - Thready [] thrds = new Thready [threadCount]; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -72,12 +72,12 @@ tc02x001a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -39,7 +39,7 @@ public final static int checkClassBrkpLine1 = 96; public final static int checkClassBrkpLine2 = 98; - Thready [] thrds = new Thready [threadCount]; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -74,12 +74,12 @@ tc02x002a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -39,7 +39,7 @@ public final static int checkClassBrkpLine1 = 96; public final static int checkClassBrkpLine2 = 98; - Thready [] thrds = new Thready [threadCount]; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -74,12 +74,12 @@ tc02x003a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BScenarios.multithrd; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE @@ -38,7 +37,7 @@ static Log log; public final static int checkClassBrkpLine = 79; - Thready [] thrds = new Thready [threadCount]; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -58,12 +57,12 @@ tc02x004a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } @@ -75,6 +74,7 @@ } } + class tc02x004aClass1 { public tc02x004aClass1(String thrdName) { // checkClassBrkpLine tc02x004a.log.display("tc02x004aClass1::constructor is called from" diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -38,7 +38,7 @@ static Log log; public final static int checkExBrkpLine = 90; - Thready [] thrds = new Thready [threadCount]; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -74,12 +74,12 @@ tc03x001a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BScenarios.multithrd; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE @@ -37,8 +36,8 @@ public final static int threadCount = 3; static Log log; - public final static int checkMethodBrkpLine = 74; - Thready [] thrds = new Thready [threadCount]; + public final static int checkMethodBrkpLine = 73; + Thread[] thrds = new Thread[threadCount]; public static void main (String argv[]) { ArgumentHandler argHandler = new ArgumentHandler(argv); @@ -65,7 +64,7 @@ tc04x001a() { for (int i = 0; i < thrds.length; i++ ) { - thrds[i] = new Thready("Thread-" + (i+1)); + thrds[i] = JDIThreadFactory.newThread(new Thready("Thread-" + (i+1))); thrds[i].start(); } } @@ -78,7 +77,7 @@ log.display(caller + "::bar is called"); } - static class Thready extends Thread { + static class Thready extends NamedTask { Thready(String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/_bounds_/filters001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/_bounds_/filters001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/_bounds_/filters001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/_bounds_/filters001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -64,11 +64,11 @@ } } -class filters001b extends Thread { +class filters001b extends NamedTask { static Log log; filters001b(String nameObj) { - setName(nameObj); + super(nameObj); } public void run() { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addInstanceFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,8 +53,8 @@ //====================================================== test program - static Threadinstancefilter001a thread1 = null; - static Threadinstancefilter001a thread2 = null; + static Thread thread1 = null; + static Thread thread2 = null; static instancefilter001aTestClass objTC[] = { new instancefilter001aTestClass(), new instancefilter001aTestClass(), new instancefilter001aTestClass() }; @@ -99,8 +98,8 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadinstancefilter001a("thread1"); - thread2 = new Threadinstancefilter001a("thread2"); + thread1 = JDIThreadFactory.newThread(new Threadinstancefilter001a("thread1")); + thread2 = JDIThreadFactory.newThread(new Threadinstancefilter001a("thread2")); break; case 1: @@ -149,31 +148,29 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadinstancefilter001a extends Thread { + static class Threadinstancefilter001a extends NamedTask { - String tName = null; int tNumber; public Threadinstancefilter001a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { synchronized (waitnotifyObj) { waitnotifyObj.notify(); } - log1(" objTC[tNumber].method(); :: threadName == " + tName + " tNumber == " + tNumber); + log1(" objTC[tNumber].method(); :: threadName == " + getName() + " tNumber == " + tNumber); objTC[tNumber].method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addInstanceFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Threadinstancefilter002a thread1 = null; + static Thread thread1 = null; static instancefilter002aTestClass objTC[] = { new instancefilter002aTestClass(), new instancefilter002aTestClass() }; @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadinstancefilter002a("thread1"); + thread1 = JDIThreadFactory.newThread(new Threadinstancefilter002a("thread1")); break; //------------------------------------------------- standard end section @@ -137,21 +136,19 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadinstancefilter002a extends Thread { + static class Threadinstancefilter002a extends NamedTask { - String tName = null; int tNumber; public Threadinstancefilter002a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { @@ -160,7 +157,7 @@ } objTC[tNumber].method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter003a.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addInstanceFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Threadinstancefilter003a thread1 = null; + static Thread thread1 = null; static instancefilter003aTestClass objTC[] = { new instancefilter003aTestClass(), new instancefilter003aTestClass() }; @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadinstancefilter003a("thread1"); + thread1 = JDIThreadFactory.newThread(new Threadinstancefilter003a("thread1")); break; //------------------------------------------------- standard end section @@ -137,21 +136,19 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadinstancefilter003a extends Thread { + static class Threadinstancefilter003a extends NamedTask { - String tName = null; int tNumber; public Threadinstancefilter003a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { @@ -160,7 +157,7 @@ } objTC[tNumber].method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter004a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter004a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter004a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addInstanceFilter/instancefilter004a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addInstanceFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,8 +53,8 @@ //====================================================== test program - static Threadinstancefilter004a thread1 = null; - static Threadinstancefilter004a thread2 = null; + static Thread thread1 = null; + static Thread thread2 = null; static instancefilter004aTestClass objTC[] = { new instancefilter004aTestClass(), new instancefilter004aTestClass(), new instancefilter004aTestClass() }; @@ -99,8 +98,8 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadinstancefilter004a("thread1"); - thread2 = new Threadinstancefilter004a("thread2"); + thread1 = JDIThreadFactory.newThread(new Threadinstancefilter004a("thread1")); + thread2 = JDIThreadFactory.newThread(new Threadinstancefilter004a("thread2")); break; case 1: @@ -149,31 +148,29 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadinstancefilter004a extends Thread { + static class Threadinstancefilter004a extends NamedTask { - String tName = null; int tNumber; public Threadinstancefilter004a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { synchronized (waitnotifyObj) { waitnotifyObj.notify(); } - log1(" objTC[tNumber].method(); :: threadName == " + tName + " tNumber == " + tNumber); + log1(" objTC[tNumber].method(); :: threadName == " + getName() + " tNumber == " + tNumber); objTC[tNumber].method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addThreadFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,8 +53,8 @@ //====================================================== test program - static Threadthreadfilter001a thread1 = null; - static Threadthreadfilter001a thread2 = null; + static Thread thread1 = null; + static Thread thread2 = null; static threadfilter001aTestClass objTC = new threadfilter001aTestClass(); @@ -99,8 +98,8 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadthreadfilter001a("thread1"); - thread2 = new Threadthreadfilter001a("thread2"); + thread1 = JDIThreadFactory.newThread(new Threadthreadfilter001a("thread1")); + thread2 = JDIThreadFactory.newThread(new Threadthreadfilter001a("thread2")); break; case 1: @@ -149,21 +148,19 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadthreadfilter001a extends Thread { + static class Threadthreadfilter001a extends NamedTask { - String tName = null; int tNumber; public Threadthreadfilter001a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { @@ -172,7 +169,7 @@ } objTC.method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addThreadFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Threadthreadfilter002a thread1 = null; + static Thread thread1 = null; static threadfilter002aTestClass objTC = new threadfilter002aTestClass(); @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadthreadfilter002a("thread1"); + thread1 = JDIThreadFactory.newThread(new Threadthreadfilter002a("thread1")); break; //------------------------------------------------- standard end section @@ -137,21 +136,19 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadthreadfilter002a extends Thread { + static class Threadthreadfilter002a extends NamedTask { - String tName = null; int tNumber; public Threadthreadfilter002a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { @@ -160,7 +157,7 @@ } objTC.method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter003a.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addThreadFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Threadthreadfilter003a thread1 = null; + static Thread thread1 = null; static threadfilter003aTestClass objTC = new threadfilter003aTestClass(); @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadthreadfilter003a("thread1"); + thread1 = JDIThreadFactory.newThread(new Threadthreadfilter003a("thread1")); break; case 1: @@ -149,7 +148,7 @@ return PASSED; } - static class Threadthreadfilter003a extends Thread { + static class Threadthreadfilter003a extends NamedTask { public Threadthreadfilter003a(String threadName) { super(threadName); diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter004a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter004a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter004a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/addThreadFilter/threadfilter004a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.addThreadFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,8 +53,8 @@ //====================================================== test program - static Threadthreadfilter004a thread1 = null; - static Threadthreadfilter004a thread2 = null; + static Thread thread1 = null; + static Thread thread2 = null; static threadfilter004aTestClass objTC = new threadfilter004aTestClass(); @@ -99,8 +98,8 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadthreadfilter004a("thread1"); - thread2 = new Threadthreadfilter004a("thread2"); + thread1 = JDIThreadFactory.newThread(new Threadthreadfilter004a("thread1")); + thread2 = JDIThreadFactory.newThread(new Threadthreadfilter004a("thread2")); break; case 1: @@ -151,21 +150,19 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadthreadfilter004a extends Thread { + static class Threadthreadfilter004a extends NamedTask { - String tName = null; int tNumber; public Threadthreadfilter004a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { @@ -174,7 +171,7 @@ } objTC.method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/BreakpointRequest/location/location001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.BreakpointRequest.location; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Threadlocation001a thread1 = null; + static Thread thread1 = null; static TestClass objTC = new TestClass(); @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Threadlocation001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Threadlocation001a("thread1")); break; //------------------------------------------------- standard end section @@ -137,21 +136,19 @@ static Object lockingObj[] = new Object[2]; static volatile int number = 0; - static class Threadlocation001a extends Thread { + static class Threadlocation001a extends NamedTask { - String tName = null; int tNumber; public Threadlocation001a(String threadName) { super(threadName); - tName = threadName; tNumber = number; number++; lockingObj[tNumber] = threadName; } public void run() { - log1(" 'run': enter :: threadName == " + tName); + log1(" 'run': enter :: threadName == " + getName()); if (lockingObj[tNumber] == null) log1("lockingObj[tNumber] == null"); synchronized(lockingObj[tNumber]) { @@ -160,7 +157,7 @@ } objTC.method(); } - log1(" 'run': exit :: threadName == " + tName); + log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassExclusionFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1filter001a thread1 = null; + static Thread thread1 = null; //------------------------------------------------------ common section @@ -101,7 +100,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1filter001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1filter001a("thread1")); log1("run1(thread1);"); run1(thread1); @@ -143,7 +142,7 @@ } -class Thread1filter001a extends Thread { +class Thread1filter001a extends NamedTask { class TestClass10{ int var10 = 0; @@ -152,17 +151,14 @@ int var11 = 0; } - String tName = null; - public Thread1filter001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter001a.log1(" 'run': enter :: threadName == " + tName); + filter001a.log1(" 'run': enter :: threadName == " + getName()); TestClass11 obj1 = new TestClass11(); - filter001a.log1(" 'run': exit :: threadName == " + tName); + filter001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassExclusionFilter/filter002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassExclusionFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1filter002a thread1 = null; + static Thread thread1 = null; //------------------------------------------------------ common section @@ -101,7 +100,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1filter002a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1filter002a("thread1")); log1("run1(thread1);"); run1(thread1); @@ -143,7 +142,7 @@ } -class Thread1filter002a extends Thread { +class Thread1filter002a extends NamedTask { class TestClass10{ int var10 = 0; @@ -152,17 +151,14 @@ int var11 = 0; } - String tName = null; - public Thread1filter002a(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter002a.log1(" 'run': enter :: threadName == " + tName); + filter002a.log1(" 'run': enter :: threadName == " + getName()); TestClass11 obj1 = new TestClass11(); - filter002a.log1(" 'run': exit :: threadName == " + tName); + filter002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassFilter_rt; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -98,8 +97,8 @@ case 1: - filter_rt001aThread1 thread1 = new filter_rt001aThread1("thread1"); - filter_rt001aThread2 thread2 = new filter_rt001aThread2("thread2"); + Thread thread1 = JDIThreadFactory.newThread(new filter_rt001aThread1("thread1")); + Thread thread2 = JDIThreadFactory.newThread(new filter_rt001aThread2("thread2")); log1("new filter_rt001a().run1(thread1);"); new filter_rt001a().run1(thread1); @@ -155,19 +154,16 @@ class filter_rt001aTestClass11 extends filter_rt001aTestClass10{ static int var11 = 0; } -class filter_rt001aThread1 extends Thread { - - String tName = null; +class filter_rt001aThread1 extends NamedTask { public filter_rt001aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_rt001a.log1(" 'run': enter :: threadName == " + tName); + filter_rt001a.log1(" 'run': enter :: threadName == " + getName()); filter_rt001aTestClass11 obj1 = new filter_rt001aTestClass11(); - filter_rt001a.log1(" 'run': exit :: threadName == " + tName); + filter_rt001a.log1(" 'run': exit :: threadName == " + getName()); return; } } @@ -178,19 +174,16 @@ class filter_rt001aTestClass21 { static int var21 = 0; } -class filter_rt001aThread2 extends Thread { - - String tName = null; +class filter_rt001aThread2 extends NamedTask { public filter_rt001aThread2(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_rt001a.log1(" 'run': enter :: threadName == " + tName); + filter_rt001a.log1(" 'run': enter :: threadName == " + getName()); filter_rt001aTestClass21 obj2 = new filter_rt001aTestClass21(); - filter_rt001a.log1(" 'run': exit :: threadName == " + tName); + filter_rt001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassFilter_rt; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static filter_rt002aThread1 thread1 = null; + static Thread thread1 = null; static filter_rt002aTestClass10 obj = new filter_rt002aTestClass10(); @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new filter_rt002aThread1("thread1"); + thread1 = JDIThreadFactory.newThread(new filter_rt002aThread1("thread1")); break; //------------------------------------------------- standard end section @@ -149,19 +148,16 @@ class filter_rt002aTestClass11 extends filter_rt002aTestClass10{ static int var11 = 0; } -class filter_rt002aThread1 extends Thread { - - String tName = null; +class filter_rt002aThread1 extends NamedTask { public filter_rt002aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_rt002a.log1(" 'run': enter :: threadName == " + tName); + filter_rt002a.log1(" 'run': enter :: threadName == " + getName()); filter_rt002aTestClass11 obj1 = new filter_rt002aTestClass11(); - filter_rt002a.log1(" 'run': exit :: threadName == " + tName); + filter_rt002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt003a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt003a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt003a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_rt/filter_rt003a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassFilter_rt; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -99,8 +98,8 @@ case 1: - filter_rt003aThread1 thread1 = new filter_rt003aThread1("thread1"); - filter_rt003aThread2 thread2 = new filter_rt003aThread2("thread2"); + Thread thread1 = JDIThreadFactory.newThread(new filter_rt003aThread1("thread1")); + Thread thread2 = JDIThreadFactory.newThread(new filter_rt003aThread2("thread2")); log1("new filter_rt003a().run1(thread1);"); new filter_rt003a().run1(thread1); @@ -156,19 +155,16 @@ class filter_rt003aTestClass11 extends filter_rt003aTestClass10{ static int var11 = 0; } -class filter_rt003aThread1 extends Thread { - - String tName = null; +class filter_rt003aThread1 extends NamedTask { public filter_rt003aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_rt003a.log1(" 'run': enter :: threadName == " + tName); + filter_rt003a.log1(" 'run': enter :: threadName == " + getName()); filter_rt003aTestClass11 obj1 = new filter_rt003aTestClass11(); - filter_rt003a.log1(" 'run': exit :: threadName == " + tName); + filter_rt003a.log1(" 'run': exit :: threadName == " + getName()); return; } } @@ -179,19 +175,16 @@ class filter_rt003aTestClass21 { static int var21 = 0; } -class filter_rt003aThread2 extends Thread { - - String tName = null; +class filter_rt003aThread2 extends NamedTask { public filter_rt003aThread2(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_rt003a.log1(" 'run': enter :: threadName == " + tName); + filter_rt003a.log1(" 'run': enter :: threadName == " + getName()); filter_rt003aTestClass21 obj2 = new filter_rt003aTestClass21(); - filter_rt003a.log1(" 'run': exit :: threadName == " + tName); + filter_rt003a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassFilter_s; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -98,13 +97,13 @@ //------------------------------------------------------ section tested case 0: - Thread1filter_s001a thread1 = new Thread1filter_s001a("thread1"); + Thread thread1 = JDIThreadFactory.newThread(new Thread1filter_s001a("thread1")); log1("new filter_s001a().run1(thread1);"); new filter_s001a().run1(thread1); break; case 1: - Thread2filter_s001a thread2 = new Thread2filter_s001a("thread2"); + Thread thread2 = JDIThreadFactory.newThread(new Thread2filter_s001a("thread2")); log1("new filter_s001a().run1(thread2);"); new filter_s001a().run1(thread2); @@ -146,7 +145,7 @@ } -class Thread1filter_s001a extends Thread { +class Thread1filter_s001a extends NamedTask { class TestClass10{ int var10 = 0; @@ -155,34 +154,28 @@ int var11 = 0; } - String tName = null; - public Thread1filter_s001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_s001a.log1(" 'run': enter :: threadName == " + tName); + filter_s001a.log1(" 'run': enter :: threadName == " + getName()); TestClass11 obj1 = new TestClass11(); - filter_s001a.log1(" 'run': exit :: threadName == " + tName); + filter_s001a.log1(" 'run': exit :: threadName == " + getName()); return; } } -class Thread2filter_s001a extends Thread { - - String tName = null; +class Thread2filter_s001a extends NamedTask { public Thread2filter_s001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_s001a.log1(" 'run': enter :: threadName == " + tName); + filter_s001a.log1(" 'run': enter :: threadName == " + getName()); filter_s001aTestClass21 obj2 = new filter_s001aTestClass21(); - filter_s001a.log1(" 'run': exit :: threadName == " + tName); + filter_s001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassPrepareRequest/addClassFilter_s/filter_s002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.ClassPrepareRequest.addClassFilter_s; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1filter_s002a thread1 = null; + static Thread thread1 = null; //------------------------------------------------------ common section @@ -96,7 +95,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1filter_s002a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1filter_s002a("thread1")); break; //------------------------------------------------- standard end section @@ -142,7 +141,7 @@ } -class Thread1filter_s002a extends Thread { +class Thread1filter_s002a extends NamedTask { class TestClass10{ int var10 = 0; @@ -151,18 +150,14 @@ int var11 = 0; } - - String tName = null; - public Thread1filter_s002a(String threadName) { super(threadName); - tName = threadName; } public void run() { - filter_s002a.log1(" 'run': enter :: threadName == " + tName); + filter_s002a.log1(" 'run': enter :: threadName == " + getName()); TestClass11 obj1 = new TestClass11(); - filter_s002a.log1(" 'run': exit :: threadName == " + tName); + filter_s002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -23,7 +23,6 @@ package nsk.jdi.ClassType.invokeMethod; -import nsk.share.*; import nsk.share.jpda.*; import nsk.share.jdi.*; @@ -99,8 +98,8 @@ //------------------------------------------------------ section tested case 0: - Threadinvokemethod001a test_thread = - new Threadinvokemethod001a("testedThread"); + Thread test_thread = + JDIThreadFactory.newThread(new Threadinvokemethod001a("testedThread")); log1(" thread2 is created"); label: @@ -150,7 +149,7 @@ } } -class Threadinvokemethod001a extends Thread { +class Threadinvokemethod001a extends NamedTask { public Threadinvokemethod001a(String threadName) { super(threadName); diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod007a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod007a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod007a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod007a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -46,7 +46,7 @@ log = new Log(System.err, argHandler); waitTime = argHandler.getWaitTime() * 60000; pipe = argHandler.createDebugeeIOPipe(log); - im007aThread01 thread = null; + Thread thread = null; pipe.println(invokemethod007.SGNL_READY); String instr = pipe.readln(); @@ -54,7 +54,7 @@ // create new thread and start it if (instr.equals(invokemethod007.SGNL_STRTHRD)) { - thread = new im007aThread01("im007aThread01"); + thread = JDIThreadFactory.newThread(new im007aThread01("im007aThread01")); synchronized(im007aThread01.waitStarting) { thread.start(); try { @@ -117,7 +117,7 @@ } } -class im007aThread01 extends Thread { +class im007aThread01 extends NamedTask { public static Object waitInvoking = new Object(); public static Object waitStarting = new Object(); public static Object waitFinishing = new Object(); diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011t.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011t.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011t.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011t.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -34,8 +34,8 @@ */ public class invokemethod011t { static Log log; - private invokemethod011Thr thrs[] = - new invokemethod011Thr[invokemethod011.THRDS_NUM-1]; + private invokemethod011Thr thrs011[] = new invokemethod011Thr[invokemethod011.THRDS_NUM-1]; + private Thread thrs[] = new Thread[invokemethod011.THRDS_NUM-1]; private IOPipe pipe; public static void main(String args[]) { @@ -103,8 +103,8 @@ Object readyObj = new Object(); for (int i=0; i * A debugger launchs a debuggee which creates new thread, thread2.
* The tested class TestClass is specified outside of the class
- * Threadnewinstance002a extends Thread
+ * Threadnewinstance002a extends JDITask
* After getting thread2 running but locked at a monitor
* the debugger informs the debugger of the thread2 creation
* and waits for an instruction from it.
diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -23,7 +23,6 @@ package nsk.jdi.ClassType.newInstance; -import nsk.share.*; import nsk.share.jpda.*; import nsk.share.jdi.*; @@ -97,8 +96,8 @@ //------------------------------------------------------ section tested case 0: - Threadnewinstance001a test_thread = - new Threadnewinstance001a("testedThread"); + Thread test_thread = + JDIThreadFactory.newThread(new Threadnewinstance001a("testedThread")); log1(" thread2 is created"); label: @@ -169,7 +168,7 @@ } -class Threadnewinstance001a extends Thread { +class Threadnewinstance001a extends NamedTask { public Threadnewinstance001a(String threadName) { super(threadName); diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance007a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance007a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance007a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/ClassType/newInstance/newinstance007a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -46,7 +46,7 @@ log = new Log(System.err, argHandler); waitTime = argHandler.getWaitTime() * 60000; pipe = argHandler.createDebugeeIOPipe(log); - im007aThread01 thread = null; + Thread thread = null; pipe.println(newinstance007.SGNL_READY); String instr = pipe.readln(); @@ -54,7 +54,7 @@ // create new thread and start it if (instr.equals(newinstance007.SGNL_STRTHRD)) { - thread = new im007aThread01("im007aThread01"); + thread = JDIThreadFactory.newThread(new im007aThread01("im007aThread01")); synchronized(im007aThread01.waitStarting) { thread.start(); try { @@ -120,7 +120,7 @@ } } -class im007aThread01 extends Thread { +class im007aThread01 extends NamedTask { public static Object waitInvoking = new Object(); public static Object waitStarting = new Object(); public static Object waitFinishing = new Object(); diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/equals/equals001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/equals/equals001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/equals/equals001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/equals/equals001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -73,7 +73,7 @@ log = new Log(System.err, argHandler); pipe = argHandler.createDebugeeIOPipe(log); try { - Thread thread1 = new equals001aThread("thread1"); + Thread thread1 = JDIThreadFactory.newThread(new equals001aThread("thread1")); synchronized (lock) { synchronized(wait) { @@ -108,7 +108,7 @@ //--------------------------------------------------------- test specific classes -class equals001aThread extends Thread { +class equals001aThread extends NamedTask { String name; @@ -126,7 +126,7 @@ foo(); - equals001aThread1 thread2 = new equals001aThread1(); + Thread thread2 = JDIThreadFactory.newThread(new equals001aThread1()); thread2.start(); try { @@ -147,7 +147,7 @@ } } -class equals001aThread1 extends Thread { +class equals001aThread1 implements Runnable { public void run() { } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/hashCode/hashcode001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/hashCode/hashcode001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/hashCode/hashcode001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/hashCode/hashcode001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -73,7 +73,7 @@ log = new Log(System.err, argHandler); pipe = argHandler.createDebugeeIOPipe(log); try { - Thread thread1 = new hashcode001aThread("thread1"); + Thread thread1 = JDIThreadFactory.newThread(new hashcode001aThread("thread1")); synchronized (lock) { synchronized(wait) { @@ -108,7 +108,7 @@ //--------------------------------------------------------- test specific classes -class hashcode001aThread extends Thread { +class hashcode001aThread extends NamedTask { String name; @@ -126,7 +126,7 @@ foo(); - hashcode001aThread1 thread2 = new hashcode001aThread1(); + Thread thread2 = JDIThreadFactory.newThread(new hashcode001aThread1()); thread2.start(); try { @@ -147,7 +147,7 @@ } } -class hashcode001aThread1 extends Thread { +class hashcode001aThread1 implements Runnable { public void run() { } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -106,7 +106,7 @@ //------------------------------------------------------ section tested case 0: - thread2 = new Thread3request001a("thread2"); + thread2 = JDIThreadFactory.newThread(new Thread3request001a("thread2")); threadStart(thread2); try { // we should wait here for thread2 completion (see 6671428) @@ -119,9 +119,9 @@ for (int n1 = 0; n1 < threadsN; n1++) { if (n1 < threadsN-1) - threads[n1] = new Thread1request001a(threadNames[n1]); + threads[n1] = JDIThreadFactory.newThread(new Thread1request001a(threadNames[n1])); else - threads[n1] = new Thread2request001a(threadNames[n1]); + threads[n1] = JDIThreadFactory.newThread(new Thread2request001a(threadNames[n1])); } log1(" threads has been created"); @@ -183,7 +183,7 @@ static volatile int n = 0; - static class Thread1request001a extends Thread { + static class Thread1request001a extends NamedTask { int threadIndex; @@ -214,7 +214,7 @@ } - static class Thread2request001a extends Thread { + static class Thread2request001a extends NamedTask { int threadIndex; @@ -249,21 +249,18 @@ } - static class Thread3request001a extends Thread { - - String tName = null; + static class Thread3request001a extends NamedTask { public Thread3request001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - log3(" 'run': enter :: threadName == " + tName); + log3(" 'run': enter :: threadName == " + getName()); synchronized (waitnotifyObj) { waitnotifyObj.notify(); } - log3(" 'run': exit :: threadName == " + tName); + log3(" 'run': exit :: threadName == " + getName()); } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -105,7 +105,7 @@ //------------------------------------------------------ section tested case 0: - thread2 = new Thread3nextevent001a("thread2"); + thread2 = JDIThreadFactory.newThread(new Thread3nextevent001a("thread2")); threadStart(thread2); try { // we should wait here for thread2 completion (see 6671428) @@ -118,9 +118,9 @@ for (int n1 = 0; n1 < threadsN; n1++) { if (n1 < threadsN-1) - threads[n1] = new Thread1nextevent001a(threadNames[n1]); + threads[n1] = JDIThreadFactory.newThread(new Thread1nextevent001a(threadNames[n1])); else - threads[n1] = new Thread2nextevent001a(threadNames[n1]); + threads[n1] = JDIThreadFactory.newThread(new Thread2nextevent001a(threadNames[n1])); } log1(" threads has been created"); @@ -182,7 +182,7 @@ static volatile int n = 0; - static class Thread1nextevent001a extends Thread { + static class Thread1nextevent001a extends NamedTask { int threadIndex; @@ -213,7 +213,7 @@ } - static class Thread2nextevent001a extends Thread { + static class Thread2nextevent001a extends NamedTask { int threadIndex; @@ -248,21 +248,18 @@ } - static class Thread3nextevent001a extends Thread { - - String tName = null; + static class Thread3nextevent001a extends NamedTask { public Thread3nextevent001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - log3(" 'run': enter :: threadName == " + tName); + log3(" 'run': enter :: threadName == " + getName()); synchronized (waitnotifyObj) { waitnotifyObj.notify(); } - log3(" 'run': exit :: threadName == " + tName); + log3(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/addCountFilter/addcountfilter001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.addCountFilter; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1addcountfilter001a thread1 = null; + static Thread thread1 = null; static TestClass11 obj = new TestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1addcountfilter001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1addcountfilter001a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class Thread1addcountfilter001a extends Thread { - - String tName = null; +class Thread1addcountfilter001a extends NamedTask { public Thread1addcountfilter001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - addcountfilter001a.log1(" 'run': enter :: threadName == " + tName); + addcountfilter001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(addcountfilter001a.waitnotifyObj) { addcountfilter001a.waitnotifyObj.notify(); } synchronized(addcountfilter001a.lockObj) { TestClass11.method11(); } - addcountfilter001a.log1(" 'run': exit :: threadName == " + tName); + addcountfilter001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.disable; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static disable001aThread1 thread1 = null; + static Thread thread1 = null; static disable001aTestClass11 obj = new disable001aTestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new disable001aThread1("thread1"); + thread1 = JDIThreadFactory.newThread(new disable001aThread1("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class disable001aThread1 extends Thread { - - String tName = null; +class disable001aThread1 extends NamedTask { public disable001aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - disable001a.log1(" 'run': enter :: threadName == " + tName); + disable001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(disable001a.waitnotifyObj) { disable001a.waitnotifyObj.notify(); } synchronized(disable001a.lockObj) { disable001aTestClass11.method11(); } - disable001a.log1(" 'run': exit :: threadName == " + tName); + disable001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/disable/disable002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -204,22 +204,19 @@ class disable002aThread1 extends Thread { - String tName = null; - public disable002aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - disable002a.log1(" 'run': enter :: threadName == " + tName); + disable002a.log1(" 'run': enter :: threadName == " + getName()); synchronized(disable002a.waitnotifyObj) { disable002a.waitnotifyObj.notify(); } synchronized(disable002a.lockObj) { disable002aTestClass11.method11(); } - disable002a.log1(" 'run': exit :: threadName == " + tName); + disable002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -204,22 +204,19 @@ class enable001aThread1 extends Thread { - String tName = null; - public enable001aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - enable001a.log1(" 'run': enter :: threadName == " + tName); + enable001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(enable001a.waitnotifyObj) { enable001a.waitnotifyObj.notify(); } synchronized(enable001a.lockObj) { enable001aTestClass11.method11(); } - enable001a.log1(" 'run': exit :: threadName == " + tName); + enable001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/enable/enable002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -210,22 +210,19 @@ class enable002aThread1 extends Thread { - String tName = null; - public enable002aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - enable002a.log1(" 'run': enter :: threadName == " + tName); + enable002a.log1(" 'run': enter :: threadName == " + getName()); synchronized(enable002a.waitnotifyObj) { enable002a.waitnotifyObj.notify(); } synchronized(enable002a.lockObj) { enable002aTestClass11.method11(); } - enable002a.log1(" 'run': exit :: threadName == " + tName); + enable002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/getProperty/getproperty001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.getProperty; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1getproperty001a thread1 = null; + static Thread thread1 = null; static TestClass11 obj = new TestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1getproperty001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1getproperty001a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class Thread1getproperty001a extends Thread { - - String tName = null; +class Thread1getproperty001a extends NamedTask { public Thread1getproperty001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - getproperty001a.log1(" 'run': enter :: threadName == " + tName); + getproperty001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(getproperty001a.waitnotifyObj) { getproperty001a.waitnotifyObj.notify(); } synchronized(getproperty001a.lockObj) { TestClass11.method11(); } - getproperty001a.log1(" 'run': exit :: threadName == " + tName); + getproperty001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/isEnabled/isenabled001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.isEnabled; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1isenabled001a thread1 = null; + static Thread thread1 = null; static TestClass11 obj = new TestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1isenabled001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1isenabled001a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class Thread1isenabled001a extends Thread { - - String tName = null; +class Thread1isenabled001a extends NamedTask { public Thread1isenabled001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - isenabled001a.log1(" 'run': enter :: threadName == " + tName); + isenabled001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(isenabled001a.waitnotifyObj) { isenabled001a.waitnotifyObj.notify(); } synchronized(isenabled001a.lockObj) { TestClass11.method11(); } - isenabled001a.log1(" 'run': exit :: threadName == " + tName); + isenabled001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/putProperty/putproperty001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.putProperty; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1putproperty001a thread1 = null; + static Thread thread1 = null; static TestClass11 obj = new TestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1putproperty001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1putproperty001a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class Thread1putproperty001a extends Thread { - - String tName = null; +class Thread1putproperty001a extends NamedTask { public Thread1putproperty001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - putproperty001a.log1(" 'run': enter :: threadName == " + tName); + putproperty001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(putproperty001a.waitnotifyObj) { putproperty001a.waitnotifyObj.notify(); } synchronized(putproperty001a.lockObj) { TestClass11.method11(); } - putproperty001a.log1(" 'run': exit :: threadName == " + tName); + putproperty001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.setEnabled; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static setenabled001aThread1 thread1 = null; + static Thread thread1 = null; static setenabled001aTestClass11 obj = new setenabled001aTestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new setenabled001aThread1("thread1"); + thread1 = JDIThreadFactory.newThread(new setenabled001aThread1("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class setenabled001aThread1 extends Thread { - - String tName = null; +class setenabled001aThread1 extends NamedTask { public setenabled001aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - setenabled001a.log1(" 'run': enter :: threadName == " + tName); + setenabled001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(setenabled001a.waitnotifyObj) { setenabled001a.waitnotifyObj.notify(); } synchronized(setenabled001a.lockObj) { setenabled001aTestClass11.method11(); } - setenabled001a.log1(" 'run': exit :: threadName == " + tName); + setenabled001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.setEnabled; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static setenabled002aThread1 thread1 = null; + static Thread thread1 = null; static setenabled002aTestClass11 obj = new setenabled002aTestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new setenabled002aThread1("thread1"); + thread1 = JDIThreadFactory.newThread(new setenabled002aThread1("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -208,24 +207,21 @@ } } -class setenabled002aThread1 extends Thread { - - String tName = null; +class setenabled002aThread1 extends NamedTask { public setenabled002aThread1(String threadName) { super(threadName); - tName = threadName; } public void run() { - setenabled002a.log1(" 'run': enter :: threadName == " + tName); + setenabled002a.log1(" 'run': enter :: threadName == " + getName()); synchronized(setenabled002a.waitnotifyObj) { setenabled002a.waitnotifyObj.notify(); } synchronized(setenabled002a.lockObj) { setenabled002aTestClass11.method11(); } - setenabled002a.log1(" 'run': exit :: threadName == " + tName); + setenabled002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setEnabled/setenabled003a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.setEnabled; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1setenabled003a thread1 = null; + static Thread thread1 = null; //------------------------------------------------------ common section @@ -96,7 +95,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1setenabled003a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1setenabled003a("thread1")); Thread1setenabled003a.method(); break; @@ -152,23 +151,20 @@ } } -class Thread1setenabled003a extends Thread { - - String tName = null; +class Thread1setenabled003a extends NamedTask { public Thread1setenabled003a(String threadName) { super(threadName); - tName = threadName; } public void run() { - setenabled003a.log1(" 'run': enter :: threadName == " + tName); + setenabled003a.log1(" 'run': enter :: threadName == " + getName()); synchronized(setenabled003a.waitnotifyObj) { setenabled003a.waitnotifyObj.notify(); } synchronized(setenabled003a.lockObj) { - setenabled003a.log1(" 'run': exit :: threadName == " + tName); + setenabled003a.log1(" 'run': exit :: threadName == " + getName()); } return; } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/setSuspendPolicy/setsuspendpolicy001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.setSuspendPolicy; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1setsuspendpolicy001a thread1 = null; + static Thread thread1 = null; static TestClass11 obj = new TestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1setsuspendpolicy001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1setsuspendpolicy001a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class Thread1setsuspendpolicy001a extends Thread { - - String tName = null; +class Thread1setsuspendpolicy001a extends NamedTask { public Thread1setsuspendpolicy001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - setsuspendpolicy001a.log1(" 'run': enter :: threadName == " + tName); + setsuspendpolicy001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(setsuspendpolicy001a.waitnotifyObj) { setsuspendpolicy001a.waitnotifyObj.notify(); } synchronized(setsuspendpolicy001a.lockObj) { TestClass11.method11(); } - setsuspendpolicy001a.log1(" 'run': exit :: threadName == " + tName); + setsuspendpolicy001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequest/suspendPolicy/suspendpolicy001a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequest.suspendPolicy; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1suspendpolicy001a thread1 = null; + static Thread thread1 = null; static TestClass11 obj = new TestClass11(); @@ -100,7 +99,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1suspendpolicy001a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1suspendpolicy001a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -202,24 +201,21 @@ } } -class Thread1suspendpolicy001a extends Thread { - - String tName = null; +class Thread1suspendpolicy001a extends NamedTask { public Thread1suspendpolicy001a(String threadName) { super(threadName); - tName = threadName; } public void run() { - suspendpolicy001a.log1(" 'run': enter :: threadName == " + tName); + suspendpolicy001a.log1(" 'run': enter :: threadName == " + getName()); synchronized(suspendpolicy001a.waitnotifyObj) { suspendpolicy001a.waitnotifyObj.notify(); } synchronized(suspendpolicy001a.lockObj) { TestClass11.method11(); } - suspendpolicy001a.log1(" 'run': exit :: threadName == " + tName); + suspendpolicy001a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -54,7 +53,7 @@ //====================================================== test program - static Thread1crstepreq002a thread1 = null; + static Thread thread1 = null; static TestClass10 obj = new TestClass10(); @@ -98,7 +97,7 @@ //------------------------------------------------------ section tested case 0: - thread1 = new Thread1crstepreq002a("thread1"); + thread1 = JDIThreadFactory.newThread(new Thread1crstepreq002a("thread1")); synchronized (lockObj) { threadStart(thread1); @@ -149,24 +148,21 @@ } } -class Thread1crstepreq002a extends Thread { - - String tName = null; +class Thread1crstepreq002a extends NamedTask { public Thread1crstepreq002a(String threadName) { super(threadName); - tName = threadName; } public void run() { - crstepreq002a.log1(" 'run': enter :: threadName == " + tName); + crstepreq002a.log1(" 'run': enter :: threadName == " + getName()); synchronized(crstepreq002a.waitnotifyObj) { crstepreq002a.waitnotifyObj.notify(); } synchronized(crstepreq002a.lockObj) { TestClass11.m11(); } - crstepreq002a.log1(" 'run': exit :: threadName == " + tName); + crstepreq002a.log1(" 'run': exit :: threadName == " + getName()); return; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq003a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -72,21 +72,21 @@ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test case section case 0: - Thread thread0 = new Thread0crstepreq003a("thread0"); + Thread thread0 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread0")); threadStart(thread0); threadJoin (thread0, "0"); break; case 1: - Thread thread1 = new Thread0crstepreq003a("thread1"); + Thread thread1 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread1")); threadStart(thread1); threadJoin (thread1, "1"); break; case 2: - Thread thread2 = new Thread0crstepreq003a("thread2"); + Thread thread2 = JDIThreadFactory.newThread(new Thread0crstepreq003a("thread2")); threadStart(thread2); threadJoin (thread2, "2"); @@ -160,7 +160,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq003a extends Thread { +class Thread0crstepreq003a extends NamedTask { public Thread0crstepreq003a (String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq004a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -95,8 +95,8 @@ private static void runTestCase(int testCaseId) { isFirstThreadReady = false; isSecondThreadReady = false; - Thread thread1 = new Thread1crstepreq004a("thread1"); - Thread thread2 = new Thread2crstepreq004a("thread2"); + Thread thread1 = JDIThreadFactory.newThread(new Thread1crstepreq004a("thread1")); + Thread thread2 = JDIThreadFactory.newThread(new Thread2crstepreq004a("thread2")); synchronized (lockObj) { thread1.start(); while (!isFirstThreadReady) { @@ -167,7 +167,7 @@ /** * First thread which owns and locks the crstepreq004a.lockObj1 monitor . */ -class Thread1crstepreq004a extends Thread { +class Thread1crstepreq004a extends NamedTask { public Thread1crstepreq004a (String name) { super(name); } @@ -182,7 +182,7 @@ /** * Second thread which who owns the crstepreq004a.lockObj1 monitor . */ -class Thread2crstepreq004a extends Thread { +class Thread2crstepreq004a extends NamedTask { public Thread2crstepreq004a (String name) { super(name); } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq005a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,11 +24,11 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE + /** * The debugged application of the test. */ @@ -83,7 +83,7 @@ label0: for (int testCase = 0; testCase < maxCase && instruction != quit; testCase++) { - thread1 = new Thread0crstepreq005a(testCase); + thread1 = JDIThreadFactory.newThread(new Thread0crstepreq005a(testCase)); threadStart(thread1); threadJoin (thread1, testCase); @@ -125,7 +125,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq005a extends Thread { +class Thread0crstepreq005a extends NamedTask { int testCase; public Thread0crstepreq005a (int testCase) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq006a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,11 +24,11 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE + /** * The debugged application of the test. */ @@ -83,7 +83,7 @@ label0: for (int testCase = 0; testCase < maxCase && instruction != quit; testCase++) { - thread1 = new Thread0crstepreq006a(testCase); + thread1 = JDIThreadFactory.newThread(new Thread0crstepreq006a(testCase)); threadStart(thread1); threadJoin (thread1, testCase); @@ -125,7 +125,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq006a extends Thread { +class Thread0crstepreq006a extends NamedTask { int testCase; public Thread0crstepreq006a (int testCase) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq007a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,11 +24,11 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE + /** * The debugged application of the test. */ @@ -83,7 +83,7 @@ label0: for (int testCase = 0; testCase < maxCase && instruction != quit; testCase++) { - thread1 = new Thread0crstepreq007a(testCase); + thread1 = JDIThreadFactory.newThread(new Thread0crstepreq007a(testCase)); threadStart(thread1); threadJoin (thread1, testCase); @@ -125,7 +125,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq007a extends Thread { +class Thread0crstepreq007a extends NamedTask { int testCase; public Thread0crstepreq007a (int testCase) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq008a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,11 +24,11 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE + /** * The debugged application of the test. */ @@ -83,7 +83,7 @@ label0: for (int testCase = 0; testCase < maxCase && instruction != quit; testCase++) { - thread1 = new Thread0crstepreq008a(testCase); + thread1 = JDIThreadFactory.newThread(new Thread0crstepreq008a(testCase)); threadStart(thread1); threadJoin (thread1, testCase); @@ -125,7 +125,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq008a extends Thread { +class Thread0crstepreq008a extends NamedTask { int testCase; public Thread0crstepreq008a (int testCase) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq009a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,11 +24,11 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE + /** * The debugged application of the test. */ @@ -83,7 +83,7 @@ label0: for (int testCase = 0; testCase < maxCase && instruction != quit; testCase++) { - thread1 = new Thread0crstepreq009a(testCase); + thread1 = JDIThreadFactory.newThread(new Thread0crstepreq009a(testCase)); threadStart(thread1); threadJoin (thread1, testCase); @@ -125,7 +125,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq009a extends Thread { +class Thread0crstepreq009a extends NamedTask { int testCase; public Thread0crstepreq009a (int testCase) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/createStepRequest/crstepreq010a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2021, 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 @@ -24,11 +24,11 @@ package nsk.jdi.EventRequestManager.createStepRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; // THIS TEST IS LINE NUMBER SENSITIVE + /** * The debugged application of the test. */ @@ -83,7 +83,7 @@ label0: for (int testCase = 0; testCase < maxCase && instruction != quit; testCase++) { - thread1 = new Thread0crstepreq010a(testCase); + thread1 = JDIThreadFactory.newThread(new Thread0crstepreq010a(testCase)); threadStart(thread1); threadJoin (thread1, testCase); @@ -125,7 +125,7 @@ /** * This thread will be suspended on breakpoint. No locks are used. */ -class Thread0crstepreq010a extends Thread { +class Thread0crstepreq010a extends NamedTask { int testCase; public Thread0crstepreq010a (int testCase) { diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequestManager.deleteEventRequest; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -56,7 +55,7 @@ static int testField1 = 0; static NullPointerException testField2 = new NullPointerException("test"); - static Thread1delevtreq002a testField3 = null; + static Thread testField3 = null; //------------------------------------------------------ common section @@ -99,7 +98,7 @@ case 0: synchronized (lockObj1) { - testField3 = new Thread1delevtreq002a("thread1"); + testField3 = JDIThreadFactory.newThread(new Thread1delevtreq002a("thread1")); threadStart(testField3); methodForCommunication(); } @@ -136,22 +135,19 @@ } } -class Thread1delevtreq002a extends Thread { - - String tName = null; +class Thread1delevtreq002a extends NamedTask { public Thread1delevtreq002a(String threadName) { super(threadName); - tName = threadName; } public void run() { - delevtreq002a.log1(" 'run': enter :: threadName == " + tName); + delevtreq002a.log1(" 'run': enter :: threadName == " + getName()); synchronized(delevtreq002a.waitnotifyObj) { delevtreq002a.waitnotifyObj.notify(); } synchronized(delevtreq002a.lockObj1) { - delevtreq002a.log1(" 'run': exit :: threadName == " + tName); + delevtreq002a.log1(" 'run': exit :: threadName == " + getName()); } return; } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002a.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002a.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002a.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,6 @@ package nsk.jdi.EventRequestManager.deleteEventRequests; import nsk.share.*; -import nsk.share.jpda.*; import nsk.share.jdi.*; /** @@ -56,7 +55,7 @@ static int testField1 = 0; static NullPointerException testField2 = new NullPointerException("test"); - static Thread1delevtreqs002a testField3[] = new Thread1delevtreqs002a[10]; + static Thread testField3[] = new Thread[10]; //------------------------------------------------------ common section @@ -100,7 +99,7 @@ case 0: synchronized (lockObj1) { for (int ii = 0; ii < 10; ii++) { - testField3[ii] = new Thread1delevtreqs002a("thread" + ii); + testField3[ii] = JDIThreadFactory.newThread(new Thread1delevtreqs002a("thread" + ii)); threadStart(testField3[ii]); } methodForCommunication(); @@ -138,22 +137,19 @@ } -class Thread1delevtreqs002a extends Thread { - - String tName = null; +class Thread1delevtreqs002a extends NamedTask { public Thread1delevtreqs002a(String threadName) { super(threadName); - tName = threadName; } public void run() { - delevtreqs002a.log1(" 'run': enter :: threadName == " + tName); + delevtreqs002a.log1(" 'run': enter :: threadName == " + getName()); synchronized(delevtreqs002a.waitnotifyObj) { delevtreqs002a.waitnotifyObj.notify(); } synchronized(delevtreqs002a.lockObj1) { - delevtreqs002a.log1(" 'run': exit :: threadName == " + tName); + delevtreqs002a.log1(" 'run': exit :: threadName == " + getName()); } return; } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001t.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2021, 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 @@ -23,7 +23,6 @@ package nsk.jdi.EventRequestManager.stepRequests; -import nsk.share.*; import nsk.share.jpda.*; import nsk.share.jdi.*; @@ -61,8 +60,8 @@ // Get a monitor in order to prevent the threads from exiting synchronized(lockObj) { for (int i=1; i -1) && (threshold > max) ) { // we can't test threshold - not enough memory log.display("not enough memory for testing threshold:" + - " used=" + used + - ", max = " + max ); + " used=" + used + ", max=" + max + ": skip"); + continue; } monitor.setUsageThreshold(pool, threshold); - log.display(" threshold " + threshold + " is set, used = " + used ); + log.display(" used value is " + used + " max is " + max + " isExceeded = " + isExceeded); + log.display("peak used value is " + peakUsed); + log.display(" threshold set to " + threshold); + log.display(" threshold count " + monitor.getUsageThresholdCount(pool)); + // Reset peak usage so we can use it: monitor.resetPeakUsage(pool); - log.display(" resetting peak usage"); - log.display(" peak usage = " + monitor.getPeakUsage(pool).getUsed()); - - // Eat some memory - provoke usage of the pool to cross the - // threshold value - b = new byte[INCREMENT]; // Eat 100K - - boolean isExceeded = monitor.isUsageThresholdExceeded(pool); - usage = monitor.getPeakUsage(pool); + isExceeded = monitor.isUsageThresholdExceeded(pool); + log.display(" reset peak usage. peak usage = " + monitor.getPeakUsage(pool).getUsed() + + " isExceeded = " + isExceeded); + + // Eat some memory - _may_ cause usage of the pool to cross threshold, + // but cannot assume this affects the pool we are testing. + b = new byte[INCREMENT]; + + isExceeded = monitor.isUsageThresholdExceeded(pool); + log.display(" Allocated heap. isExceeded = " + isExceeded); + + // Fetch usage information: use peak usage in comparisons below, in case usage went up and then down. + // Log used and peak used in case of failure. + usage = monitor.getUsage(pool); + peakUsage = monitor.getPeakUsage(pool); used = usage.getUsed(); + max = usage.getMax(); + peakUsed = peakUsage.getUsed(); - log.display(" used value is " + used); - - if (used < threshold && isExceeded) { - // There're problems with isUsageThresholdExceeded() + log.display(" used value is " + used + " max is " + max + " isExceeded = " + isExceeded); + log.display("peak used value is " + peakUsed); + long thresholdCount = monitor.getUsageThresholdCount(pool); + log.display(" threshold count " + thresholdCount); + + // If peak used value is less than threshold, then isUsageThresholdExceeded() + // is expected to return false. + if (peakUsed < threshold && isExceeded) { + // used is commonly less than threshold, but isExceeded should not be true: log.complain("isUsageThresholdExceeded() returned " + "true, while threshold = " + threshold - + " and used peak = " + used); + + " and used peak = " + peakUsed); + isExceeded = monitor.isUsageThresholdExceeded(pool); + if (isExceeded) { testFailed = true; + } else { + log.complain("isUsageThresholdExceeded() now says false."); + } } else - if (used >= threshold && !isExceeded) { - // we can introduce some imprecision during pooling memory usage - // value at the Code Cache memory pool. Amount of used memory - // was changed after we'd calculated isExceeded value - - if (monitor.isUsageThresholdExceeded(pool)) { - // that's mean such imprecision - log.display("isUsageThresholdExceeded() returned false," + // If peak used value is greater or equal than threshold, then + // isUsageThresholdExceeded() is expected to return true. + if (peakUsed >= threshold && !isExceeded) { + isExceeded = monitor.isUsageThresholdExceeded(pool); + if (isExceeded) { + log.display("isUsageThresholdExceeded() returned false, then true," + " while threshold = " + threshold + " and " - + "used peak = " + used); + + "used peak = " + peakUsed); } else { - // some other problems with isUsageThresholdExceeded() - log.complain("isUsageThresholdExceeded() returned false," + // Failure: + log.complain("isUsageThresholdExceeded() returned false, and is still false," + " while threshold = " + threshold + " and " - + "used peak = " + used); + + "used peak = " + peakUsed); testFailed = true; } } diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load007/TestDescription.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load007/TestDescription.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load007/TestDescription.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load007/TestDescription.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -47,7 +47,7 @@ * /test/lib * @comment generate and compile LoadableClassXXX classes * @run driver nsk.monitoring.stress.classload.GenClassesBuilder - * @run main/othervm + * @run main/othervm/timeout=180 * -XX:-UseGCOverheadLimit * nsk.monitoring.stress.classload.load001 * classes diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load011/TestDescription.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load011/TestDescription.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load011/TestDescription.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load011/TestDescription.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -45,7 +45,7 @@ * /test/lib * @comment generate and compile LoadableClassXXX classes * @run driver nsk.monitoring.stress.classload.GenClassesBuilder - * @run main/othervm + * @run main/othervm/timeout=180 * -XX:-UseGCOverheadLimit * nsk.monitoring.stress.classload.load001 * classes diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load012/TestDescription.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load012/TestDescription.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load012/TestDescription.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/monitoring/stress/classload/load012/TestDescription.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -45,7 +45,7 @@ * /test/lib * @comment generate and compile LoadableClassXXX classes * @run driver nsk.monitoring.stress.classload.GenClassesBuilder - * @run main/othervm + * @run main/othervm/timeout=180 * -XX:-UseGCOverheadLimit * nsk.monitoring.stress.classload.load001 * classes diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIThreadFactory.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIThreadFactory.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIThreadFactory.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIThreadFactory.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.share.jdi; + +import java.util.concurrent.ThreadFactory; + +/* + This factory is used to run new threads in debuggee in JDI tests. + */ + +public class JDIThreadFactory { + + private static ThreadFactory threadFactory = r -> new Thread(r); + + public static Thread newThread(NamedTask task) { + return newThread(task, task.getName()); + } + + + public static Thread newThread(Runnable task) { + return threadFactory.newThread(task); + } + + public static Thread newThread(Runnable task, String name) { + Thread t = threadFactory.newThread(task); + t.setName(name); + return t; + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIUtils.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIUtils.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/JDIUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.share.jdi; + +public class JDIUtils { + + /* + * Wait until thread is no longer alive, but only wait + * for a short period of time since it shouldn't take long. + */ + public static boolean waitForCompletion(Thread thread) { + for (int attempt = 1; attempt <= 5; attempt++) { + if (!thread.isAlive()) { + return true; + } + try { + Thread.sleep(attempt * 1000); + } catch (InterruptedException ie) { + } + } + return false; + } +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/NamedTask.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/NamedTask.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/NamedTask.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/NamedTask.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.share.jdi; + +public abstract class NamedTask implements Runnable { + private String name; + + public NamedTask(String name) { + this.name = name; + } + + @Override + public abstract void run(); + + public String getName() { + return name; + } + +} diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/stress/numeric/TEST.properties 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 2018, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# 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, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -exclusiveAccess.dirs=. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree002/btree002.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -30,7 +30,7 @@ * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] * VM Testbase readme: * DESCRIPTION - * Single thread loads a tree of classes with signle loader. + * Single thread loads a tree of classes with single loader. * The test is deemed failed if loading attempt fails. * The test repeats until the given number of iterations, * or until EndOfMemoryError. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree005/btree005.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -30,7 +30,7 @@ * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] * VM Testbase readme: * DESCRIPTION - * Multiple threads load a tree of classes with signle loader. + * Multiple threads load a tree of classes with single loader. * The test is deemed failed if loading attempt fails. * The test repeats until the given number of iterations, * or until EndOfMemoryError. diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree008/btree008.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -30,7 +30,7 @@ * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] * VM Testbase readme: * DESCRIPTION - * Single thread loads a tree of classes with signle loader. + * Single thread loads a tree of classes with single loader. * Then, memory stress is induced to unload the classes. * The test is deemed failed if loading attempt fails; * or if the tested VM crashes. @@ -51,5 +51,6 @@ * -jarpath btree.jar${path.separator}fats.jar * -useSingleLoader * -stressHeap + * -t 1 */ diff -Nru openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java --- openjdk-17-17.0.9+9/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/hotspot/jtreg/vmTestbase/nsk/sysdict/vm/stress/btree/btree011/btree011.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -30,7 +30,7 @@ * VM Testbase keywords: [stress, sysdict, stressopt, nonconcurrent] * VM Testbase readme: * DESCRIPTION - * Multiple threads load a tree of classes with signle loader. + * Multiple threads load a tree of classes with single loader. * Then, memory stress is induced to unload the classes. * The test is deemed failed if loading attempt fails; * or if the tested VM crashes. diff -Nru openjdk-17-17.0.9+9/test/jaxp/TEST.ROOT openjdk-17-17.0.10+7/test/jaxp/TEST.ROOT --- openjdk-17-17.0.9+9/test/jaxp/TEST.ROOT 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jaxp/TEST.ROOT 2024-01-09 21:18:15.000000000 +0000 @@ -23,7 +23,7 @@ groups=TEST.groups # Minimum jtreg version -requiredVersion=6+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them diff -Nru openjdk-17-17.0.9+9/test/jdk/ProblemList.txt openjdk-17-17.0.10+7/test/jdk/ProblemList.txt --- openjdk-17-17.0.9+9/test/jdk/ProblemList.txt 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/ProblemList.txt 2024-01-09 21:18:15.000000000 +0000 @@ -119,7 +119,6 @@ java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java 6849364 generic-all java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 generic-all java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 6848407 generic-all -java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java 8239801 macosx-all java/awt/Frame/MaximizedUndecorated/MaximizedUndecorated.java 8022302 generic-all java/awt/Frame/FrameLocation/FrameLocation.java 8233703 linux-all java/awt/FileDialog/FileDialogIconTest/FileDialogIconTest.java 8160558 windows-all @@ -127,7 +126,6 @@ java/awt/event/MouseWheelEvent/InfiniteRecursion/InfiniteRecursion_1.java 8060176 windows-all,macosx-all java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.java 8171510 macosx-all -javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252 macosx-all @@ -209,7 +207,6 @@ java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java 8150540 windows-all java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java 8150540 windows-all java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java 8150540 windows-all -java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java 8193543 linux-all java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java 8150540 windows-all java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java 8150540 windows-all java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 8150540 windows-all @@ -388,7 +385,6 @@ java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java 8198665 macosx-all java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java 8198665 macosx-all java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326 macosx-all -java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8023562 macosx-all java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021 macosx-all java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all @@ -458,6 +454,7 @@ java/awt/List/SingleModeDeselect/SingleModeDeselect.java 8196367 windows-all java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235 macosx-all javax/print/PrintSEUmlauts/PrintSEUmlauts.java 8135174 generic-all +java/awt/font/Rotate/RotatedTextTest.java 8219641 linux-all java/awt/font/TextLayout/LigatureCaretTest.java 8266312 generic-all java/awt/image/VolatileImage/CustomCompositeTest.java 8199002 windows-all,linux-all java/awt/image/VolatileImage/GradientPaints.java 8199003 linux-all @@ -465,9 +462,7 @@ java/awt/Debug/DumpOnKey/DumpOnKey.java 8202667 windows-all java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 8202926 linux-all java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all -java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.java 8202882,8255898 linux-all,macosx-all -java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931 macosx-all,linux-all java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 7124275 macosx-all java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java 6848810 macosx-all,linux-all java/awt/Component/NativeInLightShow/NativeInLightShow.java 8202932 linux-all @@ -508,6 +503,7 @@ java/awt/MenuBar/TestNoScreenMenuBar.java 8265987 macosx-all java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8266283 generic-all +java/awt/Graphics2D/DrawString/RotTransText.java 8316878 linux-all java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java 8257529 windows-x64 java/awt/Window/GetScreenLocation/GetScreenLocationTest.java 8225787 linux-x64 @@ -536,7 +532,7 @@ 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 ############################################################################ @@ -598,7 +594,7 @@ # jdk_nio -java/nio/channels/DatagramChannel/Unref.java 8233519 generic-all +java/nio/channels/DatagramChannel/Unref.java 8233437 generic-all java/nio/channels/AsynchronousSocketChannel/StressLoopback.java 8211851 aix-ppc64 @@ -615,6 +611,7 @@ java/rmi/transport/checkLeaseInfoLeak/CheckLeaseLeak.java 7191877 generic-all java/rmi/registry/readTest/CodebaseTest.java 8173324 windows-all +java/rmi/registry/multipleRegistries/MultipleRegistries.java 8268182 macosx-all java/rmi/Naming/DefaultRegistryPort.java 8005619 windows-all java/rmi/Naming/legalRegistryNames/LegalRegistryNames.java 8005619 windows-all @@ -633,8 +630,6 @@ # jdk_security -sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8161536 generic-all - javax/net/ssl/DTLS/CipherSuite.java 8202059 macosx-x64 sun/security/smartcardio/TestChannel.java 8039280 generic-all @@ -655,7 +650,7 @@ com/sun/security/sasl/gsskerb/NoSecurityLayer.java 8039280 generic-all javax/security/auth/kerberos/KerberosHashEqualsTest.java 8039280 generic-all javax/security/auth/kerberos/KerberosTixDateTest.java 8039280 generic-all -javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java 8285785,8286045,8287596 generic-all +javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java 8286045 generic-all sun/security/provider/PolicyFile/GrantAllPermToExtWhenNoPolicy.java 8039280 generic-all sun/security/provider/PolicyParser/ExtDirsChange.java 8039280 generic-all sun/security/provider/PolicyParser/PrincipalExpansionError.java 8039280 generic-all @@ -759,8 +754,6 @@ com/sun/jdi/InvokeHangTest.java 8218463 linux-all -com/sun/jdi/AfterThreadDeathTest.java 8232839 linux-all - ############################################################################ # jdk_time @@ -786,10 +779,10 @@ sun/tools/jstatd/TestJstatdRmiPort.java 8226420,8251259 windows-all sun/tools/jstatd/TestJstatdServer.java 8081569,8226420 windows-all -sun/tools/jstat/jstatLineCounts1.sh 8268211 linux-aarch64 -sun/tools/jstat/jstatLineCounts2.sh 8268211 linux-aarch64 -sun/tools/jstat/jstatLineCounts3.sh 8268211 linux-aarch64 -sun/tools/jstat/jstatLineCounts4.sh 8268211 linux-aarch64 +sun/tools/jstat/jstatLineCounts1.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 +sun/tools/jstat/jstatLineCounts2.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 +sun/tools/jstat/jstatLineCounts3.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 +sun/tools/jstat/jstatLineCounts4.sh 8248691,8268211 linux-ppc64le,aix-ppc64,linux-aarch64 ############################################################################ @@ -803,7 +796,6 @@ # jdk_jfr -jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 8228990,8229370 generic-all jdk/jfr/event/compiler/TestCodeSweeper.java 8225209 generic-all jdk/jfr/event/os/TestThreadContextSwitches.java 8247776 windows-all jdk/jfr/startupargs/TestStartName.java 8214685 windows-x64 diff -Nru openjdk-17-17.0.9+9/test/jdk/TEST.ROOT openjdk-17-17.0.10+7/test/jdk/TEST.ROOT --- openjdk-17-17.0.9+9/test/jdk/TEST.ROOT 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/TEST.ROOT 2024-01-09 21:18:15.000000000 +0000 @@ -32,7 +32,8 @@ sun/tools/jstatd sun/tools/jcmd \ sun/tools/jinfo sun/tools/jmap sun/tools/jps sun/tools/jstack sun/tools/jstat \ com/sun/tools/attach sun/security/mscapi java/util/Arrays/largeMemory \ -java/util/BitSet/stream javax/rmi java/net/httpclient/websocket +java/util/BitSet/stream javax/rmi java/net/httpclient/websocket \ +sun/tools/jhsdb # Group definitions groups=TEST.groups @@ -71,7 +72,7 @@ jdk.containerized # Minimum jtreg version -requiredVersion=6+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java openjdk-17-17.0.10+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortInput.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023, Alphabet LLC. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8314045 + * @summary ArithmeticException in GaloisCounterMode + */ + +import java.nio.ByteBuffer; + +import javax.crypto.AEADBadTagException; +import javax.crypto.Cipher; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +public class GCMShortInput { + + public static void main(String args[]) throws Exception { + SecretKeySpec keySpec = + new SecretKeySpec( + new byte[] { + 88, 26, 43, -100, -24, -29, -70, 10, 34, -85, 52, 101, 45, -68, -105, + -123 + }, + "AES"); + GCMParameterSpec params = + new GCMParameterSpec(8 * 16, new byte[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); + Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); + cipher.init(Cipher.DECRYPT_MODE, keySpec, params); + try { + cipher.doFinal(ByteBuffer.allocate(0), ByteBuffer.allocate(0)); + throw new AssertionError("AEADBadTagException expected"); + } catch (AEADBadTagException e) { + // expected + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/AfterThreadDeathTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/AfterThreadDeathTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/AfterThreadDeathTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/AfterThreadDeathTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -51,9 +51,9 @@ public class AfterThreadDeathTest extends TestScaffold { ReferenceType targetClass; ThreadReference mainThread; - StepRequest stepRequest = null; EventRequestManager erm; - boolean mainIsDead; + volatile boolean mainIsDead = false; + volatile boolean gotExpectedThreadStart = false; AfterThreadDeathTest (String args[]) { super(args); @@ -68,20 +68,23 @@ public void threadStarted(ThreadStartEvent event) { println("Got ThreadStartEvent: " + event); - if (stepRequest != null) { - erm.deleteEventRequest(stepRequest); - stepRequest = null; - println("Deleted stepRequest"); + // We don't want to attempt the StepRequest.enable() until we recieve + // the ThreadStartEvent for the "DestroyJavaVM" thread. See JDK-8232839. + if (!event.thread().name().equals("DestroyJavaVM")) { + return; } + gotExpectedThreadStart = true; - if (mainIsDead) { + if (!mainIsDead) { + failure("FAILED: Got expected ThreadStartEvent before \"main\" ThreadDeathEvent"); + } else { // Here is the odd thing about this test; whatever thread this event // is for, we do a step on the mainThread. If the mainThread is // already dead, we should get the exception. Note that we don't // come here for the start of the main thread. - stepRequest = erm.createStepRequest(mainThread, - StepRequest.STEP_LINE, - StepRequest.STEP_OVER); + StepRequest stepRequest = erm.createStepRequest(mainThread, + StepRequest.STEP_LINE, + StepRequest.STEP_OVER); stepRequest.addCountFilter(1); stepRequest.setSuspendPolicy (EventRequest.SUSPEND_ALL); try { @@ -146,6 +149,13 @@ */ listenUntilVMDisconnect(); + if (!gotExpectedThreadStart) { + failure("FAILED: never got expected ThreadStartEvent"); + } + if (!mainIsDead) { + failure("FAILED: never got ThreadDeathEvent for \"main\" thread"); + } + /* * deal with results of test * if anything has called failure("foo") testFailed will be true diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/JdwpOnThrowTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/JdwpOnThrowTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/JdwpOnThrowTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/JdwpOnThrowTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2023 SAP SE. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import com.sun.jdi.Bootstrap; +import com.sun.jdi.VirtualMachine; +import com.sun.jdi.connect.AttachingConnector; +import com.sun.jdi.connect.Connector; +import com.sun.jdi.connect.IllegalConnectorArgumentsException; +import com.sun.jdi.event.EventIterator; +import com.sun.jdi.event.EventQueue; +import com.sun.jdi.event.EventSet; +import com.sun.jdi.event.Event; +import com.sun.jdi.event.ExceptionEvent; +import lib.jdb.Debuggee; + +import java.io.IOException; +import java.net.ServerSocket; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/* + * @test + * @bug 8317920 + * @summary Tests for JDWP agent to send valid exception event with onthrow option + * @library /test/lib + * + * @build ThrowCaughtException JdwpOnThrowTest + * @run main/othervm JdwpOnThrowTest + */ +public class JdwpOnThrowTest { + + private static long TIMEOUT = 10000; + + private static String ATTACH_CONNECTOR = "com.sun.jdi.SocketAttach"; + // cache socket attaching connector + private static AttachingConnector attachingConnector; + + public static void main(String[] args) throws Exception { + int port = findFreePort(); + try (Debuggee debuggee = Debuggee.launcher("ThrowCaughtException").setAddress("localhost:" + port) + .enableOnThrow("Ex", "Start").setSuspended(true).launch()) { + VirtualMachine vm = null; + try { + vm = attach("localhost", "" + port); + EventQueue queue = vm.eventQueue(); + log("Waiting for exception event"); + long start = System.currentTimeMillis(); + while (start + TIMEOUT > System.currentTimeMillis()) { + EventSet eventSet = queue.remove(TIMEOUT); + EventIterator eventIterator = eventSet.eventIterator(); + while(eventIterator.hasNext() && start + TIMEOUT > System.currentTimeMillis()) { + Event event = eventIterator.next(); + if (event instanceof ExceptionEvent ex) { + verifyExceptionEvent(ex); + log("Received exception event: " + event); + vm.dispose(); + return; + } + log("Received event: " + event); + } + } + throw new RuntimeException("ERROR: failed to receive exception event"); + } catch (IOException ex) { + throw new RuntimeException("ERROR: failed to attach", ex); + } + } + } + + private static void verifyExceptionEvent(ExceptionEvent ex) throws Exception { + if (ex.exception() == null) { + throw new RuntimeException("Exception is null"); + } + if (ex.exception().type() == null) { + throw new RuntimeException("Exception type is null"); + } + if (ex.exception().referenceType() == null) { + throw new RuntimeException("Exception reference type is null"); + } + if (ex.catchLocation() == null) { + throw new RuntimeException("Exception catch location is null"); + } + if (!ex.location().equals(ex.thread().frame(0).location())) { + throw new RuntimeException( + String.format("Throw location %s and location of first frame %s are not equal", + ex.location(), ex.thread().frame(0).location())); + } + if (!ex.exception().type().name().equals("Ex")) { + throw new RuntimeException("Exception has wrong type: " + ex.exception().type().name()); + } + } + + private static int findFreePort() { + try (ServerSocket socket = new ServerSocket(0)) { + return socket.getLocalPort(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static VirtualMachine attach(String address, String port) throws IOException { + if (attachingConnector == null) { + attachingConnector = (AttachingConnector)getConnector(ATTACH_CONNECTOR); + } + Map args = attachingConnector.defaultArguments(); + setConnectorArg(args, "hostname", address); + setConnectorArg(args, "port", port); + try { + return attachingConnector.attach(args); + } catch (IllegalConnectorArgumentsException e) { + // unexpected.. wrap in RuntimeException + throw new RuntimeException(e); + } + } + + private static Connector getConnector(String name) { + for (Connector connector : Bootstrap.virtualMachineManager().allConnectors()) { + if (connector.name().equalsIgnoreCase(name)) { + return connector; + } + } + throw new IllegalArgumentException("Connector " + name + " not found"); + } + + private static void setConnectorArg(Map args, String name, String value) { + Connector.Argument arg = args.get(name); + if (arg == null) { + throw new IllegalArgumentException("Argument " + name + " is not defined"); + } + arg.setValue(value); + } + + private static void log(Object o) { + System.out.println(String.valueOf(o)); + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/ThrowCaughtException.java openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/ThrowCaughtException.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/ThrowCaughtException.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/ThrowCaughtException.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2023 SAP SE. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + public class ThrowCaughtException { + public static void main(String args[]) throws Exception { + try { + System.out.println("Start"); + throw new Ex(); + } catch (Exception e) { + System.out.println(e); + } + } +} + +class Ex extends RuntimeException { +} diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/jdi/lib/jdb/Debuggee.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -69,6 +69,9 @@ private String transport = "dt_socket"; private String address = null; private boolean suspended = true; + private String onthrow = ""; + private boolean waitForPortPrint = true; + private String expectedOutputBeforeThrow = ""; private Launcher(String mainClass) { this.mainClass = mainClass; @@ -101,21 +104,31 @@ return this; } + // required to pass non null port with address and emit string before the throw + public Launcher enableOnThrow(String value, String expectedOutputBeforeThrow) { + this.onthrow = value; + this.waitForPortPrint = false; + this.expectedOutputBeforeThrow = expectedOutputBeforeThrow; + return this; + } + public ProcessBuilder prepare() { List debuggeeArgs = new LinkedList<>(); if (vmOptions != null) { debuggeeArgs.add(vmOptions); } + String onthrowArgs = onthrow.isEmpty() ? "" : ",onthrow=" + onthrow + ",launch=exit"; debuggeeArgs.add("-agentlib:jdwp=transport=" + transport + (address == null ? "" : ",address=" + address) - + ",server=y,suspend=" + (suspended ? "y" : "n")); + + ",server=y,suspend=" + (suspended ? "y" : "n") + + onthrowArgs); debuggeeArgs.addAll(options); debuggeeArgs.add(mainClass); return ProcessTools.createTestJvm(debuggeeArgs); } public Debuggee launch(String name) { - return new Debuggee(prepare(), name); + return new Debuggee(prepare(), name, waitForPortPrint, expectedOutputBeforeThrow); } public Debuggee launch() { return launch("debuggee"); @@ -123,10 +136,22 @@ } // starts the process, waits for "Listening for transport" output and detects transport/address - private Debuggee(ProcessBuilder pb, String name) { + private Debuggee(ProcessBuilder pb, String name, boolean waitForPortPrint, String expectedOutputBeforeThrow) { // debuggeeListen[0] - transport, debuggeeListen[1] - address String[] debuggeeListen = new String[2]; Pattern listenRegexp = Pattern.compile("Listening for transport \\b(.+)\\b at address: \\b(.+)\\b"); + if (!waitForPortPrint) { + try { + p = ProcessTools.startProcess(name, pb, s -> {output.add(s);}, s -> { + return s.equals(expectedOutputBeforeThrow); + }, 30, TimeUnit.SECONDS); + } catch (IOException | InterruptedException | TimeoutException ex) { + throw new RuntimeException("failed to launch debuggee", ex); + } + transport = null; + address = null; + return; + } try { p = ProcessTools.startProcess(name, pb, s -> output.add(s), // output consumer @@ -175,10 +200,16 @@ } String getTransport() { + if (transport == null) { + throw new IllegalStateException("transport is not available"); + } return transport; } public String getAddress() { + if (address == null) { + throw new IllegalStateException("address is not available"); + } return address; } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/LdapSSLHandshakeFailureTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,249 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.net.URIBuilder; + +import javax.naming.Context; +import javax.naming.ldap.InitialLdapContext; +import javax.naming.ldap.LdapContext; +import javax.net.SocketFactory; +import javax.net.ssl.SSLServerSocketFactory; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.SocketException; +import java.util.Hashtable; + +/* + * @test + * @bug 8314063 + * @library /test/lib + * @summary For LDAPs connection, if the value of com.sun.jndi.ldap.connect.timeout is + * set too small or not an optimal value for the system, after the socket is created and + * connected to the server, but the handshake between the client and server fails due to + * socket time out, the opened socket is not closed properly. In this test case, the server + * is forced to sleep ten seconds and connection time out for client is one second. This + * will allow the socket opened and connected, and give the chance for the handshake to be + * timed out. Before this fix, the socket is kept opened. Right now the exception will be + * caught and the socket will be closed. + * + * @run main/othervm LdapSSLHandshakeFailureTest LdapSSLHandshakeFailureTest$CustomSocketFactory true 6000 + * @run main/othervm LdapSSLHandshakeFailureTest -1000 true 6000 + * @run main/othervm LdapSSLHandshakeFailureTest -1000 false 6000 + * @run main/othervm LdapSSLHandshakeFailureTest 2000 false 6000 + * @run main/othervm LdapSSLHandshakeFailureTest 0 true 6000 + * @run main/othervm LdapSSLHandshakeFailureTest 0 false 6000 + * @run main/othervm LdapSSLHandshakeFailureTest true + * @run main/othervm LdapSSLHandshakeFailureTest false + */ + +public class LdapSSLHandshakeFailureTest { + private static String SOCKET_CLOSED_MSG = "The socket has been closed."; + + private static int serverSleepingTime = 5000; + + public static void main(String args[]) throws Exception { + + // Set the keystores + setKeyStore(); + boolean serverSlowDown = Boolean.valueOf(args[0]); + if (args.length == 2) { + serverSlowDown = Boolean.valueOf(args[1]); + } + + if (args.length == 3) { + serverSleepingTime = Integer.valueOf(args[2]); + } + + boolean hasCustomSocketFactory = args[0] + .equals("LdapSSLHandshakeFailureTest$CustomSocketFactory"); + // start the test server first. + try (TestServer server = new TestServer(serverSlowDown, serverSleepingTime)) { + server.start(); + Hashtable env = new Hashtable<>(); + env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + env.put("java.naming.ldap.version", "3"); + env.put(Context.PROVIDER_URL, URIBuilder.newBuilder() + .scheme("ldaps") + .loopback() + .port(server.getPortNumber()) + .buildUnchecked().toString()); + + if (hasCustomSocketFactory) { + env.put("java.naming.ldap.factory.socket", args[0]); + env.put("com.sun.jndi.ldap.connect.timeout", "1000"); + } + + if (args.length == 2 && !hasCustomSocketFactory) { + env.put("com.sun.jndi.ldap.connect.timeout", args[0]); + } + + env.put(Context.SECURITY_PROTOCOL, "ssl"); + env.put(Context.SECURITY_AUTHENTICATION, "Simple"); + env.put(Context.SECURITY_PRINCIPAL, "cn=principal"); + env.put(Context.SECURITY_CREDENTIALS, "123456"); + LdapContext ctx = null; + try { + ctx = new InitialLdapContext(env, null); + } catch (Exception e) { + if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0 + && hasCustomSocketFactory + && Boolean.valueOf(args[1])) { + System.out.println(SOCKET_CLOSED_MSG); + } else { + throw e; + } + } finally { + if (ctx != null) + ctx.close(); + } + } + } + + public static class CustomSocketFactory extends SocketFactory { + private static CustomSocket customSocket; + + public static CustomSocketFactory getDefault() { + return new CustomSocketFactory(); + } + + @Override + public Socket createSocket() throws SocketException { + customSocket = new CustomSocket(); + return customSocket; + } + + @Override + public Socket createSocket(String s, int timeout) { + return customSocket; + } + + @Override + public Socket createSocket(String host, int port, InetAddress localHost, + int localPort) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress host, int port) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress address, int port, + InetAddress localAddress, int localPort) { + return customSocket; + } + } + + private static class CustomSocket extends Socket { + private int closeMethodCalled = 0; + + public CustomSocket() { + closeMethodCalled = 0; + } + + public int closeMethodCalledCount() { + return closeMethodCalled; + } + + @Override + public void close() throws java.io.IOException { + closeMethodCalled++; + super.close(); + } + } + + private static void setKeyStore() { + + String fileName = "ksWithSAN", dir = System.getProperty("test.src", ".") + File.separator; + + System.setProperty("javax.net.ssl.keyStore", dir + fileName); + System.setProperty("javax.net.ssl.keyStorePassword", "welcome1"); + System.setProperty("javax.net.ssl.trustStore", dir + fileName); + System.setProperty("javax.net.ssl.trustStorePassword", "welcome1"); + } + + static class TestServer extends Thread implements AutoCloseable { + private boolean isForceToSleep; + private int sleepingTime; + private final ServerSocket serverSocket; + private final int PORT; + + private TestServer(boolean isForceToSleep, int sleepingTime) { + this.isForceToSleep = isForceToSleep; + this.sleepingTime = sleepingTime; + try { + SSLServerSocketFactory socketFactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + serverSocket = socketFactory.createServerSocket(0, 0, InetAddress.getLoopbackAddress()); + PORT = serverSocket.getLocalPort(); + } catch (IOException ex) { + throw new RuntimeException(ex); + } + setDaemon(true); + } + + public int getPortNumber() { + return PORT; + } + + @Override + public void run() { + try (Socket socket = serverSocket.accept(); + InputStream in = socket.getInputStream(); + OutputStream out = socket.getOutputStream()) { + if (isForceToSleep) { + Thread.sleep(sleepingTime); + } + byte[] bindResponse = {0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A, + 0x01, 0x00, 0x04, 0x00, 0x04, 0x00}; + // read the bindRequest + while (in.read() != -1) { + in.skip(in.available()); + break; + } + out.write(bindResponse); + out.flush(); + // ignore the further requests + while (in.read() != -1) { + in.skip(in.available()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void close() throws Exception { + if (serverSocket != null) { + serverSocket.close(); + } + } + } +} + + diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/SocketCloseTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,168 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.naming.Context; +import javax.naming.directory.DirContext; +import javax.naming.directory.InitialDirContext; +import javax.net.SocketFactory; +import java.net.InetAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Hashtable; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/* + * @test + * @bug 8313657 + * @summary make sure socket is closed when the error happens for OutputStream flushing + * The value of provider url can be random, not necessary to be the one in the code + * @library /test/lib + * @run main/othervm SocketCloseTest + */ + +public class SocketCloseTest { + public static String SOCKET_CLOSED_MSG = "The socket has been closed."; + public static String SOCKET_NOT_CLOSED_MSG = "The socket was not closed."; + public static String BAD_FLUSH = "Bad flush!"; + private static final byte[] BIND_RESPONSE = new byte[]{ + 48, 12, 2, 1, 1, 97, 7, 10, 1, 0, 4, 0, 4, 0 + }; + + public static void main(String[] args) throws Exception { + SocketCloseTest scTest = new SocketCloseTest(); + scTest.runCloseSocketScenario(); + } + + public void runCloseSocketScenario() throws Exception { + Hashtable props = new Hashtable<>(); + + props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + props.put(Context.PROVIDER_URL, "ldap://localhost:1389/o=example"); + props.put("java.naming.ldap.factory.socket", CustomSocketFactory.class.getName()); + try { + final DirContext ctx = new InitialDirContext(props); + } catch (Exception e) { + if (CustomSocketFactory.customSocket.closeMethodCalledCount() > 0) { + System.out.println(SOCKET_CLOSED_MSG); + } else { + System.out.println(SOCKET_NOT_CLOSED_MSG); + throw e; + } + } + } + + public static class CustomSocketFactory extends SocketFactory { + public static CustomSocket customSocket = new CustomSocket(); + + public static CustomSocketFactory getDefault() { + return new CustomSocketFactory(); + } + + @Override + public Socket createSocket() { + return customSocket; + } + + @Override + public Socket createSocket(String s, int timeout) { + return customSocket; + } + + @Override + public Socket createSocket(String host, int port, InetAddress localHost, + int localPort) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress host, int port) { + return customSocket; + } + + @Override + public Socket createSocket(InetAddress address, int port, + InetAddress localAddress, int localPort) { + return customSocket; + } + } + + private static class LdapInputStream extends InputStream { + private ByteArrayInputStream bos; + + public LdapInputStream() { + } + + @Override + public int read() throws IOException { + bos = new ByteArrayInputStream(BIND_RESPONSE); + return bos.read(); + } + } + + private static class LdapOutputStream extends OutputStream { + + @Override + public void write(int b) throws IOException { + System.out.println("output stream writing"); + } + + @Override + public void flush() throws IOException { + System.out.println(BAD_FLUSH); + throw new IOException(BAD_FLUSH); + } + } + + private static class CustomSocket extends Socket { + private int closeMethodCalled = 0; + private LdapOutputStream output = new LdapOutputStream(); + private LdapInputStream input = new LdapInputStream(); + + public void connect(SocketAddress address, int timeout) { + } + + public InputStream getInputStream() { + return input; + } + + public OutputStream getOutputStream() { + return output; + } + + public int closeMethodCalledCount() { + return closeMethodCalled; + } + + @Override + public void close() throws IOException { + closeMethodCalled++; + super.close(); + } + } +} Binary files /srv/release.debian.org/tmp/gcz0UWv7ZH/openjdk-17-17.0.9+9/test/jdk/com/sun/jndi/ldap/ksWithSAN and /srv/release.debian.org/tmp/dMyM48XNv5/openjdk-17-17.0.10+7/test/jdk/com/sun/jndi/ldap/ksWithSAN differ diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/DateFormatterTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/DateFormatterTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/DateFormatterTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/DateFormatterTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -87,7 +87,7 @@ @AfterTest public void cleanUp() { - server.stop(1); + server.stop(0); } @Test diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/HttpServerTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/HttpServerTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/HttpServerTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/HttpServerTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -60,7 +60,7 @@ sendHttpStatusCode(HTTP_STATUS_CODE_OK, ex); System.out.println("Stopping server ..."); - server.stop(1); + server.stop(0); serverStopped.countDown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/SelCacheTest.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/SelCacheTest.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/SelCacheTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/SelCacheTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -89,9 +89,8 @@ test(false, "https", root+"/test1", loopback, httpsport, "largefile.txt", 2730088); System.out.println("OK"); } finally { - delay(); - s1.stop(2); - s2.stop(2); + s1.stop(0); + s2.stop(0); executor.shutdown(); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -35,10 +35,4 @@ logger.setLevel(Level.ALL); logger.addHandler(h); } - - static void delay () { - try { - Thread.sleep (1000); - } catch (Exception e) {} - } } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test1.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test1.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test1.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test1.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -96,11 +96,10 @@ test (false, "https", root+"/test1", httpsport, "largefile.txt", 2730088); System.out.println ("OK"); } finally { - delay(); if (s1 != null) - s1.stop(2); + s1.stop(0); if (s2 != null) - s2.stop(2); + s2.stop(0); if (executor != null) executor.shutdown (); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test10.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test10.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test10.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test10.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 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 @@ -57,9 +57,8 @@ doClient(port); System.out.println ("OK"); } finally { - delay(); if (server != null) - server.stop(2); + server.stop(0); if (exec != null) exec.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test11.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test11.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test11.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test11.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -78,7 +78,7 @@ System.out.println ("OK"); } finally { s.shutdown(); - server.stop(2); + server.stop(0); } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test12.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test12.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test12.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test12.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -88,11 +88,10 @@ join (r); System.out.println ("OK"); } finally { - delay(); if (s1 != null) - s1.stop(2); + s1.stop(0); if (s2 != null) - s2.stop(2); + s2.stop(0); if (executor != null) executor.shutdown (); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test13.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test13.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test13.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test13.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -93,11 +93,10 @@ join (r); System.out.println ("OK"); } finally { - delay(); if (s1 != null) - s1.stop(2); + s1.stop(0); if (s2 != null) - s2.stop(2); + s2.stop(0); if (executor != null) executor.shutdown (); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test14.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test14.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test14.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test14.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -114,7 +114,7 @@ output = output + (char)x; } error = !output.equals (test_output); - server.stop(2); + server.stop(0); executor.shutdown(); if (error ) { throw new RuntimeException ("test failed error"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test2.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test2.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test2.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test2.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -79,7 +79,7 @@ while (is.read()!= -1) { c ++; } - server.stop(2); + server.stop(0); executor.shutdown(); if (error ) { throw new RuntimeException ("test failed error"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test3.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test3.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test3.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test3.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -64,9 +64,8 @@ doClient(port); System.out.println ("OK"); } finally { - delay(); if (server != null) - server.stop(2); + server.stop(0); if (exec != null) exec.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test4.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test4.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test4.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test4.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -62,9 +62,8 @@ doClient(port); System.out.println ("OK"); } finally { - delay(); if (server != null) - server.stop(2); + server.stop(0); if (exec != null) exec.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test5.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test5.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test5.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test5.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -63,9 +63,8 @@ doClient(port); System.out.println ("OK"); } finally { - delay (); if (server != null) - server.stop(2); + server.stop(0); if (exec != null) exec.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test6.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test6.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test6.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test6.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -81,8 +81,7 @@ if (error) { throw new RuntimeException ("test failed error"); } - delay(); - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test6a.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test6a.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test6a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test6a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -86,8 +86,7 @@ if (error) { throw new RuntimeException ("test failed error"); } - delay(); - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test7.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test7.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test7.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test7.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -80,8 +80,7 @@ if (error) { throw new RuntimeException ("test failed error"); } - delay(); - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test7a.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test7a.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test7a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test7a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -89,8 +89,7 @@ if (error) { throw new RuntimeException ("test failed error"); } - delay(); - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test8.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test8.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test8.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test8.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -80,8 +80,7 @@ if (error) { throw new RuntimeException ("test failed error"); } - delay(); - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test8a.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test8a.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test8a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test8a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -99,8 +99,7 @@ } is.close(); } finally { - delay(); - if (server != null) server.stop(2); + if (server != null) server.stop(0); if (executor != null) executor.shutdown(); } if (error) { diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test9.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test9.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test9.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test9.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -100,11 +100,10 @@ System.out.println ("OK"); } finally { - delay(); if (s1 != null) - s1.stop(2); + s1.stop(0); if (s2 != null) - s2.stop(2); + s2.stop(0); if (executor != null) executor.shutdown (); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test9a.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test9a.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/Test9a.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/Test9a.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -96,9 +96,8 @@ System.out.println ("OK"); } finally { - delay(); if (server != null) - server.stop(2); + server.stop(0); if (executor != null) executor.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/TestLogging.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/TestLogging.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/TestLogging.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/TestLogging.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -105,9 +105,8 @@ os.close(); is.close(); s.close(); System.out.println ("OK"); } finally { - delay(); if (s1 != null) - s1.stop(2); + s1.stop(0); if (executor != null) executor.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/8199849/BasicAuthenticatorCharset.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -181,7 +181,7 @@ connectAndAuth("/test3/defaultCharset.html", 200); } - testHttpServer.stop(2); + testHttpServer.stop(0); executor.shutdown(); // should fail once with UNICODE_PW and unsupporting character set diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/8199849/TestHttpUnicode.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -94,7 +94,7 @@ InputStream is = testConnection.getInputStream(); while (is.read() != -1) ; } finally { - testHttpServer.stop(2); + testHttpServer.stop(0); } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6339483.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6339483.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6339483.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6339483.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -66,7 +66,7 @@ c ++; } } catch (IOException e) { - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6341616.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6341616.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6341616.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6341616.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -75,7 +75,7 @@ c ++; } } catch (IOException e) { - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6361557.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6361557.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6361557.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6361557.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -126,7 +126,7 @@ break; } } - server.stop (1); + server.stop(0); selector.close(); executor.shutdown (); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6393710.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6393710.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6393710.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6393710.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -96,7 +96,7 @@ ok = false; } finally { s.close(); - server.stop(2); + server.stop(0); } if (requests != 1) { diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6401598.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6401598.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6401598.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6401598.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -130,7 +130,7 @@ } catch (Exception e) { throw new AssertionError("Unexpected exception: " + e, e); } finally { - server.stop (1); + server.stop(0); exec.shutdown(); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6431193.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6431193.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6431193.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6431193.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -85,7 +85,7 @@ .toURL(); InputStream is = url.openConnection(Proxy.NO_PROXY).getInputStream(); read (is); - server.stop (1); + server.stop(0); if (error) { throw new RuntimeException ("error in test"); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6433018.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6433018.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6433018.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6433018.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 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 @@ -77,7 +77,7 @@ os.write(cmd.getBytes()); finished.await(30, TimeUnit.SECONDS); } finally { - server.stop(2); + server.stop(0); } if (finished.getCount() != 0) diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6526158.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6526158.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6526158.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6526158.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -78,7 +78,7 @@ } is.close(); } finally { - server.stop(2); + server.stop(0); executor.shutdown(); } if (error) { diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6526913.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6526913.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6526913.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6526913.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -71,7 +71,7 @@ } is.close(); } finally { - server.stop(2); + server.stop(0); executor.shutdown(); } if (error) { diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6529200.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6529200.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6529200.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6529200.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 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 @@ -72,7 +72,7 @@ /* test will timeout otherwise */ } } catch (SocketTimeoutException e) { - server.stop (2); + server.stop(0); executor.shutdown (); throw new RuntimeException ("Test failed in test1"); } @@ -92,20 +92,20 @@ buf[i++] = (byte)c; } } catch (SocketTimeoutException e) { - server.stop (2); + server.stop(0); executor.shutdown (); throw new RuntimeException ("Test failed in test2"); } String ss = new String (buf, "ISO-8859-1"); if (ss.indexOf ("\r\n\r\nhello world") == -1) { - server.stop (2); + server.stop(0); executor.shutdown (); throw new RuntimeException ("Test failed in test2: wrong string"); } System.out.println (ss); is.close (); - server.stop (2); + server.stop(0); executor.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6744329.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6744329.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6744329.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6744329.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -72,7 +72,7 @@ e.printStackTrace(); error = true; } - server.stop(2); + server.stop(0); executor.shutdown(); if (error) { throw new RuntimeException ("Test failed"); diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6886436.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6886436.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B6886436.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B6886436.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -74,11 +74,11 @@ is.close (); } catch (IOException e) { - server.stop(2); + server.stop(0); executor.shutdown(); throw new RuntimeException ("Test failed"); } - server.stop(2); + server.stop(0); executor.shutdown(); System.out.println ("OK"); } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B8211420.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B8211420.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/B8211420.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/B8211420.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -86,7 +86,7 @@ throw new RuntimeException("Content-length not present or has wrong value"); System.out.println("OK"); } finally { - server.stop(2); + server.stop(0); executor.shutdown(); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java --- openjdk-17-17.0.9+9/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/com/sun/net/httpserver/bugs/HttpExchange/AutoCloseableHttpExchange.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -101,7 +101,7 @@ connectAndCheck("/test"); } latch.await(); - testHttpServer.stop(2); + testHttpServer.stop(0); executor.shutdown(); if (exchangeCloseFail.get()) diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022, 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 @@ -33,6 +33,10 @@ import java.awt.Robot; import java.awt.Toolkit; import java.awt.event.InputEvent; +import java.awt.image.BufferedImage; +import java.io.File; + +import javax.imageio.ImageIO; /** * @test @@ -44,6 +48,7 @@ private static final int SIZE = 350; private static int frameWidth; + private static Rectangle bounds; public static void main(final String[] args) throws Exception { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); @@ -52,7 +57,7 @@ Point right = null; for (GraphicsDevice sd : sds) { GraphicsConfiguration gc = sd.getDefaultConfiguration(); - Rectangle bounds = gc.getBounds(); + bounds = gc.getBounds(); if (left == null || left.x > bounds.x) { left = new Point(bounds.x, bounds.y + bounds.height / 2); } @@ -120,6 +125,8 @@ robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); robot.waitForIdle(); if (choice.getSelectedIndex() == 0) { + BufferedImage failImage = robot.createScreenCapture(bounds); + ImageIO.write(failImage, "png", new File("failImage.png")); throw new RuntimeException(); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/EmptyChoiceTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/EmptyChoiceTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/EmptyChoiceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/EmptyChoiceTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 4908468 + @summary Linux Empty Choice throws NPE + @key headful + @run main EmptyChoiceTest +*/ +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.lang.reflect.InvocationTargetException; + +public class EmptyChoiceTest +{ + Frame frame; + Choice choice = null; + + public static void main(String[] args) throws + InterruptedException, + InvocationTargetException { + EventQueue.invokeAndWait(() -> { + EmptyChoiceTest emptyChoiceTest = new EmptyChoiceTest(); + emptyChoiceTest.init(); + emptyChoiceTest.test(); + }); + } + + public void init() { + frame = new Frame(); + frame.setLayout(new BorderLayout()); + choice = new Choice(); + frame.add(choice, BorderLayout.NORTH); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + frame.validate(); + } + + public void test () { + try { + int iWidth = choice.getWidth(); + int iHeight = choice.getHeight(); + Image componentImage = + choice.createImage(iWidth, iHeight); + Graphics graphics = + componentImage.getGraphics(); + graphics.setClip(0, 0, iWidth, iHeight); + choice.printAll(graphics); + System.out.println("PrintAll successful!"); + } catch (NullPointerException exp) { + throw new RuntimeException("Test failed. " + + "Empty Choice printAll throws NullPointerException"); + } catch (Exception exc){ + throw new RuntimeException("Test failed.", exc); + } finally { + frame.dispose(); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/InsertRemoveTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/InsertRemoveTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/InsertRemoveTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/InsertRemoveTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 4115130 + @summary Tests Inserting/Removing items doesn't cause crash. + @key headful + @run main InsertRemoveTest + */ + +import java.awt.BorderLayout; +import java.awt.Choice; +import java.awt.EventQueue; +import java.awt.Frame; +import java.lang.reflect.InvocationTargetException; + +public class InsertRemoveTest { + Choice choice1; + Choice choice2; + Choice choice3; + Frame f; + int itemCount = 0; + int iterCount = 0; + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException { + EventQueue.invokeAndWait(() -> new InsertRemoveTest().start()); + } + + public void start() { + f = new Frame("Check Choice"); + f.setLayout(new BorderLayout()); + + choice1 = new Choice(); + choice2 = new Choice(); + choice3 = new Choice(); + + f.add(choice1, BorderLayout.NORTH); + f.add(choice3, BorderLayout.CENTER); + f.add(choice2, BorderLayout.SOUTH); + + f.pack(); + f.setLocationRelativeTo(null); + f.setVisible(true); + + try { + for (int i = 0; i < 50; i++) { + if (choice1 != null && itemCount < 40) { + choice1.insert("I am Choice, yes I am : " + iterCount, + 0); + choice2.add("I am the same, yes I am : " + iterCount); + choice3.insert("I am the same, yes I am : " + iterCount, + 10); + itemCount++; + iterCount++; + } + if (itemCount >= 20 && choice1 != null + && choice1.getItemCount() > 0) { + choice1.remove(0); + choice2.remove(10); + choice3.remove(19); + itemCount--; + } + f.validate(); + } + } finally { + f.dispose(); + } + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/OpenedChoiceHangs.java openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/OpenedChoiceHangs.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/OpenedChoiceHangs.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/OpenedChoiceHangs.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2005, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6246503 + @summary Disabling a choice after selection locks keyboard, \ + mouse and makes the system unusable + @key headful + @run main OpenedChoiceHangs +*/ + +import java.awt.AWTException; +import java.awt.Button; +import java.awt.Choice; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Robot; +import java.awt.event.FocusEvent; +import java.awt.event.InputEvent; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; +import java.lang.reflect.InvocationTargetException; + +public class OpenedChoiceHangs implements ItemListener { + static final Object FOCUS_LOCK = new Object(); + + Frame frame; + Choice ch = new Choice(); + Button b = new Button("A button"); + Robot robot; + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException { + OpenedChoiceHangs openedChoiceHangs = new OpenedChoiceHangs(); + EventQueue.invokeAndWait(openedChoiceHangs::init); + openedChoiceHangs.test(); + } + + public void init() { + frame = new Frame(); + + frame.setLayout(new FlowLayout()); + for (int i = 1; i < 10; i++) { + ch.add("item " + i); + } + frame.add(ch); + frame.add(b); + ch.setBackground(new Color(255, 0, 0)); + ch.setForeground(new Color(255, 0, 0)); + ch.addItemListener(this); + + frame.setSize(200, 200); + frame.setVisible(true); + frame.setLocationRelativeTo(null); + frame.validate(); + } + + public void test() { + try { + robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); + robot.delay(1000); + robot.mouseMove(ch.getLocationOnScreen().x + ch.getWidth() / 2, + ch.getLocationOnScreen().y + ch.getHeight() / 2); + + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.delay(1000); + if (!ch.isFocusOwner()) { + synchronized (FOCUS_LOCK) { + FOCUS_LOCK.wait(3000); + } + } + if (!ch.isFocusOwner()){ + throw new RuntimeException( + "Test failed. Choice has no focus after mouse press."); + } + robot.keyPress(KeyEvent.VK_DOWN); + robot.keyRelease(KeyEvent.VK_DOWN); + robot.delay(1000); + + robot.keyPress(KeyEvent.VK_UP); + robot.keyRelease(KeyEvent.VK_UP); + robot.delay(1000); + + Color color = robot.getPixelColor( + ch.getLocationOnScreen().x + ch.getWidth() / 2, + ch.getLocationOnScreen().y + ch.getHeight() * 4); + System.out.println("Color is " + color); + if (color.equals(new Color(255, 0,0))){ + throw new RuntimeException( + "Test failed. Choice is disabled and still opened. "); + } + } catch (AWTException e) { + throw new RuntimeException( + "Test interrupted due to AWTException. Robot=" + robot, e); + } catch (InterruptedException e) { + throw new RuntimeException("Test interrupted. Robot=" + robot, e); + } finally { + EventQueue.invokeLater(frame::dispose); + } + + System.out.println("Test passed: Choice became closed after disabling."); + } + + public void itemStateChanged (ItemEvent ie) { + System.out.println("Choice Item has changed: "+ie); + ch.setEnabled(false); + } + public void focusGained(FocusEvent fEvent){ + System.out.println("focusGained"+fEvent); + synchronized(FOCUS_LOCK){ + FOCUS_LOCK.notify(); + } + } + + public void focusLost(FocusEvent fEvent){ + System.out.println("focusLost"+fEvent); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Choice/PressOutsideOpenedChoice.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2005, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + @test + @bug 6259328 + @summary Choice scrolls when dragging the parent frame while drop-down \ + is active + @key headful + @run main PressOutsideOpenedChoice +*/ + + +import java.awt.Choice; +import java.awt.Color; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.lang.reflect.InvocationTargetException; + +public class PressOutsideOpenedChoice extends Frame { + Robot robot; + Choice choice1 = new Choice(); + Point pt; + + public static void main(String[] args) + throws InterruptedException, InvocationTargetException { + PressOutsideOpenedChoice pressOutsideOpenedChoice = + new PressOutsideOpenedChoice(); + EventQueue.invokeAndWait(pressOutsideOpenedChoice::init); + pressOutsideOpenedChoice.start(); + } + + public void init() { + for (int i = 1; i < 50; i++) { + choice1.add("item-" + i); + } + choice1.setForeground(Color.red); + choice1.setBackground(Color.red); + add(choice1); + setLayout(new FlowLayout()); + setSize (200,200); + setLocationRelativeTo(null); + setVisible(true); + validate(); + } + + public void start() { + try { + robot = new Robot(); + robot.setAutoWaitForIdle(true); + robot.setAutoDelay(50); + robot.delay(1000); + testPressOutsideOpenedChoice(InputEvent.BUTTON1_DOWN_MASK); + } catch (Throwable e) { + throw new RuntimeException("Test failed. Exception thrown: " + e); + } finally { + EventQueue.invokeLater(this::dispose); + } + } + + public void testPressOutsideOpenedChoice(int button) { + pt = choice1.getLocationOnScreen(); + robot.mouseMove(pt.x + choice1.getWidth() - choice1.getHeight() / 4, + pt.y + choice1.getHeight() / 2); + robot.delay(100); + robot.mousePress(button); + robot.mouseRelease(button); + robot.delay(200); + //move mouse outside of the choice + robot.mouseMove(pt.x - choice1.getWidth() / 2, + pt.y + choice1.getHeight() / 2); + robot.delay(400); + robot.mousePress(button); + robot.mouseRelease(button); + robot.delay(200); + Color color = robot.getPixelColor(pt.x + choice1.getWidth() / 2, + pt.y + 3 * choice1.getHeight()); + System.out.println("color got " + + robot.getPixelColor(pt.x + choice1.getWidth() / 2, + pt.y + 3 * choice1.getHeight())); + if (color.equals(Color.red)) { + throw new RuntimeException("Test failed. Choice didn't close " + + "after mouse press outside of Choice " + button); + } else { + System.out.println("Test passed. " + + "Choice closed with MousePress outside"); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2022, 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 @@ -25,6 +25,8 @@ import java.awt.Choice; import java.awt.FlowLayout; import java.awt.Frame; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; import java.awt.Point; import java.awt.Robot; import java.awt.Window; @@ -32,9 +34,14 @@ import java.awt.event.FocusEvent; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import javax.imageio.ImageIO; + /** * @test * @bug 4478780 @@ -49,12 +56,12 @@ Button def = new Button("default owner"); CountDownLatch go = new CountDownLatch(1); - public static void main(final String[] args) { + public static void main(final String[] args) throws IOException { AccessibleChoiceTest app = new AccessibleChoiceTest(); app.test(); } - private void test() { + private void test() throws IOException { try { init(); start(); @@ -77,7 +84,7 @@ win.add(choice); } - public void start () { + public void start () throws IOException { frame.setVisible(true); win.pack(); win.setLocation(100, 200); @@ -89,15 +96,16 @@ } catch (Exception ex) { throw new RuntimeException("Can't create robot"); } - robot.delay(2000); + robot.waitForIdle(); + robot.delay(1000); robot.setAutoDelay(150); robot.setAutoWaitForIdle(true); // Focus default button and wait till it gets focus Point loc = def.getLocationOnScreen(); robot.mouseMove(loc.x+2, loc.y+2); - robot.mousePress(InputEvent.BUTTON1_MASK); - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); try { go.await(1, TimeUnit.SECONDS); @@ -120,10 +128,13 @@ robot.keyPress(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_DOWN); + robot.delay(500); + String osName = System.getProperty("os.name").toLowerCase(); if (osName.startsWith("mac")) { robot.keyPress(KeyEvent.VK_DOWN); robot.keyRelease(KeyEvent.VK_DOWN); + robot.delay(500); robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); } @@ -132,6 +143,16 @@ // On success second item should be selected if (choice.getSelectedItem() != choice.getItem(1)) { + // Print out os name to check if mac conditional is relevant + System.err.println("Failed on os: " + osName); + + // Save image to better debug the status of test when failing + GraphicsConfiguration ge = GraphicsEnvironment + .getLocalGraphicsEnvironment().getDefaultScreenDevice() + .getDefaultConfiguration(); + BufferedImage failImage = robot.createScreenCapture(ge.getBounds()); + ImageIO.write(failImage, "png", new File("failImage.png")); + throw new RuntimeException("Choice can't be controlled by keyboard"); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/FontClass/FontScalerRoundTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/FontClass/FontScalerRoundTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/FontClass/FontScalerRoundTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/FontClass/FontScalerRoundTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8299255 + * @summary Verify no round error in Font scaling + */ + +import java.awt.Font; +import java.awt.Graphics2D; +import java.awt.font.FontRenderContext; +import java.awt.font.LineMetrics; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; + +public class FontScalerRoundTest { + public static void main(String[] args) { + final double SCALE = 4096.0; + final double STEP = 0.0001; + final double LIMIT = STEP * 100.0; + + BufferedImage img = new BufferedImage(100, 100, + BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = img.createGraphics(); + FontRenderContext frc = g2d.getFontRenderContext(); + + Font font = new Font(Font.DIALOG, Font.PLAIN, 1); + float h1 = getScaledHeight(font, frc, SCALE); + float h2 = getScaledHeight(font, frc, SCALE + STEP); + float diff = Math.abs(h1 - h2); + + if (diff > LIMIT) { + throw new RuntimeException("Font metrix had round error " + + h1 + "," + h2); + } + } + + private static float getScaledHeight(Font font, + FontRenderContext frc, + double scale) { + AffineTransform at = new AffineTransform(scale, 0.0, 0.0, scale, + 0.0, 0.0); + Font transFont = font.deriveFont(at); + LineMetrics m = transFont.getLineMetrics("0", frc); + return m.getHeight(); + } +} + diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Frame/AwtFramePackTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/Frame/AwtFramePackTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Frame/AwtFramePackTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Frame/AwtFramePackTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.AWTException; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.Panel; +import java.awt.Robot; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import javax.imageio.ImageIO; + +/* + * @test + * @bug 8265586 + * @key headful + * @summary Tests whether correct native frame insets are obtained + * for Resizable & Non-Resizable AWT Frame by checking the actual + * and expected/preferred frame sizes. + * @run main AwtFramePackTest + */ +public class AwtFramePackTest { + private static Frame frame; + private static Robot robot; + private static StringBuffer errorLog = new StringBuffer(); + + public static void main(String[] args) throws AWTException { + robot = new Robot(); + robot.setAutoDelay(300); + + // Resizable frame + createAWTFrame(true); + + robot.waitForIdle(); + robot.delay(500); + + // Non-Resizable frame + createAWTFrame(false); + + if (!errorLog.isEmpty()) { + throw new RuntimeException("Test failed due to the following" + + " one or more errors: \n" + errorLog); + } + } + + private static void createAWTFrame(boolean isResizable) { + try { + frame = new Frame(); + frame.setLayout(new BorderLayout()); + + Panel panel = new Panel(); + panel.add(new Button("Panel Button B1")); + panel.add(new Button("Panel Button B2")); + frame.add(panel, BorderLayout.CENTER); + + MenuBar mb = new MenuBar(); + Menu m = new Menu("Menu"); + mb.add(m); + frame.setMenuBar(mb); + + frame.setResizable(isResizable); + frame.pack(); + frame.setVisible(true); + + robot.waitForIdle(); + robot.delay(500); + + Dimension actualFrameSize = frame.getSize(); + Dimension expectedFrameSize = frame.getPreferredSize(); + + if (!actualFrameSize.equals(expectedFrameSize)) { + String frameType = isResizable ? "ResizableFrame" : "NonResizableFrame"; + System.out.println("Expected frame size: " + expectedFrameSize); + System.out.println("Actual frame size: " + actualFrameSize); + saveScreenCapture(frameType + ".png"); + errorLog.append(frameType + ": Expected and Actual frame size" + + " are different. frame.pack() does not work!! \n"); + } + } finally { + if (frame != null) { + frame.dispose(); + } + } + } + + // for debugging purpose, saves screen capture when test fails. + private static void saveScreenCapture(String filename) { + BufferedImage image = robot.createScreenCapture(frame.getBounds()); + try { + ImageIO.write(image,"png", new File(filename)); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Graphics2D/DrawPrimitivesTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/Graphics2D/DrawPrimitivesTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Graphics2D/DrawPrimitivesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Graphics2D/DrawPrimitivesTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, JetBrains s.r.o.. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @key headful + * @bug 8287600 8291266 8299207 + * @requires os.family == "mac" + * @summary [macosx] Some primitives do not render in metal pipeline + * @run main DrawPrimitivesTest + */ + +import java.awt.AWTException; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.RenderingHints; +import java.awt.Robot; +import java.lang.reflect.InvocationTargetException; +import java.util.concurrent.CountDownLatch; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +public abstract class DrawPrimitivesTest extends JFrame { + private final static int W = 800; + private final static int H = 800; + private final static Color[] color = { Color.RED, Color.BLUE, Color.GREEN}; + private final static int COLOR_TOLERANCE = 10; + private final CountDownLatch latchRender = new CountDownLatch(1); + private volatile int frameX0 = 0; + private volatile int frameY0 = 0; + private final String name; + + + private static boolean isAlmostEqual(Color c1, Color c2) { + return Math.abs(c1.getRed() - c2.getRed()) < COLOR_TOLERANCE && + Math.abs(c1.getGreen() - c2.getGreen()) < COLOR_TOLERANCE && + Math.abs(c1.getBlue() - c2.getBlue()) < COLOR_TOLERANCE; + + } + + public static void main(String[] args) throws InterruptedException, AWTException, InvocationTargetException { + new DrawPrimitivesTest("drawLine") { + public void renderPrimitive(Graphics2D g2d, int x0, int y0, int w, int h) { + g2d.drawLine(x0, y0, x0+w, y0+h); + } + }.runTest(); + + new DrawPrimitivesTest("fillRect") { + public void renderPrimitive(Graphics2D g2d, int x0, int y0, int w, int h) { + g2d.fillRect(x0, y0, w, h); + } + }.runTest(); + + new DrawPrimitivesTest("fillOvalAA") { + public void renderPrimitive(Graphics2D g2d, int x0, int y0, int w, int h) { + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.fillOval(x0, y0, w, h); + } + }.runTest(); + } + + public abstract void renderPrimitive(Graphics2D g2d, int x0, int y0, int w, int h); + + public DrawPrimitivesTest(String name) { + super(); + this.name = name; + } + + public void runTest() throws InterruptedException, InvocationTargetException, AWTException { + SwingUtilities.invokeLater(() -> { + add(new JPanel() { + @Override + public Dimension getPreferredSize() { + return new Dimension(W, H); + } + + @Override + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(Color.YELLOW); + int c = 0; + for (int i = 0; i < W; i += 10) { + for (int j = 0; j < H; j += 10) { + c = (c + 1) % color.length; + g2d.setColor(color[c]); + renderPrimitive(g2d, i, j, 10, 10); + } + } + Point p = getLocationOnScreen(); + frameX0 = p.x; + frameY0 = p.y - getInsets().top; + + latchRender.countDown(); + } + }); + setPreferredSize(new Dimension(W, H)); + pack(); + setVisible(true); + }); + + latchRender.await(); + Thread.sleep(1000); + + Robot robot = new Robot(); + + boolean hasEmptyContent = true; + l:for (int i = frameX0 + W/3; i < frameX0 + (2*W)/3; i++) { + for (int j = 0; j < 10; j += 2) { + if (isAlmostEqual(robot.getPixelColor(i, frameY0 + H / 2 + j), Color.RED)) { + hasEmptyContent = false; + break l; + } + } + } + + SwingUtilities.invokeAndWait(() -> { + setVisible(false); + dispose(); + }); + + if (hasEmptyContent) { + throw new RuntimeException(name + ": Empty content"); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/List/ListGarbageCollectionTest/AwtListGarbageCollectionTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -21,21 +21,28 @@ * questions. */ -/** +import java.awt.Frame; +import java.awt.List; +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; + +import jdk.test.lib.util.ForceGC; + +/* * @test * @key headful * @bug 8040076 * @summary AwtList not garbage collected - * @run main/othervm -Xmx100m AwtListGarbageCollectionTest + * @library /test/lib/ + * @build jdk.test.lib.util.ForceGC + * @run main/othervm -Xmx100m -Xlog:gc=debug AwtListGarbageCollectionTest */ +public class AwtListGarbageCollectionTest { -import java.awt.*; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.lang.ref.WeakReference; + private static final long ENQUEUE_TIMEOUT = 50; -public class AwtListGarbageCollectionTest { - public static void main(String[] args) { + public static void main(String[] args) throws InterruptedException { Frame frame = new Frame("List leak test"); try { test(frame); @@ -45,29 +52,32 @@ } private static void test(Frame frame) { - WeakReference weakListRef = null; - try { - frame.setSize(300, 200); - frame.setVisible(true); + frame.setSize(300, 200); + frame.setVisible(true); - List strongListRef = new List(); - frame.add(strongListRef); - strongListRef.setMultipleMode(true); - frame.remove(strongListRef); - weakListRef = new WeakReference(strongListRef); - strongListRef = null; - - //make out of memory to force gc - String veryLongString = new String(new char[100]); - while (true) { - veryLongString += veryLongString; - } - } catch (OutOfMemoryError e) { - if (weakListRef == null) { - throw new RuntimeException("Weak list ref wasn't created"); - } else if (weakListRef.get() != null) { - throw new RuntimeException("List wasn't garbage collected"); - } + List strongListRef = new List(); + frame.add(strongListRef); + strongListRef.setMultipleMode(true); + frame.remove(strongListRef); + + final ReferenceQueue referenceQueue = new ReferenceQueue<>(); + final PhantomReference phantomListRef = + new PhantomReference<>(strongListRef, referenceQueue); + System.out.println("phantomListRef: " + phantomListRef); + + strongListRef = null; // Clear the strong reference + + System.out.println("Waiting for the reference to be cleared"); + if (!ForceGC.wait(() -> phantomListRef == remove(referenceQueue))) { + throw new RuntimeException("List wasn't garbage collected"); + } + } + + private static Reference remove(ReferenceQueue queue) { + try { + return queue.remove(ENQUEUE_TIMEOUT); + } catch (InterruptedException e) { + throw new RuntimeException(e); } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/Mouse/EnterExitEvents/DragWindowTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -34,11 +34,23 @@ * @run main DragWindowTest */ -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Rectangle; +import java.awt.Robot; +import java.awt.Panel; +import java.awt.Point; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; -import java.util.concurrent.*; +import java.util.concurrent.Callable; import test.java.awt.regtesthelpers.Util; @@ -55,7 +67,7 @@ public static void main(String[] args) throws Exception { Robot robot = new Robot(); - robot.setAutoDelay(50); + robot.setAutoDelay(100); SwingUtilities.invokeAndWait(new Runnable() { @@ -65,6 +77,7 @@ } }); + robot.delay(250); robot.waitForIdle(); Point pointToClick = Util.invokeOnEDT(new Callable() { @@ -134,6 +147,7 @@ panel.add(button, BorderLayout.CENTER); frame.getContentPane().add(panel); + frame.setLocationRelativeTo(null); frame.setVisible(true); } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.html openjdk-17-17.0.10+7/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.html --- openjdk-17-17.0.9+9/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.html 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - - - - - SelectionVisible - - - -

SelectionVisible
Bugid: 4082144

- - - - diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.java openjdk-17-17.0.10+7/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/TextArea/SelectionVisible/SelectionVisible.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2022, 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 @@ -21,42 +21,62 @@ * questions. */ - -import java.applet.Applet; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Panel; +import java.awt.Frame; import java.awt.TextArea; +import java.lang.reflect.InvocationTargetException; + +import static java.awt.EventQueue.invokeAndWait; + +/* + @test + @key headful + @bug 4082144 7150100 + @summary Ensures that TextArea.select() works when called + before setVisible() + @run main SelectionVisible +*/ -public final class SelectionVisible extends Applet { +public class SelectionVisible { - private TextArea ta; + private static TextArea ta; + private static Frame frame; - @Override - public void init() { + public static void createTestUI() { + frame = new Frame("Test 4082144 7150100"); ta = new TextArea(4, 20); ta.setText("01234\n56789"); ta.select(3, 9); - final TextArea instruction = new TextArea("INSTRUCTIONS:\n" - + "The text 34567 should be selected in the TextArea.\n" - + "If this is what you observe, then the test passes.\n" - + "Otherwise, the test fails.", 40, 5, - TextArea.SCROLLBARS_NONE); - instruction.setEditable(false); - instruction.setPreferredSize(new Dimension(300, 70)); - final Panel panel = new Panel(); - panel.setLayout(new FlowLayout()); - panel.add(ta); - setLayout(new BorderLayout()); - add(instruction, BorderLayout.CENTER); - add(panel, BorderLayout.PAGE_END); - } + frame.add(ta); + frame.setLocationRelativeTo(null); + frame.pack(); + frame.setVisible(true); - @Override - public void start() { - setVisible(true); ta.requestFocus(); } + + public static void test() throws InterruptedException, + InvocationTargetException { + String selectedText = ta.getSelectedText(); + System.out.println("selectedText : " + selectedText); + invokeAndWait(SelectionVisible::disposeFrame); + if (!selectedText.equals("34\n567")) { + throw new RuntimeException("Expected '34\n567' to be " + + "selected text, but got " + selectedText); + } + System.out.println("Test passed"); + } + + public static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } + + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + invokeAndWait(SelectionVisible::createTestUI); + test(); + } + } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.html openjdk-17-17.0.10+7/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.html --- openjdk-17-17.0.9+9/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.html 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ - - - - - - SelectionVisible - - - -

SelectionVisible
Bugid: 4082144

- - - - diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.java openjdk-17-17.0.10+7/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/TextField/SelectionVisible/SelectionVisible.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2022, 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 @@ -21,43 +21,57 @@ * questions. */ - -import java.applet.Applet; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Panel; -import java.awt.TextArea; +import java.awt.Frame; import java.awt.TextField; +import java.lang.reflect.InvocationTargetException; + +import static java.awt.EventQueue.invokeAndWait; +/* + @test + @key headful + @bug 4082144 7150100 + @summary Ensures that TextField.select() works when called + before setVisible() + @run main SelectionVisible + */ -public final class SelectionVisible extends Applet { +public class SelectionVisible { - TextField tf; + private static Frame frame; + private static TextField tf; - @Override - public void init() { + public static void createTestUI() { + frame = new Frame("Test TextField.select()"); tf = new TextField(20); tf.setText("0123456789"); tf.select(0, 6); + frame.add(tf); + frame.setSize(200,200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + private static void test() throws InterruptedException, + InvocationTargetException { + String selectedText = tf.getSelectedText(); + System.out.println("Selected Text : " + selectedText); + invokeAndWait(SelectionVisible::disposeFrame); + if (!selectedText.equals("012345")) { + throw new RuntimeException("Expected 012345 to be selected but " + + "got " + selectedText); + } + System.out.println("Test passed"); + } - final TextArea ta = new TextArea("INSTRUCTIONS:\n" - + "The text 012345 should be selected in the TextField.\n" - + "If this is what you observe, then the test passes.\n" - + "Otherwise, the test fails.", 40, 5, - TextArea.SCROLLBARS_NONE); - ta.setEditable(false); - ta.setPreferredSize(new Dimension(300, 70)); - final Panel panel = new Panel(); - panel.setLayout(new FlowLayout()); - panel.add(tf); - setLayout(new BorderLayout()); - add(ta, BorderLayout.CENTER); - add(panel, BorderLayout.PAGE_END); + private static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } } - @Override - public void start() { - setVisible(true); - tf.requestFocus(); + public static void main(String[] args) throws InterruptedException, + InvocationTargetException { + invokeAndWait(SelectionVisible::createTestUI); + test(); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2022, 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 @@ -21,7 +21,7 @@ * questions. */ -import java.awt.*; +import java.awt.SystemTray; /* * @test @@ -30,12 +30,20 @@ * a proper instance is returned in supported platforms and a proper * exception is thrown in unsupported platforms * @author Dmitriy Ermashov (dmitriy.ermashov@oracle.com) + * @requires (os.family != "linux") * @run main/othervm -DSystemTraySupport=TRUE SystemTrayInstanceTest */ +/* + * @test + * @key headful + * @requires (os.family == "linux") + * @run main/othervm -DSystemTraySupport=MAYBE SystemTrayInstanceTest + */ + public class SystemTrayInstanceTest { - private static boolean supported = false; + private static boolean shouldSupport = false; public static void main(String[] args) throws Exception { String sysTraySupport = System.getProperty("SystemTraySupport"); @@ -43,30 +51,35 @@ throw new RuntimeException("SystemTray support status unknown!"); if ("TRUE".equals(sysTraySupport)) { - System.out.println("System tray is supported on the platform under test"); - supported = true; + System.out.println("System tray should be supported on this platform."); + shouldSupport = true; } new SystemTrayInstanceTest().doTest(); } - private void doTest() throws Exception { - boolean flag = SystemTray.isSupported(); - if (supported != flag) - throw new RuntimeException("FAIL: isSupported did not return the correct value"+ - (supported ? - "SystemTray is supported on the platform under test" : - "SystemTray is not supported on the platform under test") + - "SystemTray.isSupported() method returned " + flag); + private void doTest() { + boolean systemSupported = SystemTray.isSupported(); + if (shouldSupport && !systemSupported) { + throw new RuntimeException( + "FAIL: SystemTray is not supported on the platform under test, while it should." + ); + } - if (supported) { + if (shouldSupport || systemSupported) { SystemTray tray = SystemTray.getSystemTray(); + System.out.println("SystemTray instance received"); } else { + boolean exceptionThrown = false; try { SystemTray tray = SystemTray.getSystemTray(); } catch (UnsupportedOperationException uoe) { + exceptionThrown = true; System.out.println("UnsupportedOperationException thrown correctly"); } + if (!exceptionThrown) { + throw new RuntimeException("UnsupportedOperationException is not thrown"); + } } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -49,6 +49,7 @@ public class DisposeFrameOnDragTest { private static JTextArea textArea; + private static JFrame background; public static void main(String[] args) throws Throwable { @@ -72,14 +73,20 @@ Util.drag(testRobot, new Point((int) loc.x + 3, (int) loc.y + 3), new Point((int) loc.x + 40, (int) loc.y + 40), - InputEvent.BUTTON1_MASK); + InputEvent.BUTTON1_DOWN_MASK); Util.waitForIdle(testRobot); testRobot.delay(200); + background.dispose(); } private static void constructTestUI() { + background = new JFrame("Background"); + background.setBounds(100, 100, 100, 100); + background.setUndecorated(true); + background.setVisible(true); + final JFrame frame = new JFrame("Test frame"); textArea = new JTextArea("Drag Me!"); try { diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/event/StressTest/MouseAndKeyEventStressTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,556 @@ +/* + * Copyright (c) 2007, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Button; +import java.awt.Canvas; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.List; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/* + * @test + * @key headful + * @bug 8302525 + * @summary Test performs various mouse and key operations to check events are getting triggered properly. + * @run main MouseAndKeyEventStressTest + */ +public class MouseAndKeyEventStressTest { + + private volatile static int mouseButtonTypes[] = + { InputEvent.BUTTON1_DOWN_MASK, InputEvent.BUTTON2_DOWN_MASK, + InputEvent.BUTTON3_DOWN_MASK }; + private volatile static String mouseButtonNames[] = + { "BUTTON1", "BUTTON2", "BUTTON3" }; + + private static Frame frame; + private volatile static Canvas canvas; + private volatile static Button button; + private volatile static List list; + private volatile static Choice choice; + private volatile static Checkbox checkbox; + private volatile static Component[] components; + + private volatile static boolean keyPressed; + private volatile static boolean keyReleased; + private volatile static boolean mousePressed; + private volatile static boolean mouseReleased; + private volatile static boolean actionPerformed; + private volatile static boolean itemEventPerformed; + + private volatile static Robot robot; + private volatile static Point compAt; + private volatile static Dimension compSize; + + private static void initializeGUI() { + frame = new Frame("Test Frame"); + frame.setLayout(new FlowLayout()); + canvas = new Canvas(); + canvas.setSize(50, 50); + canvas.setBackground(Color.red); + button = new Button("Button"); + list = new List(); + list.add("One"); + list.add("Two"); + list.add("Three"); + choice = new Choice(); + for (int i = 0; i < 8; i++) { + choice.add("Choice " + i); + } + choice.select(3); + checkbox = new Checkbox("Checkbox"); + + components = new Component[] { canvas, button, list, choice, checkbox }; + + button.addActionListener((actionEvent) -> { + actionPerformed = true; + System.out.println("button Got an actionEvent: " + actionEvent); + }); + checkbox.addItemListener((itemEvent) -> { + itemEventPerformed = true; + System.out.println("checkbox Got a ItemEvent: " + itemEvent); + }); + list.addItemListener((itemEvent) -> { + itemEventPerformed = true; + System.out.println("List Got a ItemEvent: " + itemEvent); + }); + choice.addItemListener((itemEvent) -> { + itemEventPerformed = true; + System.out.println("Choice Got a ItemEvent: " + itemEvent); + }); + for (int i = 0; i < components.length; i++) { + components[i].addKeyListener(new KeyAdapter() { + + public void keyPressed(KeyEvent ke) { + System.out.println("Got a keyPressedSource: " + ke); + keyPressed = true; + } + + public void keyReleased(KeyEvent ke) { + System.out.println("Got a keyReleasedSource: " + ke); + keyReleased = true; + } + }); + components[i].addMouseListener(new MouseAdapter() { + + public void mousePressed(MouseEvent me) { + mousePressed = true; + System.out.println("Got a mousePressSource: " + me); + } + + public void mouseReleased(MouseEvent me) { + mouseReleased = true; + System.out.println("Got a mouseReleaseSource: " + me); + } + + }); + frame.add(components[i]); + } + + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + EventQueue.invokeAndWait(MouseAndKeyEventStressTest::initializeGUI); + doTest(); + } finally { + EventQueue.invokeAndWait(MouseAndKeyEventStressTest::disposeFrame); + } + } + + private static void doTest() throws Exception { + robot = new Robot(); + robot.setAutoDelay(100); + robot.waitForIdle(); + + canvasMouseKeyTest(); + buttonMouseKeyTest(); + listMouseKeyTest(); + choiceMouseKeyTest(); + checkboxMouseKeyTest(); + + System.out.println("Test passed!"); + } + + private static void canvasMouseKeyTest() throws Exception { + Component component = canvas; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void buttonMouseKeyTest() throws Exception { + Component component = button; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + + if (!actionPerformed) { + throw new RuntimeException( + "FAIL: action event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void listMouseKeyTest() throws Exception { + Component component = list; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + + if (!itemEventPerformed) { + throw new RuntimeException("FAIL: Item event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void choiceMouseKeyTest() throws Exception { + Component component = choice; + robot.waitForIdle(); + + for (int i = 0; i < mouseButtonTypes.length; i++) { + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + if (component instanceof Choice) { + keyType(KeyEvent.VK_ESCAPE); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + boolean isMac = + System.getProperty("os.name").toLowerCase().contains("os x"); + if (isMac) { + // Choice's pop-up menu is drawn in front of choice. So + // choice can not get mouse events generated by robot, + // that's why test is made to dispath event. + MouseEvent me = + new MouseEvent(choice, MouseEvent.MOUSE_RELEASED, + System.currentTimeMillis(), mouseButtonTypes[i], + compSize.width, compSize.height, 1, false); + choice.dispatchEvent(me); + } else { + robot.mouseRelease(mouseButtonTypes[i]); + } + robot.waitForIdle(); + + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height + 30); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + + if (!itemEventPerformed) { + throw new RuntimeException("FAIL: Item event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void checkboxMouseKeyTest() throws Exception { + Component component = checkbox; + robot.waitForIdle(); + for (int i = 0; i < mouseButtonTypes.length; i++) { + + resetValues(); + EventQueue.invokeAndWait(() -> { + compAt = component.getLocationOnScreen(); + compSize = component.getSize(); + }); + + robot.mouseMove(compAt.x + compSize.width / 2, + compAt.y + compSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: Moving focus. mousePressed event did not occur for " + + component.getClass()); + } + + resetValues(); + robot.keyPress(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyPressed) { + throw new RuntimeException( + "FAIL: keyPressed event " + "did not occur for " + + component.getClass() + " for key A"); + } + + resetValues(); + robot.mousePress(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mousePressed) { + throw new RuntimeException( + "FAIL: mousePressed event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.mouseRelease(mouseButtonTypes[i]); + robot.waitForIdle(); + if (!mouseReleased) { + throw new RuntimeException( + "FAIL: mouseReleased event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + if (!itemEventPerformed) { + throw new RuntimeException("FAIL: Item event did not occur for " + + component.getClass() + " for " + mouseButtonNames[i]); + } + + resetValues(); + robot.keyRelease(KeyEvent.VK_A); + robot.waitForIdle(); + if (!keyReleased) { + throw new RuntimeException("FAIL: keyReleased event " + + "did not occur for " + component.getClass()); + } + + keyType(KeyEvent.VK_ESCAPE); + robot.waitForIdle(); + } + System.out.println("Test passed:" + component); + } + + private static void resetValues() { + keyPressed = false; + keyReleased = false; + mousePressed = false; + mouseReleased = false; + } + + private static void keyType(int key) throws Exception { + robot.keyPress(key); + robot.keyRelease(key); + } + + public static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/font/FontScaling/StretchedFontTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,6 +26,7 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.font.FontRenderContext; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.File; @@ -61,15 +62,19 @@ new Color(0x7F000000, true) }; + /** Locale for getting font names. */ + private static final Locale ENGLISH_LOCALE = Locale.ENGLISH; + private static final AffineTransform STRETCH_TRANSFORM = AffineTransform.getScaleInstance(2.0, 1.0); public static void main(String[] args) { List errors = Arrays.stream(getLocalGraphicsEnvironment() - .getAvailableFontFamilyNames(Locale.ENGLISH)) + .getAvailableFontFamilyNames(ENGLISH_LOCALE)) .map(family -> new Font(family, Font.PLAIN, FONT_SIZE)) .filter(font -> font.canDisplay(TEXT.codePointAt(0))) + .filter(font -> !isBrokenFont(font)) .map(font -> font.deriveFont(STRETCH_TRANSFORM)) .flatMap(StretchedFontTest::testFont) .filter(Objects::nonNull) @@ -83,6 +88,26 @@ } /** + * Checks whether the font renders the glyph in {@code TEXT} and + * returns {@code true} if the glyph isn't rendered. + * + * @param font the font to test + * @return {@code true} if the visual bounds of {@code TEXT} are empty, and + * {@code false} otherwise + */ + private static boolean isBrokenFont(final Font font) { + final boolean empty = + font.createGlyphVector(new FontRenderContext(null, false, false), + TEXT) + .getVisualBounds() + .isEmpty(); + if (empty) { + System.err.println("Broken font: " + font.getFontName(ENGLISH_LOCALE)); + } + return empty; + } + + /** * Tests the font with a set of text antialiasing hints. * * @param font the font to test @@ -145,7 +170,7 @@ if (verifyImage(image)) { return null; } - String fontName = font.getFontName(Locale.ENGLISH); + String fontName = font.getFontName(ENGLISH_LOCALE); String hintValue = getHintString(hint); String hexColor = String.format("0x%08x", foreground.getRGB()); saveImage(image, fontName + "-" + hintValue + "-" + hexColor); diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java openjdk-17-17.0.10+7/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/print/PrinterJob/ImagePrinting/PrintARGBImage.java 2024-01-09 21:18:15.000000000 +0000 @@ -54,6 +54,7 @@ """; PassFailJFrame passFailJFrame = new PassFailJFrame(instruction, 10); + PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL); try { PrinterJob pj = PrinterJob.getPrinterJob(); pj.setPrintable(new PrintARGBImage()); diff -Nru openjdk-17-17.0.9+9/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java openjdk-17-17.0.10+7/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java --- openjdk-17-17.0.9+9/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/awt/print/PrinterJob/PageRangesDlgTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -81,6 +81,7 @@ """; PassFailJFrame passFailJFrame = new PassFailJFrame(instruction, 10); + PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.HORIZONTAL); showPrintDialogs(); passFailJFrame.awaitAndCheck(); } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/io/File/GetXSpace.java openjdk-17-17.0.10+7/test/jdk/java/io/File/GetXSpace.java --- openjdk-17-17.0.9+9/test/jdk/java/io/File/GetXSpace.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/io/File/GetXSpace.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -29,7 +29,7 @@ * @summary Basic functionality of File.get-X-Space methods. * @library .. /test/lib * @build jdk.test.lib.Platform - * @run main/othervm -Djava.security.manager=allow GetXSpace + * @run main/othervm/native -Djava.security.manager=allow GetXSpace */ import java.io.BufferedReader; @@ -52,13 +52,13 @@ @SuppressWarnings("removal") public class GetXSpace { + static { + System.loadLibrary("GetXSpace"); + } private static SecurityManager [] sma = { null, new Allow(), new DenyFSA(), new DenyRead() }; - // FileSystem Total Used Available Use% MountedOn - private static final Pattern DF_PATTERN = Pattern.compile("([^\\s]+)\\s+(\\d+)\\s+\\d+\\s+(\\d+)\\s+\\d+%\\s+([^\\s].*)\n"); - private static int fail = 0; private static int pass = 0; private static Throwable first; @@ -100,39 +100,46 @@ } private static class Space { - private static final long KSIZE = 1024; private final String name; + private final long size; private final long total; private final long free; + private final long available; - Space(String total, String free, String name) { - try { - this.total = Long.parseLong(total) * KSIZE; - this.free = Long.parseLong(free) * KSIZE; - } catch (NumberFormatException x) { - throw new RuntimeException("the regex should have caught this", x); - } + Space(String name) { this.name = name; + long[] sizes = new long[4]; + if (getSpace0(name, sizes)) + System.err.println("WARNING: total space is estimated"); + this.size = sizes[0]; + this.total = sizes[1]; + this.free = sizes[2]; + this.available = sizes[3]; } String name() { return name; } + long size() { return size; } long total() { return total; } + long available() { return available; } long free() { return free; } + boolean woomFree(long freeSpace) { - return ((freeSpace >= (free / 10)) && (freeSpace <= (free * 10))); + return ((freeSpace >= (available / 10)) && + (freeSpace <= (available * 10))); } + public String toString() { - return String.format("%s (%d/%d)", name, free, total); + return String.format("%s (%d/%d/%d)", name, total, free, available); } } - private static ArrayList space(String f) throws IOException { + private static void diskFree() throws IOException { ArrayList al = new ArrayList<>(); - String cmd = "df -k -P" + (f == null ? "" : " " + f); + String cmd = "fsutil volume diskFree C:\\"; StringBuilder sb = new StringBuilder(); Process p = Runtime.getRuntime().exec(cmd); - try (BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()))) { + try (BufferedReader in = p.inputReader()) { String s; int i = 0; while ((s = in.readLine()) != null) { @@ -142,33 +149,18 @@ } } out.println(sb); + } - Matcher m = DF_PATTERN.matcher(sb); - int j = 0; - while (j < sb.length()) { - if (m.find(j)) { - // swap can change while this test is running - if (!m.group(1).equals("swap")) { - String name = f; - if (name == null) { - // cygwin's df lists windows path as FileSystem (1st group) - name = Platform.isWindows() ? m.group(1) : m.group(4); - } - al.add(new Space(m.group(2), m.group(3), name));; - } - j = m.end(); - } else { - throw new RuntimeException("unrecognized df output format: " - + "charAt(" + j + ") = '" - + sb.charAt(j) + "'"); - } - } + private static ArrayList paths() throws IOException { + ArrayList al = new ArrayList<>(); - if (al.size() == 0) { - // df did not produce output - String name = (f == null ? "" : f); - al.add(new Space("0", "0", name)); + File[] roots = File.listRoots(); + long[] space = new long[4]; + for (File root : roots) { + String path = root.toString(); + al.add(path); } + return al; } @@ -208,14 +200,15 @@ long fs = f.getFreeSpace(); long us = f.getUsableSpace(); - out.format("%s:%n", s.name()); - String fmt = " %-4s total= %12d free = %12d usable = %12d%n"; - out.format(fmt, "df", s.total(), 0, s.free()); - out.format(fmt, "getX", ts, fs, us); + out.format("%s (%d):%n", s.name(), s.size()); + String fmt = " %-4s total = %12d free = %12d usable = %12d%n"; + out.format(fmt, "getSpace0", s.total(), s.free(), s.available()); + out.format(fmt, "getXSpace", ts, fs, us); // If the file system can dynamically change size, this check will fail. // This can happen on macOS for the /dev files system. - if (ts != s.total() && (!Platform.isOSX() || !s.name().equals("/dev"))) { + if (ts != s.total() + && (!Platform.isOSX() || !s.name().equals("/dev"))) { long blockSize = 1; long numBlocks = 0; try { @@ -232,34 +225,76 @@ throw new RuntimeException(e); } - // On macOS, the number of 1024 byte blocks might be incorrectly - // calculated by 'df' using integer division by 2 of the number of - // 512 byte blocks, resulting in a size smaller than the actual - // value when the number of blocks is odd. - if (!Platform.isOSX() || blockSize != 512 || numBlocks % 2 == 0 - || ts - s.total() != 512) { - fail(s.name(), s.total(), "!=", ts); + if (Platform.isWindows()) { + if (ts > s.total()) { + fail(s.name() + " total space", ts, ">", s.total()); + } + } else if (ts != s.total()) { + fail(s.name() + " total space", ts, "!=", s.total()); } } else { pass(); } - // unix df returns statvfs.f_bavail + // unix usable space is from statvfs.f_bavail long tsp = (!Platform.isWindows() ? us : fs); if (!s.woomFree(tsp)) { - fail(s.name(), s.free(), "??", tsp); + fail(s.name(), s.available(), "??", tsp); } else { pass(); } - if (fs > s.total()) { - fail(s.name(), s.total(), ">", fs); + // + // Invariants are: + // total space <= size + // total space == size (Unix) + // free space <= total space (if no quotas in effect) (Windows) + // free space < size (if quotas in effect) (Windows) + // usable space <= total space + // usable space <= free space + // + + // total space <= size + if (ts > s.size()) { + fail(s.name() + " size", ts, ">", s.size()); } else { pass(); } + // On Unix the total space should always be the volume size + if (Platform.isWindows()) { + // ts != s.size() indicates that quotas are in effect + if (ts == s.size() && fs > s.total()) { + fail(s.name() + " free space", fs, ">", s.total()); + } else if (ts < s.size() && fs > s.size()) { + fail(s.name() + " free space (quota)", fs, ">", s.size()); + } else { + pass(); + } + } else { // not Windows + if (ts != s.size()) { + fail(s.name() + " total space", ts, "!=", s.size()); + } else { + pass(); + } + } + + // usable space <= total space if (us > s.total()) { - fail(s.name(), s.total(), ">", us); + fail(s.name() + " usable space", us, ">", s.total()); + } else { + pass(); + } + + // usable space <= free space + if (us > s.free()) { + // free and usable change dynamically + System.err.println("Warning: us > s.free()"); + if (1.0 - Math.abs((double)s.free()/(double)us) > 0.01) { + fail(s.name() + " usable vs. free space", us, ">", s.free()); + } else { + pass(); + } } else { pass(); } @@ -316,14 +351,14 @@ public void checkPermission(Permission p) { if (p.implies(new RuntimePermission("setSecurityManager")) || p.implies(new RuntimePermission("getProtectionDomain"))) - return; + return; super.checkPermission(p); } public void checkPermission(Permission p, Object context) { if (p.implies(new RuntimePermission("setSecurityManager")) || p.implies(new RuntimePermission("getProtectionDomain"))) - return; + return; super.checkPermission(p, context); } } @@ -355,17 +390,11 @@ private static int testFile(Path dir) { String dirName = dir.toString(); out.format("--- Testing %s%n", dirName); - ArrayList l; - try { - l = space(dirName); - } catch (IOException x) { - throw new RuntimeException(dirName + " can't get file system information", x); - } - compare(l.get(0)); + compare(new Space(dir.getRoot().toString())); if (fail != 0) { err.format("%d tests: %d failure(s); first: %s%n", - fail + pass, fail, first); + fail + pass, fail, first); } else { out.format("all %d tests passed%n", fail + pass); } @@ -373,13 +402,16 @@ return fail != 0 ? 1 : 0; } - private static int testDF() { - out.println("--- Testing df"); - // Find all of the partitions on the machine and verify that the size - // returned by "df" is equivalent to File.getXSpace() values. - ArrayList l; + private static int testVolumes() { + out.println("--- Testing volumes"); + // Find all of the partitions on the machine and verify that the sizes + // returned by File::getXSpace are equivalent to those from getSpace0 + ArrayList l; try { - l = space(null); + l = paths(); + if (Platform.isWindows()) { + diskFree(); + } } catch (IOException x) { throw new RuntimeException("can't get file system information", x); } @@ -395,7 +427,8 @@ out.format("%nSecurityManager = %s%n" , (sm == null ? "null" : sm.getClass().getName())); - for (var s : l) { + for (var p : l) { + Space s = new Space(p); if (sm instanceof Deny) { tryCatch(s); } else { @@ -410,7 +443,7 @@ if (fail != 0) { err.format("%d tests: %d failure(s); first: %s%n", - fail + pass, fail, first); + fail + pass, fail, first); } else { out.format("all %d tests passed%n", fail + pass); } @@ -433,7 +466,7 @@ } public static void main(String[] args) throws Exception { - int failedTests = testDF(); + int failedTests = testVolumes(); reset(); Path tmpDir = Files.createTempDirectory(null); @@ -452,4 +485,13 @@ throw new RuntimeException(failedTests + " test(s) failed"); } } + + // + // root the root of the volume + // size[0] total size: number of bytes in the volume + // size[1] total space: number of bytes visible to the caller + // size[2] free space: number of free bytes in the volume + // size[3] usable space: number of bytes available to the caller + // + private static native boolean getSpace0(String root, long[] space); } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/io/File/libGetXSpace.c openjdk-17-17.0.10+7/test/jdk/java/io/File/libGetXSpace.c --- openjdk-17-17.0.9+9/test/jdk/java/io/File/libGetXSpace.c 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/io/File/libGetXSpace.c 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,164 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +#include +#include "jni.h" +#include "jni_util.h" +#ifdef WINDOWS +#include +#include +#include +#else +#include +#include +#if __APPLE__ +#include +#include +#else +#include +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef WINDOWS +jboolean initialized = JNI_FALSE; +BOOL(WINAPI * pfnGetDiskSpaceInformation)(LPCWSTR, LPVOID) = NULL; +#endif + +// +// root the root of the volume +// sizes[0] total size: number of bytes in the volume +// sizes[1] total space: number of bytes visible to the caller +// sizes[2] free space: number of free bytes in the volume +// sizes[3] usable space: number of bytes available to the caller +// +JNIEXPORT jboolean JNICALL +Java_GetXSpace_getSpace0 + (JNIEnv *env, jclass cls, jstring root, jlongArray sizes) +{ + jboolean totalSpaceIsEstimated = JNI_FALSE; + jlong array[4]; + const jchar* strchars = (*env)->GetStringChars(env, root, NULL); + if (strchars == NULL) { + JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException", + "GetStringChars"); + return JNI_FALSE; + } + +#ifdef WINDOWS + if (initialized == JNI_FALSE) { + initialized = JNI_TRUE; + HMODULE hmod = GetModuleHandleW(L"kernel32"); + if (hmod != NULL) { + *(FARPROC*)&pfnGetDiskSpaceInformation = + GetProcAddress(hmod, "GetDiskSpaceInformationW"); + } + } + + LPCWSTR path = (LPCWSTR)strchars; + + if (pfnGetDiskSpaceInformation != NULL) { + // use GetDiskSpaceInformationW + DISK_SPACE_INFORMATION diskSpaceInfo; + BOOL hres = pfnGetDiskSpaceInformation(path, &diskSpaceInfo); + (*env)->ReleaseStringChars(env, root, strchars); + if (FAILED(hres)) { + JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException", + "GetDiskSpaceInformationW"); + return totalSpaceIsEstimated; + } + + ULONGLONG bytesPerAllocationUnit = + diskSpaceInfo.SectorsPerAllocationUnit*diskSpaceInfo.BytesPerSector; + array[0] = (jlong)(diskSpaceInfo.ActualTotalAllocationUnits* + bytesPerAllocationUnit); + array[1] = (jlong)(diskSpaceInfo.CallerTotalAllocationUnits* + bytesPerAllocationUnit); + array[2] = (jlong)(diskSpaceInfo.ActualAvailableAllocationUnits* + bytesPerAllocationUnit); + array[3] = (jlong)(diskSpaceInfo.CallerAvailableAllocationUnits* + bytesPerAllocationUnit); + } else { + totalSpaceIsEstimated = JNI_TRUE; + + // if GetDiskSpaceInformationW is unavailable ("The specified + // procedure could not be found"), fall back to GetDiskFreeSpaceExW + ULARGE_INTEGER freeBytesAvailable; + ULARGE_INTEGER totalNumberOfBytes; + ULARGE_INTEGER totalNumberOfFreeBytes; + + BOOL hres = GetDiskFreeSpaceExW(path, &freeBytesAvailable, + &totalNumberOfBytes, &totalNumberOfFreeBytes); + (*env)->ReleaseStringChars(env, root, strchars); + if (FAILED(hres)) { + JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException", + "GetDiskFreeSpaceExW"); + return totalSpaceIsEstimated; + } + + // If quotas are in effect, it is impossible to obtain the volume size, + // so estimate it as free + used = free + (visible - available) + ULONGLONG used = totalNumberOfBytes.QuadPart - freeBytesAvailable.QuadPart; + array[0] = (jlong)(totalNumberOfFreeBytes.QuadPart + used); + array[1] = (jlong)totalNumberOfBytes.QuadPart; + array[2] = (jlong)totalNumberOfFreeBytes.QuadPart; + array[3] = (jlong)freeBytesAvailable.QuadPart; + } +#else + int len = (int)(*env)->GetStringLength(env, root); + char* chars = (char*)malloc((len + 1)*sizeof(char)); + if (chars == NULL) { + (*env)->ReleaseStringChars(env, root, strchars); + JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException", + "malloc"); + return JNI_FALSE; + } + + for (int i = 0; i < len; i++) { + chars[i] = (char)strchars[i]; + } + chars[len] = '\0'; + (*env)->ReleaseStringChars(env, root, strchars); + + struct statfs buf; + int result = statfs((const char*)chars, &buf); + free(chars); + if (result < 0) { + JNU_ThrowByNameWithLastError(env, "java/lang/RuntimeException", + strerror(errno)); + return totalSpaceIsEstimated; + } + + array[0] = (jlong)(buf.f_blocks*buf.f_bsize); + array[1] = array[0]; // number visible is the same as the total size + array[2] = (jlong)(buf.f_bfree*buf.f_bsize); + array[3] = (jlong)(buf.f_bavail*buf.f_bsize); +#endif + (*env)->SetLongArrayRegion(env, sizes, 0, 4, array); + return totalSpaceIsEstimated; +} +#ifdef __cplusplus +} +#endif diff -Nru openjdk-17-17.0.9+9/test/jdk/java/io/ObjectStreamClass/TestOSCClassLoaderLeak.java openjdk-17-17.0.10+7/test/jdk/java/io/ObjectStreamClass/TestOSCClassLoaderLeak.java --- openjdk-17-17.0.9+9/test/jdk/java/io/ObjectStreamClass/TestOSCClassLoaderLeak.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/io/ObjectStreamClass/TestOSCClassLoaderLeak.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2022, 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 @@ -30,8 +30,8 @@ import java.io.Serializable; import java.util.Arrays; import org.testng.annotations.Test; -import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; +import static org.testng.Assert.assertFalse; import jdk.test.lib.util.ForceGC; @@ -54,15 +54,14 @@ objectStreamClass_MemoryLeakExample.toString(); WeakReference myOwnClassLoaderWeakReference = new WeakReference<>(myOwnClassLoader); - assertNotNull(myOwnClassLoaderWeakReference.get()); + assertFalse(myOwnClassLoaderWeakReference.refersTo(null)); objectStreamClass_MemoryLeakExample = null; myOwnClassLoader = null; loadClass = null; con = null; - assertNotNull(myOwnClassLoaderWeakReference.get()); + assertFalse(myOwnClassLoaderWeakReference.refersTo(null)); - ForceGC gc = new ForceGC(); - assertTrue(gc.await(() -> myOwnClassLoaderWeakReference.get() == null)); + assertTrue(ForceGC.wait(() -> myOwnClassLoaderWeakReference.refersTo(null))); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/ClassLoader/nativeLibrary/NativeLibraryTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2022, 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 @@ -66,9 +66,8 @@ // Unload the class loader and native library, and give the Cleaner // thread a chance to unload the native library. // unloadedCount is incremented when the native library is unloaded. - ForceGC gc = new ForceGC(); final int finalCount = count; - if (!gc.await(() -> finalCount == unloadedCount)) { + if (!ForceGC.wait(() -> finalCount == unloadedCount)) { throw new RuntimeException("Expected unloaded=" + count + " but got=" + unloadedCount); } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/ProcessHandle/InfoTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/ProcessHandle/InfoTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/ProcessHandle/InfoTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/ProcessHandle/InfoTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -39,12 +39,13 @@ import java.util.Random; import java.util.concurrent.TimeUnit; -import jdk.test.lib.Platform; -import jdk.test.lib.Utils; import org.testng.Assert; import org.testng.TestNG; import org.testng.annotations.Test; +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; + /* * @test * @bug 8077350 8081566 8081567 8098852 8136597 @@ -81,7 +82,6 @@ } // Main can be used to run the tests from the command line with only testng.jar. - @SuppressWarnings("raw_types") public static void main(String[] args) { Class[] testclass = {InfoTest.class}; TestNG testng = new TestNG(); @@ -160,11 +160,7 @@ ProcessHandle.Info info = p1.info(); System.out.printf(" info: %s%n", info); - if (info.user().isPresent()) { - String user = info.user().get(); - Assert.assertNotNull(user, "User name"); - Assert.assertEquals(user, whoami, "User name"); - } + assertUser(info); Optional command = info.command(); if (command.isPresent()) { @@ -291,11 +287,8 @@ ProcessHandle.Info info = p.info(); System.out.printf(" info: %s%n", info); - if (info.user().isPresent()) { - String user = info.user().get(); - Assert.assertNotNull(user); - Assert.assertEquals(user, whoami); - } + assertUser(info); + if (info.command().isPresent()) { String command = info.command().get(); String expected = "sleep"; @@ -397,7 +390,7 @@ Instant end = Instant.now().plusMillis(500L); while (end.isBefore(Instant.now())) { // burn the cpu time checking the time - long x = r.nextLong(); + r.nextLong(); } if (self.info().totalCpuDuration().isPresent()) { Duration totalCpu = self.info().totalCpuDuration().get(); @@ -410,6 +403,7 @@ } } } + /** * Check two Durations, the second should be greater than the first or * within the supplied Epsilon. @@ -443,4 +437,31 @@ pb.command(list); return pb.start(); } + + /** + * Asserts the expected process user. + * + * The Expected user is determined by creating a file and reading its owner, see static block above. + * + * On Windows, when run privileged as member of the Administrators group, this does not always + * work because new files can be owned by BUILTIN\Administrators instead, depending on system + * settings. In that case we resort to comparing System property user.name, which does not contain + * the domain name, though. + * + * @param info ProcessHanlde info object + */ + static void assertUser(ProcessHandle.Info info) { + if (!info.user().isPresent()) { + return; + } + String user = info.user().get(); + Assert.assertNotNull(user, "User name"); + if (Platform.isWindows() && "BUILTIN\\Administrators".equals(whoami)) { + int bsi = user.lastIndexOf("\\"); + Assert.assertEquals(bsi == -1 ? user : user.substring(bsi + 1), + System.getProperty("user.name"), "User name"); + } else { + Assert.assertEquals(user, whoami, "User name"); + } + } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/META-INF/services/java.lang.System$LoggerFinder 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1 @@ +loggerfinder.SimpleLoggerFinder diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/PlatformRecursiveLoadingTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8314263 + * @summary Creating a logger while loading the Logger finder + * triggers recursion and StackOverflowError + * @modules java.base/sun.util.logging java.base/jdk.internal.logger:+open + * @library ../lib + * @compile RecursiveLoadingTest.java SimpleLoggerFinder.java + * @run main/othervm PlatformRecursiveLoadingTest + */ + +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.logging.LogRecord; + +import sun.util.logging.PlatformLogger; + +public class PlatformRecursiveLoadingTest { + + /** + * This test triggers recursion by calling `System.getLogger` in the class init and constructor + * of a custom LoggerFinder. Without the fix, this is expected to throw + * java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.logger.LoggerFinderLoader$ErrorPolicy + * caused by: java.lang.StackOverflowError + */ + public static void main(String[] args) throws Throwable { + PlatformLogger.getLogger("main").info("in main"); + // allow time to let bootstrap logger flush data + BootstrapLoggerUtils.awaitPending(); + List logs = loggerfinder.SimpleLoggerFinder.LOGS; + logs.stream().map(SimpleLogRecord::of).forEach(System.out::println); + logs.stream().map(SimpleLogRecord::of).forEach(SimpleLogRecord::check); + assertEquals(String.valueOf(logs.size()), String.valueOf(3)); + } + + static List asList(Object[] params) { + return params == null ? null : Arrays.asList(params); + } + + record SimpleLogRecord(String message, Instant instant, String loggerName, + java.util.logging.Level level, List params, + String resourceBundleName, long seqNumber, + String sourceClassName, String methodName, Throwable thrown) { + SimpleLogRecord(LogRecord record) { + this(record.getMessage(), record.getInstant(), record.getLoggerName(), record.getLevel(), + asList(record.getParameters()), record.getResourceBundleName(), record.getSequenceNumber(), + record.getSourceClassName(), record.getSourceMethodName(), record.getThrown()); + } + static SimpleLogRecord of(Object o) { + return (o instanceof LogRecord record) ? new SimpleLogRecord(record) : null; + } + static SimpleLogRecord check(SimpleLogRecord record) { + if (record.loggerName.equals("dummy")) { + assertEquals(record.sourceClassName, "jdk.internal.logger.BootstrapLogger$LogEvent"); + assertEquals(record.methodName(), "log"); + } + if (record.loggerName.equals("main")) { + assertEquals(record.sourceClassName, PlatformRecursiveLoadingTest.class.getName()); + assertEquals(record.methodName, "main"); + } + return record; + } + } + + private static void assertEquals(String received, String expected) { + if (!expected.equals(received)) { + throw new RuntimeException("Received: " + received); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/RecursiveLoadingTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8314263 + * @summary Creating a logger while loading the Logger finder + * triggers recursion and StackOverflowError + * @modules java.base/jdk.internal.logger:+open + * @library ../lib + * @compile RecursiveLoadingTest.java SimpleLoggerFinder.java + * @run main/othervm RecursiveLoadingTest + */ + +import java.time.Instant; +import java.util.Arrays; +import java.util.List; +import java.util.logging.LogRecord; + +public class RecursiveLoadingTest { + + /** + * This test triggers recursion by calling `System.getLogger` in the class init and constructor + * of a custom LoggerFinder. Without the fix, this is expected to throw + * java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.logger.LoggerFinderLoader$ErrorPolicy + * caused by: java.lang.StackOverflowError + */ + public static void main(String[] args) throws Throwable { + System.getLogger("main").log(System.Logger.Level.INFO, "in main"); + // allow time to let bootstrap logger flush data + BootstrapLoggerUtils.awaitPending(); + List logs = loggerfinder.SimpleLoggerFinder.LOGS; + logs.stream().map(SimpleLogRecord::of).forEach(System.out::println); + logs.stream().map(SimpleLogRecord::of).forEach(SimpleLogRecord::check); + assertEquals(String.valueOf(logs.size()), String.valueOf(3)); + } + + static List asList(Object[] params) { + return params == null ? null : Arrays.asList(params); + } + + record SimpleLogRecord(String message, Instant instant, String loggerName, + java.util.logging.Level level, List params, + String resourceBundleName, long seqNumber, + String sourceClassName, String methodName, Throwable thrown) { + SimpleLogRecord(LogRecord record) { + this(record.getMessage(), record.getInstant(), record.getLoggerName(), record.getLevel(), + asList(record.getParameters()), record.getResourceBundleName(), record.getSequenceNumber(), + record.getSourceClassName(), record.getSourceMethodName(), record.getThrown()); + } + static SimpleLogRecord of(Object o) { + return (o instanceof LogRecord record) ? new SimpleLogRecord(record) : null; + } + static SimpleLogRecord check(SimpleLogRecord record) { + if (record.loggerName.equals("dummy")) { + assertEquals(record.sourceClassName, "jdk.internal.logger.BootstrapLogger$LogEvent"); + assertEquals(record.methodName(), "log"); + } + if (record.loggerName.equals("main")) { + assertEquals(record.sourceClassName, RecursiveLoadingTest.class.getName()); + assertEquals(record.methodName, "main"); + } + return record; + } + } + + private static void assertEquals(String received, String expected) { + if (!expected.equals(received)) { + throw new RuntimeException("Received: " + received); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/RecursiveLoading/SimpleLoggerFinder.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package loggerfinder; + +import java.lang.*; +import java.util.*; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Handler; +import java.util.logging.LogRecord; +import java.util.logging.Logger; + +public class SimpleLoggerFinder extends System.LoggerFinder { + + public static final CopyOnWriteArrayList LOGS = new CopyOnWriteArrayList<>(); + static { + try { + long sleep = new Random().nextLong(1000L) + 1L; + // simulate a slow load service + Thread.sleep(sleep); + System.getLogger("dummy") + .log(System.Logger.Level.INFO, + "Logger finder service load sleep value: " + sleep); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + private final Map loggers = new ConcurrentHashMap<>(); + public SimpleLoggerFinder() { + System.getLogger("dummy") + .log(System.Logger.Level.INFO, + "Logger finder service created"); + } + + @Override + public System.Logger getLogger(String name, Module module) { + return loggers.computeIfAbsent(name, SimpleLogger::new); + } + + private static class SimpleLogger implements System.Logger { + private final java.util.logging.Logger logger; + + private static final class SimpleHandler extends Handler { + @Override + public void publish(LogRecord record) { + LOGS.add(record); + } + @Override public void flush() { } + @Override public void close() { } + } + + public SimpleLogger(String name) { + logger = Logger.getLogger(name); + logger.addHandler(new SimpleHandler()); + } + + @Override + public String getName() { + return logger.getName(); + } + + java.util.logging.Level level(Level level) { + return switch (level) { + case ALL -> java.util.logging.Level.ALL; + case DEBUG -> java.util.logging.Level.FINE; + case TRACE -> java.util.logging.Level.FINER; + case INFO -> java.util.logging.Level.INFO; + case WARNING -> java.util.logging.Level.WARNING; + case ERROR -> java.util.logging.Level.SEVERE; + case OFF -> java.util.logging.Level.OFF; + }; + } + + @Override + public boolean isLoggable(Level level) { + return logger.isLoggable(level(level)); + } + + @Override + public void log(Level level, ResourceBundle bundle, String msg, Throwable thrown) { + var julLevel = level(level); + if (!logger.isLoggable(julLevel)) return; + if (bundle != null) { + logger.logrb(julLevel, bundle, msg, thrown); + } else { + logger.log(julLevel, msg, thrown); + } + } + + @Override + public void log(Level level, ResourceBundle bundle, String format, Object... params) { + var julLevel = level(level); + if (!logger.isLoggable(julLevel)) return; + if (params == null) { + if (bundle == null) { + logger.log(julLevel, format); + } else { + logger.logrb(julLevel, bundle, format); + } + } else { + if (bundle == null) { + logger.log(julLevel, format, params); + } else { + logger.logrb(julLevel, bundle, format, params); + } + } + } + } +} + diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/META-INF/services/java.lang.System$LoggerFinder 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1 @@ +loggerfinder.SimpleLoggerFinder diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SignedLoggerFinderTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,307 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8314263 + * @summary Signed jars triggering Logger finder recursion and StackOverflowError + * @library /test/lib ../lib + * @compile/module=java.base share/classes/jdk/internal/event/EventHelper.java + * @modules java.base/jdk.internal.logger:+open + * @build jdk.test.lib.compiler.CompilerUtils + * jdk.test.lib.process.* + * jdk.test.lib.util.JarUtils + * jdk.test.lib.JDKToolLauncher + * @compile SignedLoggerFinderTest.java SimpleLoggerFinder.java + * @run main SignedLoggerFinderTest init + * @run main SignedLoggerFinderTest init sign + */ + +import java.io.File; +import java.nio.file.*; +import java.security.*; +import java.util.*; +import java.util.function.*; +import java.util.jar.*; + +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Utils; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.util.JarUtils; + +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +import static java.util.Arrays.asList; + +public class SignedLoggerFinderTest { + + /** + * This test triggers recursion in the broken JDK. The error can + * manifest in a few different ways. + * One error seen is "java.lang.NoClassDefFoundError: + * Could not initialize class jdk.internal.logger.LoggerFinderLoader$ErrorPolicy" + * + * The original reported error was a StackOverflow (also seen in different iterations + * of this run). Running test in signed and unsigned jar mode for sanity coverage. + * The current bug only manifests when jars are signed. + */ + + private static boolean init = false; + private static boolean signJars = false; + private static boolean mutliThreadLoad = false; + private static volatile boolean testComplete = false; + + private static final String KEYSTORE = "8314263.keystore"; + private static final String ALIAS = "JavaTest"; + private static final String STOREPASS = "changeit"; + private static final String KEYPASS = "changeit"; + private static final String DNAME = "CN=sample"; + private static final String CUSTOM_LOGGER_FINDER_NAME = + "loggerfinder.SimpleLoggerFinder"; + private static final String CUSTOM_LOGGER_NAME = + "loggerfinder.SimpleLoggerFinder$SimpleLogger"; + private static final String INTERNAL_LOGGER_FINDER_NAME = + "sun.util.logging.internal.LoggingProviderImpl"; + private static final String INTERNAL_LOGGER_NAME = + "sun.util.logging.internal.LoggingProviderImpl$JULWrapper"; + private static final Path jarPath1 = + Path.of(System.getProperty("test.classes", "."), "SimpleLoggerFinder.jar"); + private static final Path jarPath2 = + Path.of(System.getProperty("test.classes", "."), "SimpleLoggerFinder2.jar"); + + public static void main(String[] args) throws Throwable { + init = args.length >=1 && args[0].equals("init"); + signJars = args.length >=2 && args[1].equals("sign"); + + // init only passed in by jtreg test run, initialize the environment + // for the subsequent test run + if (init) { + initialize(); + launchTest(false, false); + launchTest(false, true); + launchTest(true, false); + launchTest(true, true); + + } else { + // set up complete. Run the code to trigger the recursion + // We're in the JVM launched by ProcessTools.executeCommand + boolean multiThreadLoad = Boolean.getBoolean("multiThreadLoad"); + boolean withCustomLoggerFinder = Boolean.getBoolean("withCustomLoggerFinder"); + + if (multiThreadLoad) { + long sleep = new Random().nextLong(100L) + 1L; + System.out.println("multi thread load sleep value: " + sleep); + new Thread(runnableWithSleep( + () -> System.getLogger("logger" + System.currentTimeMillis()), + sleep, "System.getLogger type: ")).start(); + new Thread(runnableWithSleep( + () -> System.LoggerFinder.getLoggerFinder(), + sleep, "System.getLoggerFinder type: ")).start(); + } + + if (withCustomLoggerFinder) { + JarFile jf = new JarFile(jarPath1.toString(), true); + jf.getInputStream(jf.getJarEntry("loggerfinder/SimpleLoggerFinder.class")); + JarFile jf2 = new JarFile(jarPath2.toString(), true); + jf2.getInputStream(jf.getJarEntry("loggerfinder/SimpleLoggerFinder.class")); + } else { + // some other call to prod LoggerFinder loading + System.getLogger("random" + System.currentTimeMillis()); + System.LoggerFinder.getLoggerFinder(); + } + Security.setProperty("test_1", "test"); + + // some extra sanity checks + if (withCustomLoggerFinder) { + assertEquals(System.LoggerFinder.getLoggerFinder().getClass().getName(), + CUSTOM_LOGGER_FINDER_NAME); + System.Logger testLogger = System.getLogger("jdk.event.security"); + assertEquals(testLogger.getClass().getName(), CUSTOM_LOGGER_NAME); + } else { + assertEquals(System.LoggerFinder.getLoggerFinder().getClass().getName(), + INTERNAL_LOGGER_FINDER_NAME); + System.Logger testLogger = System.getLogger("jdk.event.security"); + assertEquals(testLogger.getClass().getName(), INTERNAL_LOGGER_NAME); + } + testComplete = true; + + // LoggerFinder should be initialized, trigger a simple log call + Security.setProperty("test_2", "test"); + // allow time to let bootstrap logger flush data + BootstrapLoggerUtils.awaitPending(); + } + } + + // helper to create the inner test. Run config variations with the LoggerFinder jars + // on the classpath and with other threads running System.Logger calls during load + private static void launchTest(boolean multiThreadLoad, boolean withCustomLoggerFinder) { + List cmds = new ArrayList<>(); + cmds.add(JDKToolFinder.getJDKTool("java")); + cmds.addAll(asList(Utils.getTestJavaOpts())); + if (withCustomLoggerFinder) { + cmds.addAll(List.of("-classpath", + System.getProperty("test.classes") + File.pathSeparator + + jarPath1.toString() + File.pathSeparator + jarPath2.toString(), + "-Dtest.classes=" + System.getProperty("test.classes"))); + } else { + cmds.addAll(List.of("-classpath", + System.getProperty("test.classes"))); + } + + Path patches = Paths.get(System.getProperty("test.classes"), "patches", "java.base"); + cmds.addAll(List.of( + // patch of EventHelper to log at INFO level (for bootstrap logger) + "--patch-module", "java.base=" + patches.toString(), + // allow test to access internal bootstrap logger functionality + "--add-opens=java.base/jdk.internal.logger=ALL-UNNAMED", + // following debug property seems useful to tickle the issue + "-Dsun.misc.URLClassPath.debug=true", + // console logger level to capture event output + "-Djdk.system.logger.level=DEBUG", + // useful for debug purposes + "-Djdk.logger.finder.error=DEBUG", + // enable logging to verify correct output + "-Djava.util.logging.config.file=" + + Path.of(System.getProperty("test.src", "."), "logging.properties"))); + if (multiThreadLoad) { + cmds.add("-DmultiThreadLoad=true"); + } + if (withCustomLoggerFinder) { + cmds.add("-DwithCustomLoggerFinder=true"); + } + cmds.addAll(List.of( + "SignedLoggerFinderTest", + "no-init")); + + try { + OutputAnalyzer outputAnalyzer = ProcessTools.executeCommand(cmds.stream() + .filter(t -> !t.isEmpty()) + .toArray(String[]::new)) + .shouldHaveExitValue(0); + if (withCustomLoggerFinder) { + outputAnalyzer + .shouldContain("TEST LOGGER: [test_1, test]") + .shouldContain("TEST LOGGER: [test_2, test]"); + } else { + outputAnalyzer + .shouldContain("SecurityPropertyModification: key:test_1") + .shouldContain("SecurityPropertyModification: key:test_2"); + } + if (withCustomLoggerFinder && signJars) { + // X509 cert generated during verification of signed jar file + outputAnalyzer + .shouldContain(DNAME); + } + + } catch (Throwable t) { + throw new RuntimeException("Unexpected fail.", t); + } + } + + private static Runnable runnableWithSleep(Supplier s, long sleep, String desc) { + return () -> { + while(!testComplete) { + System.out.println(desc + s.get().getClass().getName()); + try { + Thread.sleep(sleep); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + }; + } + + private static void initialize() throws Throwable { + if (signJars) { + genKey(); + } + + Path classes = Paths.get(System.getProperty("test.classes", "")); + JarUtils.createJarFile(jarPath1, + classes, + classes.resolve("loggerfinder/SimpleLoggerFinder.class"), + classes.resolve("loggerfinder/SimpleLoggerFinder$SimpleLogger.class")); + + JarUtils.updateJarFile(jarPath1, Path.of(System.getProperty("test.src")), + Path.of("META-INF", "services", "java.lang.System$LoggerFinder")); + if (signJars) { + signJar(jarPath1.toString()); + } + // multiple signed jars with services to have ServiceLoader iteration + Files.copy(jarPath1, jarPath2, REPLACE_EXISTING); + } + + private static void genKey() throws Throwable { + String keytool = JDKToolFinder.getJDKTool("keytool"); + Files.deleteIfExists(Paths.get(KEYSTORE)); + ProcessTools.executeCommand(keytool, + "-J-Duser.language=en", + "-J-Duser.country=US", + "-genkey", + "-keyalg", "rsa", + "-alias", ALIAS, + "-keystore", KEYSTORE, + "-keypass", KEYPASS, + "-dname", DNAME, + "-storepass", STOREPASS + ).shouldHaveExitValue(0); + } + + + private static OutputAnalyzer signJar(String jarName) throws Throwable { + List args = new ArrayList<>(); + args.add("-verbose"); + args.add(jarName); + args.add(ALIAS); + + return jarsigner(args); + } + + private static OutputAnalyzer jarsigner(List extra) + throws Throwable { + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jarsigner") + .addVMArg("-Duser.language=en") + .addVMArg("-Duser.country=US") + .addToolArg("-keystore") + .addToolArg(KEYSTORE) + .addToolArg("-storepass") + .addToolArg(STOREPASS) + .addToolArg("-keypass") + .addToolArg(KEYPASS); + for (String s : extra) { + if (s.startsWith("-J")) { + launcher.addVMArg(s.substring(2)); + } else { + launcher.addToolArg(s); + } + } + return ProcessTools.executeCommand(launcher.getCommand()); + } + + private static void assertEquals(String received, String expected) { + if (!expected.equals(received)) { + throw new RuntimeException("Received: " + received); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/SimpleLoggerFinder.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package loggerfinder; + +import java.lang.*; +import java.util.*; + +public class SimpleLoggerFinder extends System.LoggerFinder { + + static { + try { + long sleep = new Random().nextLong(1000L) + 1L; + System.out.println("Logger finder service load sleep value: " + sleep); + // simulate a slow load service + Thread.sleep(sleep); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + @Override + public System.Logger getLogger(String name, Module module) { + return new SimpleLogger(name); + } + + private static class SimpleLogger implements System.Logger { + private final String name; + + public SimpleLogger(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public boolean isLoggable(Level level) { + return true; + } + + @Override + public void log(Level level, ResourceBundle bundle, String msg, Throwable thrown) { + System.out.println("TEST LOGGER: " + msg); + } + + @Override + public void log(Level level, ResourceBundle bundle, String format, Object... params) { + System.out.println("TEST LOGGER: " + Arrays.asList(params)); + + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/java.base/share/classes/jdk/internal/event/EventHelper.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.internal.event; + +import jdk.internal.access.JavaUtilJarAccess; +import jdk.internal.access.SharedSecrets; + +import java.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; +import java.time.Duration; +import java.time.Instant; +import java.util.Date; +import java.util.stream.Collectors; +import java.util.stream.LongStream; + +/** + * A helper class to have events logged to a JDK Event Logger. + */ + +public final class EventHelper { + + private static final JavaUtilJarAccess JUJA = SharedSecrets.javaUtilJarAccess(); + private static volatile boolean loggingSecurity; + private static volatile System.Logger securityLogger; + private static final VarHandle LOGGER_HANDLE; + static { + System.err.println("Patch version of EventHelper loaded"); + try { + LOGGER_HANDLE = + MethodHandles.lookup().findStaticVarHandle( + EventHelper.class, "securityLogger", System.Logger.class); + } catch (ReflectiveOperationException e) { + throw new Error(e); + } + } + // a patch module to help this test ensure events are logged when + // bootstrap logger is in use + private static final System.Logger.Level LOG_LEVEL = System.Logger.Level.INFO; + + // helper class used for logging security related events for now + private static final String SECURITY_LOGGER_NAME = "jdk.event.security"; + + + public static void logTLSHandshakeEvent(Instant start, + String peerHost, + int peerPort, + String cipherSuite, + String protocolVersion, + long peerCertId) { + assert securityLogger != null; + String prepend = getDurationString(start); + securityLogger.log(LOG_LEVEL, prepend + + " TLSHandshake: {0}:{1,number,#}, {2}, {3}, {4,number,#}", + peerHost, peerPort, protocolVersion, cipherSuite, peerCertId); + } + + public static void logSecurityPropertyEvent(String key, + String value) { + + assert securityLogger != null; + securityLogger.log(LOG_LEVEL, + "SecurityPropertyModification: key:{0}, value:{1}", key, value); + } + + public static void logX509ValidationEvent(long anchorCertId, + long[] certIds) { + assert securityLogger != null; + String codes = LongStream.of(certIds) + .mapToObj(Long::toString) + .collect(Collectors.joining(", ")); + securityLogger.log(LOG_LEVEL, + "ValidationChain: {0,number,#}, {1}", anchorCertId, codes); + } + + public static void logX509CertificateEvent(String algId, + String serialNum, + String subject, + String issuer, + String keyType, + int length, + long certId, + long beginDate, + long endDate) { + assert securityLogger != null; + securityLogger.log(LOG_LEVEL, "X509Certificate: Alg:{0}, Serial:{1}" + + ", Subject:{2}, Issuer:{3}, Key type:{4}, Length:{5,number,#}" + + ", Cert Id:{6,number,#}, Valid from:{7}, Valid until:{8}", + algId, serialNum, subject, issuer, keyType, length, + certId, new Date(beginDate), new Date(endDate)); + } + + /** + * Method to calculate a duration timestamp for events which measure + * the start and end times of certain operations. + * @param start Instant indicating when event started recording + * @return A string representing duraction from start time to + * time of this method call. Empty string is start is null. + */ + private static String getDurationString(Instant start) { + if (start != null) { + if (start.equals(Instant.MIN)) { + return "N/A"; + } + Duration duration = Duration.between(start, Instant.now()); + long micros = duration.toNanos() / 1_000; + if (micros < 1_000_000) { + return "duration = " + (micros / 1_000.0) + " ms:"; + } else { + return "duration = " + ((micros / 1_000) / 1_000.0) + " s:"; + } + } else { + return ""; + } + } + + /** + * Helper to determine if security events are being logged + * at a preconfigured logging level. The configuration value + * is read once at class initialization. + * + * @return boolean indicating whether an event should be logged + */ + public static boolean isLoggingSecurity() { + // Avoid a bootstrap issue where the commitEvent attempts to + // trigger early loading of System Logger but where + // the verification process still has JarFiles locked + if (securityLogger == null && !JUJA.isInitializing()) { + LOGGER_HANDLE.compareAndSet( null, System.getLogger(SECURITY_LOGGER_NAME)); + loggingSecurity = securityLogger.isLoggable(LOG_LEVEL); + } + return loggingSecurity; + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/SignedLoggerFinderTest/logging.properties 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,14 @@ +############################################################ +# Configuration file for log testing +# +############################################################ + +handlers= java.util.logging.ConsoleHandler + +.level= FINE + +java.util.logging.ConsoleHandler.level = FINE +java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter + +jdk.event.security.level = FINE + diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerAPIsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -29,7 +29,7 @@ import java.util.Enumeration; import java.util.List; import java.util.ResourceBundle; -import java.util.Set; + import jdk.internal.logger.BootstrapLogger; import jdk.internal.logger.LazyLoggers; @@ -38,9 +38,10 @@ * @bug 8144460 8144214 * @summary Cover the logXX and LogEvent.valueOf APIs of BootstrapLogger * and logXX APIs of SimpleConsoleLogger. + * @library ../../lib * @modules java.base/jdk.internal.logger:+open * java.base/sun.util.logging - * @build BootstrapLoggerUtils LogStream + * @build LogStream * @run main/othervm BootstrapLoggerAPIsTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -53,9 +53,10 @@ * @summary JDK implementation specific unit test for JDK internal artifacts. Tests the behavior of bootstrap loggers (and SimpleConsoleLoggers * too). + * @library ../../lib * @modules java.base/jdk.internal.logger:+open * java.logging - * @build BootstrapLoggerUtils LogStream + * @build LogStream * @run main/othervm BootstrapLoggerTest NO_SECURITY * @run main/othervm -Djava.security.manager=allow BootstrapLoggerTest SECURE * @run main/othervm/timeout=120 -Djava.security.manager=allow BootstrapLoggerTest SECURE_AND_WAIT diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerUtils.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2015, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.function.BooleanSupplier; - -import jdk.internal.logger.BootstrapLogger; - -class BootstrapLoggerUtils { - - private static final Field IS_BOOTED; - private static final Method AWAIT_PENDING; - - static { - try { - IS_BOOTED = BootstrapLogger.class.getDeclaredField("isBooted"); - IS_BOOTED.setAccessible(true); - // private reflection hook that allows us to test wait until all - // the tasks pending in the BootstrapExecutor are finished. - AWAIT_PENDING = BootstrapLogger.class.getDeclaredMethod("awaitPendingTasks"); - AWAIT_PENDING.setAccessible(true); - } catch (Exception ex) { - throw new ExceptionInInitializerError(ex); - } - } - - static void setBootedHook(BooleanSupplier supplier) throws IllegalAccessException { - IS_BOOTED.set(null, supplier); - } - - static void awaitPending() { - try { - AWAIT_PENDING.invoke(null); - } catch (IllegalAccessException | IllegalArgumentException - | InvocationTargetException ex) { - ex.printStackTrace(); - } - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/LogStream.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -25,8 +25,6 @@ import java.io.OutputStream; import java.io.PrintStream; -import jdk.internal.logger.BootstrapLogger; - /** * We use an instance of this class to check what the logging system has printed * on System.err. diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/System/LoggerFinder/lib/BootstrapLoggerUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2015, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.function.BooleanSupplier; + +import jdk.internal.logger.BootstrapLogger; + +public final class BootstrapLoggerUtils { + + private static final Field IS_BOOTED; + private static final Method AWAIT_PENDING; + + static { + try { + IS_BOOTED = BootstrapLogger.class.getDeclaredField("isBooted"); + IS_BOOTED.setAccessible(true); + // private reflection hook that allows us to test wait until all + // the tasks pending in the BootstrapExecutor are finished. + AWAIT_PENDING = BootstrapLogger.class.getDeclaredMethod("awaitPendingTasks"); + AWAIT_PENDING.setAccessible(true); + } catch (Exception ex) { + throw new ExceptionInInitializerError(ex); + } + } + + public static void setBootedHook(BooleanSupplier supplier) throws IllegalAccessException { + IS_BOOTED.set(null, supplier); + } + + public static void awaitPending() { + try { + AWAIT_PENDING.invoke(null); + } catch (IllegalAccessException | IllegalArgumentException + | InvocationTargetException ex) { + ex.printStackTrace(); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/Thread/IsAlive.java openjdk-17-17.0.10+7/test/jdk/java/lang/Thread/IsAlive.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/Thread/IsAlive.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/Thread/IsAlive.java 2024-01-09 21:18:15.000000000 +0000 @@ -25,7 +25,7 @@ * @test * @bug 8305425 * @summary Check Thread.isAlive - * @run main/othervm/timeout=10 IsAlive + * @run main/othervm IsAlive */ public class IsAlive { diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/instrument/GetObjectSizeIntrinsicsTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/instrument/GetObjectSizeIntrinsicsTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/instrument/GetObjectSizeIntrinsicsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/instrument/GetObjectSizeIntrinsicsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -278,17 +278,17 @@ * * @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox * - * @run main/othervm -Xmx8g + * @run main/othervm/timeout=300 -Xmx8g * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xint * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest large * - * @run main/othervm -Xmx8g + * @run main/othervm/timeout=240 -Xmx8g * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:TieredStopAtLevel=1 * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest large * - * @run main/othervm -Xmx8g + * @run main/othervm/timeout=180 -Xmx8g * -XX:+UnlockDiagnosticVMOptions -XX:+AbortVMOnCompilationFailure -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch -XX:-TieredCompilation * -javaagent:basicAgent.jar GetObjectSizeIntrinsicsTest GetObjectSizeIntrinsicsTest large diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/invoke/defineHiddenClass/UnloadingTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/invoke/defineHiddenClass/UnloadingTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/invoke/defineHiddenClass/UnloadingTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/invoke/defineHiddenClass/UnloadingTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -214,18 +214,15 @@ } void unload() { - // Force garbage collection to trigger unloading of class loader and native library - ForceGC gc = new ForceGC(); - assertTrue(gc.await(() -> weakRef.get() == null)); - - if (weakRef.get() != null) { + // Force garbage collection to trigger unloading of class loader + // and native library. + if (!ForceGC.wait(() -> weakRef.refersTo(null))) { throw new RuntimeException("loader " + " not unloaded!"); } } boolean tryUnload() { - ForceGC gc = new ForceGC(); - return gc.await(() -> weakRef.get() == null); + return ForceGC.wait(() -> weakRef.refersTo(null)); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/invoke/unreflect/TEST.properties openjdk-17-17.0.10+7/test/jdk/java/lang/invoke/unreflect/TEST.properties --- openjdk-17-17.0.9+9/test/jdk/java/lang/invoke/unreflect/TEST.properties 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/invoke/unreflect/TEST.properties 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -# -# Copyright (c) 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# 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, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -enablePreview=true diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/module/ModuleDescriptorHashCodeTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2021, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import org.testng.annotations.Test; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.module.ModuleDescriptor; +import java.util.Set; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotSame; + +/** + * @test + * @bug 8275509 + * @run testng ModuleDescriptorHashCodeTest + * @run testng/othervm -Xshare:off ModuleDescriptorHashCodeTest + * @summary Tests the ModuleDescriptor.hashCode() for boot layer modules + */ +public class ModuleDescriptorHashCodeTest { + + /** + * Verifies that the ModuleDescriptor.hashCode() returned by a boot layer module is + * the same as that returned by a ModuleDescriptor constructed from the ModuleDescriptor.Builder + * for the same module. + */ + @Test + public void testBootModuleDescriptor() throws Exception { + Set bootModules = ModuleLayer.boot().modules(); + for (Module bootModule : bootModules) { + System.out.println("Testing module descriptor of boot module " + bootModule); + ModuleDescriptor bootMD = bootModule.getDescriptor(); + ModuleDescriptor mdFromBuilder = fromModuleInfoClass(bootModule); + // verify that this object is indeed a different object instance than the boot module descriptor + // to prevent any artificial passing of the test + assertNotSame(mdFromBuilder, bootMD, "ModuleDescriptor loaded from boot layer and " + + "one created from module-info.class unexpectedly returned the same instance"); + assertEquals(mdFromBuilder.hashCode(), bootMD.hashCode(), + "Unexpected ModuleDescriptor.hashCode() for " + mdFromBuilder); + assertEquals(mdFromBuilder.compareTo(bootMD), 0, + "Unexpected ModuleDescriptor.compareTo() for " + mdFromBuilder); + } + } + + // Returns a ModuleDescriptor parsed out of the module-info.class of the passed Module + private static ModuleDescriptor fromModuleInfoClass(Module module) throws IOException { + try (InputStream moduleInfo = module.getResourceAsStream("module-info.class")) { + if (moduleInfo == null) { + throw new RuntimeException("Could not locate module-info.class in " + module); + } + // internally calls ModuleDescriptor.Builder + return ModuleDescriptor.read(moduleInfo); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/callerCache/ReflectionCallerCacheTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, 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 @@ -107,9 +107,7 @@ WeakReference weakLoader = loadAndRunClass(classname); // Force garbage collection to trigger unloading of class loader - new ForceGC().await(() -> weakLoader.get() == null); - - if (weakLoader.get() != null) { + if (!ForceGC.wait(() -> weakLoader.refersTo(null))) { throw new RuntimeException("Class " + classname + " not unloaded!"); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/reflect/sealed_classes/SealedClassesReflectionTest.java openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/sealed_classes/SealedClassesReflectionTest.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/reflect/sealed_classes/SealedClassesReflectionTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/sealed_classes/SealedClassesReflectionTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -25,8 +25,8 @@ * @test * @bug 8227046 * @summary reflection test for sealed classes - * @compile --enable-preview -source ${jdk.version} SealedClassesReflectionTest.java - * @run testng/othervm --enable-preview SealedClassesReflectionTest + * @compile SealedClassesReflectionTest.java + * @run testng/othervm SealedClassesReflectionTest */ import java.lang.annotation.*; diff -Nru openjdk-17-17.0.9+9/test/jdk/java/lang/reflect/sealed_classes/TestSecurityManagerChecks.java openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/sealed_classes/TestSecurityManagerChecks.java --- openjdk-17-17.0.9+9/test/jdk/java/lang/reflect/sealed_classes/TestSecurityManagerChecks.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/lang/reflect/sealed_classes/TestSecurityManagerChecks.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -28,8 +28,8 @@ * @library /test/lib * @modules java.compiler * @build jdk.test.lib.compiler.CompilerUtils jdk.test.lib.compiler.ModuleInfoMaker TestSecurityManagerChecks - * @run main/othervm -Djava.security.manager=allow --enable-preview TestSecurityManagerChecks named - * @run main/othervm -Djava.security.manager=allow --enable-preview TestSecurityManagerChecks unnamed + * @run main/othervm -Djava.security.manager=allow TestSecurityManagerChecks named + * @run main/othervm -Djava.security.manager=allow TestSecurityManagerChecks unnamed */ import java.io.IOException; diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/DatagramSocket/DatagramSocketMulticasting.java openjdk-17-17.0.10+7/test/jdk/java/net/DatagramSocket/DatagramSocketMulticasting.java --- openjdk-17-17.0.9+9/test/jdk/java/net/DatagramSocket/DatagramSocketMulticasting.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/DatagramSocket/DatagramSocketMulticasting.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 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 @@ -27,10 +27,10 @@ * @library /test/lib * @build jdk.test.lib.NetworkConfiguration * jdk.test.lib.net.IPSupport - * @run main/othervm DatagramSocketMulticasting - * @run main/othervm -Djava.net.preferIPv4Stack=true DatagramSocketMulticasting - * @run main/othervm -Djdk.usePlainDatagramSocketImpl=true DatagramSocketMulticasting - * @run main/othervm -Djdk.usePlainDatagramSocketImpl=true -Djava.net.preferIPv4Stack=true DatagramSocketMulticasting + * @run junit/othervm DatagramSocketMulticasting + * @run junit/othervm -Djava.net.preferIPv4Stack=true DatagramSocketMulticasting + * @run junit/othervm -Djdk.usePlainDatagramSocketImpl=true DatagramSocketMulticasting + * @run junit/othervm -Djdk.usePlainDatagramSocketImpl=true -Djava.net.preferIPv4Stack=true DatagramSocketMulticasting */ import java.io.IOException; @@ -50,6 +50,7 @@ import jdk.test.lib.NetworkConfiguration; import jdk.test.lib.net.IPSupport; +import org.junit.jupiter.api.Test; import static java.net.StandardProtocolFamily.INET; import static java.net.StandardProtocolFamily.INET6; @@ -59,11 +60,16 @@ import static java.net.StandardSocketOptions.SO_REUSEADDR; import static jdk.test.lib.NetworkConfiguration.isSameInterface; +import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + public class DatagramSocketMulticasting { static final ProtocolFamily UNSPEC = () -> "UNSPEC"; + static final int MAX_TRIES = 3; - public static void main(String[] args) throws IOException { - IPSupport.throwSkippedExceptionIfNonOperational(); + @Test + public void main() throws IOException { + assumeTrue(IPSupport.currentConfigurationIsValid(), "Invalid networking configuration"); // IPv4 and IPv6 interfaces that support multicasting NetworkConfiguration config = NetworkConfiguration.probe(); @@ -134,13 +140,13 @@ System.out.format("testJoinGroup2: local socket address: %s%n", s.getLocalSocketAddress()); // check network interface not set - assertTrue(s.getOption(IP_MULTICAST_IF) == null); + assertNull(s.getOption(IP_MULTICAST_IF)); // join on default interface s.joinGroup(new InetSocketAddress(group, 0), null); // join should not change the outgoing multicast interface - assertTrue(s.getOption(IP_MULTICAST_IF) == null); + assertNull(s.getOption(IP_MULTICAST_IF)); // already a member (exception not specified) assertThrows(SocketException.class, @@ -157,7 +163,7 @@ s.joinGroup(new InetSocketAddress(group, 0), ni); // join should not change the outgoing multicast interface - assertTrue(s.getOption(IP_MULTICAST_IF) == null); + assertNull(s.getOption(IP_MULTICAST_IF)); // already a member (exception not specified) assertThrows(SocketException.class, @@ -234,7 +240,7 @@ static void testNetworkInterface(DatagramSocket s, NetworkInterface ni) throws IOException { // default value - assertTrue(s.getOption(IP_MULTICAST_IF) == null); + assertNull(s.getOption(IP_MULTICAST_IF)); // setOption(IP_MULTICAST_IF) s.setOption(IP_MULTICAST_IF, ni); @@ -253,12 +259,12 @@ */ static void testTimeToLive(DatagramSocket s) throws IOException { // should be 1 by default - assertTrue(s.getOption(IP_MULTICAST_TTL) == 1); + assertEquals(1, s.getOption(IP_MULTICAST_TTL)); // setOption(IP_MULTICAST_TTL) for (int ttl = 0; ttl <= 2; ttl++) { s.setOption(IP_MULTICAST_TTL, ttl); - assertTrue(s.getOption(IP_MULTICAST_TTL) == ttl); + assertEquals(ttl, s.getOption(IP_MULTICAST_TTL)); } // bad values for IP_MULTICAST_TTL @@ -275,15 +281,15 @@ */ static void testLoopbackMode(DatagramSocket s) throws IOException { // should be enabled by default - assertTrue(s.getOption(IP_MULTICAST_LOOP) == true); + assertTrue(s.getOption(IP_MULTICAST_LOOP)); // setLoopbackMode // setOption(IP_MULTICAST_LOOP) s.setOption(IP_MULTICAST_LOOP, false); // disable - assertTrue(s.getOption(IP_MULTICAST_LOOP) == false); + assertFalse(s.getOption(IP_MULTICAST_LOOP)); s.setOption(IP_MULTICAST_LOOP, true); // enable - assertTrue(s.getOption(IP_MULTICAST_LOOP) == true); + assertTrue(s.getOption(IP_MULTICAST_LOOP)); // bad values for IP_MULTICAST_LOOP assertThrows(IllegalArgumentException.class, @@ -300,23 +306,37 @@ System.out.println("testSendReceive"); // outgoing multicast interface needs to be set - assertTrue(s.getOption(IP_MULTICAST_IF) != null); + assertNotNull(s.getOption(IP_MULTICAST_IF)); SocketAddress target = new InetSocketAddress(group, s.getLocalPort()); - byte[] message = "hello".getBytes("UTF-8"); + String message = "testSendReceive"; + byte[] messageBytes = message.getBytes("UTF-8"); // send message to multicast group - DatagramPacket p = new DatagramPacket(message, message.length); + DatagramPacket p = new DatagramPacket(messageBytes, messageBytes.length); p.setSocketAddress(target); s.send(p); - // receive message + // receive message with retry in case of stray messages s.setSoTimeout(0); - p = new DatagramPacket(new byte[1024], 100); - s.receive(p); + for (int i = 1; i <= MAX_TRIES; i++) { + p = new DatagramPacket(new byte[1024], 100); + s.receive(p); + String messageReceived = new String(p.getData(), 0, p.getLength(), "UTF-8"); + + System.out.format( + "TestSendReceive iteration [%s], Received DatagramPacket [%s] from [%s]%n", + i, messageReceived, s.getLocalSocketAddress()); + + if (s.getLocalPort() == p.getPort()) { + assertEquals(message, messageReceived, + String.format("expected message %s, instead received %s%n", + message, messageReceived)); + break; + } - assertTrue(p.getLength() == message.length); - assertTrue(p.getPort() == s.getLocalPort()); + assertNotEquals(MAX_TRIES, i, "testSendReceive: too many retries"); + } } /** @@ -328,11 +348,11 @@ System.out.println("testSendNoReceive"); // outgoing multicast interface needs to be set - assertTrue(s.getOption(IP_MULTICAST_IF) != null); + assertNotNull(s.getOption(IP_MULTICAST_IF)); SocketAddress target = new InetSocketAddress(group, s.getLocalPort()); long nano = System.nanoTime(); - String text = nano + ": hello"; + String text = nano + ": testSendNoReceive"; byte[] message = text.getBytes("UTF-8"); // send datagram to multicast group @@ -349,31 +369,13 @@ if (Arrays.equals(p.getData(), p.getOffset(), p.getLength(), message, 0, message.length)) { throw new RuntimeException("message shouldn't have been received"); } else { - System.out.format("Received unexpected message from %s%n", p.getSocketAddress()); + String messageReceived = new String(p.getData(), 0, p.getLength(), "UTF-8"); + System.out.format("Received unexpected message %s from %s%n", + messageReceived, p.getSocketAddress()); } } catch (SocketTimeoutException expected) { break; } } } - - - static void assertTrue(boolean e) { - if (!e) throw new RuntimeException(); - } - - interface ThrowableRunnable { - void run() throws Exception; - } - - static void assertThrows(Class exceptionClass, ThrowableRunnable task) { - try { - task.run(); - throw new RuntimeException("Exception not thrown"); - } catch (Exception e) { - if (!exceptionClass.isInstance(e)) { - throw new RuntimeException("expected: " + exceptionClass + ", actual: " + e); - } - } - } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/DatagramSocket/SendPortZero.java openjdk-17-17.0.10+7/test/jdk/java/net/DatagramSocket/SendPortZero.java --- openjdk-17-17.0.9+9/test/jdk/java/net/DatagramSocket/SendPortZero.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/DatagramSocket/SendPortZero.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -29,6 +29,7 @@ import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; +import java.net.InetSocketAddress; import java.net.InetAddress; import java.net.MulticastSocket; import java.net.SocketException; @@ -70,7 +71,7 @@ // Addresses loopbackAddr = InetAddress.getLoopbackAddress(); - //wildcardAddr = new InetSocketAddress(0).getAddress(); + wildcardAddr = new InetSocketAddress(0).getAddress(); // Packets // loopback w/port 0 @@ -78,29 +79,30 @@ loopbackZeroPkt.setAddress(loopbackAddr); loopbackZeroPkt.setPort(0); - /* - //Commented until JDK-8236852 is fixed - // wildcard w/port 0 wildcardZeroPkt = new DatagramPacket(buf, 0, buf.length); wildcardZeroPkt.setAddress(wildcardAddr); wildcardZeroPkt.setPort(0); - //Commented until JDK-8236807 is fixed - // wildcard addr w/valid port + // Not currently tested. See JDK-8236807 wildcardValidPkt = new DatagramPacket(buf, 0, buf.length); - var addr = socket.getAddress(); - wildcardValidPkt.setAddress(addr); - wildcardValidPkt.setPort(socket.getLocalPort()); - */ + wildcardValidPkt.setAddress(wildcardAddr); + wildcardValidPkt.setPort(datagramSocket.getLocalPort()); } @DataProvider(name = "data") public Object[][] variants() { return new Object[][]{ { datagramSocket, loopbackZeroPkt }, + { datagramSocket, wildcardZeroPkt }, + // Re-enable when JDK-8236807 fixed + //{ datagramSocket, wildcardValidPkt }, + { datagramSocketAdaptor, loopbackZeroPkt }, + { datagramSocketAdaptor, wildcardZeroPkt }, + // Re-enable when JDK-8236807 fixed + //{ datagramSocketAdaptor, wildcardValidPkt }, }; } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/MulticastSocket/SendPortZero.java openjdk-17-17.0.10+7/test/jdk/java/net/MulticastSocket/SendPortZero.java --- openjdk-17-17.0.9+9/test/jdk/java/net/MulticastSocket/SendPortZero.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/MulticastSocket/SendPortZero.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -30,6 +30,7 @@ import java.net.DatagramPacket; import java.net.MulticastSocket; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.MulticastSocket; import java.net.SocketException; import java.net.SocketPermission; @@ -69,7 +70,7 @@ // Addresses loopbackAddr = InetAddress.getLoopbackAddress(); - //wildcardAddr = new InetSocketAddress(0).getAddress(); + wildcardAddr = new InetSocketAddress(0).getAddress(); // Packets // loopback w/port 0 @@ -77,28 +78,25 @@ loopbackZeroPkt.setAddress(loopbackAddr); loopbackZeroPkt.setPort(0); - /* - //Commented until JDK-8236852 is fixed - // wildcard w/port 0 wildcardZeroPkt = new DatagramPacket(buf, 0, buf.length); wildcardZeroPkt.setAddress(wildcardAddr); wildcardZeroPkt.setPort(0); - //Commented until JDK-8236807 is fixed - // wildcard addr w/valid port + // Not currently tested. See JDK-8236807 wildcardValidPkt = new DatagramPacket(buf, 0, buf.length); - var addr = socket.getAddress(); - wildcardValidPkt.setAddress(addr); - wildcardValidPkt.setPort(socket.getLocalPort()); - */ + wildcardValidPkt.setAddress(wildcardAddr); + wildcardValidPkt.setPort(multicastSocket.getLocalPort()); } @DataProvider(name = "data") public Object[][] variants() { return new Object[][]{ - { multicastSocket, loopbackZeroPkt } + { multicastSocket, loopbackZeroPkt }, + { multicastSocket, wildcardZeroPkt }, + // Not currently tested. See JDK-8236807 + //{ multicastSocket, wildcardValidPkt } }; } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/Socket/B8312065.java openjdk-17-17.0.10+7/test/jdk/java/net/Socket/B8312065.java --- openjdk-17-17.0.9+9/test/jdk/java/net/Socket/B8312065.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/Socket/B8312065.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2023, Alibaba Group Holding Limited. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8312065 + * @summary Socket.connect does not timeout as expected when profiling (i.e. keep receiving signal) + * @requires (os.family != "windows") + * @compile NativeThread.java + * @run main/othervm/native/timeout=120 -Djdk.net.usePlainSocketImpl B8312065 + */ + +import sun.misc.Signal; + +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketTimeoutException; +import java.util.concurrent.TimeUnit; + +public class B8312065 { + public static void main(String[] args) throws Exception { + System.loadLibrary("NativeThread"); + + // Setup SIGPIPE handler + Signal.handle(new Signal("PIPE"), System.out::println); + + long osThreadId = NativeThread.getID(); + + int timeoutMillis = 2000; + int n = 10; + Thread t = new Thread(() -> { + // Send SIGPIPE to the thread every second + for (int i = 0; i < n; i++) { + if (NativeThread.signal(osThreadId, NativeThread.SIGPIPE) != 0) { + System.out.println("Test FAILED: failed to send signal"); + System.exit(1); + } + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + System.out.println("Test FAILED: unexpected interrupt"); + System.exit(1); + } + } + System.out.println("Test FAILED: Socket.connect blocked " + n + " seconds, " + + "expected around " + timeoutMillis / 1000 + " seconds"); + System.exit(1); + }); + t.setDaemon(true); + t.start(); + + long startTime = System.nanoTime(); + + try { + Socket socket = new Socket(); + // There is no good way to mock SocketTimeoutException, just assume 192.168.255.255 is not in use + socket.connect(new InetSocketAddress("192.168.255.255", 8080), timeoutMillis); + } catch (SocketTimeoutException e) { + long duration = TimeUnit.MILLISECONDS.convert(System.nanoTime() - startTime, TimeUnit.NANOSECONDS); + if (duration >= timeoutMillis) { + System.out.println("Test passed"); + } else { + System.out.println("Test FAILED: duration " + duration + " ms, expected >= " + timeoutMillis + " ms"); + System.exit(1); + } + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/httpclient/HandshakeFailureTest.java openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/HandshakeFailureTest.java --- openjdk-17-17.0.9+9/test/jdk/java/net/httpclient/HandshakeFailureTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/HandshakeFailureTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -49,7 +49,7 @@ /** * @test - * @bug 8238990 + * @bug 8238990 8258951 * @run main/othervm -Djdk.internal.httpclient.debug=true HandshakeFailureTest TLSv1.2 * @run main/othervm -Djdk.internal.httpclient.debug=true HandshakeFailureTest TLSv1.3 * @summary Verify SSLHandshakeException is received when the handshake fails, diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/httpclient/HttpServerAdapters.java openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/HttpServerAdapters.java --- openjdk-17-17.0.9+9/test/jdk/java/net/httpclient/HttpServerAdapters.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/HttpServerAdapters.java 2024-01-09 21:18:15.000000000 +0000 @@ -45,6 +45,7 @@ import java.util.List; import java.util.ListIterator; import java.util.Map; +import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; @@ -105,6 +106,16 @@ public abstract Set>> entrySet(); public abstract List get(String name); public abstract boolean containsKey(String name); + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof HttpTestRequestHeaders other)) return false; + return Objects.equals(entrySet(), other.entrySet()); + } + @Override + public int hashCode() { + return Objects.hashCode(entrySet()); + } public static HttpTestRequestHeaders of(Headers headers) { return new Http1TestRequestHeaders(headers); @@ -138,6 +149,10 @@ public boolean containsKey(String name) { return headers.containsKey(name); } + @Override + public String toString() { + return String.valueOf(headers); + } } private static final class Http2TestRequestHeaders extends HttpTestRequestHeaders { private final HttpHeaders headers; @@ -160,6 +175,10 @@ public boolean containsKey(String name) { return headers.firstValue(name).isPresent(); } + @Override + public String toString() { + return String.valueOf(headers); + } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/java/net/httpclient/SpecialHeadersTest.java openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/SpecialHeadersTest.java --- openjdk-17-17.0.9+9/test/jdk/java/net/httpclient/SpecialHeadersTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/net/httpclient/SpecialHeadersTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, 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 @@ -47,7 +47,12 @@ import com.sun.net.httpserver.HttpsConfigurator; import com.sun.net.httpserver.HttpsServer; import jdk.test.lib.net.SimpleSSLContext; +import org.testng.ITestContext; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.annotations.AfterClass; import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -70,8 +75,20 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Objects; import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; +import java.util.stream.Collectors; + +import static java.lang.System.err; import static java.lang.System.out; import static java.net.http.HttpClient.Builder.NO_PROXY; import static java.net.http.HttpClient.Version.HTTP_2; @@ -140,6 +157,142 @@ } static final int ITERATION_COUNT = 3; // checks upgrade and re-use + // a shared executor helps reduce the amount of threads created by the test + static final TestExecutor executor = new TestExecutor(Executors.newCachedThreadPool()); + static final ConcurrentMap FAILURES = new ConcurrentHashMap<>(); + static volatile boolean tasksFailed; + static final AtomicLong serverCount = new AtomicLong(); + static final AtomicLong clientCount = new AtomicLong(); + static final long start = System.nanoTime(); + public static String now() { + long now = System.nanoTime() - start; + long secs = now / 1000_000_000; + long mill = (now % 1000_000_000) / 1000_000; + long nan = now % 1000_000; + return String.format("[%d s, %d ms, %d ns] ", secs, mill, nan); + } + + final ReferenceTracker TRACKER = ReferenceTracker.INSTANCE; + private volatile HttpClient sharedClient; + + static class TestExecutor implements Executor { + final AtomicLong tasks = new AtomicLong(); + Executor executor; + TestExecutor(Executor executor) { + this.executor = executor; + } + + @Override + public void execute(Runnable command) { + long id = tasks.incrementAndGet(); + executor.execute(() -> { + try { + command.run(); + } catch (Throwable t) { + tasksFailed = true; + out.printf(now() + "Task %s failed: %s%n", id, t); + err.printf(now() + "Task %s failed: %s%n", id, t); + FAILURES.putIfAbsent("Task " + id, t); + throw t; + } + }); + } + + public void shutdown() throws InterruptedException { + if (executor instanceof ExecutorService service) { + service.shutdown(); + service.awaitTermination(1000, TimeUnit.MILLISECONDS); + } + } + + + } + + protected boolean stopAfterFirstFailure() { + return Boolean.getBoolean("jdk.internal.httpclient.debug"); + } + + final AtomicReference skiptests = new AtomicReference<>(); + void checkSkip() { + var skip = skiptests.get(); + if (skip != null) throw skip; + } + static String name(ITestResult result) { + var params = result.getParameters(); + return result.getName() + + (params == null ? "()" : Arrays.toString(result.getParameters())); + } + + @BeforeMethod + void beforeMethod(ITestContext context) { + if (stopAfterFirstFailure() && context.getFailedTests().size() > 0) { + if (skiptests.get() == null) { + SkipException skip = new SkipException("some tests failed"); + skip.setStackTrace(new StackTraceElement[0]); + skiptests.compareAndSet(null, skip); + } + } + } + + @AfterClass + static final void printFailedTests(ITestContext context) { + out.println("\n========================="); + var failed = context.getFailedTests().getAllResults().stream() + .collect(Collectors.toMap(r -> name(r), ITestResult::getThrowable)); + FAILURES.putAll(failed); + try { + out.printf("%n%sCreated %d servers and %d clients%n", + now(), serverCount.get(), clientCount.get()); + if (FAILURES.isEmpty()) return; + out.println("Failed tests: "); + FAILURES.entrySet().forEach((e) -> { + out.printf("\t%s: %s%n", e.getKey(), e.getValue()); + e.getValue().printStackTrace(out); + }); + if (tasksFailed) { + out.println("WARNING: Some tasks failed"); + } + } finally { + out.println("\n=========================\n"); + } + } + + private HttpClient makeNewClient() { + clientCount.incrementAndGet(); + return HttpClient.newBuilder() + .proxy(NO_PROXY) + .executor(executor) + .sslContext(sslContext) + .build(); + } + + static volatile String lastMethod; + HttpClient newHttpClient(String method, boolean share) { + if (!share) return TRACKER.track(makeNewClient()); + HttpClient shared = sharedClient; + String last = lastMethod; + if (shared != null && Objects.equals(last, method)) return shared; + synchronized (this) { + shared = sharedClient; + last = lastMethod; + if (!Objects.equals(last, method)) { + // reset sharedClient to avoid side effects + // between methods. This is needed to keep the test + // expectation that the first HTTP/2 clear request + // will be an upgrade + if (shared != null) { + TRACKER.track(shared); + shared = sharedClient = null; + } + } + if (shared == null) { + shared = sharedClient = makeNewClient(); + last = lastMethod = method; + } + return shared; + } + } + static String userAgent() { return "Java-http-client/" + System.getProperty("java.version"); @@ -167,48 +320,54 @@ HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { - if (!sameClient || client == null) - client = HttpClient.newBuilder() - .proxy(NO_PROXY) - .sslContext(sslContext) - .build(); - - HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri); - if (!useDefault) { - requestBuilder.header(name, value); - } - HttpRequest request = requestBuilder.build(); - HttpResponse resp = client.send(request, BodyHandlers.ofString()); + try { + if (!sameClient || client == null) + client = newHttpClient("test", sameClient); + + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri); + if (!useDefault) { + requestBuilder.header(name, value); + } + HttpRequest request = requestBuilder.build(); + HttpResponse resp = client.send(request, BodyHandlers.ofString()); - out.println("Got response: " + resp); - out.println("Got body: " + resp.body()); - assertEquals(resp.statusCode(), 200, - "Expected 200, got:" + resp.statusCode()); - - boolean isInitialRequest = i == 0; - boolean isSecure = uri.getScheme().equalsIgnoreCase("https"); - boolean isHTTP2 = resp.version() == HTTP_2; - boolean isNotH2CUpgrade = isSecure || (sameClient == true && !isInitialRequest); - boolean isDefaultHostHeader = name.equalsIgnoreCase("host") && useDefault; - - // By default, HTTP/2 sets the `:authority:` pseudo-header, instead - // of the `Host` header. Therefore, there should be no "X-Host" - // header in the response, except the response to the h2c Upgrade - // request which will have been sent through HTTP/1.1. - - if (isDefaultHostHeader && isHTTP2 && isNotH2CUpgrade) { - assertTrue(resp.headers().firstValue("X-" + key).isEmpty()); - assertTrue(resp.headers().allValues("X-" + key).isEmpty()); - out.println("No X-" + key + " header received, as expected"); - } else { - String receivedHeaderString = value == null ? null - : resp.headers().firstValue("X-"+key).get(); - out.println("Got X-" + key + ": " + resp.headers().allValues("X-"+key)); - if (value != null) { - assertEquals(receivedHeaderString, value); - assertEquals(resp.headers().allValues("X-"+key), List.of(value)); + out.println("Got response: " + resp); + out.println("Got body: " + resp.body()); + assertEquals(resp.statusCode(), 200, + "Expected 200, got:" + resp.statusCode()); + + boolean isInitialRequest = i == 0; + boolean isSecure = uri.getScheme().equalsIgnoreCase("https"); + boolean isHTTP2 = resp.version() == HTTP_2; + boolean isNotH2CUpgrade = isSecure || (sameClient == true && !isInitialRequest); + boolean isDefaultHostHeader = name.equalsIgnoreCase("host") && useDefault; + + // By default, HTTP/2 sets the `:authority:` pseudo-header, instead + // of the `Host` header. Therefore, there should be no "X-Host" + // header in the response, except the response to the h2c Upgrade + // request which will have been sent through HTTP/1.1. + + if (isDefaultHostHeader && isHTTP2 && isNotH2CUpgrade) { + assertTrue(resp.headers().firstValue("X-" + key).isEmpty()); + assertTrue(resp.headers().allValues("X-" + key).isEmpty()); + out.println("No X-" + key + " header received, as expected"); } else { - assertEquals(resp.headers().allValues("X-"+key).size(), 0); + String receivedHeaderString = value == null ? null + : resp.headers().firstValue("X-" + key).orElse(null); + out.println("Got X-" + key + ": " + resp.headers().allValues("X-" + key)); + if (value != null) { + assertEquals(receivedHeaderString, value); + assertEquals(resp.headers().allValues("X-" + key), List.of(value)); + } else { + assertEquals(resp.headers().allValues("X-" + key).size(), 0); + } + } + } finally { + if (!sameClient) { + client = null; + System.gc(); + var error = TRACKER.check(500); + if (error != null) throw error; } } } @@ -223,42 +382,61 @@ out.println("\n--- Starting "); final URI uri = URI.create(uriString); - HttpClient client = HttpClient.newBuilder() - .proxy(NO_PROXY) - .sslContext(sslContext) - .build(); + HttpClient client = newHttpClient("testHomeMadeIllegalHeader", sameClient); - // Test a request which contains an illegal header created - HttpRequest req = new HttpRequest() { - @Override public Optional bodyPublisher() { - return Optional.of(BodyPublishers.noBody()); - } - @Override public String method() { - return "GET"; - } - @Override public Optional timeout() { - return Optional.empty(); - } - @Override public boolean expectContinue() { - return false; - } - @Override public URI uri() { - return uri; - } - @Override public Optional version() { - return Optional.empty(); + try { + // Test a request which contains an illegal header created + HttpRequest req = new HttpRequest() { + @Override + public Optional bodyPublisher() { + return Optional.of(BodyPublishers.noBody()); + } + + @Override + public String method() { + return "GET"; + } + + @Override + public Optional timeout() { + return Optional.empty(); + } + + @Override + public boolean expectContinue() { + return false; + } + + @Override + public URI uri() { + return uri; + } + + @Override + public Optional version() { + return Optional.empty(); + } + + @Override + public HttpHeaders headers() { + Map> map = Map.of("upgrade", List.of("http://foo.com")); + return HttpHeaders.of(map, (x, y) -> true); + } + }; + + try { + HttpResponse response = client.send(req, BodyHandlers.ofString()); + Assert.fail("Unexpected reply: " + response); + } catch (IllegalArgumentException ee) { + out.println("Got IAE as expected"); } - @Override public HttpHeaders headers() { - Map> map = Map.of("upgrade", List.of("http://foo.com")); - return HttpHeaders.of(map, (x, y) -> true); + } finally { + if (!sameClient) { + client = null; + System.gc(); + var error = TRACKER.check(500); + if (error != null) throw error; } - }; - - try { - HttpResponse response = client.send(req, BodyHandlers.ofString()); - Assert.fail("Unexpected reply: " + response); - } catch (IllegalArgumentException ee) { - out.println("Got IAE as expected"); } } @@ -276,52 +454,59 @@ HttpClient client = null; for (int i=0; i< ITERATION_COUNT; i++) { - if (!sameClient || client == null) - client = HttpClient.newBuilder() - .proxy(NO_PROXY) - .sslContext(sslContext) - .build(); - - HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri); - if (!useDefault) { - requestBuilder.header(name, value); - } - HttpRequest request = requestBuilder.build(); + try { + if (!sameClient || client == null) + client = newHttpClient("testAsync", sameClient); + + HttpRequest.Builder requestBuilder = HttpRequest.newBuilder(uri); + if (!useDefault) { + requestBuilder.header(name, value); + } + HttpRequest request = requestBuilder.build(); - boolean isInitialRequest = i == 0; - boolean isSecure = uri.getScheme().equalsIgnoreCase("https"); - boolean isNotH2CUpgrade = isSecure || (sameClient == true && !isInitialRequest); - boolean isDefaultHostHeader = name.equalsIgnoreCase("host") && useDefault; - - client.sendAsync(request, BodyHandlers.ofString()) - .thenApply(response -> { - out.println("Got response: " + response); - out.println("Got body: " + response.body()); - assertEquals(response.statusCode(), 200); - return response;}) - .thenAccept(resp -> { - // By default, HTTP/2 sets the `:authority:` pseudo-header, instead - // of the `Host` header. Therefore, there should be no "X-Host" - // header in the response, except the response to the h2c Upgrade - // request which will have been sent through HTTP/1.1. - - if (isDefaultHostHeader && resp.version() == HTTP_2 && isNotH2CUpgrade) { - assertTrue(resp.headers().firstValue("X-" + key).isEmpty()); - assertTrue(resp.headers().allValues("X-" + key).isEmpty()); - out.println("No X-" + key + " header received, as expected"); - } else { - String receivedHeaderString = value == null ? null - : resp.headers().firstValue("X-"+key).get(); - out.println("Got X-" + key + ": " + resp.headers().allValues("X-"+key)); - if (value != null) { - assertEquals(receivedHeaderString, value); - assertEquals(resp.headers().allValues("X-" + key), List.of(value)); + boolean isInitialRequest = i == 0; + boolean isSecure = uri.getScheme().equalsIgnoreCase("https"); + boolean isNotH2CUpgrade = isSecure || (sameClient == true && !isInitialRequest); + boolean isDefaultHostHeader = name.equalsIgnoreCase("host") && useDefault; + + client.sendAsync(request, BodyHandlers.ofString()) + .thenApply(response -> { + out.println("Got response: " + response); + out.println("Got body: " + response.body()); + assertEquals(response.statusCode(), 200); + return response; + }) + .thenAccept(resp -> { + // By default, HTTP/2 sets the `:authority:` pseudo-header, instead + // of the `Host` header. Therefore, there should be no "X-Host" + // header in the response, except the response to the h2c Upgrade + // request which will have been sent through HTTP/1.1. + + if (isDefaultHostHeader && resp.version() == HTTP_2 && isNotH2CUpgrade) { + assertTrue(resp.headers().firstValue("X-" + key).isEmpty()); + assertTrue(resp.headers().allValues("X-" + key).isEmpty()); + out.println("No X-" + key + " header received, as expected"); } else { - assertEquals(resp.headers().allValues("X-" + key).size(), 1); + String receivedHeaderString = value == null ? null + : resp.headers().firstValue("X-" + key).orElse(null); + out.println("Got X-" + key + ": " + resp.headers().allValues("X-" + key)); + if (value != null) { + assertEquals(receivedHeaderString, value); + assertEquals(resp.headers().allValues("X-" + key), List.of(value)); + } else { + assertEquals(resp.headers().allValues("X-" + key).size(), 1); + } } - } - }) - .join(); + }) + .join(); + } finally { + if (!sameClient) { + client = null; + System.gc(); + var error = TRACKER.check(500); + if (error != null) throw error; + } + } } } @@ -364,10 +549,27 @@ @AfterTest public void teardown() throws Exception { - httpTestServer.stop(); - httpsTestServer.stop(); - http2TestServer.stop(); - https2TestServer.stop(); + HttpClient shared = sharedClient; + String sharedClientName = + shared == null ? null : shared.toString(); + if (shared != null) TRACKER.track(shared); + shared = sharedClient = null; + Thread.sleep(100); + AssertionError fail = TRACKER.check(500); + try { + httpTestServer.stop(); + httpsTestServer.stop(); + http2TestServer.stop(); + https2TestServer.stop(); + executor.shutdown(); + } finally { + if (fail != null) { + if (sharedClientName != null) { + err.println("Shared client name is: " + sharedClientName); + } + throw fail; + } + } } /** A handler that returns, as its body, the exact received request URI. @@ -379,9 +581,11 @@ public void handle(HttpTestExchange t) throws IOException { URI uri = t.getRequestURI(); String uriString = uri.toString(); - out.println("Http1UriStringHandler received, uri: " + uriString); + out.println("HttpUriStringHandler received, uri: " + uriString); String query = uri.getQuery(); String headerName = query.substring(query.indexOf("=")+1).trim(); + out.println("HttpUriStringHandler received, headerName: " + headerName + + "\n\theaders: " + t.getRequestHeaders()); try (InputStream is = t.getRequestBody(); OutputStream os = t.getResponseBody()) { is.readAllBytes(); diff -Nru openjdk-17-17.0.9+9/test/jdk/java/nio/Buffer/BulkPutBuffer.java openjdk-17-17.0.10+7/test/jdk/java/nio/Buffer/BulkPutBuffer.java --- openjdk-17-17.0.9+9/test/jdk/java/nio/Buffer/BulkPutBuffer.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/nio/Buffer/BulkPutBuffer.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -51,8 +51,8 @@ * @test * @bug 8219014 8245121 * @summary Ensure that a bulk put of a buffer into another is correct. - * @compile --enable-preview -source ${jdk.version} BulkPutBuffer.java - * @run testng/othervm --enable-preview BulkPutBuffer + * @compile BulkPutBuffer.java + * @run testng/othervm BulkPutBuffer */ public class BulkPutBuffer { static final long SEED = System.nanoTime(); diff -Nru openjdk-17-17.0.9+9/test/jdk/java/nio/file/FileStore/Basic.java openjdk-17-17.0.10+7/test/jdk/java/nio/file/FileStore/Basic.java --- openjdk-17-17.0.9+9/test/jdk/java/nio/file/FileStore/Basic.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/nio/file/FileStore/Basic.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -57,10 +57,14 @@ throw new RuntimeException("Assertion failed"); } - static void checkWithin1GB(long value1, long value2) { - long diff = Math.abs(value1 - value2); - if (diff > G) - throw new RuntimeException("values differ by more than 1GB"); + static void checkWithin1GB(String space, long expected, long actual) { + long diff = Math.abs(actual - expected); + if (diff > G) { + String msg = String.format("%s: |actual %d - expected %d| = %d (%f G)", + space, actual, expected, diff, + (float)diff/G); + throw new RuntimeException(msg); + } } static void doTests(Path dir) throws IOException { @@ -107,19 +111,19 @@ * Test: Space atributes */ File f = file1.toFile(); - long total = f.getTotalSpace(); - long free = f.getFreeSpace(); - long usable = f.getUsableSpace(); // check values are "close" - checkWithin1GB(total, store1.getTotalSpace()); - checkWithin1GB(free, store1.getUnallocatedSpace()); - checkWithin1GB(usable, store1.getUsableSpace()); + checkWithin1GB("total", f.getTotalSpace(), store1.getTotalSpace()); + checkWithin1GB("free", f.getFreeSpace(), store1.getUnallocatedSpace()); + checkWithin1GB("usable", f.getUsableSpace(), store1.getUsableSpace()); // get values by name - checkWithin1GB(total, (Long)store1.getAttribute("totalSpace")); - checkWithin1GB(free, (Long)store1.getAttribute("unallocatedSpace")); - checkWithin1GB(usable, (Long)store1.getAttribute("usableSpace")); + checkWithin1GB("total", f.getTotalSpace(), + (Long)store1.getAttribute("totalSpace")); + checkWithin1GB("free", f.getFreeSpace(), + (Long)store1.getAttribute("unallocatedSpace")); + checkWithin1GB("usable", f.getUsableSpace(), + (Long)store1.getAttribute("usableSpace")); /** * Test: Enumerate all FileStores diff -Nru openjdk-17-17.0.9+9/test/jdk/java/nio/file/Files/CopyAndMove.java openjdk-17-17.0.10+7/test/jdk/java/nio/file/Files/CopyAndMove.java --- openjdk-17-17.0.9+9/test/jdk/java/nio/file/Files/CopyAndMove.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/nio/file/Files/CopyAndMove.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 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 @@ -892,7 +892,7 @@ if (supportsLinks) { source = createSourceFile(dir1); link = dir1.resolve("link"); - createSymbolicLink(link, source); + createSymbolicLink(link, source.getFileName()); target = getTargetFile(dir2); copyAndVerify(link, target); delete(link); diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/Formatter/Padding.java openjdk-17-17.0.10+7/test/jdk/java/util/Formatter/Padding.java --- openjdk-17-17.0.9+9/test/jdk/java/util/Formatter/Padding.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/Formatter/Padding.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,313 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4906370 + * @summary Tests to excercise padding on int and double values, + * with various flag combinations. + * @run junit Padding + */ + +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +public class Padding { + + static Arguments[] padding() { + return new Arguments[] { + /* blank padding, right adjusted, optional plus sign */ + arguments("12", "%1d", 12), + arguments("12", "%2d", 12), + arguments(" 12", "%3d", 12), + arguments(" 12", "%4d", 12), + arguments(" 12", "%5d", 12), + arguments(" 12", "%10d", 12), + + arguments("-12", "%1d", -12), + arguments("-12", "%2d", -12), + arguments("-12", "%3d", -12), + arguments(" -12", "%4d", -12), + arguments(" -12", "%5d", -12), + arguments(" -12", "%10d", -12), + + arguments("1.2", "%1.1f", 1.2), + arguments("1.2", "%2.1f", 1.2), + arguments("1.2", "%3.1f", 1.2), + arguments(" 1.2", "%4.1f", 1.2), + arguments(" 1.2", "%5.1f", 1.2), + arguments(" 1.2", "%10.1f", 1.2), + + arguments("-1.2", "%1.1f", -1.2), + arguments("-1.2", "%2.1f", -1.2), + arguments("-1.2", "%3.1f", -1.2), + arguments("-1.2", "%4.1f", -1.2), + arguments(" -1.2", "%5.1f", -1.2), + arguments(" -1.2", "%10.1f", -1.2), + + /* blank padding, right adjusted, mandatory plus sign */ + arguments("+12", "%+1d", 12), + arguments("+12", "%+2d", 12), + arguments("+12", "%+3d", 12), + arguments(" +12", "%+4d", 12), + arguments(" +12", "%+5d", 12), + arguments(" +12", "%+10d", 12), + + arguments("-12", "%+1d", -12), + arguments("-12", "%+2d", -12), + arguments("-12", "%+3d", -12), + arguments(" -12", "%+4d", -12), + arguments(" -12", "%+5d", -12), + arguments(" -12", "%+10d", -12), + + arguments("+1.2", "%+1.1f", 1.2), + arguments("+1.2", "%+2.1f", 1.2), + arguments("+1.2", "%+3.1f", 1.2), + arguments("+1.2", "%+4.1f", 1.2), + arguments(" +1.2", "%+5.1f", 1.2), + arguments(" +1.2", "%+10.1f", 1.2), + + arguments("-1.2", "%+1.1f", -1.2), + arguments("-1.2", "%+2.1f", -1.2), + arguments("-1.2", "%+3.1f", -1.2), + arguments("-1.2", "%+4.1f", -1.2), + arguments(" -1.2", "%+5.1f", -1.2), + arguments(" -1.2", "%+10.1f", -1.2), + + /* blank padding, right adjusted, mandatory blank sign */ + arguments(" 12", "% 1d", 12), + arguments(" 12", "% 2d", 12), + arguments(" 12", "% 3d", 12), + arguments(" 12", "% 4d", 12), + arguments(" 12", "% 5d", 12), + arguments(" 12", "% 10d", 12), + + arguments("-12", "% 1d", -12), + arguments("-12", "% 2d", -12), + arguments("-12", "% 3d", -12), + arguments(" -12", "% 4d", -12), + arguments(" -12", "% 5d", -12), + arguments(" -12", "% 10d", -12), + + arguments(" 1.2", "% 1.1f", 1.2), + arguments(" 1.2", "% 2.1f", 1.2), + arguments(" 1.2", "% 3.1f", 1.2), + arguments(" 1.2", "% 4.1f", 1.2), + arguments(" 1.2", "% 5.1f", 1.2), + arguments(" 1.2", "% 10.1f", 1.2), + + arguments("-1.2", "% 1.1f", -1.2), + arguments("-1.2", "% 2.1f", -1.2), + arguments("-1.2", "% 3.1f", -1.2), + arguments("-1.2", "% 4.1f", -1.2), + arguments(" -1.2", "% 5.1f", -1.2), + arguments(" -1.2", "% 10.1f", -1.2), + + /* blank padding, left adjusted, optional sign */ + arguments("12", "%-1d", 12), + arguments("12", "%-2d", 12), + arguments("12 ", "%-3d", 12), + arguments("12 ", "%-4d", 12), + arguments("12 ", "%-5d", 12), + arguments("12 ", "%-10d", 12), + + arguments("-12", "%-1d", -12), + arguments("-12", "%-2d", -12), + arguments("-12", "%-3d", -12), + arguments("-12 ", "%-4d", -12), + arguments("-12 ", "%-5d", -12), + arguments("-12 ", "%-10d", -12), + + arguments("1.2", "%-1.1f", 1.2), + arguments("1.2", "%-2.1f", 1.2), + arguments("1.2", "%-3.1f", 1.2), + arguments("1.2 ", "%-4.1f", 1.2), + arguments("1.2 ", "%-5.1f", 1.2), + arguments("1.2 ", "%-10.1f", 1.2), + + arguments("-1.2", "%-1.1f", -1.2), + arguments("-1.2", "%-2.1f", -1.2), + arguments("-1.2", "%-3.1f", -1.2), + arguments("-1.2", "%-4.1f", -1.2), + arguments("-1.2 ", "%-5.1f", -1.2), + arguments("-1.2 ", "%-10.1f", -1.2), + + /* blank padding, left adjusted, mandatory plus sign */ + arguments("+12", "%-+1d", 12), + arguments("+12", "%-+2d", 12), + arguments("+12", "%-+3d", 12), + arguments("+12 ", "%-+4d", 12), + arguments("+12 ", "%-+5d", 12), + arguments("+12 ", "%-+10d", 12), + + arguments("-12", "%-+1d", -12), + arguments("-12", "%-+2d", -12), + arguments("-12", "%-+3d", -12), + arguments("-12 ", "%-+4d", -12), + arguments("-12 ", "%-+5d", -12), + arguments("-12 ", "%-+10d", -12), + + arguments("+1.2", "%-+1.1f", 1.2), + arguments("+1.2", "%-+2.1f", 1.2), + arguments("+1.2", "%-+3.1f", 1.2), + arguments("+1.2", "%-+4.1f", 1.2), + arguments("+1.2 ", "%-+5.1f", 1.2), + arguments("+1.2 ", "%-+10.1f", 1.2), + + arguments("-1.2", "%-+1.1f", -1.2), + arguments("-1.2", "%-+2.1f", -1.2), + arguments("-1.2", "%-+3.1f", -1.2), + arguments("-1.2", "%-+4.1f", -1.2), + arguments("-1.2 ", "%-+5.1f", -1.2), + arguments("-1.2 ", "%-+10.1f", -1.2), + + /* blank padding, left adjusted, mandatory blank sign */ + arguments(" 12", "%- 1d", 12), + arguments(" 12", "%- 2d", 12), + arguments(" 12", "%- 3d", 12), + arguments(" 12 ", "%- 4d", 12), + arguments(" 12 ", "%- 5d", 12), + arguments(" 12 ", "%- 10d", 12), + + arguments("-12", "%- 1d", -12), + arguments("-12", "%- 2d", -12), + arguments("-12", "%- 3d", -12), + arguments("-12 ", "%- 4d", -12), + arguments("-12 ", "%- 5d", -12), + arguments("-12 ", "%- 10d", -12), + + arguments(" 1.2", "%- 1.1f", 1.2), + arguments(" 1.2", "%- 2.1f", 1.2), + arguments(" 1.2", "%- 3.1f", 1.2), + arguments(" 1.2", "%- 4.1f", 1.2), + arguments(" 1.2 ", "%- 5.1f", 1.2), + arguments(" 1.2 ", "%- 10.1f", 1.2), + + arguments("-1.2", "%- 1.1f", -1.2), + arguments("-1.2", "%- 2.1f", -1.2), + arguments("-1.2", "%- 3.1f", -1.2), + arguments("-1.2", "%- 4.1f", -1.2), + arguments("-1.2 ", "%- 5.1f", -1.2), + arguments("-1.2 ", "%- 10.1f", -1.2), + + /* zero padding, right adjusted, optional sign */ + arguments("12", "%01d", 12), + arguments("12", "%02d", 12), + arguments("012", "%03d", 12), + arguments("0012", "%04d", 12), + arguments("00012", "%05d", 12), + arguments("0000000012", "%010d", 12), + + arguments("-12", "%01d", -12), + arguments("-12", "%02d", -12), + arguments("-12", "%03d", -12), + arguments("-012", "%04d", -12), + arguments("-0012", "%05d", -12), + arguments("-000000012", "%010d", -12), + + arguments("1.2", "%01.1f", 1.2), + arguments("1.2", "%02.1f", 1.2), + arguments("1.2", "%03.1f", 1.2), + arguments("01.2", "%04.1f", 1.2), + arguments("001.2", "%05.1f", 1.2), + arguments("00000001.2", "%010.1f", 1.2), + + arguments("-1.2", "%01.1f", -1.2), + arguments("-1.2", "%02.1f", -1.2), + arguments("-1.2", "%03.1f", -1.2), + arguments("-1.2", "%04.1f", -1.2), + arguments("-01.2", "%05.1f", -1.2), + arguments("-0000001.2", "%010.1f", -1.2), + + /* zero padding, right adjusted, mandatory plus sign */ + arguments("+12", "%+01d", 12), + arguments("+12", "%+02d", 12), + arguments("+12", "%+03d", 12), + arguments("+012", "%+04d", 12), + arguments("+0012", "%+05d", 12), + arguments("+000000012", "%+010d", 12), + + arguments("-12", "%+01d", -12), + arguments("-12", "%+02d", -12), + arguments("-12", "%+03d", -12), + arguments("-012", "%+04d", -12), + arguments("-0012", "%+05d", -12), + arguments("-000000012", "%+010d", -12), + + arguments("+1.2", "%+01.1f", 1.2), + arguments("+1.2", "%+02.1f", 1.2), + arguments("+1.2", "%+03.1f", 1.2), + arguments("+1.2", "%+04.1f", 1.2), + arguments("+01.2", "%+05.1f", 1.2), + arguments("+0000001.2", "%+010.1f", 1.2), + + arguments("-1.2", "%+01.1f", -1.2), + arguments("-1.2", "%+02.1f", -1.2), + arguments("-1.2", "%+03.1f", -1.2), + arguments("-1.2", "%+04.1f", -1.2), + arguments("-01.2", "%+05.1f", -1.2), + arguments("-0000001.2", "%+010.1f", -1.2), + + /* zero padding, right adjusted, mandatory blank sign */ + arguments(" 12", "% 01d", 12), + arguments(" 12", "% 02d", 12), + arguments(" 12", "% 03d", 12), + arguments(" 012", "% 04d", 12), + arguments(" 0012", "% 05d", 12), + arguments(" 000000012", "% 010d", 12), + + arguments("-12", "% 01d", -12), + arguments("-12", "% 02d", -12), + arguments("-12", "% 03d", -12), + arguments("-012", "% 04d", -12), + arguments("-0012", "% 05d", -12), + arguments("-000000012", "% 010d", -12), + + arguments(" 1.2", "% 01.1f", 1.2), + arguments(" 1.2", "% 02.1f", 1.2), + arguments(" 1.2", "% 03.1f", 1.2), + arguments(" 1.2", "% 04.1f", 1.2), + arguments(" 01.2", "% 05.1f", 1.2), + arguments(" 0000001.2", "% 010.1f", 1.2), + + arguments("-1.2", "% 01.1f", -1.2), + arguments("-1.2", "% 02.1f", -1.2), + arguments("-1.2", "% 03.1f", -1.2), + arguments("-1.2", "% 04.1f", -1.2), + arguments("-01.2", "% 05.1f", -1.2), + arguments("-0000001.2", "% 010.1f", -1.2), + + }; + } + + @ParameterizedTest + @MethodSource + void padding(String expected, String format, Object value) { + assertEquals(expected, String.format(format, value)); + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/Random/RandomTestBsi1999.java openjdk-17-17.0.10+7/test/jdk/java/util/Random/RandomTestBsi1999.java --- openjdk-17-17.0.9+9/test/jdk/java/util/Random/RandomTestBsi1999.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/Random/RandomTestBsi1999.java 2024-01-09 21:18:15.000000000 +0000 @@ -43,9 +43,9 @@ /** * @test - * @summary test bit sequences produced by clases that implement interface RandomGenerator + * @summary test bit sequences produced by classes that implement interface RandomGenerator * @bug 8248862 - * @run main RandomTestBsi1999 + * @run main/othervm/timeout=400 RandomTestBsi1999 * @key randomness */ diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java openjdk-17-17.0.10+7/test/jdk/java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java --- openjdk-17-17.0.9+9/test/jdk/java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 6602600 - * @run main/othervm -Xmx8m BasicCancelTest + * @run main/othervm -Xmx64m BasicCancelTest * @summary Check effectiveness of RemoveOnCancelPolicy */ @@ -76,7 +76,7 @@ // Needed to avoid OOME pool.setRemoveOnCancelPolicy(true); - final long moreThanYouCanChew = Runtime.getRuntime().freeMemory() / 4; + final long moreThanYouCanChew = Runtime.getRuntime().maxMemory() / 32; System.out.printf("moreThanYouCanChew=%d%n", moreThanYouCanChew); Runnable noopTask = new Runnable() { public void run() {}}; diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/concurrent/tck/JSR166TestCase.java openjdk-17-17.0.10+7/test/jdk/java/util/concurrent/tck/JSR166TestCase.java --- openjdk-17-17.0.9+9/test/jdk/java/util/concurrent/tck/JSR166TestCase.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/concurrent/tck/JSR166TestCase.java 2024-01-09 21:18:15.000000000 +0000 @@ -35,33 +35,54 @@ */ /* - * @test - * @summary JSR-166 tck tests, in a number of variations. - * The first is the conformance testing variant, - * while others also test implementation details. + * @test id=default + * @summary Conformance testing variant of JSR-166 tck tests. + * @build * + * @modules java.management + * @run junit/othervm/timeout=1000 JSR166TestCase + */ + +/* + * @test id=security-manager + * @summary Conformance testing variant of JSR-166 tck tests + * with java security manager set to allow. * @build * * @modules java.management * @run junit/othervm/timeout=1000 -Djava.security.manager=allow JSR166TestCase + */ + +/* + * @test id=forkjoinpool-common-parallelism + * @summary Test implementation details variant of JSR-166 + * tck tests with ForkJoinPool common parallelism. + * @build * + * @modules java.management * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED - * -Djava.security.manager=allow * -Djsr166.testImplementationDetails=true + * -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 * JSR166TestCase * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED - * -Djava.security.manager=allow * -Djsr166.testImplementationDetails=true - * -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 + * -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 + * -Djava.util.secureRandomSeed=true * JSR166TestCase + */ + +/* + * @test id=others + * @summary Remaining test implementation details variant of + * JSR-166 tck tests apart from ForkJoinPool common + * parallelism. + * @build * + * @modules java.management * @run junit/othervm/timeout=1000 * --add-opens java.base/java.util.concurrent=ALL-UNNAMED * --add-opens java.base/java.lang=ALL-UNNAMED - * -Djava.security.manager=allow * -Djsr166.testImplementationDetails=true - * -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 - * -Djava.util.secureRandomSeed=true * JSR166TestCase * @run junit/othervm/timeout=1000/policy=tck.policy * --add-opens java.base/java.util.concurrent=ALL-UNNAMED diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java openjdk-17-17.0.10+7/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java --- openjdk-17-17.0.9+9/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/jar/JarFile/SignedJarPendingBlock.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,173 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @modules java.base/sun.security.tools.keytool + * @summary JARs with pending block files (where .RSA comes before .SF) should verify correctly + */ + +import jdk.security.jarsigner.JarSigner; + +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.KeyStore; +import java.util.Collections; +import java.util.jar.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipOutputStream; + +public class SignedJarPendingBlock { + + public static void main(String[] args) throws Exception { + Path jar = createJarFile(); + Path signed = signJarFile(jar); + Path pendingBlocks = moveBlockFirst(signed); + Path invalid = invalidate(pendingBlocks); + + // 1: Regular signed JAR with no pending blocks should verify + checkSigned(signed); + + // 2: Signed jar with pending blocks should verify + checkSigned(pendingBlocks); + + // 3: Invalid signed jar with pending blocks should throw SecurityException + try { + checkSigned(invalid); + throw new Exception("Expected invalid digest to be detected"); + } catch (SecurityException se) { + // Ignore + } + } + + private static void checkSigned(Path b) throws Exception { + try (JarFile jf = new JarFile(b.toFile(), true)) { + + JarEntry je = jf.getJarEntry("a.txt"); + try (InputStream in = jf.getInputStream(je)) { + in.transferTo(OutputStream.nullOutputStream()); + } + } + } + + /** + * Invalidate signed file by modifying the contents of "a.txt" + */ + private static Path invalidate(Path s) throws Exception{ + Path invalid = Path.of("pending-block-file-invalidated.jar"); + + try (ZipFile zip = new ZipFile(s.toFile()); + ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(invalid))) { + + for (ZipEntry ze : Collections.list(zip.entries())) { + String name = ze.getName(); + out.putNextEntry(new ZipEntry(name)); + + if (name.equals("a.txt")) { + // Change the contents of a.txt to trigger SignatureException + out.write("b".getBytes(StandardCharsets.UTF_8)); + } else { + try (InputStream in = zip.getInputStream(ze)) { + in.transferTo(out); + } + } + } + } + return invalid; + } + + private static Path moveBlockFirst(Path s) throws Exception { + Path b = Path.of("pending-block-file-blockfirst.jar"); + try (ZipFile in = new ZipFile(s.toFile()); + ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(b))) { + + copy("META-INF/MANIFEST.MF", in, out); + + // Switch the order of the RSA and SF files + copy("META-INF/SIGNER.RSA", in, out); + copy("META-INF/SIGNER.SF", in, out); + + copy("a.txt", in, out); + } + return b; + } + + /** + * Copy an entry from a ZipFile to a ZipOutputStream + */ + private static void copy(String name, ZipFile in, ZipOutputStream out) throws Exception { + out.putNextEntry(new ZipEntry(name)); + try (InputStream is = in.getInputStream(in.getEntry(name))) { + is.transferTo(out); + } + } + + private static Path signJarFile(Path j) throws Exception { + Path s = Path.of("pending-block-file-signed.jar"); + + Files.deleteIfExists(Path.of("ks")); + + sun.security.tools.keytool.Main.main( + ("-keystore ks -storepass changeit -keypass changeit -dname" + + " CN=SIGNER" +" -alias r -genkeypair -keyalg rsa").split(" ")); + + char[] pass = "changeit".toCharArray(); + + KeyStore ks = KeyStore.getInstance(new File("ks"), pass); + + KeyStore.PrivateKeyEntry pke = (KeyStore.PrivateKeyEntry) + ks.getEntry("r", new KeyStore.PasswordProtection(pass)); + + JarSigner signer = new JarSigner.Builder(pke) + .digestAlgorithm("SHA-256") + .signatureAlgorithm("SHA256withRSA") + .signerName("SIGNER") + .build(); + + try (ZipFile in = new ZipFile(j.toFile()); + OutputStream out = Files.newOutputStream(s)) { + signer.sign(in, out); + } + + return s; + } + + /** + * Create a jar file with single entry "a.txt" containing "a" + */ + private static Path createJarFile() throws Exception { + Path jar = Path.of("pending-block-file.jar"); + Manifest manifest = new Manifest(); + manifest.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); + try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(jar),manifest)) { + out.putNextEntry(new JarEntry("a.txt")); + out.write("a".getBytes(StandardCharsets.UTF_8)); + } + return jar; + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/zip/DeInflate.java openjdk-17-17.0.10+7/test/jdk/java/util/zip/DeInflate.java --- openjdk-17-17.0.9+9/test/jdk/java/util/zip/DeInflate.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/zip/DeInflate.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2018, 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 @@ -33,7 +33,6 @@ import java.util.*; import java.util.zip.*; -import static java.nio.charset.StandardCharsets.UTF_8; public class DeInflate { @@ -47,11 +46,12 @@ Arrays.fill(out1, (byte)0); Arrays.fill(out2, (byte)0); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - try (DeflaterOutputStream defos = new DeflaterOutputStream(baos, def)) { - defos.write(in, 0, len); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + try (DeflaterOutputStream defos = new DeflaterOutputStream(baos, def)) { + defos.write(in, 0, len); + } + out1 = baos.toByteArray(); } - out1 = baos.toByteArray(); int m = out1.length; Inflater inf = new Inflater(nowrap); @@ -118,27 +118,55 @@ } catch (ReadOnlyBufferException robe) {} } - static void check(Deflater def, byte[] in, int len, - byte[] out1, byte[] out2, boolean nowrap) + /** + * Uses the {@code def} deflater to deflate the input data {@code in} of length {@code len}. + * A new {@link Inflater} is then created within this method to inflate the deflated data. The + * inflated data is then compared with the {@code in} to assert that it matches the original + * input data. + * This method repeats these checks for the different overloaded methods of + * {@code Deflater.deflate(...)} and {@code Inflater.inflate(...)} + * + * @param def the deflater to use for deflating the contents in {@code in} + * @param in the input content + * @param len the length of the input content to use + * @param nowrap will be passed to the constructor of the {@code Inflater} used in this + * method + * @throws Throwable if any error occurs during the check + */ + static void check(Deflater def, byte[] in, int len, boolean nowrap) throws Throwable { - Arrays.fill(out1, (byte)0); - Arrays.fill(out2, (byte)0); - + byte[] tempBuffer = new byte[1024]; + byte[] out1, out2; + int m = 0, n = 0; + Inflater inf = new Inflater(nowrap); def.setInput(in, 0, len); def.finish(); - int m = def.deflate(out1); - Inflater inf = new Inflater(nowrap); - inf.setInput(out1, 0, m); - int n = inf.inflate(out2); - - if (n != len || - !Arrays.equals(Arrays.copyOf(in, len), Arrays.copyOf(out2, len)) || - inf.inflate(out2) != 0) { - System.out.printf("m=%d, n=%d, len=%d, eq=%b%n", - m, n, len, Arrays.equals(in, out2)); - throw new RuntimeException("De/inflater failed:" + def); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + while (!def.finished()) { + int temp_counter = def.deflate(tempBuffer); + m += temp_counter; + baos.write(tempBuffer, 0, temp_counter); + } + out1 = baos.toByteArray(); + baos.reset(); + + inf.setInput(out1, 0, m); + + while (!inf.finished()) { + int temp_counter = inf.inflate(tempBuffer); + n += temp_counter; + baos.write(tempBuffer, 0, temp_counter); + } + out2 = baos.toByteArray(); + if (n != len || + !Arrays.equals(in, 0, len, out2, 0, len) || + inf.inflate(out2) != 0) { + System.out.printf("m=%d, n=%d, len=%d, eq=%b%n", + m, n, len, Arrays.equals(in, out2)); + throw new RuntimeException("De/inflater failed:" + def); + } } // readable @@ -285,9 +313,10 @@ for (int i = 0; i < 5; i++) { int len = (i == 0)? dataIn.length : new Random().nextInt(dataIn.length); + System.out.println("iteration: " + (i + 1) + " input length: " + len); // use a new deflater Deflater def = newDeflater(level, strategy, dowrap, dataOut2); - check(def, dataIn, len, dataOut1, dataOut2, dowrap); + check(def, dataIn, len, dowrap); def.end(); // reuse the deflater (with reset) and test on stream, which diff -Nru openjdk-17-17.0.9+9/test/jdk/java/util/zip/ZipFile/ZipFileDuplicateEntryTest.java openjdk-17-17.0.10+7/test/jdk/java/util/zip/ZipFile/ZipFileDuplicateEntryTest.java --- openjdk-17-17.0.9+9/test/jdk/java/util/zip/ZipFile/ZipFileDuplicateEntryTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/java/util/zip/ZipFile/ZipFileDuplicateEntryTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,581 @@ +/* + * Copyright (c) 2021, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import org.testng.annotations.AfterTest; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.ByteArrayOutputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.JarURLConnection; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Formatter; +import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.JarInputStream; +import java.util.jar.JarOutputStream; +import java.util.stream.Collectors; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; + +import static org.testng.Assert.*; + +/** + * @test + * @bug 8276123 + * @summary ZipFile::getEntry will not return a file entry when there is a + * directory entry of the same name within a Zip File + * @run testng/othervm ZipFileDuplicateEntryTest + */ +public class ZipFileDuplicateEntryTest { + + /** + * Name to use for creating Zip entries + */ + private static final String ENTRY_NAME = "entry"; + + /** + * Zip and Jar files to be created + */ + private static final Path ZIP_FILE = Paths.get("fileDirEntry.zip"); + private static final Path ZIP_FILE2 = Paths.get("OnlyDirEntry.zip"); + private static final Path DUPLICATE_FILE_ENTRY_FILE = Paths.get("DupFIleEntry.zip"); + private static final Path TEST_JAR = Paths.get("fileDirEntry.jar"); + + /** + * Directory entry added to the Zip File. + */ + private static final Entry DIR_ENTRY = + Entry.of(ENTRY_NAME + "/", ZipEntry.DEFLATED, + "I am a Directory"); + + /** + * File entry added to the Zip File. + */ + private static final Entry FILE_ENTRY = + Entry.of(ENTRY_NAME, ZipEntry.DEFLATED, "I am a File"); + + /** + * Duplicate File entry added to the Zip file. This is the 2nd entry added + * to the Zip file and is expected to be returned. + */ + private static final Entry DUPLICATE_FILE_ENTRY = + Entry.of(ENTRY_NAME, ZipEntry.DEFLATED, "Yet another File"); + /** + * Entries expected to be returned via ZipFile::stream + */ + private static final List EXPECTED_ENTRIES = + Arrays.asList(FILE_ENTRY.name, DIR_ENTRY.name); + + /** + * Max buffer size for readAllBytes method which can be used when + * InputStream::readAllBytes is not available + */ + private static final int MAX_BUFFER_SIZE = 1024; + + /** + * Flag to enable test output + */ + private static final boolean DEBUG = false; + + /** + * Array representing a Jar File with the entries: + * Name: entry, contents: "I am a File" + * Name: entry, contents: "Yet another File" + * See createByteArray() + */ + private static final byte[] DUPLICATE_ENTRY_JAR_BYTES = { + (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, (byte) 0x14, (byte) 0x0, (byte) 0x0, (byte) 0x8, + (byte) 0x8, (byte) 0x0, (byte) 0x60, (byte) 0x59, (byte) 0x55, (byte) 0x53, (byte) 0x8e, (byte) 0x39, + (byte) 0x14, (byte) 0x49, (byte) 0xd, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xb, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x5, (byte) 0x0, (byte) 0x14, (byte) 0x0, (byte) 0x65, (byte) 0x6e, + (byte) 0x74, (byte) 0x72, (byte) 0x79, (byte) 0x1, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0xb, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xd, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xf3, + (byte) 0x54, (byte) 0x48, (byte) 0xcc, (byte) 0x55, (byte) 0x48, (byte) 0x54, (byte) 0x70, (byte) 0xcb, + (byte) 0xcc, (byte) 0x49, (byte) 0x5, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x3, (byte) 0x4, + (byte) 0x14, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x60, (byte) 0x59, + (byte) 0x55, (byte) 0x53, (byte) 0xe1, (byte) 0x4c, (byte) 0x29, (byte) 0xa4, (byte) 0x12, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x5, (byte) 0x0, + (byte) 0x14, (byte) 0x0, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x72, (byte) 0x79, (byte) 0x1, + (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x12, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x8b, (byte) 0x4c, (byte) 0x2d, (byte) 0x51, (byte) 0x48, + (byte) 0xcc, (byte) 0xcb, (byte) 0x2f, (byte) 0xc9, (byte) 0x48, (byte) 0x2d, (byte) 0x52, (byte) 0x70, + (byte) 0xcb, (byte) 0xcc, (byte) 0x49, (byte) 0x5, (byte) 0x0, (byte) 0x50, (byte) 0x4b, (byte) 0x1, + (byte) 0x2, (byte) 0x14, (byte) 0x0, (byte) 0x14, (byte) 0x0, (byte) 0x0, (byte) 0x8, (byte) 0x8, + (byte) 0x0, (byte) 0x60, (byte) 0x59, (byte) 0x55, (byte) 0x53, (byte) 0x8e, (byte) 0x39, (byte) 0x14, + (byte) 0x49, (byte) 0xd, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0xb, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x5, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x65, (byte) 0x6e, (byte) 0x74, (byte) 0x72, (byte) 0x79, + (byte) 0x50, (byte) 0x4b, (byte) 0x1, (byte) 0x2, (byte) 0x14, (byte) 0x0, (byte) 0x14, (byte) 0x0, + (byte) 0x0, (byte) 0x8, (byte) 0x8, (byte) 0x0, (byte) 0x60, (byte) 0x59, (byte) 0x55, (byte) 0x53, + (byte) 0xe1, (byte) 0x4c, (byte) 0x29, (byte) 0xa4, (byte) 0x12, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x10, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x5, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x44, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x65, (byte) 0x6e, + (byte) 0x74, (byte) 0x72, (byte) 0x79, (byte) 0x50, (byte) 0x4b, (byte) 0x5, (byte) 0x6, (byte) 0x0, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x2, (byte) 0x0, (byte) 0x66, + (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x8d, (byte) 0x0, (byte) 0x0, (byte) 0x0, (byte) 0x0, + (byte) 0x0, + }; + + /** + * Create Zip files used by the tests. + * + * @throws IOException If an error occurs + */ + @BeforeTest + public static void setup() throws IOException { + + /** + * Zip contains two entries named "entry" and "entry/" + */ + Files.deleteIfExists(ZIP_FILE); + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(ZIP_FILE))) { + zos.putNextEntry(new ZipEntry(FILE_ENTRY.name)); + zos.write(FILE_ENTRY.bytes); + zos.closeEntry(); + zos.putNextEntry(new ZipEntry(DIR_ENTRY.name)); + zos.write(DIR_ENTRY.bytes); + zos.closeEntry(); + } + + /** + * Jar contains two entries named "entry" and "entry/" + */ + Files.deleteIfExists(TEST_JAR); + try (JarOutputStream jos = new JarOutputStream(Files.newOutputStream(TEST_JAR))) { + jos.putNextEntry(new JarEntry(FILE_ENTRY.name)); + jos.write(FILE_ENTRY.bytes); + jos.closeEntry(); + jos.putNextEntry(new JarEntry(DIR_ENTRY.name)); + jos.write(DIR_ENTRY.bytes); + jos.closeEntry(); + } + + /** + * Zip contains the entry "entry/" + */ + Files.deleteIfExists(ZIP_FILE2); + try (ZipOutputStream zos = new ZipOutputStream(Files.newOutputStream(ZIP_FILE2))) { + zos.putNextEntry(new ZipEntry(DIR_ENTRY.name)); + zos.write(DIR_ENTRY.bytes); + zos.closeEntry(); + } + + /** + * Create a Jar that contains two entries named "entry" + */ + Files.deleteIfExists(DUPLICATE_FILE_ENTRY_FILE); + Files.write(DUPLICATE_FILE_ENTRY_FILE, DUPLICATE_ENTRY_JAR_BYTES); + } + + /** + * Clean up after the test run + * + * @throws IOException If an error occurs + */ + @AfterTest + public static void cleanup() throws IOException { + Files.deleteIfExists(ZIP_FILE); + Files.deleteIfExists(ZIP_FILE2); + Files.deleteIfExists(DUPLICATE_FILE_ENTRY_FILE); + Files.deleteIfExists(TEST_JAR); + } + + /** + * DataProvider used to specify the Zip entries to use + * + * @return The Entry to use within the test + */ + @DataProvider + public Object[][] entries() { + return new Object[][]{ + {FILE_ENTRY}, + {DIR_ENTRY} + }; + } + + /** + * Test whether ZipFile::getEntry can find a directory entry within a Zip + * file specifying "name" vs "name/" + * + * @throws IOException If an error occurs + */ + @Test + public void readDirWithoutSlash() throws IOException { + System.out.printf("%n%n**** readDirWithoutSlash ***%n"); + try (ZipFile zip = new ZipFile(ZIP_FILE2.toString())) { + ZipEntry ze = zip.getEntry(ENTRY_NAME); + if (DEBUG) { + System.out.printf(" Entry:%s, found:%s%n", ENTRY_NAME, ze != null); + } + assertNotNull(ze); + assertTrue(ze.isDirectory()); + try (InputStream in = zip.getInputStream(ze)) { + byte[] bytes = in.readAllBytes(); + if (DEBUG) { + System.out.printf("name: %s, isDirectory: %s, payload= %s%n", + ze.getName(), ze.isDirectory(), new String(bytes)); + } + assertEquals(bytes, DIR_ENTRY.bytes, + String.format("Expected payload: %s", + new String(DIR_ENTRY.bytes))); + } + } + } + + /** + * Validate that ZipFile::getEntry will return the correct entry when a file + * and directory have the same name + * + * @param entry The entry to search for + * @throws IOException If an error occurs + */ + @Test(dataProvider = "entries") + public void testSameFileDirEntryName(Entry entry) throws IOException { + System.out.printf("%n%n**** testSameFileDirEntryName ***%n"); + + try (ZipFile zip = new ZipFile(ZIP_FILE.toString())) { + ZipEntry ze = zip.getEntry(entry.name); + if (DEBUG) { + System.out.printf(" Entry:%s, found:%s%n", entry.name, ze != null); + } + assertNotNull(ze); + try (InputStream in = zip.getInputStream(ze)) { + byte[] bytes = in.readAllBytes(); + if (DEBUG) { + System.out.printf("name: %s, isDirectory: %s, payload= %s%n", + ze.getName(), ze.isDirectory(), new String(bytes)); + } + assertEquals(entry.bytes, bytes, + String.format("Expected payload: %s", new String(entry.bytes))); + } + } + } + + /** + * Validate that ZipFile::getEntry will return the correct entry, which + * is the second entry, when there are duplicate entries within the Zip file. + * + * @throws IOException If an error occurs + */ + @Test + public void DupFileEntryTest() throws IOException { + System.out.printf("%n%n**** DupFileEntryTest ***%n"); + try (ZipFile zip = + new ZipFile(DUPLICATE_FILE_ENTRY_FILE.toString())) { + ZipEntry ze = zip.getEntry(ENTRY_NAME); + if (DEBUG) { + System.out.printf(" Entry:%s, found:%s%n", ENTRY_NAME, ze != null); + } + assertNotNull(ze); + try (InputStream in = zip.getInputStream(ze)) { + byte[] bytes = in.readAllBytes(); + if (DEBUG) { + System.out.printf("name: %s, isDirectory: %s, payload= %s%n", + ze.getName(), ze.isDirectory(), new String(bytes)); + } + assertEquals(bytes, DUPLICATE_FILE_ENTRY.bytes, + String.format("Expected payload: %s", new String(DUPLICATE_FILE_ENTRY.bytes))); + } + } + } + + /** + * Verify that ZipInputStream can be used to read all Zip entries including + * a file and directory entry with the same name + * + * @throws IOException If an error occurs + */ + @Test + public void ZipInputStreamTest() throws IOException { + System.out.printf("%n%n**** ZipInputStreamTest ***%n"); + try (ZipInputStream zis = new ZipInputStream( + new FileInputStream(ZIP_FILE.toFile()))) { + ZipEntry zipEntry = zis.getNextEntry(); + assertNotNull(zipEntry); + while (zipEntry != null) { + Entry e; + if (zipEntry.getName().equals(FILE_ENTRY.name)) { + e = FILE_ENTRY; + } else if (zipEntry.getName().equals(DIR_ENTRY.name)) { + e = DIR_ENTRY; + } else { + throw new RuntimeException( + String.format("Invalid Zip entry: %s", zipEntry.getName())); + } + assertEquals(zipEntry.getMethod(), e.method); + assertEquals(zis.readAllBytes(), e.bytes, + String.format("Expected payload: %s", new String(e.bytes))); + zipEntry = zis.getNextEntry(); + } + } + } + + /** + * Verify that ZipFile::stream returns all Zip entries including + * a file and directory entry with the same name + * + * @throws IOException If an error occurs + */ + @Test + public void ZipFileStreamTest() throws IOException { + System.out.printf("%n%n**** ZipFileStreamTest ***%n"); + try (ZipFile zf = new ZipFile(ZIP_FILE.toFile())) { + List entries = zf.stream().collect(Collectors.toList()); + assertEquals(EXPECTED_ENTRIES.size(), entries.size()); + for (ZipEntry e : entries) { + assertTrue(EXPECTED_ENTRIES.contains(e.getName())); + } + } + } + + /** + * Verify that JarFile can be used to read all the entries including + * a file and directory entry with the same name + * + * @param entry The entry to validate + * @throws IOException If an error occurs + */ + @Test(dataProvider = "entries") + public static void JarFileInputStreamTest(Entry entry) throws IOException { + System.out.printf("%n%n**** JarFileInputStreamTest ***%n"); + try (JarFile jarFile = new JarFile(TEST_JAR.toFile())) { + JarEntry je = jarFile.getJarEntry(entry.name); + assertNotNull(je); + if (DEBUG) { + System.out.printf("Entry Name: %s, method: %s, Expected Method: %s%n", + entry.name, je.getMethod(), entry.method); + } + assertEquals(entry.method, je.getMethod()); + try (InputStream in = jarFile.getInputStream(je)) { + byte[] bytes = in.readAllBytes(); + if (DEBUG) { + System.out.printf("bytes= %s, expected=%s%n", + new String(bytes), new String(entry.bytes)); + } + assertEquals(bytes, entry.bytes, + String.format("Expected payload: %s", new String(entry.bytes))); + } + } + } + + /** + * Verify that JarInputStream can be used to read all entries including + * a file and directory entry with the same name + * + * @throws IOException If an error occurs + */ + @Test + public void JarInputStreamTest() throws IOException { + System.out.printf("%n%n**** JarInputStreamTest ***%n"); + try (JarInputStream jis = new JarInputStream( + new FileInputStream(TEST_JAR.toFile()))) { + JarEntry jarEntry = jis.getNextJarEntry(); + assertNotNull(jarEntry); + while (jarEntry != null) { + Entry e; + if (jarEntry.getName().equals(FILE_ENTRY.name)) { + e = FILE_ENTRY; + } else if (jarEntry.getName().equals(DIR_ENTRY.name)) { + e = DIR_ENTRY; + } else { + throw new RuntimeException( + String.format("Invalid Jar entry: %s", jarEntry.getName())); + } + assertEquals(jarEntry.getMethod(), e.method); + assertEquals(jis.readAllBytes(), e.bytes, + String.format("Expected payload: %s", new String(e.bytes))); + jarEntry = jis.getNextJarEntry(); + } + } + } + + /** + * Verify that JarURLConnection can be used to access all the entries including + * a file and directory entry with the same name within a jar file + * + * @param entry The entry to validate + * @throws IOException If an error occurs + */ + @Test(dataProvider = "entries") + public void JarURLConnectionTest(Entry entry) throws Exception { + System.out.printf("%n%n**** JarURLConnectionTest ***%n"); + URL url = new URL("jar:" + TEST_JAR.toUri().toURL() + "!/" + entry.name); + if (DEBUG) { + System.out.printf("URL=%s%n", url); + } + JarURLConnection con = (JarURLConnection) url.openConnection(); + con.connect(); + JarEntry je = con.getJarEntry(); + try (JarFile jarFile = con.getJarFile()) { + assertNotNull(je); + assertNotNull(jarFile); + assertNull(con.getAttributes()); + assertNull(con.getMainAttributes()); + assertNull(con.getManifest()); + assertEquals(je.getName(), entry.name); + assertEquals(con.getEntryName(), entry.name); + assertEquals(je.getMethod(), entry.method); + assertEquals(con.getJarFileURL(), TEST_JAR.toUri().toURL()); + if (DEBUG) { + System.out.printf(" getEntryName: %s, getJarFileURL:%s%n", + con.getEntryName(), con.getJarFileURL()); + System.out.printf(" Jar Entry= %s, size= %s%n", je.getName(), je.getSize()); + } + + try (InputStream is = jarFile.getInputStream(je)) { + byte[] bytes = is.readAllBytes(); + if (DEBUG) { + System.out.printf(" Bytes read:%s%n", new String(bytes)); + } + assertEquals(bytes, entry.bytes, + String.format("Expected payload: %s", new String(entry.bytes))); + } + } + } + + /** + * Verify that JarFile::stream returns all entries including + * a file and directory entry with the same name + * + * @throws IOException If an error occurs + */ + @Test + public void JarFileStreamTest() throws IOException { + System.out.printf("%n%n**** JarFileStreamTest ***%n"); + try (JarFile jf = new JarFile(TEST_JAR.toFile())) { + List entries = jf.stream().collect(Collectors.toList()); + assertEquals(EXPECTED_ENTRIES.size(), jf.size()); + for (JarEntry e : entries) { + assertTrue(EXPECTED_ENTRIES.contains(e.getName())); + } + } + } + + /** + * Method used to read the bytes from an InputStream. This method is + * here so that the test could be backported to JDK 8 if needed as + * InputStream::readAllBytes() does not exist + * + * @param is The InputStream to read from + * @return The byte array representing bytes read from the InputStream + * @throws IOException If an error occurs + */ + public static byte[] readAllBytes(InputStream is) throws IOException { + byte[] data = new byte[MAX_BUFFER_SIZE]; + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + int len; + while ((len = is.read(data, 0, data.length)) != -1) { + buffer.write(data, 0, len); + } + buffer.flush(); + return buffer.toByteArray(); + } + + /** + * Method used to create a byte[] representing a Jar file with + * duplicate file entries. This uses ZipArchiveOutputStream as ZipOutputStream + * will fail with a "java.util.zip.ZipException: duplicate entry". + */ +// public static void createJarWithDuplicateFileEntries() throws IOException { +// Files.deleteIfExists(DUPFILE_ENTRY_FILE); +// try (ZipArchiveOutputStream zos = +// new ZipArchiveOutputStream(DUPFILE_ENTRY_FILE.toFile())) { +// zos.putArchiveEntry(new ZipArchiveEntry(FILE_ENTRY.name)); +// zos.write(FILE_ENTRY.bytes); +// zos.putArchiveEntry(new ZipArchiveEntry(FILE_ENTRY.name)); +// zos.write("Yet another File".getBytes(StandardCharsets.UTF_8)); +// zos.closeArchiveEntry(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// byte[] jarBytes = Files.readAllBytes(DUPFILE_ENTRY_FILE); +// String result = createByteArray(jarBytes, "DUPLICATE_ENTRY_JAR_BYTES"); +// System.out.println(result); +// } + + /** + * Utility method which takes a byte array and converts to byte array + * declaration. For example: + *
+     *     {@code
+     *        var fooJar = Files.readAllBytes(Path.of("foo.jar"));
+     *        var result = createByteArray(fooJar, "FOOBYTES");
+     *      }
+     * 
+ * + * @param bytes A byte array used to create a byte array declaration + * @param name Name to be used in the byte array declaration + * @return The formatted byte array declaration + */ + public static String createByteArray(byte[] bytes, String name) { + StringBuilder sb = new StringBuilder(bytes.length * 5); + Formatter fmt = new Formatter(sb); + fmt.format(" public static byte[] %s = {", name); + final int linelen = 8; + for (int i = 0; i < bytes.length; i++) { + if (i % linelen == 0) { + fmt.format("%n "); + } + fmt.format(" (byte) 0x%x,", bytes[i] & 0xff); + } + fmt.format("%n };%n"); + return sb.toString(); + } + + /** + * Represents an entry in a Zip file. An entry encapsulates a name, a + * compression method, and its contents/data. + */ + public static class Entry { + public final String name; + public final int method; + public final byte[] bytes; + + public Entry(String name, int method, String contents) { + this.name = name; + this.method = method; + this.bytes = contents.getBytes(StandardCharsets.UTF_8); + } + + public static Entry of(String name, int method, String contents) { + return new Entry(name, method, contents); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/crypto/JceSecurity/VerificationResults.java openjdk-17-17.0.10+7/test/jdk/javax/crypto/JceSecurity/VerificationResults.java --- openjdk-17-17.0.9+9/test/jdk/javax/crypto/JceSecurity/VerificationResults.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/crypto/JceSecurity/VerificationResults.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023, BELLSOFT. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8168469 + * @summary Memory leak in JceSecurity + * @compile --add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED VerificationResults.java + * @run main/othervm -Xmx128m --add-exports java.base/com.sun.crypto.provider=ALL-UNNAMED VerificationResults + */ + +import java.security.NoSuchAlgorithmException; +import java.security.Provider; + +import javax.crypto.Cipher; +import javax.crypto.NoSuchPaddingException; + +import com.sun.crypto.provider.SunJCE; + +public class VerificationResults { + + // approximate double the number of providers that fits in -Xmx128m heap + private static final int PROVIDERS_COUNT = 2000; + // the heap buffer size that triggers the OOME when the providers heap cannot be reclaimed + private static final int OOM_TRIGGER_SIZE = 10 * 1024 * 1024; + public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException { + int i = 0; + try { + for (; i < PROVIDERS_COUNT; i++) { + SunJCE jceProvider = new SunJCE(); + Cipher c = Cipher.getInstance("AES", jceProvider); + char[] arr = new char[OOM_TRIGGER_SIZE]; + } + } catch (OutOfMemoryError e) { + System.out.println("Caught OOME - less than 10M heap left.\nCreated " + i + " SunJCE providers"); + throw e; + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/imageio/ReadImageNoIAETest.java openjdk-17-17.0.10+7/test/jdk/javax/imageio/ReadImageNoIAETest.java --- openjdk-17-17.0.9+9/test/jdk/javax/imageio/ReadImageNoIAETest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/imageio/ReadImageNoIAETest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8272998 + * @summary ImageIO.read() should only throw IOException from decoding + */ + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import javax.imageio.ImageIO; + +public class ReadImageNoIAETest { + + static final byte[] data = { + (byte)0xff, (byte)0xd8, (byte)0xff, (byte)0xe0, (byte)0x00, (byte)0x10, + (byte)0x4a, (byte)0x46, (byte)0x49, (byte)0x46, (byte)0x00, (byte)0x01, + (byte)0x02, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x01, + (byte)0x00, (byte)0x00, (byte)0xff, (byte)0xdb, (byte)0x00, (byte)0x43, + (byte)0x00, (byte)0x08, (byte)0x06, (byte)0x06, (byte)0x07, (byte)0x06, + (byte)0x05, (byte)0x08, (byte)0x07, (byte)0x07, (byte)0x07, (byte)0x09, + (byte)0x09, (byte)0x08, (byte)0x0a, (byte)0x0c, (byte)0x14, (byte)0x0d, + (byte)0x0c, (byte)0x0b, (byte)0x0b, (byte)0x0c, (byte)0x19, (byte)0x12, + (byte)0x13, (byte)0x0f, (byte)0x14, (byte)0x1d, (byte)0x1a, (byte)0x1f, + (byte)0x1e, (byte)0x1d, (byte)0x1a, (byte)0x1c, (byte)0x1c, (byte)0x20, + (byte)0x24, (byte)0x2e, (byte)0x27, (byte)0x20, (byte)0x22, (byte)0x2c, + (byte)0x23, (byte)0x1c, (byte)0x1c, (byte)0x28, (byte)0x37, (byte)0x29, + (byte)0x2c, (byte)0x30, (byte)0x31, (byte)0x34, (byte)0x34, (byte)0x34, + (byte)0x1f, (byte)0x27, (byte)0x39, (byte)0x3d, (byte)0x38, (byte)0x32, + (byte)0x3c, (byte)0x2e, (byte)0x33, (byte)0x34, (byte)0x32, (byte)0xff, + (byte)0xdb, (byte)0x00, (byte)0x43, (byte)0x01, (byte)0x09, (byte)0x09, + (byte)0x09, (byte)0x0c, (byte)0x0b, (byte)0x0c, (byte)0x18, (byte)0x0d, + (byte)0x0d, (byte)0x18, (byte)0x32, (byte)0x21, (byte)0x1c, (byte)0x21, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, (byte)0x32, + (byte)0x32, (byte)0x32, (byte)0xff, (byte)0xc0, (byte)0x00, (byte)0x11, + (byte)0x08, (byte)0xc0, (byte)0x05, (byte)0x6d, (byte)0x05, (byte)0x03, + (byte)0x01, (byte)0x22, (byte)0x00, (byte)0x02, (byte)0x11, (byte)0x01, + (byte)0x03, (byte)0x11, (byte)0x01, (byte)0xff, (byte)0xc4, (byte)0x00, + (byte)0x1f, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x05, (byte)0x01, + (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x00, + (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04, (byte)0x05, + (byte)0x06, (byte)0x07, (byte)0x08, (byte)0x09, (byte)0x0a, (byte)0x0b, + (byte)0xff, (byte)0xc4, (byte)0x00, (byte)0xb5, (byte)0x10, (byte)0x00, + (byte)0x02, (byte)0x01, (byte)0x03, (byte)0x03, (byte)0x02, (byte)0x04, + (byte)0x03, (byte)0x05, (byte)0x05, (byte)0x04, (byte)0x04, (byte)0x00, + (byte)0x00, (byte)0x01, (byte)0x7d, (byte)0x01, (byte)0x02, (byte)0x03, + (byte)0x00, (byte)0x04, (byte)0x11, (byte)0x05, (byte)0x12, (byte)0x21, + (byte)0x31, (byte)0x41, (byte)0x06, (byte)0x13, (byte)0x51, (byte)0x61, + (byte)0x07, (byte)0x22, (byte)0x71, (byte)0x14, (byte)0x32, (byte)0x81, + (byte)0x91, (byte)0xa1, (byte)0x08, (byte)0x23, (byte)0x42, (byte)0xb1, + (byte)0xc1, (byte)0x15, (byte)0x52, (byte)0xd1, (byte)0xf0, (byte)0x24, + (byte)0x33, (byte)0x62, (byte)0x72, (byte)0x82, (byte)0x09, (byte)0x0a, + (byte)0x16, (byte)0x17, (byte)0x18, (byte)0x19, (byte)0x1a, (byte)0x25, + (byte)0x26, (byte)0x27, (byte)0x28, (byte)0x29, (byte)0x2a, (byte)0x34, + (byte)0x35, (byte)0x36, (byte)0x37, (byte)0x38, (byte)0x39, (byte)0x3a, + (byte)0x43, (byte)0x44, (byte)0x45, (byte)0x46, (byte)0x47, (byte)0x48, + (byte)0x49, (byte)0x4a, (byte)0x53, (byte)0x54, (byte)0x55, (byte)0x56, + (byte)0x57, (byte)0x58, (byte)0x59, (byte)0x5a, (byte)0x63, (byte)0x64, + (byte)0x65, (byte)0x66, (byte)0x67, (byte)0x68, (byte)0x69, (byte)0x6a, + (byte)0x73, (byte)0x74, (byte)0x75, (byte)0x76, (byte)0x77, (byte)0x78, + (byte)0x79, (byte)0x7a, (byte)0x83, (byte)0x84, (byte)0x85, (byte)0x86, + (byte)0x87, (byte)0x88, (byte)0x89, (byte)0x8a, (byte)0x92, (byte)0x93, + (byte)0x94, (byte)0x95, (byte)0x96, (byte)0x97, (byte)0x98, (byte)0x99, + (byte)0x9a, (byte)0xa2, (byte)0xa3, (byte)0xa4, (byte)0xa5, (byte)0xa6, + (byte)0xa7, (byte)0xa8, (byte)0xa9, (byte)0xaa, (byte)0xb2, (byte)0xb3, + (byte)0xb4, (byte)0xb5, (byte)0xb6, (byte)0xb7, (byte)0xb8, (byte)0xb9, + (byte)0xba, (byte)0xc2, (byte)0xc3, (byte)0xc4, (byte)0xc5, (byte)0xc6, + (byte)0xc7, (byte)0xc8, (byte)0xc9, (byte)0xca, (byte)0xd2, (byte)0xd3, + (byte)0xd4, (byte)0xd5, (byte)0xd6, (byte)0xd7, (byte)0xd8, (byte)0xd9, + (byte)0xda, (byte)0xe1, (byte)0xe2, (byte)0xe3, (byte)0xe4, (byte)0xe5, + (byte)0xe6, (byte)0xe7, (byte)0xe8, (byte)0xe9, (byte)0xea, (byte)0xf1, + (byte)0xf2, (byte)0xf3, (byte)0xf4, (byte)0xf5, (byte)0xf6, (byte)0xf7, + (byte)0xf8, (byte)0xf9, (byte)0xfa, (byte)0xff, (byte)0xc4, (byte)0x00, + (byte)0x1f, (byte)0x01, (byte)0x00, (byte)0x03, (byte)0x01, (byte)0x01, + (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01, (byte)0x01, + (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, + (byte)0x00, (byte)0x01, (byte)0x02, (byte)0x03, (byte)0x04, (byte)0x05, + (byte)0x06, (byte)0x07, (byte)0x08, (byte)0x09, (byte)0x0a, (byte)0x0b, + (byte)0xff, (byte)0xc4, (byte)0x00, (byte)0xb5, (byte)0x11, (byte)0x00, + (byte)0x02, (byte)0x01, (byte)0x02, (byte)0x04, (byte)0x04, (byte)0x03, + (byte)0x04, (byte)0x07, (byte)0x05, (byte)0x04, (byte)0x04, (byte)0x00, + (byte)0x01, (byte)0x02, (byte)0x77, (byte)0x00, (byte)0x01, (byte)0x02, + (byte)0x03, (byte)0x11, (byte)0x04, (byte)0x05, (byte)0x21, (byte)0x31, + (byte)0x06, (byte)0x12, (byte)0x41, (byte)0x51, (byte)0x07, (byte)0x61, + (byte)0x71, (byte)0x13, (byte)0x22, (byte)0x32, (byte)0x81, (byte)0x08, + (byte)0x14, (byte)0x42, (byte)0x91, (byte)0xa1, (byte)0xb1, (byte)0xc1, + (byte)0x09, (byte)0x23, (byte)0x33, (byte)0x52, (byte)0xf0, (byte)0x15, + (byte)0x62, (byte)0x72, (byte)0xd1, (byte)0x0a, (byte)0x16, (byte)0x24, + (byte)0x34, (byte)0xe1, (byte)0x25, (byte)0xf1, (byte)0x17, (byte)0x18, + (byte)0x19, (byte)0x1a, (byte)0x26, (byte)0x27, (byte)0x28, (byte)0x29, + (byte)0x2a, (byte)0x35, (byte)0x36, (byte)0x37, (byte)0x38, (byte)0x39, + (byte)0x3a, (byte)0x43, (byte)0x44, (byte)0x45, (byte)0x46, (byte)0x47, + (byte)0x48, (byte)0x49, (byte)0x4a, (byte)0x53, (byte)0x54, (byte)0x55, + (byte)0x56, (byte)0x57, (byte)0x58, (byte)0x59, (byte)0x5a, (byte)0x63, + (byte)0x64, (byte)0x65, (byte)0x66, (byte)0x67, (byte)0x68, (byte)0x69, + (byte)0x6a, (byte)0x73, (byte)0x74, (byte)0x75, (byte)0x76, (byte)0x77, + (byte)0x78, (byte)0x79, (byte)0x7a, (byte)0x82, (byte)0x83, (byte)0x84, + (byte)0x85, (byte)0x86, (byte)0x87, (byte)0x88, (byte)0x89, (byte)0x8a, + (byte)0x92, (byte)0x93, (byte)0x94, (byte)0x95, (byte)0x96, (byte)0x97, + (byte)0x98, (byte)0x99, (byte)0x9a, (byte)0xa2, (byte)0xa3, (byte)0xa4, + (byte)0xa5, (byte)0xa6, (byte)0xa7, (byte)0xa8, (byte)0xa9, (byte)0xaa, + (byte)0xb2, (byte)0xb3, (byte)0xb4, (byte)0xb5, (byte)0xb6, (byte)0xb7, + (byte)0xb8, (byte)0xb9, (byte)0xba, (byte)0xc2, (byte)0xc3, (byte)0xc4, + (byte)0xc5, (byte)0xc6, (byte)0xc7, (byte)0xc8, (byte)0xc9, (byte)0xca, + (byte)0xd2, (byte)0xd3, (byte)0xd4, (byte)0xd5, (byte)0xd6, (byte)0xd7, + (byte)0xd8, (byte)0xd9, (byte)0xda, (byte)0xe2, (byte)0xe3, (byte)0xe4, + (byte)0xe5, (byte)0xe6, (byte)0xe7, (byte)0xe8, (byte)0xe9, (byte)0xea, + (byte)0xf2, (byte)0xf3, (byte)0xf4, (byte)0xf5, (byte)0xf6, (byte)0xf7, + (byte)0xf8, (byte)0xf9, (byte)0xfa, (byte)0xff, (byte)0xda, (byte)0x00, + (byte)0x0c, (byte)0x03, (byte)0x01, (byte)0x00, (byte)0x02, (byte)0x11, + (byte)0x03, (byte)0x11, (byte)0x00, (byte)0x3f, (byte)0x00, (byte)0xe2, + (byte)0xe8, (byte)0xa2, (byte)0x8a, (byte)0xf9, (byte)0x93, (byte)0xf7, + (byte)0x13, (byte)0xff, (byte)0xd9 + }; + + public static void main(String[] arg) { + boolean io_exception = false; + try { + ImageIO.read(new ByteArrayInputStream(data)); + } catch (IOException e) { + io_exception = true; + } + if (!io_exception) { + throw new RuntimeException("No expected IOException"); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/MyX509ExtendedKeyManager.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2016, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.net.Socket; -import java.security.Principal; -import java.security.PrivateKey; -import java.security.cert.X509Certificate; -import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.X509ExtendedKeyManager; - -public class MyX509ExtendedKeyManager extends X509ExtendedKeyManager { - - static final String ERROR = "ERROR"; - X509ExtendedKeyManager akm; - String expectedAP; - boolean doCheck = true; - - MyX509ExtendedKeyManager(X509ExtendedKeyManager akm) { - this.akm = akm; - } - - public MyX509ExtendedKeyManager( - X509ExtendedKeyManager akm, String expectedAP, boolean doCheck) { - this.akm = akm; - this.expectedAP = expectedAP; - this.doCheck = doCheck; - - } - - @Override - public String[] getClientAliases(String keyType, Principal[] issuers) { - return akm.getClientAliases(keyType, issuers); - } - - @Override - public String chooseClientAlias(String[] keyType, Principal[] issuers, - Socket socket) { - String nap = ((SSLSocket) socket).getHandshakeApplicationProtocol(); - checkALPN(nap); - - return akm.chooseClientAlias(keyType, issuers, socket); - } - - @Override - public String[] getServerAliases(String keyType, Principal[] issuers) { - return akm.getServerAliases(keyType, issuers); - } - - @Override - public String chooseServerAlias(String keyType, Principal[] issuers, - Socket socket) { - String nap = ((SSLSocket) socket).getHandshakeApplicationProtocol(); - checkALPN(nap); - - return akm.chooseServerAlias(keyType, issuers, socket); - } - - @Override - public X509Certificate[] getCertificateChain(String alias) { - return akm.getCertificateChain(alias); - } - - @Override - public PrivateKey getPrivateKey(String alias) { - return akm.getPrivateKey(alias); - } - - @Override - public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, - SSLEngine engine) { - String nap = engine.getHandshakeApplicationProtocol(); - checkALPN(nap); - - return akm.chooseEngineClientAlias(keyType, issuers, engine); - } - - @Override - public String chooseEngineServerAlias(String keyType, Principal[] issuers, - SSLEngine engine) { - String nap = engine.getHandshakeApplicationProtocol(); - checkALPN(nap); - - return akm.chooseEngineServerAlias(keyType, issuers, engine); - } - - private void checkALPN(String ap) { - - if (!doCheck) { - System.out.println("Skipping KeyManager checks " + - "because a callback has been registered"); - return; - } - - if (ERROR.equals(expectedAP)) { - throw new RuntimeException("Should not reach here"); - } - - System.out.println("Expected ALPN value: " + expectedAP - + " Got: " + ap); - - if (ap == null) { - throw new RuntimeException( - "ALPN should be negotiated, but null was received"); - } - if (expectedAP.equals("NONE")) { - if (!ap.isEmpty()) { - throw new RuntimeException("Expected no ALPN value"); - } else { - System.out.println("No ALPN value negotiated, as expected"); - } - } else if (!expectedAP.equals(ap)) { - throw new RuntimeException(expectedAP - + " ALPN value not available on negotiated connection"); - } - - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/SSLEngineAlpnTest.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLEngineAlpnTest.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/SSLEngineAlpnTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLEngineAlpnTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -28,7 +28,6 @@ * @test * @bug 8051498 8145849 8170282 * @summary JEP 244: TLS Application-Layer Protocol Negotiation Extension - * @compile MyX509ExtendedKeyManager.java * * @run main/othervm SSLEngineAlpnTest h2 UNUSED h2 h2 * @run main/othervm SSLEngineAlpnTest h2 UNUSED h2,http/1.1 h2 @@ -237,10 +236,6 @@ throw new Exception("kms[0] not X509ExtendedKeyManager"); } - kms = new KeyManager[] { new MyX509ExtendedKeyManager( - (X509ExtendedKeyManager) kms[0], expectedAP, - !hasCallback && hasServerAPs) }; - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(ts); diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/SSLServerSocketAlpnTest.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLServerSocketAlpnTest.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/SSLServerSocketAlpnTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLServerSocketAlpnTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -28,7 +28,7 @@ * @test * @bug 8051498 8145849 8158978 8170282 * @summary JEP 244: TLS Application-Layer Protocol Negotiation Extension - * @compile MyX509ExtendedKeyManager.java + * @library /javax/net/ssl/templates * * @run main/othervm SSLServerSocketAlpnTest h2 UNUSED h2 h2 * @run main/othervm SSLServerSocketAlpnTest h2 UNUSED h2,http/1.1 h2 @@ -79,56 +79,18 @@ * This example is based on our standard SSLSocketTemplate. */ import java.io.*; -import java.security.KeyStore; import java.util.Arrays; import javax.net.ssl.*; -public class SSLServerSocketAlpnTest { +public class SSLServerSocketAlpnTest extends SSLSocketTemplate { - /* - * ============================================================= - * Set the various variables needed for the tests, then - * specify what tests to run on each side. - */ - - /* - * Should we run the client or server in a separate thread? - * Both sides can throw exceptions, but do you have a preference - * as to which side should be the main thread. - */ - static boolean separateServerThread = false; - - /* - * Where do we find the keystores? - */ - static String pathToStores = "../etc"; - static String keyStoreFile = "keystore"; - static String trustStoreFile = "truststore"; - static String passwd = "passphrase"; - - static String keyFilename = System.getProperty("test.src", ".") + "/" - + pathToStores + "/" + keyStoreFile; - static String trustFilename = System.getProperty("test.src", ".") + "/" - + pathToStores + "/" + trustStoreFile; - - private static boolean hasServerAPs; // whether server APs are present private static boolean hasCallback; // whether a callback is present /* - * SSLContext - */ - SSLContext mySSLContext = null; - - /* - * Is the server ready to serve? - */ - volatile static boolean serverReady = false; - - /* * Turn on SSL debugging? */ - static boolean debug = false; + static boolean debug = Boolean.getBoolean("test.debug"); static String[] serverAPs; static String callbackAP; @@ -144,16 +106,8 @@ * smart about it.... */ - /* - * Define the server side of the test. - * - * If the server prematurely exits, serverReady will be set to true - * to avoid infinite hangs. - */ - void doServerSide() throws Exception { - SSLServerSocketFactory sslssf = mySSLContext.getServerSocketFactory(); - SSLServerSocket sslServerSocket - = (SSLServerSocket) sslssf.createServerSocket(serverPort); + @Override + protected void configureServerSocket(SSLServerSocket sslServerSocket) { sslServerSocket.setNeedClientAuth(true); SSLParameters sslp = sslServerSocket.getSSLParameters(); @@ -178,13 +132,16 @@ sslServerSocket.setSSLParameters(sslp); serverPort = sslServerSocket.getLocalPort(); + } - /* - * Signal Client, we're ready for his connect. - */ - serverReady = true; - - SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + /* + * Define the server side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + @Override + protected void runServerApplication(SSLSocket sslSocket) throws Exception { if (sslSocket.getHandshakeApplicationProtocol() != null) { throw new Exception ("getHandshakeApplicationProtocol() should " @@ -245,26 +202,9 @@ sslSocket.close(); } - /* - * Define the client side of the test. - * - * If the server prematurely exits, serverReady will be set to true - * to avoid infinite hangs. - */ - void doClientSide() throws Exception { - - /* - * Wait for server to get started. - */ - while (!serverReady) { - Thread.sleep(50); - } - - SSLSocketFactory sslsf = mySSLContext.getSocketFactory(); - SSLSocket sslSocket - = (SSLSocket) sslsf.createSocket("localhost", serverPort); - - SSLParameters sslp = sslSocket.getSSLParameters(); + @Override + protected void configureClientSocket(SSLSocket socket) { + SSLParameters sslp = socket.getSSLParameters(); /* * The default ciphersuite ordering from the SSLContext may not @@ -278,7 +218,17 @@ // Set the ALPN selection. sslp.setApplicationProtocols(clientAPs); - sslSocket.setSSLParameters(sslp); + socket.setSSLParameters(sslp); + } + + /* + * Define the client side of the test. + * + * If the server prematurely exits, serverReady will be set to true + * to avoid infinite hangs. + */ + @Override + protected void runClientApplication(SSLSocket sslSocket) throws Exception { if (sslSocket.getHandshakeApplicationProtocol() != null) { throw new Exception ("getHandshakeApplicationProtocol() should " @@ -332,9 +282,6 @@ // use any free port by default volatile int serverPort = 0; - volatile Exception serverException = null; - volatile Exception clientException = null; - public static void main(String[] args) throws Exception { if (debug) { @@ -351,14 +298,13 @@ clientAPs = convert(args[2]); expectedAP = args[3]; - hasServerAPs = !args[0].equals("UNUSED"); // are server APs being used? hasCallback = !callbackAP.equals("UNUSED"); // is callback being used? /* * Start the tests. */ try { - new SSLServerSocketAlpnTest(); + new SSLServerSocketAlpnTest().run(); } catch (SSLHandshakeException she) { if (args[3].equals("ERROR")) { System.out.println("Caught the expected exception: " + she); @@ -370,40 +316,6 @@ System.out.println("Test Passed."); } - SSLContext getSSLContext(String keyFilename, String trustFilename) - throws Exception { - SSLContext ctx = SSLContext.getInstance("TLS"); - - // Keystores - KeyStore keyKS = KeyStore.getInstance("JKS"); - keyKS.load(new FileInputStream(keyFilename), passwd.toCharArray()); - - KeyStore trustKS = KeyStore.getInstance("JKS"); - trustKS.load(new FileInputStream(trustFilename), passwd.toCharArray()); - - // Generate KeyManager and TrustManager - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(keyKS, passwd.toCharArray()); - - KeyManager[] kms = kmf.getKeyManagers(); - if (!(kms[0] instanceof X509ExtendedKeyManager)) { - throw new Exception("kms[0] not X509ExtendedKeyManager"); - } - - kms = new KeyManager[] { new MyX509ExtendedKeyManager( - (X509ExtendedKeyManager) kms[0], expectedAP, - !hasCallback && hasServerAPs) }; - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(trustKS); - TrustManager[] tms = tmf.getTrustManagers(); - - // initial SSLContext - ctx.init(kms, tms, null); - - return ctx; - } - /* * Convert a comma-separated list into an array of strings. */ @@ -425,143 +337,4 @@ return strings; } - - Thread clientThread = null; - Thread serverThread = null; - - /* - * Primary constructor, used to drive remainder of the test. - * - * Fork off the other side, then do your work. - */ - SSLServerSocketAlpnTest() throws Exception { - Exception startException = null; - mySSLContext = getSSLContext(keyFilename, trustFilename); - try { - if (separateServerThread) { - startServer(true); - startClient(false); - } else { - startClient(true); - startServer(false); - } - } catch (Exception e) { - startException = e; - } - - /* - * Wait for other side to close down. - */ - if (separateServerThread) { - if (serverThread != null) { - serverThread.join(); - } - } else { - if (clientThread != null) { - clientThread.join(); - } - } - - /* - * When we get here, the test is pretty much over. - * Which side threw the error? - */ - Exception local; - Exception remote; - - if (separateServerThread) { - remote = serverException; - local = clientException; - } else { - remote = clientException; - local = serverException; - } - - Exception exception = null; - - /* - * Check various exception conditions. - */ - if ((local != null) && (remote != null)) { - // If both failed, return the curthread's exception. - local.initCause(remote); - exception = local; - } else if (local != null) { - exception = local; - } else if (remote != null) { - exception = remote; - } else if (startException != null) { - exception = startException; - } - - /* - * If there was an exception *AND* a startException, - * output it. - */ - if (exception != null) { - if (exception != startException && startException != null) { - exception.addSuppressed(startException); - } - throw exception; - } - - // Fall-through: no exception to throw! - } - - void startServer(boolean newThread) throws Exception { - if (newThread) { - serverThread = new Thread() { - @Override - public void run() { - try { - doServerSide(); - } catch (Exception e) { - /* - * Our server thread just died. - * - * Release the client, if not active already... - */ - System.err.println("Server died..."); - serverReady = true; - serverException = e; - } - } - }; - serverThread.start(); - } else { - try { - doServerSide(); - } catch (Exception e) { - serverException = e; - } finally { - serverReady = true; - } - } - } - - void startClient(boolean newThread) throws Exception { - if (newThread) { - clientThread = new Thread() { - @Override - public void run() { - try { - doClientSide(); - } catch (Exception e) { - /* - * Our client thread just died. - */ - System.err.println("Client died..."); - clientException = e; - } - } - }; - clientThread.start(); - } else { - try { - doClientSide(); - } catch (Exception e) { - clientException = e; - } - } - } } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/SSLSocketAlpnTest.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLSocketAlpnTest.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/ALPN/SSLSocketAlpnTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/ALPN/SSLSocketAlpnTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -28,7 +28,7 @@ * @test * @bug 8051498 8145849 8170282 * @summary JEP 244: TLS Application-Layer Protocol Negotiation Extension - * @compile MyX509ExtendedKeyManager.java + * @library /javax/net/ssl/templates * * @run main/othervm SSLSocketAlpnTest h2 UNUSED h2 h2 * @run main/othervm SSLSocketAlpnTest h2 UNUSED h2,http/1.1 h2 @@ -78,56 +78,18 @@ * This example is based on our standard SSLSocketTemplate. */ import java.io.*; -import java.security.KeyStore; import java.util.Arrays; import javax.net.ssl.*; -public class SSLSocketAlpnTest { +public class SSLSocketAlpnTest extends SSLSocketTemplate { - /* - * ============================================================= - * Set the various variables needed for the tests, then - * specify what tests to run on each side. - */ - - /* - * Should we run the client or server in a separate thread? - * Both sides can throw exceptions, but do you have a preference - * as to which side should be the main thread. - */ - static boolean separateServerThread = false; - - /* - * Where do we find the keystores? - */ - static String pathToStores = "../etc"; - static String keyStoreFile = "keystore"; - static String trustStoreFile = "truststore"; - static String passwd = "passphrase"; - - static String keyFilename = System.getProperty("test.src", ".") + "/" - + pathToStores + "/" + keyStoreFile; - static String trustFilename = System.getProperty("test.src", ".") + "/" - + pathToStores + "/" + trustStoreFile; - - private static boolean hasServerAPs; // whether server APs are present private static boolean hasCallback; // whether a callback is present /* - * SSLContext - */ - SSLContext mySSLContext = null; - - /* - * Is the server ready to serve? - */ - volatile static boolean serverReady = false; - - /* * Turn on SSL debugging? */ - static boolean debug = false; + static boolean debug = Boolean.getBoolean("test.debug"); static String[] serverAPs; static String callbackAP; @@ -143,28 +105,20 @@ * smart about it.... */ + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(true); + } + /* * Define the server side of the test. * * If the server prematurely exits, serverReady will be set to true * to avoid infinite hangs. */ - void doServerSide() throws Exception { - SSLServerSocketFactory sslssf = mySSLContext.getServerSocketFactory(); - SSLServerSocket sslServerSocket - = (SSLServerSocket) sslssf.createServerSocket(serverPort); - // for both client/server to call into X509KM - sslServerSocket.setNeedClientAuth(true); - - serverPort = sslServerSocket.getLocalPort(); - - /* - * Signal Client, we're ready for his connect. - */ - serverReady = true; - - SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); - + @Override + protected void runServerApplication(SSLSocket sslSocket) throws Exception { + System.out.println("in runServerApplication(SSLSocket)"); SSLParameters sslp = sslSocket.getSSLParameters(); /* @@ -206,6 +160,7 @@ } } + System.out.println("server starting handshake"); sslSocket.startHandshake(); if (sslSocket.getHandshakeApplicationProtocol() != null) { @@ -247,18 +202,9 @@ * If the server prematurely exits, serverReady will be set to true * to avoid infinite hangs. */ - void doClientSide() throws Exception { - - /* - * Wait for server to get started. - */ - while (!serverReady) { - Thread.sleep(50); - } - - SSLSocketFactory sslsf = mySSLContext.getSocketFactory(); - SSLSocket sslSocket - = (SSLSocket) sslsf.createSocket("localhost", serverPort); + @Override + protected void runClientApplication(SSLSocket sslSocket) throws Exception { + System.out.println("in runClientApplication(SSLSocket)"); SSLParameters sslp = sslSocket.getSSLParameters(); @@ -281,6 +227,7 @@ + "return null before the handshake starts"); } + System.out.println("Client starting handshake"); sslSocket.startHandshake(); if (sslSocket.getHandshakeApplicationProtocol() != null) { @@ -321,16 +268,6 @@ sslSocket.close(); } - /* - * ============================================================= - * The remainder is just support stuff - */ - // use any free port by default - volatile int serverPort = 0; - - volatile Exception serverException = null; - volatile Exception clientException = null; - public static void main(String[] args) throws Exception { if (debug) { @@ -347,14 +284,13 @@ clientAPs = convert(args[2]); expectedAP = args[3]; - hasServerAPs = !args[0].equals("UNUSED"); // are server APs being used? hasCallback = !callbackAP.equals("UNUSED"); // is callback being used? /* * Start the tests. */ try { - new SSLSocketAlpnTest(); + new SSLSocketAlpnTest().run(); } catch (SSLHandshakeException she) { if (args[3].equals("ERROR")) { System.out.println("Caught the expected exception: " + she); @@ -366,40 +302,6 @@ System.out.println("Test Passed."); } - SSLContext getSSLContext(String keyFilename, String trustFilename) - throws Exception { - SSLContext ctx = SSLContext.getInstance("TLS"); - - // Keystores - KeyStore keyKS = KeyStore.getInstance("JKS"); - keyKS.load(new FileInputStream(keyFilename), passwd.toCharArray()); - - KeyStore trustKS = KeyStore.getInstance("JKS"); - trustKS.load(new FileInputStream(trustFilename), passwd.toCharArray()); - - // Generate KeyManager and TrustManager - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(keyKS, passwd.toCharArray()); - - KeyManager[] kms = kmf.getKeyManagers(); - if (!(kms[0] instanceof X509ExtendedKeyManager)) { - throw new Exception("kms[0] not X509ExtendedKeyManager"); - } - - kms = new KeyManager[] { new MyX509ExtendedKeyManager( - (X509ExtendedKeyManager) kms[0], expectedAP, - !hasCallback && hasServerAPs) }; - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(trustKS); - TrustManager[] tms = tmf.getTrustManagers(); - - // initial SSLContext - ctx.init(kms, tms, null); - - return ctx; - } - /* * Convert a comma-separated list into an array of strings. */ @@ -421,143 +323,4 @@ return strings; } - - Thread clientThread = null; - Thread serverThread = null; - - /* - * Primary constructor, used to drive remainder of the test. - * - * Fork off the other side, then do your work. - */ - SSLSocketAlpnTest() throws Exception { - Exception startException = null; - mySSLContext = getSSLContext(keyFilename, trustFilename); - try { - if (separateServerThread) { - startServer(true); - startClient(false); - } else { - startClient(true); - startServer(false); - } - } catch (Exception e) { - startException = e; - } - - /* - * Wait for other side to close down. - */ - if (separateServerThread) { - if (serverThread != null) { - serverThread.join(); - } - } else { - if (clientThread != null) { - clientThread.join(); - } - } - - /* - * When we get here, the test is pretty much over. - * Which side threw the error? - */ - Exception local; - Exception remote; - - if (separateServerThread) { - remote = serverException; - local = clientException; - } else { - remote = clientException; - local = serverException; - } - - Exception exception = null; - - /* - * Check various exception conditions. - */ - if ((local != null) && (remote != null)) { - // If both failed, return the curthread's exception. - local.initCause(remote); - exception = local; - } else if (local != null) { - exception = local; - } else if (remote != null) { - exception = remote; - } else if (startException != null) { - exception = startException; - } - - /* - * If there was an exception *AND* a startException, - * output it. - */ - if (exception != null) { - if (exception != startException && startException != null) { - exception.addSuppressed(startException); - } - throw exception; - } - - // Fall-through: no exception to throw! - } - - void startServer(boolean newThread) throws Exception { - if (newThread) { - serverThread = new Thread() { - @Override - public void run() { - try { - doServerSide(); - } catch (Exception e) { - /* - * Our server thread just died. - * - * Release the client, if not active already... - */ - System.err.println("Server died..."); - serverReady = true; - serverException = e; - } - } - }; - serverThread.start(); - } else { - try { - doServerSide(); - } catch (Exception e) { - serverException = e; - } finally { - serverReady = true; - } - } - } - - void startClient(boolean newThread) throws Exception { - if (newThread) { - clientThread = new Thread() { - @Override - public void run() { - try { - doClientSide(); - } catch (Exception e) { - /* - * Our client thread just died. - */ - System.err.println("Client died..."); - clientException = e; - } - } - }; - clientThread.start(); - } else { - try { - doClientSide(); - } catch (Exception e) { - clientException = e; - } - } - } } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/DTLS/DTLSOverDatagram.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/DTLS/DTLSOverDatagram.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/DTLS/DTLSOverDatagram.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/DTLS/DTLSOverDatagram.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, 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 @@ -33,6 +33,7 @@ * @run main/othervm DTLSOverDatagram */ +import java.io.IOException; import java.nio.*; import java.net.*; import java.util.*; @@ -42,6 +43,7 @@ import jdk.test.lib.security.SSLContextBuilder; import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicBoolean; import jdk.test.lib.hexdump.HexPrinter; @@ -50,8 +52,6 @@ */ public class DTLSOverDatagram { - private static final int MAX_HANDSHAKE_LOOPS = 200; - private static final int MAX_APP_READ_LOOPS = 60; private static final int SOCKET_TIMEOUT = 10 * 1000; // in millis private static final int BUFFER_SIZE = 1024; private static final int MAXIMUM_PACKET_SIZE = 1024; @@ -75,8 +75,9 @@ private static final ByteBuffer CLIENT_APP = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); - private static Exception clientException = null; - private static Exception serverException = null; + private final AtomicBoolean exceptionOccurred = new AtomicBoolean(false); + + private final CountDownLatch serverStarted = new CountDownLatch(1); /* * ============================================================= * The test case @@ -148,18 +149,12 @@ SocketAddress peerAddr, String side) throws Exception { boolean endLoops = false; - int loops = MAX_HANDSHAKE_LOOPS; + int loops = 0; engine.beginHandshake(); - while (!endLoops && - (serverException == null) && (clientException == null)) { - - if (--loops < 0) { - throw new RuntimeException( - "Too many loops to produce handshake packets"); - } + while (!endLoops && !exceptionOccurred.get()) { SSLEngineResult.HandshakeStatus hs = engine.getHandshakeStatus(); - log(side, "=======handshake(" + loops + ", " + hs + ")======="); + log(side, "=======handshake(" + ++loops + ", " + hs + ")======="); switch (hs) { case NEED_UNWRAP, NEED_UNWRAP_AGAIN -> { @@ -313,16 +308,10 @@ void receiveAppData(SSLEngine engine, DatagramSocket socket, ByteBuffer expectedApp) throws Exception { - int loops = MAX_APP_READ_LOOPS; - while ((serverException == null) && (clientException == null)) { - if (--loops < 0) { - throw new RuntimeException( - "Too much loops to receive application data"); - } - + while (!exceptionOccurred.get()) { byte[] buf = new byte[BUFFER_SIZE]; - DatagramPacket packet = new DatagramPacket(buf, buf.length); - socket.receive(packet); + DatagramPacket packet = readFromSocket(socket, buf); + ByteBuffer netBuffer = ByteBuffer.wrap(buf, 0, packet.getLength()); ByteBuffer recBuffer = ByteBuffer.allocate(BUFFER_SIZE); SSLEngineResult rs = engine.unwrap(netBuffer, recBuffer); @@ -338,19 +327,31 @@ } } + /* + Some tests failed with receive time-out errors when the client tried to read + from the server. The server thread had exited normally so the read _should_ + succeed. So let's try to read a couple of times before giving up. + */ + DatagramPacket readFromSocket(DatagramSocket socket, byte[] buffer) throws IOException { + for (int i = 1 ; i <= 2 ; ++i) { + try { + DatagramPacket packet = new DatagramPacket(buffer, buffer.length); + socket.receive(packet); + return packet; + } catch (SocketTimeoutException exc) { + System.out.println("Attempt " + i + ": Timeout occurred reading from socket."); + } + } + throw new IOException("Did not receive data after 2 attempts."); + } + // produce handshake packets boolean produceHandshakePackets(SSLEngine engine, SocketAddress socketAddr, String side, List packets) throws Exception { boolean endLoops = false; - int loops = MAX_HANDSHAKE_LOOPS / 2; - while (!endLoops && - (serverException == null) && (clientException == null)) { - - if (--loops < 0) { - throw new RuntimeException( - "Too many loops to produce handshake packets"); - } + int loops = 0; + while (!endLoops && !exceptionOccurred.get()) { ByteBuffer oNet = ByteBuffer.allocate(32768); ByteBuffer oApp = ByteBuffer.allocate(0); @@ -360,7 +361,7 @@ SSLEngineResult.Status rs = r.getStatus(); SSLEngineResult.HandshakeStatus hs = r.getHandshakeStatus(); log(side, "----produce handshake packet(" + - loops + ", " + rs + ", " + hs + ")----"); + ++loops + ", " + rs + ", " + hs + ")----"); verifySSLEngineResultStatus(r, side); @@ -518,10 +519,6 @@ * The remainder is support stuff to kickstart the testing. */ - // Will the handshaking and application data exchange succeed? - public boolean isGoodJob() { - return true; - } public final void runTest(DTLSOverDatagram testCase) throws Exception { InetSocketAddress serverSocketAddress = new InetSocketAddress @@ -541,97 +538,51 @@ InetSocketAddress clientSocketAddr = new InetSocketAddress( InetAddress.getLoopbackAddress(), clientSocket.getLocalPort()); - ExecutorService pool = Executors.newFixedThreadPool(2); - Future server, client; + ExecutorService pool = Executors.newFixedThreadPool(1); + Future server; - try { - server = pool.submit(new ServerCallable( + server = pool.submit(() -> runServer( testCase, serverSocket, clientSocketAddr)); - client = pool.submit(new ClientCallable( - testCase, clientSocket, serverSocketAddr)); - } finally { - pool.shutdown(); - } - - boolean failed = false; + pool.shutdown(); - // wait for client to finish - try { - System.out.println("Client finished: " + client.get()); - } catch (CancellationException | InterruptedException - | ExecutionException e) { - System.out.println("Exception on client side: "); - e.printStackTrace(System.out); - failed = true; - } - - // wait for server to finish - try { - System.out.println("Client finished: " + server.get()); - } catch (CancellationException | InterruptedException - | ExecutionException e) { - System.out.println("Exception on server side: "); - e.printStackTrace(System.out); - failed = true; - } - - if (failed) { - throw new RuntimeException("Test failed"); - } + runClient(testCase, clientSocket, serverSocketAddr); + server.get(); } } - record ServerCallable(DTLSOverDatagram testCase, DatagramSocket socket, - InetSocketAddress clientSocketAddr) implements Callable { + Void runServer(DTLSOverDatagram testCase, DatagramSocket socket, + InetSocketAddress clientSocketAddr) throws Exception { + try { + serverStarted.countDown(); + testCase.doServerSide(socket, clientSocketAddr); - @Override - public String call() throws Exception { - try { - testCase.doServerSide(socket, clientSocketAddr); - } catch (Exception e) { - System.out.println("Exception in ServerCallable.call():"); - e.printStackTrace(System.out); - serverException = e; - - if (testCase.isGoodJob()) { - throw e; - } else { - return "Well done, server!"; - } - } + } catch (Exception exc) { + exceptionOccurred.set(true); - if (testCase.isGoodJob()) { - return "Well done, server!"; - } else { - throw new Exception("No expected exception"); - } + // log for debugging clarity + System.out.println("Unexpected exception in server"); + exc.printStackTrace(System.err); + throw exc; } - } - record ClientCallable(DTLSOverDatagram testCase, DatagramSocket socket, - InetSocketAddress serverSocketAddr) implements Callable { + return null; + } - @Override - public String call() throws Exception { - try { - testCase.doClientSide(socket, serverSocketAddr); - } catch (Exception e) { - System.out.println("Exception in ClientCallable.call():"); - e.printStackTrace(System.out); - clientException = e; - - if (testCase.isGoodJob()) { - throw e; - } else { - return "Well done, client!"; - } - } + private void runClient(DTLSOverDatagram testCase, DatagramSocket socket, + InetSocketAddress serverSocketAddr) throws Exception { + if(!serverStarted.await(5, TimeUnit.SECONDS)) { + throw new Exception("Server did not start within 5 seconds."); + } - if (testCase.isGoodJob()) { - return "Well done, client!"; - } else { - throw new Exception("No expected exception"); - } + try { + testCase.doClientSide(socket, serverSocketAddr); + } catch (Exception exc) { + exceptionOccurred.set(true); + + // log for debugging clarity + System.out.println("Unexpected exception in client."); + exc.printStackTrace(System.err); + throw exc; } } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, 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 @@ -36,27 +36,32 @@ import java.net.DatagramPacket; import java.net.SocketAddress; +import java.util.concurrent.atomic.AtomicBoolean; /** - * Test that if handshake messages are crasged, the handshake would fail + * Test that if handshake messages are changed, the handshake would fail * because of handshaking hash verification. */ public class InvalidRecords extends DTLSOverDatagram { - boolean needInvalidRecords = true; + private static final AtomicBoolean needInvalidRecords = new AtomicBoolean(true); public static void main(String[] args) throws Exception { InvalidRecords testCase = new InvalidRecords(); testCase.runTest(testCase); - } - @Override - public boolean isGoodJob() { - return false; + if (needInvalidRecords.get()) { + // if this is true, the createHandshakePacket() method + // was NOT called twice to create ClientHello messages + throw new RuntimeException( + "The invalid handshake packet was not" + + " rejected as it should have been."); + } } + @Override DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr) { - if ((ba.length >= 60) && + if (needInvalidRecords.get() && (ba.length >= 60) && (ba[0x00] == (byte)0x16) && (ba[0x0D] == (byte)0x01) && (ba[0x3B] == (byte)0x00) && (ba[0x3C] > 0)) { @@ -65,18 +70,8 @@ // ba[0x3B]: length of session ID // ba[0x3C]: length of cookie - if (!needInvalidRecords) { - // The 2nd ClientHello with cookie. The 1st one should be - // rejected as expected. - // - // This may happen if the last few bytes of the packet are - // for supported_version extension. - throw new RuntimeException( - "the crashed handshake message was rejected as expected"); - } - // ClientHello with cookie - needInvalidRecords = false; + needInvalidRecords.set(false); System.out.println("invalidate ClientHello message"); if (ba[ba.length - 1] == (byte)0xFF) { ba[ba.length - 1] = (byte)0xFE; diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/Basics.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/Basics.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/Basics.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/Basics.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2022, 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 @@ -26,43 +26,53 @@ * @bug 4495742 * @summary Add non-blocking SSL/TLS functionality, usable with any * I/O abstraction - * @ignore JSSE supported cipher suites are changed with CR 6916074, - * need to update this test case in JDK 7 soon - * * This is intended to test many of the basic API calls to the SSLEngine * interface. This doesn't really exercise much of the SSL code. * + * @library /test/lib * @author Brad Wetmore + * @run main/othervm Basics */ import java.security.*; import java.io.*; import java.nio.*; +import java.util.Arrays; import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; +import jdk.test.lib.security.SecurityUtils; + public class Basics { - private static String pathToStores = "../etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; + private static final String PATH_TO_STORES = "../etc"; + private static final String KEY_STORE_FILE = "keystore"; + private static final String TRUSTSTORE_FILE = "truststore"; + + private static final String KEYSTORE_PATH = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + KEY_STORE_FILE; + private static final String TRUSTSTORE_PATH = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + TRUSTSTORE_FILE; + + public static void main(String[] args) throws Exception { + SecurityUtils.removeFromDisabledTlsAlgs("TLSv1.1"); + + runTest("TLSv1.3", "TLS_AES_256_GCM_SHA384"); + runTest("TLSv1.2", "TLS_RSA_WITH_AES_256_GCM_SHA384"); + runTest("TLSv1.1", "TLS_DHE_DSS_WITH_AES_128_CBC_SHA"); + } - public static void main(String args[]) throws Exception { + private static void runTest(String protocol, String cipherSuite) throws Exception { + System.out.printf("Testing %s with %s%n", protocol, cipherSuite); KeyStore ks = KeyStore.getInstance("JKS"); KeyStore ts = KeyStore.getInstance("JKS"); char[] passphrase = "passphrase".toCharArray(); - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); + ks.load(new FileInputStream(KEYSTORE_PATH), passphrase); + ts.load(new FileInputStream(TRUSTSTORE_PATH), passphrase); KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, passphrase); @@ -79,75 +89,85 @@ System.out.println(ssle); String [] suites = ssle.getSupportedCipherSuites(); - String secondSuite = suites[1]; - String [] oneSuites = new String [] { secondSuite }; + // sanity check that the ciphersuite we want to use is still supported + Arrays.stream(suites) + .filter(s -> s.equals(cipherSuite)) + .findFirst() + .orElseThrow((() -> + new RuntimeException(cipherSuite + + " is not a supported ciphersuite."))); printStrings("Supported Ciphersuites", suites); printStrings("Enabled Ciphersuites", ssle.getEnabledCipherSuites()); - ssle.setEnabledCipherSuites(oneSuites); + ssle.setEnabledCipherSuites(new String [] { cipherSuite }); printStrings("Set Ciphersuites", ssle.getEnabledCipherSuites()); suites = ssle.getEnabledCipherSuites(); if ((ssle.getEnabledCipherSuites().length != 1) || - !(suites[0].equals(secondSuite))) { - throw new Exception("set ciphers not what was expected"); + !(suites[0].equals(cipherSuite))) { + throw new RuntimeException("set ciphers not what was expected"); } System.out.println(); String [] protocols = ssle.getSupportedProtocols(); - String secondProtocol = protocols[1]; - String [] oneProtocols = new String [] { protocols[1] }; + // sanity check that the protocol we want is still supported + Arrays.stream(protocols) + .filter(p -> p.equals(protocol)) + .findFirst() + .orElseThrow(() -> + new RuntimeException(protocol + + " is not a supported TLS protocol.")); printStrings("Supported Protocols", protocols); printStrings("Enabled Protocols", ssle.getEnabledProtocols()); - ssle.setEnabledProtocols(oneProtocols); + ssle.setEnabledProtocols(new String[]{ protocol }); printStrings("Set Protocols", ssle.getEnabledProtocols()); protocols = ssle.getEnabledProtocols(); if ((ssle.getEnabledProtocols().length != 1) || - !(protocols[0].equals(secondProtocol))) { - throw new Exception("set protocols not what was expected"); + !(protocols[0].equals(protocol))) { + throw new RuntimeException("set protocols not what was expected"); } System.out.println("Checking get/setUseClientMode"); ssle.setUseClientMode(true); - if (ssle.getUseClientMode() != true) { - throw new Exception("set/getUseClientMode false"); + if (!ssle.getUseClientMode()) { + throw new RuntimeException("set/getUseClientMode false"); } ssle.setUseClientMode(false); - if (ssle.getUseClientMode() != false) { - throw new Exception("set/getUseClientMode true"); + if (ssle.getUseClientMode()) { + throw new RuntimeException("set/getUseClientMode true"); } System.out.println("Checking get/setClientAuth"); ssle.setNeedClientAuth(false); - if (ssle.getNeedClientAuth() != false) { - throw new Exception("set/getNeedClientAuth true"); + if (ssle.getNeedClientAuth()) { + throw new RuntimeException("set/getNeedClientAuth true"); } ssle.setNeedClientAuth(true); - if (ssle.getNeedClientAuth() != true) { - throw new Exception("set/getNeedClientAuth false"); + if (!ssle.getNeedClientAuth()) { + throw new RuntimeException("set/getNeedClientAuth false"); } ssle.setWantClientAuth(true); - if (ssle.getNeedClientAuth() == true) { - throw new Exception("set/getWantClientAuth need = true"); + if (ssle.getNeedClientAuth()) { + throw new RuntimeException("set/getWantClientAuth need = true"); } - if (ssle.getWantClientAuth() != true) { - throw new Exception("set/getNeedClientAuth false"); + if (!ssle.getWantClientAuth()) { + throw new RuntimeException("set/getNeedClientAuth false"); } ssle.setWantClientAuth(false); - if (ssle.getWantClientAuth() != false) { - throw new Exception("set/getNeedClientAuth true"); + if (ssle.getWantClientAuth()) { + throw new RuntimeException("set/getNeedClientAuth true"); } /* @@ -158,13 +178,13 @@ System.out.println("checking session creation"); ssle.setEnableSessionCreation(false); - if (ssle.getEnableSessionCreation() != false) { - throw new Exception("set/getSessionCreation true"); + if (ssle.getEnableSessionCreation()) { + throw new RuntimeException("set/getSessionCreation true"); } ssle.setEnableSessionCreation(true); - if (ssle.getEnableSessionCreation() != true) { - throw new Exception("set/getSessionCreation false"); + if (!ssle.getEnableSessionCreation()) { + throw new RuntimeException("set/getSessionCreation false"); } /* Checking for overflow wrap/unwrap() */ @@ -172,18 +192,13 @@ if (ssle.wrap(smallBB, smallBB).getStatus() != Status.BUFFER_OVERFLOW) { - throw new Exception("wrap should have overflowed"); + throw new RuntimeException("wrap should have overflowed"); } // For unwrap(), the BUFFER_OVERFLOW will not be generated // until received SSL/TLS application data. // Test test/jdk/javax/net/ssl/SSLEngine/LargePacket.java will check // BUFFER_OVERFLOW/UNDERFLOW for both wrap() and unwrap(). - // - //if (ssle.unwrap(smallBB, smallBB).getStatus() != - // Status.BUFFER_OVERFLOW) { - // throw new Exception("unwrap should have overflowed"); - //} SSLSession ssls = ssle.getSession(); @@ -198,14 +213,18 @@ */ if (ssle.wrap(appBB, netBB).getHandshakeStatus() != HandshakeStatus.NEED_UNWRAP) { - throw new Exception("initial client hello needs unwrap"); + throw new RuntimeException("initial client hello needs unwrap"); } - /* Checking for overflow wrap/unwrap() */ - - if (ssle.wrap(appBB, netBB).getStatus() != - Status.BUFFER_OVERFLOW) { - throw new Exception("unwrap should have overflowed"); + /* + * After the first call to wrap(), the handshake status is + * NEED_UNWRAP and we need to receive data before doing anymore + * handshaking. + */ + SSLEngineResult result = ssle.wrap(appBB, netBB); + if (result.getStatus() != Status.OK + && result.bytesConsumed() != 0 && result.bytesProduced() != 0) { + throw new RuntimeException("wrap should have returned without doing anything"); } ByteBuffer ro = appBB.asReadOnlyBuffer(); @@ -220,7 +239,7 @@ try { ssle.unwrap(netBB, ro); - throw new Exception("unwrap wasn't ReadOnlyBufferException"); + throw new RuntimeException("unwrap wasn't ReadOnlyBufferException"); } catch (ReadOnlyBufferException e) { System.out.println("Caught the ReadOnlyBuffer: " + e); } @@ -235,7 +254,7 @@ appBB)).getStatus() != Status.BUFFER_UNDERFLOW) { System.out.println(sslER); - throw new Exception("unwrap should underflow"); + throw new RuntimeException("unwrap should underflow"); } if ((sslER = @@ -243,7 +262,7 @@ appBB)).getStatus() != Status.BUFFER_UNDERFLOW) { System.out.println(sslER); - throw new Exception("unwrap should underflow"); + throw new RuntimeException("unwrap should underflow"); } if ((sslER = @@ -251,15 +270,22 @@ appBB)).getStatus() != Status.BUFFER_UNDERFLOW) { System.out.println(sslER); - throw new Exception("unwrap should underflow"); + throw new RuntimeException("unwrap should underflow"); } // junk inbound message try { + /* + * Exceptions are thrown when: + * - the length field is correct but the data can't be decoded. + * - the length field is larger than max allowed. + */ ssle.unwrap(ByteBuffer.wrap(gobblydegook), appBB); - throw new Exception("Didn't catch the nasty SSLException"); - } catch (SSLException e) { - System.out.println("caught the nasty SSLException: " + e); + throw new RuntimeException("Expected SSLProtocolException was not thrown " + + "for bad input"); + } catch (SSLProtocolException e) { + System.out.println("caught the SSLProtocolException for bad decoding: " + + e); } System.out.println("Test PASSED"); @@ -280,8 +306,8 @@ (byte) 0x00 }; static byte [] gobblydegook = new byte [] { - // "HELLO HELLO" - (byte) 0x48, (byte) 0x45, (byte) 0x4C, (byte) 0x4C, (byte) 0x20, + // bad data but correct record length to cause decryption error + (byte) 0x48, (byte) 0x45, (byte) 0x4C, (byte) 0x00, (byte) 0x04, (byte) 0x48, (byte) 0x45, (byte) 0x4C, (byte) 0x4C }; static void printStrings(String label, String [] strs) { diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,714 +0,0 @@ -/* - * Copyright (c) 2003, 2015, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 4948079 - * @summary SSLEngineResult needs updating [none yet] - * @ignore the dependent implementation details are changed - * @run main/othervm -Djsse.enableCBCProtection=false CheckStatus - * - * @author Brad Wetmore - */ - -/* - * This is a simple hack to test a bunch of conditions and check - * their return codes. - */ -import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; - -public class CheckStatus { - - private static boolean debug = true; - - private SSLContext sslc; - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - private static String pathToStores = "../etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 - - /* - * Majority of the test case is here, setup is done below. - */ - - private void createSSLEngines() throws Exception { - ssle1 = sslc.createSSLEngine("client", 1); - ssle1.setUseClientMode(true); - - ssle2 = sslc.createSSLEngine("server", 2); - ssle2.setUseClientMode(false); - } - - private boolean isHandshaking(SSLEngine e) { - return (e.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING); - } - - private void checkResult(ByteBuffer bbIn, ByteBuffer bbOut, - SSLEngineResult result, - Status status, HandshakeStatus hsStatus, - int consumed, int produced) - throws Exception { - - if ((status != null) && (result.getStatus() != status)) { - throw new Exception("Unexpected Status: need = " + status + - " got = " + result.getStatus()); - } - - if ((hsStatus != null) && (result.getHandshakeStatus() != hsStatus)) { - throw new Exception("Unexpected hsStatus: need = " + hsStatus + - " got = " + result.getHandshakeStatus()); - } - - if ((consumed != -1) && (consumed != result.bytesConsumed())) { - throw new Exception("Unexpected consumed: need = " + consumed + - " got = " + result.bytesConsumed()); - } - - if ((produced != -1) && (produced != result.bytesProduced())) { - throw new Exception("Unexpected produced: need = " + produced + - " got = " + result.bytesProduced()); - } - - if ((consumed != -1) && (bbIn.position() != result.bytesConsumed())) { - throw new Exception("Consumed " + bbIn.position() + - " != " + consumed); - } - - if ((produced != -1) && (bbOut.position() != result.bytesProduced())) { - throw new Exception("produced " + bbOut.position() + - " != " + produced); - } - } - - private void test() throws Exception { - createSSLEngines(); - createBuffers(); - - SSLEngineResult result1; // ssle1's results from last operation - SSLEngineResult result2; // ssle2's results from last operation - - String [] suite1 = new String [] { - "SSL_RSA_WITH_RC4_128_MD5" }; - String [] suite2 = new String [] { - "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" }; - - ssle1.setEnabledCipherSuites(suite1); - ssle2.setEnabledCipherSuites(suite1); - - log("================"); - - log("unexpected empty unwrap"); - twoToOne.limit(0); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.NEED_WRAP, 0, 0); - twoToOne.limit(twoToOne.capacity()); - - log("======================================"); - log("client hello"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); - runDelegatedTasks(ssle2); - - oneToTwo.compact(); - - log("Check for unwrap when wrap needed"); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_WRAP, 0, 0); - - log("======================================"); - log("ServerHello"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); - twoToOne.compact(); - - runDelegatedTasks(ssle1); - - log("======================================"); - log("Key Exchange"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); - runDelegatedTasks(ssle2); - - oneToTwo.compact(); - - log("======================================"); - log("CCS"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_UNWRAP, - result1.bytesProduced(), 0); - - oneToTwo.compact(); - - log("======================================"); - log("Finished"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_WRAP, result1.bytesProduced(), 0); - - oneToTwo.compact(); - - log("======================================"); - log("CCS"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); - twoToOne.compact(); - - log("======================================"); - log("FINISHED"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.FINISHED, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.FINISHED, result2.bytesProduced(), 0); - twoToOne.compact(); - - log("======================================"); - log("Check Session/Ciphers"); - - String suite = ssle1.getSession().getCipherSuite(); - if (!suite.equals(suite1[0])) { - throw new Exception("suites not equal: " + suite + "/" + - suite1[0]); - } - - suite = ssle2.getSession().getCipherSuite(); - if (!suite.equals(suite1[0])) { - throw new Exception("suites not equal: " + suite + "/" + - suite1[0]); - } - - log("======================================"); - log("DATA"); - - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - appOut1.capacity(), -1); - oneToTwo.flip(); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - appOut2.capacity(), -1); - twoToOne.flip(); - - SSLEngineResult result3 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result3, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - result2.bytesProduced(), result2.bytesConsumed()); - twoToOne.compact(); - - SSLEngineResult result4 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result4, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - result1.bytesProduced(), result1.bytesConsumed()); - oneToTwo.compact(); - - appIn1.clear(); - appIn2.clear(); - appOut1.rewind(); - appOut2.rewind(); - - log("======================================"); - log("RENEGOTIATE"); - - ssle2.getSession().invalidate(); - ssle2.setNeedClientAuth(true); - - ssle1.setEnabledCipherSuites(suite2); - ssle2.setEnabledCipherSuites(suite2); - - ssle2.beginHandshake(); - - log("======================================"); - log("HelloRequest"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); - twoToOne.compact(); - - runDelegatedTasks(ssle1); - - log("======================================"); - log("ClientHello"); - - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); - runDelegatedTasks(ssle2); - - oneToTwo.compact(); - - log("======================================"); - log("CLIENT->SERVER DATA IN MIDDLE OF HANDSHAKE"); - - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, - appOut1.capacity(), -1); - oneToTwo.flip(); - - result4 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result4, - Status.OK, HandshakeStatus.NEED_WRAP, - result1.bytesProduced(), result1.bytesConsumed()); - oneToTwo.compact(); - - appIn2.clear(); - appOut1.rewind(); - - log("======================================"); - log("ServerHello"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); - twoToOne.compact(); - - runDelegatedTasks(ssle1); - - log("======================================"); - log("SERVER->CLIENT DATA IN MIDDLE OF HANDSHAKE"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NEED_UNWRAP, - appOut2.capacity(), -1); - twoToOne.flip(); - - result3 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result3, - Status.OK, HandshakeStatus.NEED_WRAP, - result2.bytesProduced(), result2.bytesConsumed()); - twoToOne.compact(); - - appIn1.clear(); - appOut2.rewind(); - - log("======================================"); - log("Client Cert and Key Exchange"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); - runDelegatedTasks(ssle2); - - oneToTwo.compact(); - - log("======================================"); - log("CCS"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_UNWRAP, - result1.bytesProduced(), 0); - - oneToTwo.compact(); - - log("======================================"); - log("Finished"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); - - oneToTwo.flip(); - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.OK, HandshakeStatus.NEED_WRAP, result1.bytesProduced(), 0); - - oneToTwo.compact(); - - log("======================================"); - log("CCS"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); - twoToOne.compact(); - - log("======================================"); - log("FINISHED"); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.FINISHED, 0, -1); - twoToOne.flip(); - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.OK, HandshakeStatus.FINISHED, result2.bytesProduced(), 0); - twoToOne.compact(); - - log("======================================"); - log("Check Session/Ciphers"); - - suite = ssle1.getSession().getCipherSuite(); - if (!suite.equals(suite2[0])) { - throw new Exception("suites not equal: " + suite + "/" + - suite2[0]); - } - - suite = ssle2.getSession().getCipherSuite(); - if (!suite.equals(suite2[0])) { - throw new Exception("suites not equal: " + suite + "/" + - suite2[0]); - } - - log("======================================"); - log("DATA USING NEW SESSION"); - - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - appOut1.capacity(), -1); - oneToTwo.flip(); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - appOut2.capacity(), -1); - twoToOne.flip(); - - result3 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result3, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - result2.bytesProduced(), result2.bytesConsumed()); - twoToOne.compact(); - - result4 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(oneToTwo, appIn2, result4, - Status.OK, HandshakeStatus.NOT_HANDSHAKING, - result1.bytesProduced(), result1.bytesConsumed()); - oneToTwo.compact(); - - appIn1.clear(); - appIn2.clear(); - appOut1.rewind(); - appOut2.rewind(); - - log("======================================"); - log("CN"); - - if (isHandshaking(ssle1)) { - throw new Exception("ssle1 IS handshaking"); - } - - if (isHandshaking(ssle2)) { - throw new Exception("ssle2 IS handshaking"); - } - - ssle2.closeOutbound(); - - if (!isHandshaking(ssle2)) { - throw new Exception("ssle1 IS NOT handshaking"); - } - - appOut1.rewind(); - appOut2.rewind(); - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.CLOSED, HandshakeStatus.NEED_UNWRAP, 0, -1); - twoToOne.flip(); - - if (ssle1.isInboundDone()) { - throw new Exception("ssle1 inboundDone"); - } - - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(twoToOne, appIn1, result1, - Status.CLOSED, HandshakeStatus.NEED_WRAP, - result2.bytesProduced(), 0); - twoToOne.compact(); - - if (!ssle1.isInboundDone()) { - throw new Exception("ssle1 inboundDone"); - } - - if (!isHandshaking(ssle1)) { - throw new Exception("ssle1 IS NOT handshaking"); - } - - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(appOut2, twoToOne, result2, - Status.CLOSED, HandshakeStatus.NEED_UNWRAP, 0, 0); - twoToOne.flip(); - - log("======================================"); - log("CN response"); - - if (ssle1.isOutboundDone()) { - throw new Exception("ssle1 outboundDone"); - } - - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(appOut1, oneToTwo, result1, - Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, 0, -1); - - if (!ssle1.isOutboundDone()) { - throw new Exception("ssle1 outboundDone is NOT done"); - } - - if (isHandshaking(ssle1)) { - throw new Exception("ssle1 IS handshaking"); - } - - oneToTwo.flip(); - - if (!ssle2.isOutboundDone()) { - throw new Exception("ssle1 outboundDone"); - } - - if (ssle2.isInboundDone()) { - throw new Exception("ssle1 inboundDone"); - } - - result2 = ssle2.unwrap(oneToTwo, appIn2); - - checkResult(oneToTwo, appIn2, result2, - Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - result1.bytesProduced(), 0); - - if (!ssle2.isOutboundDone()) { - throw new Exception("ssle1 outboundDone is NOT done"); - } - - if (!ssle2.isInboundDone()) { - throw new Exception("ssle1 inboundDone is NOT done"); - } - - if (isHandshaking(ssle2)) { - throw new Exception("ssle1 IS handshaking"); - } - - oneToTwo.compact(); - } - - public static void main(String args[]) throws Exception { - // reset the security property to make sure that the algorithms - // and keys used in this test are not disabled. - Security.setProperty("jdk.tls.disabledAlgorithms", ""); - - CheckStatus cs; - - cs = new CheckStatus(); - - cs.createSSLEngines(); - - cs.test(); - - System.out.println("Test Passed."); - } - - /* - * ********************************************************** - * Majority of the test case is above, below is just setup stuff - * ********************************************************** - */ - - public CheckStatus() throws Exception { - sslc = getSSLContext(keyFilename, trustFilename); - } - - /* - * Create an initialized SSLContext to use for this test. - */ - private SSLContext getSSLContext(String keyFile, String trustFile) - throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - return sslCtx; - } - - private void createBuffers() { - // Size the buffers as appropriate. - - SSLSession session = ssle1.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); - - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); - - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); - - log("AppOut1 = " + appOut1); - log("AppOut2 = " + appOut2); - log(""); - } - - private static void runDelegatedTasks(SSLEngine engine) throws Exception { - - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("running delegated task..."); - runnable.run(); - } - } - - private static void checkTransfer(ByteBuffer a, ByteBuffer b) - throws Exception { - a.flip(); - b.flip(); - - if (!a.equals(b)) { - throw new Exception("Data didn't transfer cleanly"); - } else { - log("Data transferred cleanly"); - } - - a.position(a.limit()); - b.position(b.limit()); - a.limit(a.capacity()); - b.limit(b.capacity()); - } - - private static void log(String str) { - if (debug) { - System.out.println(str); - } - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/CheckTlsEngineResults.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/CheckTlsEngineResults.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/CheckTlsEngineResults.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/CheckTlsEngineResults.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,709 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4948079 + * @summary Verify return values from SSLEngine wrap/unwrap (TLSv1.2) operations + * + * @run main CheckTlsEngineResults + * + * @author Brad Wetmore + */ + +/* + * This is a simple hack to test a bunch of conditions and check + * their return codes. + */ +import javax.net.ssl.*; +import javax.net.ssl.SSLEngineResult.*; +import java.io.*; +import java.security.*; +import java.nio.*; + +public class CheckTlsEngineResults { + + private final SSLContext SSL_CONTEXT; + private SSLEngine clientEngine; // client + private SSLEngine serverEngine; // server + + private static final String PATH_TO_STORES = "../etc"; + + private static final String KEYSTORE_FILE = "keystore"; + private static final String TRUSTSTORE_FILE = "truststore"; + + private static final String keyFilename = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + KEYSTORE_FILE; + private static final String trustFilename = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + TRUSTSTORE_FILE; + + private ByteBuffer clientOut; // write side of clientEngine + private ByteBuffer clientIn; // read side of clientEngine + private ByteBuffer serverOut; // write side of serverEngine + private ByteBuffer serverIn; // read side of serverEngine + + private ByteBuffer clientToServer; // "reliable" transport clientEngine->serverEngine + private ByteBuffer serverToClient; // "reliable" transport serverEngine->clientEngine + + /* + * Majority of the test case is here, setup is done below. + */ + + private void createSSLEngines() throws Exception { + clientEngine = SSL_CONTEXT.createSSLEngine("client", 1); + clientEngine.setUseClientMode(true); + + serverEngine = SSL_CONTEXT.createSSLEngine("server", 2); + serverEngine.setUseClientMode(false); + } + + private boolean isHandshaking(SSLEngine e) { + return (e.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING); + } + + private void checkResult(ByteBuffer bbIn, ByteBuffer bbOut, + SSLEngineResult result, + Status status, HandshakeStatus hsStatus, + int consumed, int produced) + throws Exception { + + if ((status != null) && (result.getStatus() != status)) { + throw new Exception("Unexpected Status: need = " + status + + " got = " + result.getStatus()); + } + + if ((hsStatus != null) && (result.getHandshakeStatus() != hsStatus)) { + throw new Exception("Unexpected hsStatus: need = " + hsStatus + + " got = " + result.getHandshakeStatus()); + } + + if ((consumed != -1) && (consumed != result.bytesConsumed())) { + throw new Exception("Unexpected consumed: need = " + consumed + + " got = " + result.bytesConsumed()); + } + + if ((produced != -1) && (produced != result.bytesProduced())) { + throw new Exception("Unexpected produced: need = " + produced + + " got = " + result.bytesProduced()); + } + + if ((consumed != -1) && (bbIn.position() != result.bytesConsumed())) { + throw new Exception("Consumed " + bbIn.position() + + " != " + consumed); + } + + if ((produced != -1) && (bbOut.position() != result.bytesProduced())) { + throw new Exception("produced " + bbOut.position() + + " != " + produced); + } + } + + private void test() throws Exception { + createSSLEngines(); + createBuffers(); + + SSLEngineResult result1; // clientEngine's results from last operation + SSLEngineResult result2; // serverEngine's results from last operation + String [] suite1 = new String [] { + "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" }; + String [] suite2 = new String [] { + "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" }; + + clientEngine.setEnabledCipherSuites(suite1); + serverEngine.setEnabledCipherSuites(suite1); + + log("================"); + + log("unexpected empty unwrap"); + serverToClient.limit(0); + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_WRAP, 0, 0); + serverToClient.limit(serverToClient.capacity()); + + log("======================================"); + log("Client -> Server [ClientHello]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); + runDelegatedTasks(serverEngine); + + clientToServer.compact(); + + log("Check for unwrap when wrap needed"); + result2 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_WRAP, 0, 0); + + log("======================================"); + log("Server -> Client [ServerHello]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); + serverToClient.compact(); + + runDelegatedTasks(clientEngine); + + log("======================================"); + log("Client -> Server [ClientKeyExchange]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); + runDelegatedTasks(serverEngine); + + clientToServer.compact(); + + log("======================================"); + log("Client -> Server [ChangeCipherSpec]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_UNWRAP, + result1.bytesProduced(), 0); + + clientToServer.compact(); + + log("======================================"); + log("Client -> Server [Finished]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_WRAP, result1.bytesProduced(), 0); + + clientToServer.compact(); + + log("======================================"); + log("Server -> Client [NewSessionTicket]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); + serverToClient.compact(); + + log("======================================"); + log("Server -> Client [ChangeCipherSpec]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); + serverToClient.compact(); + + log("======================================"); + log("Server -> Client [Finished]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.FINISHED, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.FINISHED, result2.bytesProduced(), 0); + serverToClient.compact(); + + + log("======================================"); + log("Check Session/Ciphers"); + + String suite = clientEngine.getSession().getCipherSuite(); + if (!suite.equals(suite1[0])) { + throw new Exception("suites not equal: " + suite + "/" + + suite1[0]); + } + + suite = serverEngine.getSession().getCipherSuite(); + if (!suite.equals(suite1[0])) { + throw new Exception("suites not equal: " + suite + "/" + + suite1[0]); + } + + log("======================================"); + log("DATA"); + + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + clientOut.capacity(), -1); + clientToServer.flip(); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + serverOut.capacity(), -1); + serverToClient.flip(); + + SSLEngineResult result3 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result3, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + result2.bytesProduced(), result2.bytesConsumed()); + serverToClient.compact(); + + SSLEngineResult result4 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(clientToServer, serverIn, result4, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + result1.bytesProduced(), result1.bytesConsumed()); + clientToServer.compact(); + + clientIn.clear(); + serverIn.clear(); + clientOut.rewind(); + serverOut.rewind(); + + log("======================================"); + log("RENEGOTIATE"); + + serverEngine.getSession().invalidate(); + serverEngine.setNeedClientAuth(true); + + clientEngine.setEnabledCipherSuites(suite2); + serverEngine.setEnabledCipherSuites(suite2); + + serverEngine.beginHandshake(); + + log("======================================"); + log("Server -> Client [HelloRequest]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); + serverToClient.compact(); + + runDelegatedTasks(clientEngine); + + log("======================================"); + log("CLient -> Server [ClientHello]"); + + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); + runDelegatedTasks(serverEngine); + + clientToServer.compact(); + + log("======================================"); + log("CLIENT->SERVER DATA IN MIDDLE OF HANDSHAKE"); + + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, + clientOut.capacity(), -1); + clientToServer.flip(); + + result4 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(clientToServer, serverIn, result4, + Status.OK, HandshakeStatus.NEED_WRAP, + result1.bytesProduced(), result1.bytesConsumed()); + clientToServer.compact(); + + serverIn.clear(); + clientOut.rewind(); + + log("======================================"); + log("Server -> Client [ServerHello]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_TASK, result2.bytesProduced(), 0); + serverToClient.compact(); + + runDelegatedTasks(clientEngine); + + log("======================================"); + log("SERVER->CLIENT DATA IN MIDDLE OF HANDSHAKE"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_UNWRAP, + serverOut.capacity(), -1); + serverToClient.flip(); + + result3 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result3, + Status.OK, HandshakeStatus.NEED_WRAP, + result2.bytesProduced(), result2.bytesConsumed()); + serverToClient.compact(); + + clientIn.clear(); + serverOut.rewind(); + + log("======================================"); + log("Client -> Server [Certificate] and [ClientKeyExchange]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_TASK, result1.bytesProduced(), 0); + runDelegatedTasks(serverEngine); + + clientToServer.compact(); + + log("======================================"); + log("Client -> Server [ChangeCipherSpec]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_UNWRAP, + result1.bytesProduced(), 0); + + clientToServer.compact(); + + log("======================================"); + log("Client -> Server [Finished]"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, 0, -1); + + clientToServer.flip(); + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.OK, HandshakeStatus.NEED_WRAP, result1.bytesProduced(), 0); + + clientToServer.compact(); + + log("======================================"); + log("Server -> Client [NewSessionTicket]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); + serverToClient.compact(); + + log("======================================"); + log("Server -> Client [ChangeCipherSpec]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NEED_WRAP, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.NEED_UNWRAP, result2.bytesProduced(), 0); + serverToClient.compact(); + + log("======================================"); + log("Server -> Client [Finished]"); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.FINISHED, 0, -1); + serverToClient.flip(); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.OK, HandshakeStatus.FINISHED, result2.bytesProduced(), 0); + serverToClient.compact(); + + log("======================================"); + log("Check Session/Ciphers"); + + suite = clientEngine.getSession().getCipherSuite(); + if (!suite.equals(suite2[0])) { + throw new Exception("suites not equal: " + suite + "/" + + suite2[0]); + } + + suite = serverEngine.getSession().getCipherSuite(); + if (!suite.equals(suite2[0])) { + throw new Exception("suites not equal: " + suite + "/" + + suite2[0]); + } + + log("======================================"); + log("DATA USING NEW SESSION"); + + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + clientOut.capacity(), -1); + clientToServer.flip(); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + serverOut.capacity(), -1); + serverToClient.flip(); + + result3 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result3, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + result2.bytesProduced(), result2.bytesConsumed()); + serverToClient.compact(); + + result4 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(clientToServer, serverIn, result4, + Status.OK, HandshakeStatus.NOT_HANDSHAKING, + result1.bytesProduced(), result1.bytesConsumed()); + clientToServer.compact(); + + clientIn.clear(); + serverIn.clear(); + clientOut.rewind(); + serverOut.rewind(); + + log("======================================"); + log("Server -> Client [CloseNotify]"); + + if (isHandshaking(clientEngine)) { + throw new Exception("clientEngine IS handshaking"); + } + + if (isHandshaking(serverEngine)) { + throw new Exception("serverEngine IS handshaking"); + } + + serverEngine.closeOutbound(); + + if (!isHandshaking(serverEngine)) { + throw new Exception("serverEngine IS NOT handshaking"); + } + + clientOut.rewind(); + serverOut.rewind(); + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, 0, -1); + serverToClient.flip(); + + if (clientEngine.isInboundDone()) { + throw new Exception("clientEngine inboundDone"); + } + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(serverToClient, clientIn, result1, + Status.CLOSED, HandshakeStatus.NEED_WRAP, + result2.bytesProduced(), 0); + serverToClient.compact(); + + if (!clientEngine.isInboundDone()) { + throw new Exception("clientEngine inboundDone"); + } + + if (!isHandshaking(clientEngine)) { + throw new Exception("clientEngine IS NOT handshaking"); + } + + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(serverOut, serverToClient, result2, + Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, 0, 0); + serverToClient.flip(); + + log("======================================"); + log("CloseNotify response"); + + if (clientEngine.isOutboundDone()) { + throw new Exception("clientEngine outboundDone"); + } + + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientOut, clientToServer, result1, + Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, 0, -1); + + if (!clientEngine.isOutboundDone()) { + throw new Exception("clientEngine outboundDone is NOT done"); + } + + if (isHandshaking(clientEngine)) { + throw new Exception("clientEngine IS handshaking"); + } + + clientToServer.flip(); + + if (!serverEngine.isOutboundDone()) { + throw new Exception("clientEngine outboundDone"); + } + + if (serverEngine.isInboundDone()) { + throw new Exception("clientEngine inboundDone"); + } + + result2 = serverEngine.unwrap(clientToServer, serverIn); + + checkResult(clientToServer, serverIn, result2, + Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + result1.bytesProduced(), 0); + + if (!serverEngine.isOutboundDone()) { + throw new Exception("clientEngine outboundDone is NOT done"); + } + + if (!serverEngine.isInboundDone()) { + throw new Exception("clientEngine inboundDone is NOT done"); + } + + if (isHandshaking(serverEngine)) { + throw new Exception("clientEngine IS handshaking"); + } + + clientToServer.compact(); + } + + public static void main(String args[]) throws Exception { + CheckTlsEngineResults cs = new CheckTlsEngineResults(); + cs.test(); + System.out.println("Test Passed."); + } + + /* + * ********************************************************** + * Majority of the test case is above, below is just setup stuff + * ********************************************************** + */ + + public CheckTlsEngineResults() throws Exception { + SSL_CONTEXT = getSSLContext(keyFilename, trustFilename); + } + + /* + * Create an initialized SSLContext to use for this test. + */ + private SSLContext getSSLContext(String keyFile, String trustFile) + throws Exception { + + KeyStore ks = KeyStore.getInstance("JKS"); + KeyStore ts = KeyStore.getInstance("JKS"); + + char[] passphrase = "passphrase".toCharArray(); + + ks.load(new FileInputStream(keyFile), passphrase); + ts.load(new FileInputStream(trustFile), passphrase); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, passphrase); + + TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); + tmf.init(ts); + + SSLContext sslCtx = SSLContext.getInstance("TLSv1.2"); + + sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + + return sslCtx; + } + + private void createBuffers() { + // Size the buffers as appropriate. + + SSLSession session = clientEngine.getSession(); + int appBufferMax = session.getApplicationBufferSize(); + int netBufferMax = session.getPacketBufferSize(); + + clientIn = ByteBuffer.allocateDirect(appBufferMax + 50); + serverIn = ByteBuffer.allocateDirect(appBufferMax + 50); + + clientToServer = ByteBuffer.allocateDirect(netBufferMax); + serverToClient = ByteBuffer.allocateDirect(netBufferMax); + + clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); + serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); + + log("Client out = " + clientOut); + log("Server out = " + serverOut); + log(""); + } + + private static void runDelegatedTasks(SSLEngine engine) { + + Runnable runnable; + while ((runnable = engine.getDelegatedTask()) != null) { + log("Running delegated task..."); + runnable.run(); + } + } + + private static void log(String str) { + System.out.println(str); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -26,10 +26,10 @@ * @bug 4495742 * @summary Add non-blocking SSL/TLS functionality, usable with any * I/O abstraction - * @ignore the dependent implementation details are changed * @author Brad Wetmore * - * @run main/othervm ConnectionTest + * @run main/othervm ConnectionTest TLSv1.2 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + * @run main/othervm ConnectionTest TLSv1.3 TLS_AES_256_GCM_SHA384 */ /* @@ -46,44 +46,46 @@ public class ConnectionTest { - private SSLContext sslc; - private SSLEngine ssle1; - private SSLEngine ssle2; - - private static String pathToStores = "../etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appIn1, appOut1; - private ByteBuffer appIn2, appOut2; - private ByteBuffer oneToTwo, twoToOne; + private final SSLEngine clientEngine; + private final SSLEngine serverEngine; + + private static final String PATH_TO_STORES = "../etc"; + private static final String KEYSTORE_FILE = "keystore"; + private static final String TRUSTSTORE_FILE = "truststore"; + + private static final String KEYSTORE_PATH = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + KEYSTORE_FILE; + private static final String TRUSTSTORE_PATH = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + TRUSTSTORE_FILE; + + private ByteBuffer clientIn, clientOut; + private ByteBuffer serverIn, serverOut; + private ByteBuffer clientToServer, serverToClient; private ByteBuffer emptyBuffer; - private ByteBuffer oneToTwoShifter, twoToOneShifter; + private ByteBuffer clientToServerShifter, serverToClientShifter; - private String hostname = "hostname"; - private int portNumber = 77; + private final String HOSTNAME = "hostname"; - public ConnectionTest() - throws Exception { + private final int PORT_NUMBER = 77; - sslc = getSSLContext(); - ssle1 = sslc.createSSLEngine(hostname, portNumber); - ssle2 = sslc.createSSLEngine(); + public ConnectionTest(String enabledProtocol, String enabledCipherSuite) + throws Exception { - ssle1.setEnabledCipherSuites(new String [] { - "SSL_RSA_WITH_RC4_128_MD5"}); + SSLContext sslContext = getSSLContext(); + clientEngine = sslContext.createSSLEngine(HOSTNAME, PORT_NUMBER); + serverEngine = sslContext.createSSLEngine(); + + clientEngine.setEnabledCipherSuites(new String [] { + enabledCipherSuite}); + clientEngine.setEnabledProtocols(new String[]{enabledProtocol}); + + serverEngine.setEnabledCipherSuites(new String [] { + enabledCipherSuite}); + serverEngine.setEnabledProtocols(new String[]{enabledProtocol}); - ssle2.setEnabledCipherSuites(new String [] { - "SSL_RSA_WITH_RC4_128_MD5"}); createBuffers(); } @@ -93,8 +95,8 @@ KeyStore ts = KeyStore.getInstance("JKS"); char[] passphrase = "passphrase".toCharArray(); - ks.load(new FileInputStream(keyFilename), passphrase); - ts.load(new FileInputStream(trustFilename), passphrase); + ks.load(new FileInputStream(KEYSTORE_PATH), passphrase); + ts.load(new FileInputStream(TRUSTSTORE_PATH), passphrase); KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); kmf.init(ks, passphrase); @@ -111,62 +113,62 @@ private void createBuffers() { // Size the buffers as appropriate. - SSLSession session = ssle1.getSession(); + SSLSession session = clientEngine.getSession(); int appBufferMax = session.getApplicationBufferSize(); int netBufferMax = session.getPacketBufferSize(); - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 10); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 10); + clientIn = ByteBuffer.allocateDirect(appBufferMax + 10); + serverIn = ByteBuffer.allocateDirect(appBufferMax + 10); - appIn1.position(10); - appIn2.position(10); + clientIn.position(10); + serverIn.position(10); - oneToTwo = ByteBuffer.allocateDirect(netBufferMax + 10); - twoToOne = ByteBuffer.allocateDirect(netBufferMax + 10); + clientToServer = ByteBuffer.allocateDirect(netBufferMax + 10); + serverToClient = ByteBuffer.allocateDirect(netBufferMax + 10); - oneToTwo.position(10); - twoToOne.position(10); - oneToTwoShifter = oneToTwo.slice(); - twoToOneShifter = twoToOne.slice(); + clientToServer.position(10); + serverToClient.position(10); + clientToServerShifter = clientToServer.slice(); + serverToClientShifter = serverToClient.slice(); - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); + clientOut = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); + serverOut = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); emptyBuffer = ByteBuffer.allocate(10); emptyBuffer.limit(5); emptyBuffer.position(emptyBuffer.limit()); - System.out.println("AppOut1 = " + appOut1); - System.out.println("AppOut2 = " + appOut2); - System.out.println(); + log("clientOut = " + clientOut); + log("serverOut = " + serverOut); + log(""); } private void checkResult(SSLEngineResult result, Status status, HandshakeStatus hsStatus, int consumed, int produced, - boolean done) throws Exception { + boolean done) { if ((status != null) && (result.getStatus() != status)) { - throw new Exception("Unexpected Status: need = " + status + + throw new RuntimeException("Unexpected Status: need = " + status + " got = " + result.getStatus()); } if ((hsStatus != null) && (result.getHandshakeStatus() != hsStatus)) { - throw new Exception("Unexpected hsStatus: need = " + hsStatus + + throw new RuntimeException("Unexpected hsStatus: need = " + hsStatus + " got = " + result.getHandshakeStatus()); } if ((consumed != -1) && (consumed != result.bytesConsumed())) { - throw new Exception("Unexpected consumed: need = " + consumed + + throw new RuntimeException("Unexpected consumed: need = " + consumed + " got = " + result.bytesConsumed()); } if ((produced != -1) && (produced != result.bytesProduced())) { - throw new Exception("Unexpected produced: need = " + produced + + throw new RuntimeException("Unexpected produced: need = " + produced + " got = " + result.bytesProduced()); } if (done && (hsStatus == HandshakeStatus.FINISHED)) { - throw new Exception( + throw new RuntimeException( "Handshake already reported finished"); } @@ -177,13 +179,13 @@ } private void test() throws Exception { - ssle1.setUseClientMode(true); - ssle2.setUseClientMode(false); - ssle2.setNeedClientAuth(true); - - System.out.println("Testing for early unwrap/wrap"); - SSLEngineResult result1 = ssle1.unwrap(twoToOne, appIn1); - SSLEngineResult result2 = ssle2.wrap(appOut2, oneToTwo); + clientEngine.setUseClientMode(true); + serverEngine.setUseClientMode(false); + serverEngine.setNeedClientAuth(true); + + log("Testing for early unwrap/wrap"); + SSLEngineResult result1 = clientEngine.unwrap(serverToClient, clientIn); + SSLEngineResult result2 = serverEngine.wrap(serverOut, clientToServer); /* * These should not consume/produce data, because they @@ -195,195 +197,66 @@ checkResult(result2, Status.OK, HandshakeStatus.NEED_UNWRAP, 0, 0, false); - System.out.println("Doing Initial Handshake"); - - boolean done1 = false; - boolean done2 = false; + log("Doing Initial Handshake"); /* * Do initial handshaking */ - while (isHandshaking(ssle1) || - isHandshaking(ssle2)) { - - System.out.println("================"); - - result1 = ssle1.wrap(emptyBuffer, oneToTwo); - checkResult(result1, null, null, 0, -1, done1); - result2 = ssle2.wrap(emptyBuffer, twoToOne); - checkResult(result2, null, null, 0, -1, done2); - - if (result1.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done1 = true; - } - - if (result2.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done2 = true; - } - - System.out.println("wrap1 = " + result1); - System.out.println("wrap2 = " + result2); - - if (result1.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = ssle1.getDelegatedTask()) != null) { - runnable.run(); - } - } - - if (result2.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = ssle2.getDelegatedTask()) != null) { - runnable.run(); - } - } - - oneToTwo.flip(); - twoToOne.flip(); - - oneToTwo.position(10); - twoToOne.position(10); + handshake(); - System.out.println("----"); + checkEngineAndSession(); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(result1, null, null, -1, 0, done1); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(result2, null, null, -1, 0, done2); - - if (result1.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done1 = true; - } - - if (result2.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done2 = true; - } - - if (result1.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = ssle1.getDelegatedTask()) != null) { - runnable.run(); - } - } - - if (result2.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = ssle2.getDelegatedTask()) != null) { - runnable.run(); - } - } - - System.out.println("unwrap1 = " + result1); - System.out.println("unwrap2 = " + result2); - - oneToTwoShifter.position(oneToTwo.position() - 10); - oneToTwoShifter.limit(oneToTwo.limit() - 10); - twoToOneShifter.position(twoToOne.position() - 10); - twoToOneShifter.limit(twoToOne.limit() - 10); - oneToTwoShifter.compact(); - twoToOneShifter.compact(); - oneToTwo.position(oneToTwoShifter.position() + 10); - oneToTwo.limit(oneToTwoShifter.limit() + 10); - twoToOne.position(twoToOneShifter.position() + 10); - twoToOne.limit(twoToOneShifter.limit() + 10); - } - - System.out.println("\nDONE HANDSHAKING"); - System.out.println("================"); - - if (!done1 || !done2) { - throw new Exception("Both should be true:\n" + - " done1 = " + done1 + " done2 = " + done2); - } - - String host = ssle1.getPeerHost(); - int port = ssle1.getPeerPort(); - if (!host.equals(hostname) || (port != portNumber)) { - throw new Exception("unexpected host/port " + host + ":" + port); - } - - host = ssle2.getPeerHost(); - port = ssle2.getPeerPort(); - if ((host != null) || (port != -1)) { - throw new Exception("unexpected host/port " + host + ":" + port); - } - - SSLSession ssls1 = ssle1.getSession(); - - host = ssls1.getPeerHost(); - port = ssls1.getPeerPort(); - if (!host.equals(hostname) || (port != portNumber)) { - throw new Exception("unexpected host/port " + host + ":" + port); - } - - SSLSession ssls2 = ssle2.getSession(); - - host = ssls2.getPeerHost(); - port = ssls2.getPeerPort(); - if ((host != null) || (port != -1)) { - throw new Exception("unexpected host/port " + host + ":" + port); - } + SSLSession clientSession1 = clientEngine.getSession(); + SSLSession serverSession1 = serverEngine.getSession(); /* * Should be able to write/read a small buffer like this. */ - int appOut1Len = appOut1.remaining(); - int appOut2Len = appOut2.remaining(); + int appOut1Len = clientOut.remaining(); + int appOut2Len = serverOut.remaining(); int net1Len; int net2Len; - result1 = ssle1.wrap(appOut1, oneToTwo); + result1 = clientEngine.wrap(clientOut, clientToServer); checkResult(result1, Status.OK, HandshakeStatus.NOT_HANDSHAKING, appOut1Len, -1, false); - result2 = ssle2.wrap(appOut2, twoToOne); + result2 = serverEngine.wrap(serverOut, serverToClient); checkResult(result2, Status.OK, HandshakeStatus.NOT_HANDSHAKING, appOut2Len, -1, false); net1Len = result1.bytesProduced(); net2Len = result2.bytesProduced(); - System.out.println("wrap1 = " + result1); - System.out.println("wrap2 = " + result2); + log("wrap1 = " + result1); + log("wrap2 = " + result2); - oneToTwo.flip(); - twoToOne.flip(); + clientToServer.flip(); + serverToClient.flip(); - oneToTwo.position(10); - twoToOne.position(10); + clientToServer.position(10); + serverToClient.position(10); - System.out.println("----"); + log("----"); - result1 = ssle1.unwrap(twoToOne, appIn1); + result1 = clientEngine.unwrap(serverToClient, clientIn); checkResult(result1, Status.OK, HandshakeStatus.NOT_HANDSHAKING, net2Len, appOut2Len, false); - result2 = ssle2.unwrap(oneToTwo, appIn2); + result2 = serverEngine.unwrap(clientToServer, serverIn); checkResult(result2, Status.OK, HandshakeStatus.NOT_HANDSHAKING, net1Len, appOut1Len, false); - System.out.println("unwrap1 = " + result1); - System.out.println("unwrap2 = " + result2); + log("unwrap1 = " + result1); + log("unwrap2 = " + result2); - oneToTwoShifter.position(oneToTwo.position() - 10); - oneToTwoShifter.limit(oneToTwo.limit() - 10); - twoToOneShifter.position(twoToOne.position() - 10); - twoToOneShifter.limit(twoToOne.limit() - 10); - oneToTwoShifter.compact(); - twoToOneShifter.compact(); - oneToTwo.position(oneToTwoShifter.position() + 10); - oneToTwo.limit(oneToTwoShifter.limit() + 10); - twoToOne.position(twoToOneShifter.position() + 10); - twoToOne.limit(twoToOneShifter.limit() + 10); - - ssls2.invalidate(); - ssle2.beginHandshake(); + updateByteBuffers(); - System.out.println("\nRENEGOTIATING"); - System.out.println("============="); + serverSession1.invalidate(); + serverEngine.beginHandshake(); - done1 = false; - done2 = false; + log("\nRENEGOTIATING"); + log("============="); - appIn1.clear(); - appIn2.clear(); + clientIn.clear(); + serverIn.clear(); /* * Do a quick test to see if this can do a switch @@ -391,287 +264,334 @@ * to switch back. */ try { - System.out.println("Try to change client mode"); - ssle2.setUseClientMode(true); - throw new Exception("Should have thrown IllegalArgumentException"); + log("Try to change client mode"); + serverEngine.setUseClientMode(true); + throw new RuntimeException("Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException e) { - System.out.println("Caught correct IllegalArgumentException"); + log("Caught correct IllegalArgumentException"); } - while (isHandshaking(ssle1) || - isHandshaking(ssle2)) { + handshake(); - System.out.println("================"); + SSLSession clientSession2 = clientEngine.getSession(); + SSLSession serverSession2 = serverEngine.getSession(); - result1 = ssle1.wrap(emptyBuffer, oneToTwo); - checkResult(result1, null, null, 0, -1, done1); - result2 = ssle2.wrap(emptyBuffer, twoToOne); - checkResult(result2, null, null, 0, -1, done2); + + log("\nDoing close"); + log("==========="); + + clientEngine.closeOutbound(); + serverEngine.closeOutbound(); + + clientToServer.flip(); + serverToClient.flip(); + clientToServer.position(10); + serverToClient.position(10); + + clientIn.clear(); + serverIn.clear(); + + log("LAST UNWRAP"); + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(result1, Status.BUFFER_UNDERFLOW, + HandshakeStatus.NEED_WRAP, 0, 0, false); + result2 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(result2, Status.BUFFER_UNDERFLOW, + HandshakeStatus.NEED_WRAP, 0, 0, false); + + log("unwrap1 = " + result1); + log("unwrap2 = " + result2); + + updateByteBuffers(); + + log("LAST WRAP"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + 0, -1, false); + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + 0, -1, false); + + log("wrap1 = " + result1); + log("wrap2 = " + result2); + + net1Len = result1.bytesProduced(); + net2Len = result2.bytesProduced(); + + clientToServer.flip(); + serverToClient.flip(); + + clientToServer.position(10); + serverToClient.position(10); + + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + net1Len, 0, false); + result2 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + net2Len, 0, false); + + log("unwrap1 = " + result1); + log("unwrap2 = " + result2); + + updateByteBuffers(); + + log("EXTRA WRAP"); + result1 = clientEngine.wrap(clientOut, clientToServer); + checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + 0, 0, false); + result2 = serverEngine.wrap(serverOut, serverToClient); + checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + 0, 0, false); + + log("wrap1 = " + result1); + log("wrap2 = " + result2); + + clientToServer.flip(); + serverToClient.flip(); + clientToServer.position(10); + serverToClient.position(10); + + log("EXTRA UNWRAP"); + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + 0, 0, false); + result2 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, + 0, 0, false); + + log("unwrap1 = " + result1); + log("unwrap2 = " + result2); + + checkSession(clientSession1, serverSession1, clientSession2, serverSession2); + log(clientEngine); + log(serverEngine); + } + + private void handshake() throws Exception { + boolean clientDone = false; + boolean serverDone = false; + SSLEngineResult result2; + SSLEngineResult result1; + while (isHandshaking(clientEngine) || + isHandshaking(serverEngine)) { + + log("================"); + + result1 = clientEngine.wrap(emptyBuffer, clientToServer); + checkResult(result1, null, null, 0, -1, clientDone); + result2 = serverEngine.wrap(emptyBuffer, serverToClient); + checkResult(result2, null, null, 0, -1, serverDone); if (result1.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done1 = true; + clientDone = true; } if (result2.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done2 = true; + serverDone = true; } - System.out.println("wrap1 = " + result1); - System.out.println("wrap2 = " + result2); + log("wrap1 = " + result1); + log("wrap2 = " + result2); if (result1.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { Runnable runnable; - while ((runnable = ssle1.getDelegatedTask()) != null) { + while ((runnable = clientEngine.getDelegatedTask()) != null) { runnable.run(); } } if (result2.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { Runnable runnable; - while ((runnable = ssle2.getDelegatedTask()) != null) { + while ((runnable = serverEngine.getDelegatedTask()) != null) { runnable.run(); } } - oneToTwo.flip(); - twoToOne.flip(); + clientToServer.flip(); + serverToClient.flip(); - oneToTwo.position(10); - twoToOne.position(10); + clientToServer.position(10); + serverToClient.position(10); - System.out.println("----"); + log("----"); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(result1, null, null, -1, 0, done1); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(result2, null, null, -1, 0, done2); + result1 = clientEngine.unwrap(serverToClient, clientIn); + checkResult(result1, null, null, -1, 0, clientDone); + result2 = serverEngine.unwrap(clientToServer, serverIn); + checkResult(result2, null, null, -1, 0, serverDone); if (result1.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done1 = true; + clientDone = true; } if (result2.getHandshakeStatus() == HandshakeStatus.FINISHED) { - done2 = true; + serverDone = true; } - System.out.println("unwrap1 = " + result1); - System.out.println("unwrap2 = " + result2); + log("unwrap1 = " + result1); + log("unwrap2 = " + result2); if (result1.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { Runnable runnable; - while ((runnable = ssle1.getDelegatedTask()) != null) { + while ((runnable = clientEngine.getDelegatedTask()) != null) { runnable.run(); } } if (result2.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { Runnable runnable; - while ((runnable = ssle2.getDelegatedTask()) != null) { + while ((runnable = serverEngine.getDelegatedTask()) != null) { runnable.run(); } } - oneToTwoShifter.position(oneToTwo.position() - 10); - oneToTwoShifter.limit(oneToTwo.limit() - 10); - twoToOneShifter.position(twoToOne.position() - 10); - twoToOneShifter.limit(twoToOne.limit() - 10); - oneToTwoShifter.compact(); - twoToOneShifter.compact(); - oneToTwo.position(oneToTwoShifter.position() + 10); - oneToTwo.limit(oneToTwoShifter.limit() + 10); - twoToOne.position(twoToOneShifter.position() + 10); - twoToOne.limit(twoToOneShifter.limit() + 10); - } - - host = ssle1.getPeerHost(); - port = ssle1.getPeerPort(); - if (!host.equals(hostname) || (port != portNumber)) { - throw new Exception("unexpected host/port " + host + ":" + port); - } - - host = ssle2.getPeerHost(); - port = ssle2.getPeerPort(); - if ((host != null) || (port != -1)) { - throw new Exception("unexpected host/port " + host + ":" + port); + updateByteBuffers(); } - SSLSession ssls3 = ssle2.getSession(); - host = ssls1.getPeerHost(); - port = ssls1.getPeerPort(); - if (!host.equals(hostname) || (port != portNumber)) { - throw new Exception("unexpected host/port " + host + ":" + port); - } + log("\nDONE HANDSHAKING"); + log("================"); - SSLSession ssls4 = ssle2.getSession(); - - host = ssls2.getPeerHost(); - port = ssls2.getPeerPort(); - if ((host != null) || (port != -1)) { - throw new Exception("unexpected host/port " + host + ":" + port); + if (!clientDone || !serverDone) { + throw new RuntimeException("Both should be true:\n" + + " clientDone = " + clientDone + " serverDone = " + serverDone); } + } - System.out.println("\nDoing close"); - System.out.println("==========="); - - ssle1.closeOutbound(); - ssle2.closeOutbound(); - - oneToTwo.flip(); - twoToOne.flip(); - oneToTwo.position(10); - twoToOne.position(10); - - appIn1.clear(); - appIn2.clear(); - - System.out.println("LAST UNWRAP"); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(result1, Status.BUFFER_UNDERFLOW, - HandshakeStatus.NEED_WRAP, 0, 0, false); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(result2, Status.BUFFER_UNDERFLOW, - HandshakeStatus.NEED_WRAP, 0, 0, false); - - System.out.println("unwrap1 = " + result1); - System.out.println("unwrap2 = " + result2); - - oneToTwoShifter.position(oneToTwo.position() - 10); - oneToTwoShifter.limit(oneToTwo.limit() - 10); - twoToOneShifter.position(twoToOne.position() - 10); - twoToOneShifter.limit(twoToOne.limit() - 10); - oneToTwoShifter.compact(); - twoToOneShifter.compact(); - oneToTwo.position(oneToTwoShifter.position() + 10); - oneToTwo.limit(oneToTwoShifter.limit() + 10); - twoToOne.position(twoToOneShifter.position() + 10); - twoToOne.limit(twoToOneShifter.limit() + 10); - - System.out.println("LAST WRAP"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(result1, Status.CLOSED, HandshakeStatus.NEED_UNWRAP, - 0, -1, false); - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(result2, Status.CLOSED, HandshakeStatus.NEED_UNWRAP, - 0, -1, false); - - System.out.println("wrap1 = " + result1); - System.out.println("wrap2 = " + result2); - - net1Len = result1.bytesProduced(); - net2Len = result2.bytesProduced(); + private void updateByteBuffers() { + clientToServerShifter.position(clientToServer.position() - 10); + clientToServerShifter.limit(clientToServer.limit() - 10); + serverToClientShifter.position(serverToClient.position() - 10); + serverToClientShifter.limit(serverToClient.limit() - 10); + clientToServerShifter.compact(); + serverToClientShifter.compact(); + clientToServer.position(clientToServerShifter.position() + 10); + clientToServer.limit(clientToServerShifter.limit() + 10); + serverToClient.position(serverToClientShifter.position() + 10); + serverToClient.limit(serverToClientShifter.limit() + 10); + } - oneToTwo.flip(); - twoToOne.flip(); + private static void checkSession(SSLSession clientSession1, SSLSession serverSession1, + SSLSession clientSession2, SSLSession serverSession2) { + log("\nSession Info for client SSLEngine 1"); + log(clientSession1); + log(clientSession1.getCreationTime()); + + String peer1 = clientSession1.getPeerHost(); + log(peer1); + + String protocol1 = clientSession1.getProtocol(); + log(protocol1); + + String ciphersuite1 = clientSession1.getCipherSuite(); + log(ciphersuite1); + log(""); + + log("\nSession Info for server SSLEngine 1"); + log(serverSession1); + log(serverSession1.getCreationTime()); + + String peer2 = serverSession1.getPeerHost(); + log(peer2); + + String protocol2 = serverSession1.getProtocol(); + log(protocol2); + + String ciphersuite2 = serverSession1.getCipherSuite(); + log(ciphersuite2); + log(""); - oneToTwo.position(10); - twoToOne.position(10); + if (peer1.equals(peer2)) { + throw new RuntimeException("peer hostnames not equal"); + } - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - net1Len, 0, false); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - net2Len, 0, false); + if (!protocol1.equals(protocol2)) { + throw new RuntimeException("protocols not equal"); + } - System.out.println("unwrap1 = " + result1); - System.out.println("unwrap2 = " + result2); + compareCertificates(clientSession1, serverSession1); + compareCertificates(clientSession2, serverSession2); - oneToTwoShifter.position(oneToTwo.position() - 10); - oneToTwoShifter.limit(oneToTwo.limit() - 10); - twoToOneShifter.position(twoToOne.position() - 10); - twoToOneShifter.limit(twoToOne.limit() - 10); - oneToTwoShifter.compact(); - twoToOneShifter.compact(); - oneToTwo.position(oneToTwoShifter.position() + 10); - oneToTwo.limit(oneToTwoShifter.limit() + 10); - twoToOne.position(twoToOneShifter.position() + 10); - twoToOne.limit(twoToOneShifter.limit() + 10); + if (!ciphersuite1.equals(ciphersuite2)) { + throw new RuntimeException("ciphersuites not equal"); + } - System.out.println("EXTRA WRAP"); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - 0, 0, false); - result2 = ssle2.wrap(appOut2, twoToOne); - checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - 0, 0, false); + log("\nSession Info for client SSLEngine 2"); + log(clientSession2); + log("\nSession Info for server SSLEngine 2"); + log(serverSession2); + } - System.out.println("wrap1 = " + result1); - System.out.println("wrap2 = " + result2); - oneToTwo.flip(); - twoToOne.flip(); - oneToTwo.position(10); - twoToOne.position(10); + private static void compareCertificates(SSLSession client, SSLSession server) { + try { + java.security.cert.Certificate clientLocal = client.getLocalCertificates()[0]; + java.security.cert.Certificate clientPeer = client.getPeerCertificates()[0]; + java.security.cert.Certificate serverLocal = server.getLocalCertificates()[0]; + java.security.cert.Certificate serverPeer = server.getPeerCertificates()[0]; - System.out.println("EXTRA UNWRAP"); - result1 = ssle1.unwrap(twoToOne, appIn1); - checkResult(result1, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - 0, 0, false); - result2 = ssle2.unwrap(oneToTwo, appIn2); - checkResult(result2, Status.CLOSED, HandshakeStatus.NOT_HANDSHAKING, - 0, 0, false); + log(String.format("Client local cert: %s%nClient peer cert: %s%n" + + "Server local cert: %s%nServer peer cert: %s%n", + clientLocal, clientPeer, serverLocal, serverPeer)); - System.out.println("unwrap1 = " + result1); - System.out.println("unwrap2 = " + result2); + if (!clientLocal.equals(serverPeer)) { + throw new RuntimeException("Client's local certificate does " + + "not match server's peer certificate"); + } - checkSession(ssls1, ssls2, ssls3, ssls4); - System.out.println(ssle1); - System.out.println(ssle2); - } - - private static void checkSession(SSLSession ssls1, SSLSession ssls2, - SSLSession ssls3, SSLSession ssls4) throws Exception { - System.out.println("\nSession Info for SSLEngine1"); - System.out.println(ssls1); - System.out.println(ssls1.getCreationTime()); - String peer1 = ssls1.getPeerHost(); - System.out.println(peer1); - String protocol1 = ssls1.getProtocol(); - System.out.println(protocol1); - java.security.cert.Certificate cert1 = ssls1.getPeerCertificates()[0]; - System.out.println(cert1); - String ciphersuite1 = ssls1.getCipherSuite(); - System.out.println(ciphersuite1); - System.out.println(); - - System.out.println("\nSession Info for SSLEngine2"); - System.out.println(ssls2); - System.out.println(ssls2.getCreationTime()); - String peer2 = ssls2.getPeerHost(); - System.out.println(peer2); - String protocol2 = ssls2.getProtocol(); - System.out.println(protocol2); - java.security.cert.Certificate cert2 = ssls2.getPeerCertificates()[0]; - System.out.println(cert2); - String ciphersuite2 = ssls2.getCipherSuite(); - System.out.println(ciphersuite2); - System.out.println(); + if (!clientPeer.equals(serverLocal)) { + throw new RuntimeException("Client's peer certificate does " + + "not match server's local certificate"); + } - if (peer1.equals(peer2)) { - throw new Exception("peer hostnames not equal"); + } catch (SSLPeerUnverifiedException e) { + throw new RuntimeException("Could not get peer certificate!", e); } + } - if (!protocol1.equals(protocol2)) { - throw new Exception("protocols not equal"); + private void checkEngineAndSession() + throws Exception { + String host = clientEngine.getPeerHost(); + int port = clientEngine.getPeerPort(); + if (!host.equals(HOSTNAME) || (port != PORT_NUMBER)) { + throw new Exception("Unexpected host/port from client engine." + + " Expected " + HOSTNAME + ":" + PORT_NUMBER + + " Received " +host + ":" + port); } - if (!cert1.equals(cert2)) { - throw new Exception("certs not equal"); + host = serverEngine.getPeerHost(); + port = serverEngine.getPeerPort(); + if ((host != null) || (port != -1)) { + throw new Exception("Unexpected host/port from server engine." + + " Expected null:-1" + + " Received " + host + ":" + port); } - if (!ciphersuite1.equals(ciphersuite2)) { - throw new Exception("ciphersuites not equal"); + SSLSession clientSession = clientEngine.getSession(); + + host = clientSession.getPeerHost(); + port = clientSession.getPeerPort(); + if (!host.equals(HOSTNAME) || (port != PORT_NUMBER)) { + throw new Exception("Unexpected host/port from client session." + + " Expected " + HOSTNAME + ":" + PORT_NUMBER + + " Received " + host + ":" + port); } - System.out.println("\nSession Info for SSLEngine3"); - System.out.println(ssls3); - System.out.println("\nSession Info for SSLEngine4"); - System.out.println(ssls4); + SSLSession serverSession = serverEngine.getSession(); - if (ssls3.equals(ssls1) || ssls4.equals(ssls2)) { - throw new Exception("sessions should not be equals"); + host = serverSession.getPeerHost(); + port = serverSession.getPeerPort(); + if ((host != null) || (port != -1)) { + throw new Exception("Unexpected host/port from server session." + + " Expected null:-1" + + " Received " + host + ":" + port); } + + } + + private static void log(Object msg) { + System.out.println(msg); } public static void main(String args[]) throws Exception { @@ -679,7 +599,8 @@ // and keys used in this test are not disabled. Security.setProperty("jdk.tls.disabledAlgorithms", ""); - ConnectionTest ct = new ConnectionTest(); + log(String.format("Running with %s and %s%n", args[0], args[1])); + ConnectionTest ct = new ConnectionTest(args[0], args[1]); ct.test(); } -} +} \ No newline at end of file diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 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 @@ -26,8 +26,7 @@ * @bug 8133632 * @summary javax.net.ssl.SSLEngine does not properly handle received * SSL fatal alerts - * @ignore the dependent implementation details are changed - * @run main/othervm EngineCloseOnAlert + * @run main EngineCloseOnAlert */ import java.io.FileInputStream; @@ -40,23 +39,20 @@ public class EngineCloseOnAlert { - private static final String pathToStores = "../etc"; - private static final String keyStoreFile = "keystore"; - private static final String trustStoreFile = "truststore"; + private static final String PATH_TO_STORES = "../etc"; + private static final String KEYSTORE_FILENAME = "keystore"; + private static final String TRUSTSTORE_FILENAME = "truststore"; private static final String passwd = "passphrase"; - private static final String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + keyStoreFile; - private static final String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores + - "/" + trustStoreFile; + private static final String KEYSTORE_PATH = + System.getProperty("test.src", ".") + "/" + PATH_TO_STORES + + "/" + KEYSTORE_FILENAME; + private static final String TRUSTSTORE_PATH = + System.getProperty("test.src", ".") + "/" + PATH_TO_STORES + + "/" + TRUSTSTORE_FILENAME; private static KeyManagerFactory KMF; private static TrustManagerFactory TMF; - private static TrustManagerFactory EMPTY_TMF; - private static final String[] TLS10ONLY = { "TLSv1" }; - private static final String[] TLS12ONLY = { "TLSv1.2" }; private static final String[] ONECIPHER = { "TLS_RSA_WITH_AES_128_CBC_SHA" }; @@ -91,6 +87,7 @@ } } + private static final String TLSv12 = "TLSv1.2"; private static final TestCase clientReceivesAlert = new TestCase() { @Override public void runTest() throws Exception { @@ -104,7 +101,9 @@ // match the requested ciphers offered by the client. This // will generate an alert from the server to the client. - SSLContext context = SSLContext.getDefault(); + SSLContext context = SSLContext.getInstance(TLSv12); + context.init(null, null, null); + SSLEngine client = context.createSSLEngine(); SSLEngine server = context.createSSLEngine(); client.setUseClientMode(true); @@ -136,7 +135,8 @@ serverResult = server.wrap(plain, raw); System.out.println("Server result: " + serverResult); runDelegatedTasks(serverResult, server); - } catch (SSLException e) { + throw new RuntimeException("The expected SSLHandshakeException was not thrown."); + } catch (SSLHandshakeException e) { // This is the expected code path System.out.println("Server throws exception: " + e); System.out.println("Server engine state: " + @@ -147,16 +147,13 @@ } raw.clear(); - // The above should show that isInboundDone returns true, and - // handshake status is NEED_WRAP. That is the correct behavior, - // wrap will put a fatal alert message in the buffer. serverResult = server.wrap(plain, raw); System.out.println("Server result (wrap after exception): " + serverResult); System.out.println("Server engine closure state: isInboundDone=" + server.isInboundDone() + ", isOutboundDone=" + server.isOutboundDone()); - checkEngineState(server, NEED_UNWRAP, true, true); + checkEngineState(server, NOT_HANDSHAKING, true, true); raw.flip(); System.out.println("Server-to-Client:\n-----------------\n" + @@ -167,7 +164,8 @@ clientResult = client.unwrap(raw, plain); System.out.println("Client result (unwrap alert): " + clientResult); - } catch (SSLException e) { + throw new RuntimeException("Client did not throw the expected SSLException."); + } catch (SSLHandshakeException e) { System.out.println("Client throws exception: " + e); System.out.println("Engine closure status: isInboundDone=" + client.isInboundDone() + ", isOutboundDone=" @@ -188,17 +186,16 @@ private static final TestCase serverReceivesAlert = new TestCase() { @Override public void runTest() throws Exception { - SSLContext cliContext = SSLContext.getDefault(); - SSLContext servContext = SSLContext.getInstance("TLS"); + SSLContext cliContext = SSLContext.getInstance(TLSv12); + cliContext.init(null, null, null); + SSLContext servContext = SSLContext.getInstance(TLSv12); servContext.init(KMF.getKeyManagers(), TMF.getTrustManagers(), null); SSLEngine client = cliContext.createSSLEngine(); SSLEngine server = servContext.createSSLEngine(); client.setUseClientMode(true); - client.setEnabledProtocols(TLS12ONLY); client.setEnabledCipherSuites(ONECIPHER); server.setUseClientMode(false); - server.setEnabledProtocols(TLS10ONLY); SSLEngineResult clientResult; SSLEngineResult serverResult; ByteBuffer raw = ByteBuffer.allocate(32768); @@ -232,36 +229,41 @@ System.out.println("Server-to-Client:\n-----------------\n" + dumpHexBytes(raw, 16, "\n", ":")); - // The client should parse this and throw an exception because - // It is unwiling to do TLS 1.0 + // Change the handshake type field to client_hello which will + // cause the client to generate an unexpected_message alert + raw.put(5, (byte)0x1); clientResult = client.unwrap(raw, plain); checkEngineState(client, NEED_TASK, false, false); runDelegatedTasks(clientResult, client); - checkEngineState(client, NEED_UNWRAP, false, false); + checkEngineState(client, NEED_WRAP, true, false); + raw.clear(); + // Now the client should wrap the exception try { - client.unwrap(raw, plain); - } catch (SSLException e) { - System.out.println("Client throws exception: " + e); - System.out.println("Engine closure status: isInboundDone=" - + client.isInboundDone() + ", isOutboundDone=" - + client.isOutboundDone() + ", handshake status=" - + client.getHandshakeStatus()); + client.wrap(plain, raw); + throw new RuntimeException("The expected exception was not " + + "thrown after the client processed an unexpected message."); + } catch (SSLProtocolException exc) { + // this is the expected code path + System.out.println("Client throws expected exception: " + exc); + System.out.println("Client engine state: " + + "isInboundDone = "+ client.isInboundDone() + + ", isOutboundDone = " + client.isOutboundDone() + + ", handshake status = " + client.getHandshakeStatus()); checkEngineState(client, NEED_WRAP, true, false); } raw.clear(); - - // Now the client should wrap the exception client.wrap(plain, raw); - checkEngineState(client, NEED_UNWRAP, true, true); - raw.flip(); + checkEngineState(client, NOT_HANDSHAKING, true, true); System.out.println("Client-to-Server:\n-----------------\n" + dumpHexBytes(raw, 16, "\n", ":")); + raw.flip(); try { server.unwrap(raw, plain); - checkEngineState(server, NEED_UNWRAP, false, false); - } catch (SSLException e) { + throw new RuntimeException("The server did not throw an " + + "SSLProtocolException after parsing an alert message."); + } catch (SSLProtocolException e) { System.out.println("Server throws exception: " + e); System.out.println("Engine closure status: isInboundDone=" + server.isInboundDone() + ", isOutboundDone=" @@ -338,15 +340,15 @@ KeyStore empty_ts = KeyStore.getInstance("PKCS12"); char[] passphrase = passwd.toCharArray(); - keystore.load(new FileInputStream(keyFilename), passphrase); - truststore.load(new FileInputStream(trustFilename), passphrase); + keystore.load(new FileInputStream(KEYSTORE_PATH), passphrase); + truststore.load(new FileInputStream(TRUSTSTORE_PATH), passphrase); empty_ts.load(null, "".toCharArray()); KMF = KeyManagerFactory.getInstance("PKIX"); KMF.init(keystore, passphrase); TMF = TrustManagerFactory.getInstance("PKIX"); TMF.init(truststore); - EMPTY_TMF = TrustManagerFactory.getInstance("PKIX"); + TrustManagerFactory EMPTY_TMF = TrustManagerFactory.getInstance("PKIX"); EMPTY_TMF.init(truststore); } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/HandshakeWithInvalidRecordVersion.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/HandshakeWithInvalidRecordVersion.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/HandshakeWithInvalidRecordVersion.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/HandshakeWithInvalidRecordVersion.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2014, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8042449 8299870 + * @library /javax/net/ssl/templates + * @summary Verify successful handshake ignores invalid record version + * + * @run main/timeout=300 HandshakeWithInvalidRecordVersion + */ + +import javax.net.ssl.*; +import javax.net.ssl.SSLEngineResult.*; +import java.io.*; +import java.security.*; +import java.nio.*; +import java.util.Arrays; + +public class HandshakeWithInvalidRecordVersion extends SSLContextTemplate { + private static final boolean DEBUG = Boolean.getBoolean("test.debug"); + + + public static void main(String [] args) throws Exception { + var runner = new HandshakeWithInvalidRecordVersion(); + runner.executeTest("TLSv1.2", + new String[]{"TLSv1.2"}, new String[]{"TLSv1.3", "TLSv1.2"}); + + runner.executeTest("TLSv1.2", + new String[]{"TLSv1.3", "TLSv1.2"}, new String[]{"TLSv1.2"}); + + runner.executeTest("TLSv1.3", + new String[]{"TLSv1.2", "TLSv1.3"}, new String[]{"TLSv1.3"}); + + runner.executeTest("TLSv1.3", + new String[]{"TLSv1.3"}, new String[]{"TLSv1.2", "TLSv1.3"}); + } + + + private void executeTest(String expectedProtocol, String[] clientProtocols, + String[] serverProtocols) throws Exception { + System.out.printf("Executing test%n" + + "Client protocols: %s%nServer protocols: %s%nExpected negotiated: %s%n", + Arrays.toString(clientProtocols), Arrays.toString(serverProtocols), + expectedProtocol); + + SSLEngine cliEngine = createClientSSLContext().createSSLEngine(); + cliEngine.setUseClientMode(true); + cliEngine.setEnabledProtocols(clientProtocols); + SSLEngine srvEngine = createServerSSLContext().createSSLEngine(); + srvEngine.setUseClientMode(false); + srvEngine.setEnabledProtocols(serverProtocols); + + SSLSession session = cliEngine.getSession(); + int netBufferMax = session.getPacketBufferSize(); + int appBufferMax = session.getApplicationBufferSize(); + + ByteBuffer cliToSrv = ByteBuffer.allocateDirect(netBufferMax); + ByteBuffer srvIBuff = ByteBuffer.allocateDirect(appBufferMax + 50); + ByteBuffer cliOBuff = ByteBuffer.wrap("I'm client".getBytes()); + + + System.out.println("Generating ClientHello"); + SSLEngineResult cliRes = cliEngine.wrap(cliOBuff, cliToSrv); + checkResult(cliRes, HandshakeStatus.NEED_UNWRAP); + log("Client wrap result: " + cliRes); + cliToSrv.flip(); + if (cliToSrv.limit() > 5) { + System.out.println("Setting record version to (0xa9, 0xa2)"); + cliToSrv.put(1, (byte)0xa9); + cliToSrv.put(2, (byte)0xa2); + } else { + throw new RuntimeException("ClientHello message is only " + + cliToSrv.limit() + "bytes. Expecting at least 6 bytes. "); + } + + System.out.println("Processing ClientHello"); + SSLEngineResult srv = srvEngine.unwrap(cliToSrv, srvIBuff); + checkResult(srv, HandshakeStatus.NEED_TASK); + runDelegatedTasks(srvEngine); + + finishHandshake(cliEngine, srvEngine); + + if (!cliEngine.getSession().getProtocol() + .equals(srvEngine.getSession().getProtocol()) + || !cliEngine.getSession().getProtocol().equals(expectedProtocol)) { + throw new RuntimeException("Client and server did not negotiate protocol. " + + "Expected: " + expectedProtocol + ". Negotiated: " + + cliEngine.getSession().getProtocol()); + } + } + private boolean isHandshaking(SSLEngine e) { + return (e.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING); + } + + private void finishHandshake(SSLEngine client, SSLEngine server) throws Exception { + boolean clientDone = false; + boolean serverDone = false; + SSLEngineResult serverResult; + SSLEngineResult clientResult; + int capacity = client.getSession().getPacketBufferSize(); + ByteBuffer emptyBuffer = ByteBuffer.allocate(capacity); + ByteBuffer serverToClient = ByteBuffer.allocate(capacity); + ByteBuffer clientToServer = ByteBuffer.allocate(capacity); + + System.out.println("Finishing handshake..."); + while (isHandshaking(client) || + isHandshaking(server)) { + + log("================"); + + clientResult = client.wrap(emptyBuffer, clientToServer); + serverResult = server.wrap(emptyBuffer, serverToClient); + + if (clientResult.getHandshakeStatus() == HandshakeStatus.FINISHED) { + clientDone = true; + } + + if (serverResult.getHandshakeStatus() == HandshakeStatus.FINISHED) { + serverDone = true; + } + + log("wrap1 = " + clientResult); + log("wrap2 = " + serverResult); + + if (clientResult.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + Runnable runnable; + while ((runnable = client.getDelegatedTask()) != null) { + runnable.run(); + } + } + + if (serverResult.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + Runnable runnable; + while ((runnable = server.getDelegatedTask()) != null) { + runnable.run(); + } + } + + clientToServer.flip(); + serverToClient.flip(); + + log("----"); + + clientResult = client.unwrap(serverToClient, emptyBuffer); + serverResult = server.unwrap(clientToServer, emptyBuffer); + + if (clientResult.getHandshakeStatus() == HandshakeStatus.FINISHED) { + clientDone = true; + } + + if (serverResult.getHandshakeStatus() == HandshakeStatus.FINISHED) { + serverDone = true; + } + + log("unwrap1 = " + clientResult); + log("unwrap2 = " + serverResult); + + if (clientResult.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + Runnable runnable; + while ((runnable = client.getDelegatedTask()) != null) { + runnable.run(); + } + } + + if (serverResult.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + Runnable runnable; + while ((runnable = server.getDelegatedTask()) != null) { + runnable.run(); + } + } + + clientToServer.clear(); + serverToClient.clear(); + } + + System.out.println("Handshake complete"); + + if (!clientDone || !serverDone) { + throw new RuntimeException("Both should be true:\n" + + " clientDone = " + clientDone + " serverDone = " + serverDone); + } + } + + private static void runDelegatedTasks(SSLEngine engine) { + Runnable runnable; + while ((runnable = engine.getDelegatedTask()) != null) { + log("\trunning delegated task..."); + runnable.run(); + } + } + + private static void checkResult(SSLEngineResult result, HandshakeStatus expectedStatus) { + if(result.getHandshakeStatus() != expectedStatus) { + throw new RuntimeException(String.format( + "Handshake status %s does not match expected status of %s", + result.getHandshakeStatus(), expectedStatus)); + } + } + + private static void log(Object msg) { + if (DEBUG) { + System.out.println(msg); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java 2024-01-09 21:18:15.000000000 +0000 @@ -30,7 +30,6 @@ * @test * @bug 8180643 * @summary Illegal handshake message - * @ignore the dependent implementation details are changed * @run main/othervm IllegalHandshakeMessage */ diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2014, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// This test case relies on updated static security property, no way to re-use -// security property in samevm/agentvm mode. - -/* - * @test - * @bug 8042449 - * @summary Issue for negative byte major record version - * @ignore the dependent implementation details are changed - * @run main/othervm IllegalRecordVersion - */ - -import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; - -public class IllegalRecordVersion { - - public static void main(String args[]) throws Exception { - SSLContext context = SSLContext.getDefault(); - - SSLEngine cliEngine = context.createSSLEngine(); - cliEngine.setUseClientMode(true); - SSLEngine srvEngine = context.createSSLEngine(); - srvEngine.setUseClientMode(false); - - SSLSession session = cliEngine.getSession(); - int netBufferMax = session.getPacketBufferSize(); - int appBufferMax = session.getApplicationBufferSize(); - - ByteBuffer cliToSrv = ByteBuffer.allocateDirect(netBufferMax); - ByteBuffer srvIBuff = ByteBuffer.allocateDirect(appBufferMax + 50); - ByteBuffer cliOBuff = ByteBuffer.wrap("I'm client".getBytes()); - - - System.out.println("client hello (record version(0xa9, 0xa2))"); - SSLEngineResult cliRes = cliEngine.wrap(cliOBuff, cliToSrv); - System.out.println("Client wrap result: " + cliRes); - cliToSrv.flip(); - if (cliToSrv.limit() > 5) { - cliToSrv.put(1, (byte)0xa9); - cliToSrv.put(2, (byte)0xa2); - } - - try { - srvEngine.unwrap(cliToSrv, srvIBuff); - throw new Exception( - "Cannot catch the unsupported record version issue"); - } catch (SSLException e) { - // get the expected exception - } - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/TestAllSuites.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/TestAllSuites.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLEngine/TestAllSuites.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLEngine/TestAllSuites.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -24,203 +24,180 @@ /* * @test * @bug 4495742 - * @ignore JSSE supported cipher suites are changed with CR 6916074, - * need to update this test case in JDK 7 soon - * @run main/timeout=180 TestAllSuites + * @library /test/lib + * + * @run main/othervm/timeout=180 TestAllSuites TLSv1.1 + * @run main/othervm/timeout=180 TestAllSuites TLSv1.2 + * @run main/othervm/timeout=180 TestAllSuites TLSv1.3 + * * @summary Add non-blocking SSL/TLS functionality, usable with any * I/O abstraction * - * Iterate through all the suites using both TLS and SSLv3, and turn - * SSLv2Hello off and on. Exchange some bytes and shutdown. + * Iterate through all the suites, exchange some bytes and shutdown. * * @author Brad Wetmore */ +import jdk.test.lib.security.SecurityUtils; + import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; import java.io.*; import java.security.*; import java.nio.*; import java.util.*; +import java.util.Arrays; public class TestAllSuites { - private static boolean debug = false; + private static final boolean DEBUG = Boolean.getBoolean("test.debug"); - private SSLContext sslc; - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - private static String pathToStores = "../etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 - - String [][] protocols = new String [][] { - { "SSLv3" }, - { "TLSv1" }, - { "SSLv3", "SSLv2Hello"}, - { "TLSv1", "SSLv2Hello"} - }; + private final SSLContext SSL_CONTEXT; + private final String PROTOCOL; + private SSLEngine clientEngine; + private SSLEngine serverEngine; + + private static final String PATH_TO_STORES = "../etc"; + private static final String KEYSTORE_FILENAME = "keystore"; + private static final String TRUSTSTORE_FILENAME = "truststore"; + + private static final String KEYSTORE_PATH = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + KEYSTORE_FILENAME; + private static final String TRUSTSTORE_PATH = + System.getProperty("test.src", "./") + "/" + PATH_TO_STORES + + "/" + TRUSTSTORE_FILENAME; + + private ByteBuffer clientOut; + private ByteBuffer clientIn; + private ByteBuffer serverOut; + private ByteBuffer serverIn; + + private ByteBuffer clientToServer; + private ByteBuffer serverToClient; + + + private void createSSLEngines() { + clientEngine = SSL_CONTEXT.createSSLEngine("client", 1); + clientEngine.setUseClientMode(true); - /* - * Majority of the test case is here, setup is done below. - */ - - private void createSSLEngines() throws Exception { - ssle1 = sslc.createSSLEngine("client", 1); - ssle1.setUseClientMode(true); + serverEngine = SSL_CONTEXT.createSSLEngine("server", 2); + serverEngine.setUseClientMode(false); - ssle2 = sslc.createSSLEngine("server", 2); - ssle2.setUseClientMode(false); + clientEngine.setEnabledProtocols(new String[]{PROTOCOL}); + serverEngine.setEnabledProtocols(new String[]{PROTOCOL}); } private void test() throws Exception { - - createSSLEngines(); - String [] suites = ssle1.getSupportedCipherSuites(); - - for (int i = 0; i < suites.length; i++) { - for (int j = 0; j < protocols.length; j++) { - createSSLEngines(); - runTest(suites[i], protocols[j]); - } + String [] suites = clientEngine.getEnabledCipherSuites(); + System.out.println("Enabled cipher suites for protocol " + PROTOCOL + + ": " + Arrays.toString(suites)); + for (String suite: suites){ + // Need to recreate engines to override enabled ciphers + createSSLEngines(); + runTest(suite); } } - private void runTest(String suite, String [] protocols) throws Exception { + private void runTest(String suite) throws Exception { boolean dataDone = false; System.out.println("======================================"); - System.out.println("Testing: " + suite); - for (int i = 0; i < protocols.length; i++) { - System.out.print(protocols[i] + " "); - } + System.out.printf("Testing: %s with %s%n", PROTOCOL, suite); - /* - * Don't run the Kerberized suites for now. - */ - if (suite.startsWith("TLS_KRB5")) { - System.out.println("Ignoring Kerberized suite"); - return; - } + String [] suites = new String [] { suite }; - /* - * Don't run the SCSV suite - */ - if (suite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { + if(suite.equals("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { System.out.println("Ignoring SCSV suite"); return; } - - if (!suite.contains("DH_anon")) { - ssle2.setNeedClientAuth(true); - } - - String [] suites = new String [] { suite }; - - ssle1.setEnabledCipherSuites(suites); - ssle2.setEnabledCipherSuites(suites); - - ssle1.setEnabledProtocols(protocols); - ssle2.setEnabledProtocols(protocols); + clientEngine.setEnabledCipherSuites(suites); + serverEngine.setEnabledCipherSuites(suites); createBuffers(); - SSLEngineResult result1; // ssle1's results from last operation - SSLEngineResult result2; // ssle2's results from last operation + SSLEngineResult clientResult; // clientEngine's results from last operation + SSLEngineResult serverResult; // serverEngine's results from last operation Date start = new Date(); - while (!isEngineClosed(ssle1) || !isEngineClosed(ssle2)) { + while (!isEngineClosed(clientEngine) || !isEngineClosed(serverEngine)) { log("----------------"); - result1 = ssle1.wrap(appOut1, oneToTwo); - result2 = ssle2.wrap(appOut2, twoToOne); + clientResult = clientEngine.wrap(clientOut, clientToServer); + serverResult = serverEngine.wrap(serverOut, serverToClient); - log("wrap1: " + result1); - log("oneToTwo = " + oneToTwo); + log("Client engine wrap result: " + clientResult); + log("clientToServer = " + clientToServer); log(""); - log("wrap2: " + result2); - log("twoToOne = " + twoToOne); + log("Server engine wrap result: " + serverResult); + log("serverToClient = " + serverToClient); - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); + runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(serverResult, serverEngine); - oneToTwo.flip(); - twoToOne.flip(); + clientToServer.flip(); + serverToClient.flip(); log("----"); - result1 = ssle1.unwrap(twoToOne, appIn1); - result2 = ssle2.unwrap(oneToTwo, appIn2); + clientResult = clientEngine.unwrap(serverToClient, clientIn); + serverResult = serverEngine.unwrap(clientToServer, serverIn); - log("unwrap1: " + result1); - log("twoToOne = " + twoToOne); + log("Client engine unrap result: " + clientResult); + log("serverToClient = " + serverToClient); log(""); - log("unwrap2: " + result2); - log("oneToTwo = " + oneToTwo); + log("Server engine unwrap result: " + serverResult); + log("clientToServer = " + clientToServer); - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); + runDelegatedTasks(clientResult, clientEngine); + runDelegatedTasks(serverResult, serverEngine); - oneToTwo.compact(); - twoToOne.compact(); + clientToServer.compact(); + serverToClient.compact(); /* - * If we've transfered all the data between app1 and app2, + * If we've transferred all the data between client and server * we try to close and see what that gets us. */ - if (!dataDone && (appOut1.limit() == appIn2.position()) && - (appOut2.limit() == appIn1.position())) { + if (!dataDone && (clientOut.limit() == serverIn.position()) && + (serverOut.limit() == clientIn.position())) { - checkTransfer(appOut1, appIn2); - checkTransfer(appOut2, appIn1); + checkTransfer(clientOut, serverIn); + checkTransfer(serverOut, clientIn); - log("Closing ssle1's *OUTBOUND*..."); - ssle1.closeOutbound(); + clientEngine.closeOutbound(); + serverEngine.closeOutbound(); dataDone = true; } } + System.out.println("Negotiated protocol: " + clientEngine.getSession().getProtocol()); + System.out.println("Negotiated cipher: " + clientEngine.getSession().getCipherSuite()); + /* * Just for grins, try closing again, make sure nothing * strange is happening after we're closed. */ - ssle1.closeInbound(); - ssle1.closeOutbound(); + clientEngine.closeInbound(); + clientEngine.closeOutbound(); - ssle2.closeInbound(); - ssle2.closeOutbound(); + serverEngine.closeInbound(); + serverEngine.closeOutbound(); - appOut1.rewind(); - appIn1.clear(); - oneToTwo.clear(); + clientOut.rewind(); + clientIn.clear(); + clientToServer.clear(); - result1 = ssle1.wrap(appOut1, oneToTwo); - checkResult(result1); + clientResult = clientEngine.wrap(clientOut, clientToServer); + checkResult(clientResult); - result1 = ssle1.unwrap(oneToTwo, appIn1); - checkResult(result1); + clientResult = clientEngine.unwrap(clientToServer, clientIn); + checkResult(clientResult); System.out.println("Test Passed."); System.out.println("\n======================================"); @@ -244,13 +221,18 @@ public static void main(String args[]) throws Exception { - TestAllSuites tas; - - tas = new TestAllSuites(); + if (args.length < 1) { + throw new RuntimeException("Missing TLS protocol parameter."); + } - tas.createSSLEngines(); + switch(args[0]) { + case "TLSv1.1" -> SecurityUtils.removeFromDisabledTlsAlgs("TLSv1.1"); + case "TLSv1.3" -> SecurityUtils.addToDisabledTlsAlgs("TLSv1.2"); + } - tas.test(); + TestAllSuites testAllSuites = new TestAllSuites(args[0]); + testAllSuites.createSSLEngines(); + testAllSuites.test(); System.out.println("All Tests Passed."); System.out.println("Elapsed time: " + elapsed / 1000.0); @@ -262,8 +244,9 @@ * ********************************************************** */ - public TestAllSuites() throws Exception { - sslc = getSSLContext(keyFilename, trustFilename); + public TestAllSuites(String protocol) throws Exception { + PROTOCOL = protocol; + SSL_CONTEXT = getSSLContext(KEYSTORE_PATH, TRUSTSTORE_PATH); } /* @@ -286,7 +269,7 @@ TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); tmf.init(ts); - SSLContext sslCtx = SSLContext.getInstance("TLS"); + SSLContext sslCtx = SSLContext.getInstance(PROTOCOL); sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); @@ -296,21 +279,21 @@ private void createBuffers() { // Size the buffers as appropriate. - SSLSession session = ssle1.getSession(); + SSLSession session = clientEngine.getSession(); int appBufferMax = session.getApplicationBufferSize(); int netBufferMax = session.getPacketBufferSize(); - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); + clientIn = ByteBuffer.allocateDirect(appBufferMax + 50); + serverIn = ByteBuffer.allocateDirect(appBufferMax + 50); - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); + clientToServer = ByteBuffer.allocateDirect(netBufferMax); + serverToClient = ByteBuffer.allocateDirect(netBufferMax); - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); + clientOut = ByteBuffer.wrap("Hi Server, I'm Client".getBytes()); + serverOut = ByteBuffer.wrap("Hello Client, I'm Server".getBytes()); - log("AppOut1 = " + appOut1); - log("AppOut2 = " + appOut2); + log("ClientOut = " + clientOut); + log("ServerOut = " + serverOut); log(""); } @@ -348,7 +331,7 @@ } private static void log(String str) { - if (debug) { + if (DEBUG) { System.out.println(str); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLSession/ResumeTLS13withSNI.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLSession/ResumeTLS13withSNI.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/SSLSession/ResumeTLS13withSNI.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/SSLSession/ResumeTLS13withSNI.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, 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 @@ -26,7 +26,7 @@ /* * @test - * @bug 8211806 8277881 + * @bug 8211806 8277881 8277307 * @summary TLS 1.3 handshake server name indication is missing on a session resume * @run main/othervm ResumeTLS13withSNI */ @@ -102,7 +102,7 @@ SSLParameters cliSSLParams = clientEngine.getSSLParameters(); cliSSLParams.setServerNames(List.of(SNI_NAME)); clientEngine.setSSLParameters(cliSSLParams); - clientEngine.setEnabledProtocols(new String[] { "TLSv1.3" }); + clientEngine.setEnabledProtocols(new String[] { "TLSv1.2", "TLSv1.3" }); SSLEngine serverEngine = makeEngine(sslCtx, kmf, tmf, false); SSLParameters servSSLParams = serverEngine.getSSLParameters(); @@ -114,7 +114,7 @@ // Create a new client-side engine which can initiate TLS session // resumption SSLEngine newCliEngine = makeEngine(sslCtx, kmf, tmf, true); - newCliEngine.setEnabledProtocols(new String[] { "TLSv1.3" }); + newCliEngine.setEnabledProtocols(new String[] { "TLSv1.2", "TLSv1.3" }); ByteBuffer resCliHello = getResumptionClientHello(newCliEngine); dumpBuffer("Resumed ClientHello Data", resCliHello); @@ -394,6 +394,16 @@ System.err.println("* Found pre_shared_key Extension"); resCliHello.position(resCliHello.position() + extLen); break; + case 35: // session_ticket + // This is a TLS1.2 extension; should be empty since we're + // negotiating TLS1.3. See JDK-8277307 + System.err.format("* Found session_ticket extension " + + "(%d bytes)\n", extLen); + if (extLen != 0) { + throw new Exception("Unexpected session_ticket content"); + } + resCliHello.position(resCliHello.position() + extLen); + break; default: System.err.format("* Found extension %d (%d bytes)\n", extType, extLen); diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 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 @@ -134,7 +134,7 @@ * e.g. "TLSv1", "TLSv1.1", "TLSv1.2", "DTLSv1.0", "DTLSv1.2". */ public static final String TESTED_SECURITY_PROTOCOL - = System.getProperty("test.security.protocol", "TLS"); + = System.getProperty("test.security.protocol"); /** * Test mode: "norm", "norm_sni" or "krb". * Modes "norm" and "norm_sni" are used to run @@ -738,13 +738,18 @@ case "TLSv1.1": runTests(Ciphers.SUPPORTED_NON_KRB_NON_SHA_CIPHERS); break; - case "DTLSv1.1": + case "DTLS": + case "DTLSv1.2": + case "TLS": case "TLSv1.2": runTests(Ciphers.SUPPORTED_NON_KRB_CIPHERS); break; case "TLSv1.3": runTests(Ciphers.TLS13_CIPHERS); break; + default: + throw new Error("Test error: Unsupported test " + + "security protocol: " + TESTED_SECURITY_PROTOCOL); } break; case "krb": diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -42,86 +42,35 @@ * @run main/othervm DisabledShortRSAKeys SunX509 SSLv3 */ -import java.net.*; -import java.util.*; import java.io.*; import javax.net.ssl.*; import java.security.Security; -import java.security.KeyStore; -import java.security.KeyFactory; -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.security.spec.*; -import java.security.interfaces.*; -import java.util.Base64; - public class DisabledShortRSAKeys extends SSLSocketTemplate { /* - * Where do we find the keystores? - */ - // Certificates and key used in the test. - static String trustedCertStr = - "-----BEGIN CERTIFICATE-----\n" + - "MIICkjCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" + - "MTEwODE5MDE1MjE5WhcNMzIwNzI5MDE1MjE5WjA7MQswCQYDVQQGEwJVUzENMAsG\n" + - "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwgZ8wDQYJ\n" + - "KoZIhvcNAQEBBQADgY0AMIGJAoGBAM8orG08DtF98TMSscjGsidd1ZoN4jiDpi8U\n" + - "ICz+9dMm1qM1d7O2T+KH3/mxyox7Rc2ZVSCaUD0a3CkhPMnlAx8V4u0H+E9sqso6\n" + - "iDW3JpOyzMExvZiRgRG/3nvp55RMIUV4vEHOZ1QbhuqG4ebN0Vz2DkRft7+flthf\n" + - "vDld6f5JAgMBAAGjgaUwgaIwHQYDVR0OBBYEFLl81dnfp0wDrv0OJ1sxlWzH83Xh\n" + - "MGMGA1UdIwRcMFqAFLl81dnfp0wDrv0OJ1sxlWzH83XhoT+kPTA7MQswCQYDVQQG\n" + - "EwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2\n" + - "Y2WCAQAwDwYDVR0TAQH/BAUwAwEB/zALBgNVHQ8EBAMCAQYwDQYJKoZIhvcNAQEE\n" + - "BQADgYEALlgaH1gWtoBZ84EW8Hu6YtGLQ/L9zIFmHonUPZwn3Pr//icR9Sqhc3/l\n" + - "pVTxOINuFHLRz4BBtEylzRIOPzK3tg8XwuLb1zd0db90x3KBCiAL6E6cklGEPwLe\n" + - "XYMHDn9eDsaq861Tzn6ZwzMgw04zotPMoZN0mVd/3Qca8UJFucE=\n" + - "-----END CERTIFICATE-----"; - - static String targetCertStr = - "-----BEGIN CERTIFICATE-----\n" + - "MIICNDCCAZ2gAwIBAgIBDDANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" + - "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" + - "MTExMTA3MTM1NTUyWhcNMzEwNzI1MTM1NTUyWjBPMQswCQYDVQQGEwJVUzENMAsG\n" + - "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxEjAQBgNV\n" + - "BAMTCWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC3Pb49OSPfOD2G\n" + - "HSXFCFx1GJEZfqG9ZUf7xuIi/ra5dLjPGAaoY5QF2QOa8VnOriQCXDfyXHxsuRnE\n" + - "OomxL7EVAgMBAAGjeDB2MAsGA1UdDwQEAwID6DAdBgNVHQ4EFgQUXNCJK3/dtCIc\n" + - "xb+zlA/JINlvs/MwHwYDVR0jBBgwFoAUuXzV2d+nTAOu/Q4nWzGVbMfzdeEwJwYD\n" + - "VR0lBCAwHgYIKwYBBQUHAwEGCCsGAQUFBwMCBggrBgEFBQcDAzANBgkqhkiG9w0B\n" + - "AQQFAAOBgQB2qIDUxA2caMPpGtUACZAPRUtrGssCINIfItETXJZCx/cRuZ5sP4D9\n" + - "N1acoNDn0hCULe3lhXAeTC9NZ97680yJzregQMV5wATjo1FGsKY30Ma+sc/nfzQW\n" + - "+h/7RhYtoG0OTsiaDCvyhI6swkNJzSzrAccPY4+ZgU8HiDLzZTmM3Q==\n" + - "-----END CERTIFICATE-----"; - - // Private key in the format of PKCS#8, key size is 512 bits. - static String targetPrivateKey = - "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAtz2+PTkj3zg9hh0l\n" + - "xQhcdRiRGX6hvWVH+8biIv62uXS4zxgGqGOUBdkDmvFZzq4kAlw38lx8bLkZxDqJ\n" + - "sS+xFQIDAQABAkByx/5Oo2hQ/w2q4L8z+NTRlJ3vdl8iIDtC/4XPnfYfnGptnpG6\n" + - "ZThQRvbMZiai0xHQPQMszvAHjZVme1eDl3EBAiEA3aKJHynPVCEJhpfCLWuMwX5J\n" + - "1LntwJO7NTOyU5m8rPECIQDTpzn5X44r2rzWBDna/Sx7HW9IWCxNgUD2Eyi2nA7W\n" + - "ZQIgJerEorw4aCAuzQPxiGu57PB6GRamAihEAtoRTBQlH0ECIQDN08FgTtnesgCU\n" + - "DFYLLcw1CiHvc7fZw4neBDHCrC8NtQIgA8TOUkGnpCZlQ0KaI8KfKWI+vxFcgFnH\n" + - "3fnqsTgaUs4="; - - static char passphrase[] = "passphrase".toCharArray(); - - /* * Turn on SSL debugging? */ static boolean debug = false; + private final String enabledProtocol; + private final String tmAlgorithm; + + public DisabledShortRSAKeys(String tmAlgorithm, String enabledProtocol) { + this.tmAlgorithm = tmAlgorithm; + this.enabledProtocol = enabledProtocol; + } + @Override - protected SSLContext createClientSSLContext() throws Exception { - return generateSSLContext(trustedCertStr, null, null); + public SSLContext createClientSSLContext() throws Exception { + return createSSLContext(new Cert[]{Cert.CA_RSA_512}, null, + new ContextParameters(enabledProtocol, tmAlgorithm, "NewSunX509")); } @Override - protected SSLContext createServerSSLContext() throws Exception { - return generateSSLContext(null, targetCertStr, targetPrivateKey); + public SSLContext createServerSSLContext() throws Exception { + return createSSLContext(null, new Cert[]{Cert.EE_RSA_512}, + new ContextParameters(enabledProtocol, tmAlgorithm, "NewSunX509")); } @Override @@ -159,84 +108,6 @@ } } - /* - * ============================================================= - * The remainder is just support stuff - */ - private static String tmAlgorithm; // trust manager - private static String enabledProtocol; // the target protocol - - private static void parseArguments(String[] args) { - tmAlgorithm = args[0]; - enabledProtocol = args[1]; - } - - private static SSLContext generateSSLContext(String trustedCertStr, - String keyCertStr, String keySpecStr) throws Exception { - - // generate certificate from cert string - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - - // create a key store - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(null, null); - - // import the trused cert - Certificate trusedCert = null; - ByteArrayInputStream is = null; - if (trustedCertStr != null) { - is = new ByteArrayInputStream(trustedCertStr.getBytes()); - trusedCert = cf.generateCertificate(is); - is.close(); - - ks.setCertificateEntry("RSA Export Signer", trusedCert); - } - - if (keyCertStr != null) { - // generate the private key. - PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( - Base64.getMimeDecoder().decode(keySpecStr)); - KeyFactory kf = KeyFactory.getInstance("RSA"); - RSAPrivateKey priKey = - (RSAPrivateKey)kf.generatePrivate(priKeySpec); - - // generate certificate chain - is = new ByteArrayInputStream(keyCertStr.getBytes()); - Certificate keyCert = cf.generateCertificate(is); - is.close(); - - Certificate[] chain = null; - if (trusedCert != null) { - chain = new Certificate[2]; - chain[0] = keyCert; - chain[1] = trusedCert; - } else { - chain = new Certificate[1]; - chain[0] = keyCert; - } - - // import the key entry. - ks.setKeyEntry("Whatever", priKey, passphrase, chain); - } - - // create SSL context - TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlgorithm); - tmf.init(ks); - - SSLContext ctx = SSLContext.getInstance("TLS"); - if (keyCertStr != null && !keyCertStr.isEmpty()) { - KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); - kmf.init(ks, passphrase); - - ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - ks = null; - } else { - ctx.init(null, tmf.getTrustManagers(), null); - } - - return ctx; - } - public static void main(String[] args) throws Exception { Security.setProperty("jdk.certpath.disabledAlgorithms", "RSA keySize < 1024"); @@ -247,15 +118,12 @@ System.setProperty("javax.net.debug", "all"); } - /* - * Get the customized arguments. - */ - parseArguments(args); + String tmAlgorithm = args[0]; + String enabledProtocol = args[1]; /* * Start the tests. */ - new DisabledShortRSAKeys().run(); + new DisabledShortRSAKeys(tmAlgorithm, enabledProtocol).run(); } - } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLContextTemplate.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -39,534 +39,915 @@ /** * SSLContext template to speed up JSSE tests. */ -public interface SSLContextTemplate { +public abstract class SSLContextTemplate { + + /* + * ======================================= + * Certificates and keys used in the test. + */ + // Trusted certificates. + Cert[] TRUSTED_CERTS = { + Cert.CA_ECDSA_SECP256R1, + Cert.CA_RSA_2048, + Cert.CA_DSA_2048 }; + + // End entity certificate. + Cert[] END_ENTITY_CERTS = { + Cert.EE_ECDSA_SECP256R1, + Cert.EE_RSA_2048, + Cert.EE_EC_RSA_SECP256R1, + Cert.EE_DSA_2048 }; + /* * Create an instance of SSLContext for client use. */ - default SSLContext createClientSSLContext() throws Exception { + protected SSLContext createClientSSLContext() throws Exception { return createSSLContext( - createClientKeyManager(), createClientTrustManager(), + createClientKeyManager(), getClientContextParameters()); } /* * Create an instance of SSLContext for server use. */ - default SSLContext createServerSSLContext() throws Exception { + protected SSLContext createServerSSLContext() throws Exception { return createSSLContext( - createServerKeyManager(), createServerTrustManager(), + createServerKeyManager(), getServerContextParameters()); } - /* - * Create an instance of KeyManager for client use. - */ - default KeyManager createClientKeyManager() throws Exception { - return createKeyManager( - endEntityCertStrs, - endEntityPrivateKeys, - endEntityPrivateKeyAlgs, - endEntityPrivateKeyNames, - getServerContextParameters()); + private SSLContext createSSLContext(TrustManager trustManager, + KeyManager keyManager, + ContextParameters params) throws Exception { + SSLContext context = SSLContext.getInstance(params.contextProtocol); + context.init( + new KeyManager[] {keyManager}, + new TrustManager[] {trustManager}, + null); + return context; } - /* - * Create an instance of TrustManager for client use. - */ - default TrustManager createClientTrustManager() throws Exception { - return createTrustManager( - trustedCertStrs, - getServerContextParameters()); - } - /* - * Create an instance of KeyManager for server use. + /** + * Creates a TrustManager with TRUSTED_CERTS and client context parameters */ - default KeyManager createServerKeyManager() throws Exception { - return createKeyManager( - endEntityCertStrs, - endEntityPrivateKeys, - endEntityPrivateKeyAlgs, - endEntityPrivateKeyNames, - getServerContextParameters()); + protected TrustManager createClientTrustManager() throws Exception { + return createTrustManager(TRUSTED_CERTS, getClientContextParameters()); } - /* - * Create an instance of TrustManager for server use. + /** + * Creates a TrustManager with TRUSTED_CERTS and server context parameters */ - default TrustManager createServerTrustManager() throws Exception { - return createTrustManager( - trustedCertStrs, - getServerContextParameters()); + protected TrustManager createServerTrustManager() throws Exception { + return createTrustManager(TRUSTED_CERTS, getServerContextParameters()); } - /* - * The parameters used to configure SSLContext. + /** + * Creates a TrustManager with the given array of trusted certs and + * context parameters. */ - static final class ContextParameters { - final String contextProtocol; - final String tmAlgorithm; - final String kmAlgorithm; + protected TrustManager createTrustManager(Cert[] trustedCerts, + ContextParameters params) throws Exception { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream is; - ContextParameters(String contextProtocol, - String tmAlgorithm, String kmAlgorithm) { + KeyStore ts = KeyStore.getInstance("JKS"); + ts.load(null, null); - this.contextProtocol = contextProtocol; - this.tmAlgorithm = tmAlgorithm; - this.kmAlgorithm = kmAlgorithm; + if (trustedCerts != null && trustedCerts.length != 0) { + Certificate[] trustedCert = new Certificate[trustedCerts.length]; + for (int i = 0; i < trustedCerts.length; i++) { + is = new ByteArrayInputStream(trustedCerts[i].certStr.getBytes()); + try { + trustedCert[i] = cf.generateCertificate(is); + } finally { + is.close(); + } + + ts.setCertificateEntry( + "trusted-cert-" + trustedCerts[i].name(), trustedCert[i]); + } } + + // Create an SSLContext object. + TrustManagerFactory tmf = + TrustManagerFactory.getInstance(params.tmAlgorithm); + tmf.init(ts); + return tmf.getTrustManagers()[0]; } - /* - * Get the client side parameters of SSLContext. + /** + * Create a key manager with Cert.END_ENTITY_CERTS and the client + * context parameters. */ - default ContextParameters getClientContextParameters() { - return new ContextParameters("TLS", "PKIX", "NewSunX509"); + protected KeyManager createClientKeyManager() throws Exception { + return createKeyManager(END_ENTITY_CERTS, getClientContextParameters()); } - /* - * Get the server side parameters of SSLContext. + /** + * Create a key manager with Cert.END_ENTITY_CERTS and the server + * context parameters */ - default ContextParameters getServerContextParameters() { - return new ContextParameters("TLS", "PKIX", "NewSunX509"); + protected KeyManager createServerKeyManager() throws Exception { + return createKeyManager(END_ENTITY_CERTS, getServerContextParameters()); } - /* - * ======================================= - * Certificates and keys used in the test. + /** + * Creates a KeyManager with the given end-entity Cert's and context + * parameters */ - // Trusted certificates. - final static String[] trustedCertStrs = { - // SHA256withECDSA, curve prime256v1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Subject Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + - "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + - "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + - "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + - "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + - "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + - "2YEHlSQUAbwwqCDEVB5KxaqP\n" + - "-----END CERTIFICATE-----", - // -----BEGIN PRIVATE KEY----- - // MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd - // XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd - // LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp - // -----END PRIVATE KEY----- - - // SHA256withRSA, 2048 bits - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Subject Key Identifier: - // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C - "-----BEGIN CERTIFICATE-----\n" + - "MIIDSTCCAjGgAwIBAgIJAI4ZF3iy8zG+MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALpMcY7aWieXDEM1/YJf\n" + - "JW27b4nRIFZyEYhEloyGsKTuQiiQjc8cqRZFNXe2vwziDB4IyTEl0Hjl5QF6ZaQE\n" + - "huPzzwvQm1pv64KrRXrmj3FisQK8B5OWLty9xp6xDqsaMRoyObLK+oIb20T5fSlE\n" + - "evmo1vYjnh8CX0Yzx5Gr5ye6YSEHQvYOWEws8ad17OlyToR2KMeC8w4qo6rs59pW\n" + - "g7Mxn9vo22ImDzrtAbTbXbCias3xlE0Bp0h5luyf+5U4UgksoL9B9r2oP4GrLNEV\n" + - "oJk57t8lwaR0upiv3CnS8LcJELpegZub5ggqLY8ZPYFQPjlK6IzLOm6rXPgZiZ3m\n" + - "RL0CAwEAAaNQME4wHQYDVR0OBBYEFA3dk8n+S701t+iZeJD721o92xVMMB8GA1Ud\n" + - "IwQYMBaAFA3dk8n+S701t+iZeJD721o92xVMMAwGA1UdEwQFMAMBAf8wDQYJKoZI\n" + - "hvcNAQELBQADggEBAJTRC3rKUUhVH07/1+stUungSYgpM08dY4utJq0BDk36BbmO\n" + - "0AnLDMbkwFdHEoqF6hQIfpm7SQTmXk0Fss6Eejm8ynYr6+EXiRAsaXOGOBCzF918\n" + - "/RuKOzqABfgSU4UBKECLM5bMfQTL60qx+HdbdVIpnikHZOFfmjCDVxoHsGyXc1LW\n" + - "Jhkht8IGOgc4PMGvyzTtRFjz01kvrVQZ75aN2E0GQv6dCxaEY0i3ypSzjUWAKqDh\n" + - "3e2OLwUSvumcdaxyCdZAOUsN6pDBQ+8VRG7KxnlRlY1SMEk46QgQYLbPDe/+W/yH\n" + - "ca4PejicPeh+9xRAwoTpiE2gulfT7Lm+fVM7Ruc=\n" + - "-----END CERTIFICATE-----", - - // -----BEGIN PRIVATE KEY----- - // MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC6THGO2lonlwxD - // Nf2CXyVtu2+J0SBWchGIRJaMhrCk7kIokI3PHKkWRTV3tr8M4gweCMkxJdB45eUB - // emWkBIbj888L0Jtab+uCq0V65o9xYrECvAeTli7cvcaesQ6rGjEaMjmyyvqCG9tE - // +X0pRHr5qNb2I54fAl9GM8eRq+cnumEhB0L2DlhMLPGndezpck6EdijHgvMOKqOq - // 7OfaVoOzMZ/b6NtiJg867QG0212womrN8ZRNAadIeZbsn/uVOFIJLKC/Qfa9qD+B - // qyzRFaCZOe7fJcGkdLqYr9wp0vC3CRC6XoGbm+YIKi2PGT2BUD45SuiMyzpuq1z4 - // GYmd5kS9AgMBAAECggEAFHSoU2MuWwJ+2jJnb5U66t2V1bAcuOE1g5zkWvG/G5z9 - // rq6Qo5kmB8f5ovdx6tw3MGUOklLwnRXBG3RxDJ1iokz3AvkY1clMNsDPlDsUrQKF - // JSO4QUBQTPSZhnsyfR8XHSU+qJ8Y+ohMfzpVv95BEoCzebtXdVgxVegBlcEmVHo2 - // kMmkRN+bYNsr8eb2r+b0EpyumS39ZgKYh09+cFb78y3T6IFMGcVJTP6nlGBFkmA/ - // 25pYeCF2tSki08qtMJZQAvKfw0Kviibk7ZxRbJqmc7B1yfnOEHP6ftjuvKl2+RP/ - // +5P5f8CfIP6gtA0LwSzAqQX/hfIKrGV5j0pCqrD0kQKBgQDeNR6Xi4sXVq79lihO - // a1bSeV7r8yoQrS8x951uO+ox+UIZ1MsAULadl7zB/P0er92p198I9M/0Jth3KBuS - // zj45mucvpiiGvmQlMKMEfNq4nN7WHOu55kufPswQB2mR4J3xmwI+4fM/nl1zc82h - // De8JSazRldJXNhfx0RGFPmgzbwKBgQDWoVXrXLbCAn41oVnWB8vwY9wjt92ztDqJ - // HMFA/SUohjePep9UDq6ooHyAf/Lz6oE5NgeVpPfTDkgvrCFVKnaWdwALbYoKXT2W - // 9FlyJox6eQzrtHAacj3HJooXWuXlphKSizntfxj3LtMR9BmrmRJOfK+SxNOVJzW2 - // +MowT20EkwKBgHmpB8jdZBgxI7o//m2BI5Y1UZ1KE5vx1kc7VXzHXSBjYqeV9FeF - // 2ZZLP9POWh/1Fh4pzTmwIDODGT2UPhSQy0zq3O0fwkyT7WzXRknsuiwd53u/dejg - // iEL2NPAJvulZ2+AuiHo5Z99LK8tMeidV46xoJDDUIMgTG+UQHNGhK5gNAoGAZn/S - // Cn7SgMC0CWSvBHnguULXZO9wH1wZAFYNLL44OqwuaIUFBh2k578M9kkke7woTmwx - // HxQTjmWpr6qimIuY6q6WBN8hJ2Xz/d1fwhYKzIp20zHuv5KDUlJjbFfqpsuy3u1C - // kts5zwI7pr1ObRbDGVyOdKcu7HI3QtR5qqyjwaUCgYABo7Wq6oHva/9V34+G3Goh - // 63bYGUnRw2l5BD11yhQv8XzGGZFqZVincD8gltNThB0Dc/BI+qu3ky4YdgdZJZ7K - // z51GQGtaHEbrHS5caV79yQ8QGY5mUVH3E+VXSxuIqb6pZq2DH4sTAEFHyncddmOH - // zoXBInYwRG9KE/Bw5elhUw== - // -----END PRIVATE KEY----- - - - // SHA256withDSA, 2048 bits - // Validity - // Not Before: May 22 07:18:18 2018 GMT - // Not After : May 17 07:18:18 2038 GMT - // Subject Key Identifier: - // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 - "-----BEGIN CERTIFICATE-----\n" + - "MIIErjCCBFSgAwIBAgIJAOktYLNCbr02MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + - "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + - "Y2UwHhcNMTgwNTIyMDcxODE4WhcNMzgwNTE3MDcxODE4WjA7MQswCQYDVQQGEwJV\n" + - "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" + - "ggNHMIICOQYHKoZIzjgEATCCAiwCggEBAO5GyPhSm0ze3LSu+gicdULLj05iOfTL\n" + - "UvZQ29sYz41zmqrLBQbdKiHqgJu2Re9sgTb5suLNjF047TOLPnU3jhPtWm2X8Xzi\n" + - "VGIcHym/Q/MeZxStt/88seqroI3WOKzIML2GcrishT+lcGrtH36Tf1+ue2Snn3PS\n" + - "WyxygNqPjllP5uUjYmFLvAf4QLMldkd/D2VxcwsHjB8y5iUZsXezc/LEhRZS/02m\n" + - "ivqlRw3AMkq/OVe/ZtxFWsP0nsfxEGdZuaUFpppGfixxFvymrB3+J51cTt+pZBDq\n" + - "D2y0DYfc+88iCs4jwHTfcDIpLb538HBjBj2rEgtQESQmB0ooD/+wsPsCIQC1bYch\n" + - "gElNtDYL3FgpLgNSUYp7gIWv9ehaC7LO2z7biQKCAQBitvFOnDkUja8NAF7lDpOV\n" + - "b5ipQ8SicBLW3kQamxhyuyxgZyy/PojZ/oPorkqW/T/A0rhnG6MssEpAtdiwVB+c\n" + - "rBYGo3bcwmExJhdOJ6dYuKFppPWhCwKMHs9npK+lqBMl8l5j58xlcFeC7ZfGf8GY\n" + - "GkhFW0c44vEQhMMbac6ZTTP4mw+1t7xJfmDMlLEyIpTXaAAk8uoVLWzQWnR40sHi\n" + - "ybvS0u3JxQkb7/y8tOOZu8qlz/YOS7lQ6UxUGX27Ce1E0+agfPphetoRAlS1cezq\n" + - "Wa7r64Ga0nkj1kwkcRqjgTiJx0NwnUXr78VAXFhVF95+O3lfqhvdtEGtkhDGPg7N\n" + - "A4IBBgACggEBAMmSHQK0w2i+iqUjOPzn0yNEZrzepLlLeQ1tqtn0xnlv5vBAeefD\n" + - "Pm9dd3tZOjufVWP7hhEz8xPobb1CS4e3vuQiv5UBfhdPL3f3l9T7JMAKPH6C9Vve\n" + - "OQXE5eGqbjsySbcmseHoYUt1WCSnSda1opX8zchX04e7DhGfE2/L9flpYEoSt8lI\n" + - "vMNjgOwvKdW3yvPt1/eBBHYNFG5gWPv/Q5KoyCtHS03uqGm4rNc/wZTIEEfd66C+\n" + - "QRaUltjOaHmtwOdDHaNqwhYZSVOip+Mo+TfyzHFREcdHLapo7ZXqbdYkRGxRR3d+\n" + - "3DfHaraJO0OKoYlPkr3JMvM/MSGR9AnZOcejUDBOMB0GA1UdDgQWBBR2Zp73O91F\n" + - "5TvZcjw/8FQ5hjEmUzAfBgNVHSMEGDAWgBR2Zp73O91F5TvZcjw/8FQ5hjEmUzAM\n" + - "BgNVHRMEBTADAQH/MAsGCWCGSAFlAwQDAgNHADBEAiBzriYE41M2y9Hy5ppkL0Qn\n" + - "dIlNc8JhXT/PHW7GDtViagIgMko8Qoj9gDGPK3+O9E8DC3wGiiF9CObM4LN387ok\n" + - "J+g=\n" + - "-----END CERTIFICATE-----" - // -----BEGIN PRIVATE KEY----- - // MIICZQIBADCCAjkGByqGSM44BAEwggIsAoIBAQDuRsj4UptM3ty0rvoInHVCy49O - // Yjn0y1L2UNvbGM+Nc5qqywUG3Soh6oCbtkXvbIE2+bLizYxdOO0ziz51N44T7Vpt - // l/F84lRiHB8pv0PzHmcUrbf/PLHqq6CN1jisyDC9hnK4rIU/pXBq7R9+k39frntk - // p59z0lsscoDaj45ZT+blI2JhS7wH+ECzJXZHfw9lcXMLB4wfMuYlGbF3s3PyxIUW - // Uv9Npor6pUcNwDJKvzlXv2bcRVrD9J7H8RBnWbmlBaaaRn4scRb8pqwd/iedXE7f - // qWQQ6g9stA2H3PvPIgrOI8B033AyKS2+d/BwYwY9qxILUBEkJgdKKA//sLD7AiEA - // tW2HIYBJTbQ2C9xYKS4DUlGKe4CFr/XoWguyzts+24kCggEAYrbxTpw5FI2vDQBe - // 5Q6TlW+YqUPEonAS1t5EGpsYcrssYGcsvz6I2f6D6K5Klv0/wNK4ZxujLLBKQLXY - // sFQfnKwWBqN23MJhMSYXTienWLihaaT1oQsCjB7PZ6SvpagTJfJeY+fMZXBXgu2X - // xn/BmBpIRVtHOOLxEITDG2nOmU0z+JsPtbe8SX5gzJSxMiKU12gAJPLqFS1s0Fp0 - // eNLB4sm70tLtycUJG+/8vLTjmbvKpc/2Dku5UOlMVBl9uwntRNPmoHz6YXraEQJU - // tXHs6lmu6+uBmtJ5I9ZMJHEao4E4icdDcJ1F6+/FQFxYVRfefjt5X6ob3bRBrZIQ - // xj4OzQQjAiEAsceWOM8do4etxp2zgnoNXV8PUUyqWhz1+0srcKV7FR4= - // -----END PRIVATE KEY----- - }; - - // End entity certificate. - final static String[] endEntityCertStrs = { - // SHA256withECDSA, curve prime256v1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Authority Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + - "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + - "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + - "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + - "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + - "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + - "-----END CERTIFICATE-----", - - // SHA256withRSA, 2048 bits - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Authority Key Identifier: - // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C - "-----BEGIN CERTIFICATE-----\n" + - "MIIDNjCCAh6gAwIBAgIJAO2+yPcFryUTMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC\n" + - "AQ8AMIIBCgKCAQEAszfBobWfZIp8AgC6PiWDDavP65mSvgCXUGxACbxVNAfkLhNR\n" + - "QOsHriRB3X1Q3nvO9PetC6wKlvE9jlnDDj7D+1j1r1CHO7ms1fq8rfcQYdkanDtu\n" + - "4AlHo8v+SSWX16MIXFRYDj2VVHmyPtgbltcg4zGAuwT746FdLI94uXjJjq1IOr/v\n" + - "0VIlwE5ORWH5Xc+5Tj+oFWK0E4a4GHDgtKKhn2m72hN56/GkPKGkguP5NRS1qYYV\n" + - "/EFkdyQMOV8J1M7HaicSft4OL6eKjTrgo93+kHk+tv0Dc6cpVBnalX3TorG8QI6B\n" + - "cHj1XQd78oAlAC+/jF4pc0mwi0un49kdK9gRfQIDAQABoyMwITAfBgNVHSMEGDAW\n" + - "gBQN3ZPJ/ku9NbfomXiQ+9taPdsVTDANBgkqhkiG9w0BAQsFAAOCAQEApXS0nKwm\n" + - "Kp8gpmO2yG1rpd1+2wBABiMU4JZaTqmma24DQ3RzyS+V2TeRb29dl5oTUEm98uc0\n" + - "GPZvhK8z5RFr4YE17dc04nI/VaNDCw4y1NALXGs+AHkjoPjLyGbWpi1S+gfq2sNB\n" + - "Ekkjp6COb/cb9yiFXOGVls7UOIjnVZVd0r7KaPFjZhYh82/f4PA/A1SnIKd1+nfH\n" + - "2yk7mSJNC7Z3qIVDL8MM/jBVwiC3uNe5GPB2uwhd7k5LGAVN3j4HQQGB0Sz+VC1h\n" + - "92oi6xDa+YBva2fvHuCd8P50DDjxmp9CemC7rnZ5j8egj88w14X44Xjb/Fd/ApG9\n" + - "e57NnbT7KM+Grw==\n" + - "-----END CERTIFICATE-----", - - // SHA256withRSA, curv prime256v1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 21 07:18:16 2028 GMT - // Authority Key Identifier: - // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C - "-----BEGIN CERTIFICATE-----\n" + - "MIICazCCAVOgAwIBAgIJAO2+yPcFryUUMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0yODA1MjEwNzE4MTZaMFUxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" + - "AQcDQgAE59MERNTlVZ1eeps8Z3Oue5ZkgQdPtD+WIE6tj3PbIKpxGPDxvfNP959A\n" + - "yQjEK/ehWQVrCMmNoEkIzY+IIBgB06MjMCEwHwYDVR0jBBgwFoAUDd2Tyf5LvTW3\n" + - "6Jl4kPvbWj3bFUwwDQYJKoZIhvcNAQELBQADggEBAFOTVEqs70ykhZiIdrEsF1Ra\n" + - "I3B2rLvwXZk52uSltk2/bzVvewA577ZCoxQ1pL7ynkisPfBN1uVYtHjM1VA3RC+4\n" + - "+TAK78dnI7otYjWoHp5rvs4l6c/IbOspS290IlNuDUxMErEm5wxIwj+Aukx/1y68\n" + - "hOyCvHBLMY2c1LskH1MMBbDuS1aI+lnGpToi+MoYObxGcV458vxuT8+wwV8Fkpvd\n" + - "ll8IIFmeNPRv+1E+lXbES6CSNCVaZ/lFhPgdgYKleN7sfspiz50DG4dqafuEAaX5\n" + - "xaK1NWXJxTRz0ROH/IUziyuDW6jphrlgit4+3NCzp6vP9hAJQ8Vhcj0n15BKHIQ=\n" + - "-----END CERTIFICATE-----", - - // SHA256withDSA, 2048 bits - // Validity - // Not Before: May 22 07:18:20 2018 GMT - // Not After : May 17 07:18:20 2038 GMT - // Authority Key Identifier: - // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 - "-----BEGIN CERTIFICATE-----\n" + - "MIIEnDCCBEGgAwIBAgIJAP/jh1qVhNVjMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQ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wYhVi8cjLDrZFKlgEQqhB4crnJU0mJY+tA4IBBQACggEAID0ezl00/X8mv7eb\n" + - "bzovum1+DEEP7FM57k6HZEG2N3ve4CW+0m9Cd+cWPz8wkZ+M0j/Eqa6F0IdbkXEc\n" + - "Q7CuzvUyJ57xQ3L/WCgXsiS+Bh8O4Mz7GwW22CGmHqafbVv+hKBfr8MkskO6GJUt\n" + - "SUF/CVLzB4gMIvZMH26tBP2xK+i7FeEK9kT+nGdzQSZBAhFYpEVCBplHZO24/OYq\n" + - "1DNoU327nUuXIhmsfA8N0PjiWbIZIjTPwBGr9H0LpATI7DIDNcvRRvtROP+pBU9y\n" + - "fuykPkptg9C0rCM9t06bukpOSaEz/2VIQdLE8fHYFA6pHZ6CIc2+5cfvMgTPhcjz\n" + - "W2jCt6MjMCEwHwYDVR0jBBgwFoAUdmae9zvdReU72XI8P/BUOYYxJlMwCwYJYIZI\n" + - "AWUDBAMCA0gAMEUCIQCeI5fN08b9BpOaHdc3zQNGjp24FOL/RxlBLeBAorswJgIg\n" + - "JEZ8DhYxQy1O7mmZ2UIT7op6epWMB4dENjs0qWPmcKo=\n" + - "-----END CERTIFICATE-----" - }; - - // Private key in the format of PKCS#8. - final static String[] endEntityPrivateKeys = { - // - // EC private key related to cert endEntityCertStrs[0]. - // - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + - "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + - "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6", - - // - // RSA private key related to cert endEntityCertStrs[1]. - // - "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzN8GhtZ9kinwC\n" + - "ALo+JYMNq8/rmZK+AJdQbEAJvFU0B+QuE1FA6weuJEHdfVDee870960LrAqW8T2O\n" + - "WcMOPsP7WPWvUIc7uazV+ryt9xBh2RqcO27gCUejy/5JJZfXowhcVFgOPZVUebI+\n" + - "2BuW1yDjMYC7BPvjoV0sj3i5eMmOrUg6v+/RUiXATk5FYfldz7lOP6gVYrQThrgY\n" + - "cOC0oqGfabvaE3nr8aQ8oaSC4/k1FLWphhX8QWR3JAw5XwnUzsdqJxJ+3g4vp4qN\n" + - "OuCj3f6QeT62/QNzpylUGdqVfdOisbxAjoFwePVdB3vygCUAL7+MXilzSbCLS6fj\n" + - "2R0r2BF9AgMBAAECggEASIkPkMCuw4WdTT44IwERus3IOIYOs2IP3BgEDyyvm4B6\n" + - "JP/iihDWKfA4zEl1Gqcni1RXMHswSglXra682J4kui02Ov+vzEeJIY37Ibn2YnP5\n" + - "ZjRT2s9GtI/S2o4hl8A/mQb2IMViFC+xKehTukhV4j5d6NPKk0XzLR7gcMjnYxwn\n" + - "l21fS6D2oM1xRG/di7sL+uLF8EXLRzfiWDNi12uQv4nwtxPKvuKhH6yzHt7YqMH0\n" + - "46pmDKDaxV4w1JdycjCb6NrCJOYZygoQobuZqOQ30UZoZsPJrtovkncFr1e+lNcO\n" + - "+aWDfOLCtTH046dEQh5oCShyXMybNlry/QHsOtHOwQKBgQDh2iIjs+FPpQy7Z3EX\n" + - "DGEvHYqPjrYO9an2KSRr1m9gzRlWYxKY46WmPKwjMerYtra0GP+TBHrgxsfO8tD2\n" + - "wUAII6sd1qup0a/Sutgf2JxVilLykd0+Ge4/Cs51tCdJ8EqDV2B6WhTewOY2EGvg\n" + - "JiKYkeNwgRX/9M9CFSAMAk0hUQKBgQDLJAartL3DoGUPjYtpJnfgGM23yAGl6G5r\n" + - "NSXDn80BiYIC1p0bG3N0xm3yAjqOtJAUj9jZbvDNbCe3GJfLARMr23legX4tRrgZ\n" + - "nEdKnAFKAKL01oM+A5/lHdkwaZI9yyv+hgSVdYzUjB8rDmzeVQzo1BT7vXypt2yV\n" + - "6O1OnUpCbQKBgA/0rzDChopv6KRcvHqaX0tK1P0rYeVQqb9ATNhpf9jg5Idb3HZ8\n" + - "rrk91BNwdVz2G5ZBpdynFl9G69rNAMJOCM4KZw5mmh4XOEq09Ivba8AHU7DbaTv3\n" + - "7QL7KnbaUWRB26HHzIMYVh0el6T+KADf8NXCiMTr+bfpfbL3dxoiF3zhAoGAbCJD\n" + - "Qse1dBs/cKYCHfkSOsI5T6kx52Tw0jS6Y4X/FOBjyqr/elyEexbdk8PH9Ar931Qr\n" + - "NKMvn8oA4iA/PRrXX7M2yi3YQrWwbkGYWYjtzrzEAdzmg+5eARKAeJrZ8/bg9l3U\n" + - "ttKaItJsDPlizn8rngy3FsJpR9aSAMK6/+wOiYkCgYEA1tZkI1rD1W9NYZtbI9BE\n" + - "qlJVFi2PBOJMKNuWdouPX3HLQ72GJSQff2BFzLTELjweVVJ0SvY4IipzpQOHQOBy\n" + - "5qh/p6izXJZh3IHtvwVBjHoEVplg1b2+I5e3jDCfqnwcQw82dW5SxOJMg1h/BD0I\n" + - "qAL3go42DYeYhu/WnECMeis=", - - // - // EC private key related to cert endEntityCertStrs[2]. - // - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGVc7hICpmp91jbYe\n" + - "nrr8nYHD37RZP3VENY+szuA7WjuhRANCAATn0wRE1OVVnV56mzxnc657lmSBB0+0\n" + - "P5YgTq2Pc9sgqnEY8PG980/3n0DJCMQr96FZBWsIyY2gSQjNj4ggGAHT", - - // - // DSA private key related to cert endEntityCertStrs[3]. - // - "MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQCaVq+CgmsxyOpZFVwMTZ2ZYA9E\n" + - "SCfNC+d4QN5/rxymsPONLC86zlB4XLHvmJtp2jV7qM7+tbWmsIZYcMPWgD9Ofg+T\n" + - "e+7SdTHO+XWoBNz5olulRTk6nRu+notsKxBCyVX0V5GHsRvts/qClz+QcIHMSALV\n" + - "UIrumtxxdbL63pIw4ds0PeH5RtyR9JpS5pWxUk1MPUPoYSV9GPg2bPUEY99Ji8qi\n" + - "vA1kRTeBfAWC0OgBwbHu1zIKUukMd+pF/D/vKKovJ6I/sPiGXmUw2i4lYOUB0wWn\n" + - "QUyBLez1UMWKchyvpW0FYxMbv7j5zMcAH7d++vCWo3OEGfe4Uet6Q3/Dx83HAiEA\n" + - "mjtJp7XNrsgxbRDqETkHhv6zYH8Voo+gDgSO1m7XcH0CggEBAI5moswp++plZSBP\n" + - "Q9DdCNHt0AV13Toj1jf5M5DNmTX6P6/D/oRfi8Ui1fiCKFv+7lD0J2anCFUaLtu+\n" + - "j7v78gp5OChDp/n49K6DtKtZZRDmw/Bpm6LNdknmdN5kO5wVzbIXHTCCeNs/CJTF\n" + - "mSU5PvEaI4y3M5NraSgLPkq4gEv7/A8orGbKmj1Whj3F9t1Tosxdm/+WkPldMz2t\n" + - "gev+9RM2S6S9XoembRgwRaFVkpQmKoKpOoZcdqV47FLDq5BYH/5POeJ9wLuAHjxQ\n" + - "5CMKo4p/lW7BCd4kuGWFT+OFFXfG2v6EtlqFbXBiFWLxyMsOtkUqWARCqEHhyucl\n" + - "TSYlj60EIgIgLfA75+8KcKxdN8mr6gzGjQe7jPFGG42Ejhd7Q2F4wuw=" - }; - - // Private key algorithm of endEntityPrivateKeys. - final static String[] endEntityPrivateKeyAlgs = { - "EC", - "RSA", - "EC", - "DSA", - }; - - // Private key names of endEntityPrivateKeys. - static final String[] endEntityPrivateKeyNames = { - "ecdsa", - "rsa", - "ec-rsa", - "dsa", - }; + protected KeyManager createKeyManager(Cert[] endEntityCerts, + ContextParameters params) throws Exception { + KeyStore ks = null; // key store + char[] passphrase = "passphrase".toCharArray(); - /* - * Create an instance of SSLContext with the specified trust/key materials. - */ - private SSLContext createSSLContext( - KeyManager keyManager, - TrustManager trustManager, - ContextParameters params) throws Exception { + if (endEntityCerts == null || endEntityCerts.length == 0) { + return null; - SSLContext context = SSLContext.getInstance(params.contextProtocol); - context.init( - new KeyManager[] { - keyManager - }, - new TrustManager[] { - trustManager - }, - null); + } else { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ks = KeyStore.getInstance("JKS"); + ks.load(null, null); + + for (Cert endEntityCert : endEntityCerts) { + // generate the private key. + PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( + Base64.getMimeDecoder().decode(endEntityCert.privKeyStr)); + KeyFactory kf = + KeyFactory.getInstance( + endEntityCert.keyAlgo); + PrivateKey priKey = kf.generatePrivate(priKeySpec); + + // generate certificate chain + ByteArrayInputStream is = new ByteArrayInputStream( + endEntityCert.certStr.getBytes()); + Certificate keyCert = null; + try { + keyCert = cf.generateCertificate(is); + } finally { + is.close(); + } + + Certificate[] chain = new Certificate[]{keyCert}; + + // import the key entry. + ks.setKeyEntry("cert-" + endEntityCert.name(), + priKey, passphrase, chain); + } - return context; + KeyManagerFactory kmf = + KeyManagerFactory.getInstance(params.kmAlgorithm); + kmf.init(ks, passphrase); + return kmf.getKeyManagers()[0]; + } } /* - * Create an instance of KeyManager with the specified key materials. + * Create an instance of SSLContext with the specified trust/key materials. */ - static KeyManager createKeyManager( - String[] keyMaterialCerts, - String[] keyMaterialKeys, - String[] keyMaterialKeyAlgs, - String[] keyMaterialKeyNames, + protected SSLContext createSSLContext( + Cert[] trustedCerts, + Cert[] endEntityCerts, ContextParameters params) throws Exception { - char[] passphrase = "passphrase".toCharArray(); - // Generate certificate from cert string. - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - - // Import the key materials. - // - // Note that certification paths bigger than one are not supported yet. - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(null, null); - ByteArrayInputStream is; - for (int i = 0; i < keyMaterialCerts.length; i++) { - String keyCertStr = keyMaterialCerts[i]; + TrustManager tm = createTrustManager(trustedCerts, params); - // generate the private key. - PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( - Base64.getMimeDecoder().decode(keyMaterialKeys[i])); - KeyFactory kf = - KeyFactory.getInstance(keyMaterialKeyAlgs[i]); - PrivateKey priKey = kf.generatePrivate(priKeySpec); - - // generate certificate chain - is = new ByteArrayInputStream(keyCertStr.getBytes()); - Certificate keyCert = null; - try { - keyCert = cf.generateCertificate(is); - } finally { - is.close(); - } + KeyManager km = createKeyManager(endEntityCerts, params); - Certificate[] chain = new Certificate[] { keyCert }; - - // import the key entry. - ks.setKeyEntry("cert-" + keyMaterialKeyNames[i], - priKey, passphrase, chain); - } + SSLContext context = SSLContext.getInstance(params.contextProtocol); + context.init(km == null ? null : new KeyManager[]{km}, new TrustManager[]{tm}, null); + return context; + } - KeyManagerFactory kmf = - KeyManagerFactory.getInstance(params.kmAlgorithm); - kmf.init(ks, passphrase); + /* + * The parameters used to configure SSLContext. + */ + static final class ContextParameters { + final String contextProtocol; + final String tmAlgorithm; + final String kmAlgorithm; - KeyManager[] km = kmf.getKeyManagers(); + ContextParameters(String contextProtocol, + String tmAlgorithm, String kmAlgorithm) { - return km[0]; + this.contextProtocol = contextProtocol; + this.tmAlgorithm = tmAlgorithm; + this.kmAlgorithm = kmAlgorithm; + } } /* - * Create an instance of TrustManager with the specified trust materials. + * Get the client side parameters of SSLContext. */ - static TrustManager createTrustManager( - String[] trustedMaterials, - ContextParameters params) throws Exception { - - // Generate certificate from cert string. - CertificateFactory cf = CertificateFactory.getInstance("X.509"); + protected ContextParameters getClientContextParameters() { + return new ContextParameters("TLS", "PKIX", "NewSunX509"); + } - // Import the trusted certs. - KeyStore ts = KeyStore.getInstance("PKCS12"); - ts.load(null, null); + /* + * Get the server side parameters of SSLContext. + */ + protected ContextParameters getServerContextParameters() { + return new ContextParameters("TLS", "PKIX", "NewSunX509"); + } - Certificate[] trustedCert = - new Certificate[trustedMaterials.length]; - ByteArrayInputStream is; - for (int i = 0; i < trustedMaterials.length; i++) { - String trustedCertStr = trustedMaterials[i]; - is = new ByteArrayInputStream(trustedCertStr.getBytes()); - try { - trustedCert[i] = cf.generateCertificate(is); - } finally { - is.close(); - } + enum Cert { - ts.setCertificateEntry("trusted-cert-" + i, trustedCert[i]); + CA_ECDSA_SECP256R1( + "EC", + // SHA256withECDSA, curve secp256r1 + // Validity + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT + // Subject Key Identifier: + // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 + "-----BEGIN CERTIFICATE-----\n" + + "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + + "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + + "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + + "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + + "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + + "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + + "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + + "2YEHlSQUAbwwqCDEVB5KxaqP\n" + + "-----END CERTIFICATE-----", + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd\n" + + "XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd\n" + + "LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp"), + + CA_ECDSA_SECP384R1( + "EC", + // SHA384withECDSA, curve secp384r1 + // Validity + // Not Before: Jun 24 08:15:06 2019 GMT + // Not After : Jun 19 08:15:06 2039 GMT + // Subject Key Identifier: + // 0a:93:a9:a0:bf:e7:d5:48:9d:4f:89:15:c6:51:98:80:05:51:4e:4e + "-----BEGIN CERTIFICATE-----\n" + + "MIICCDCCAY6gAwIBAgIUCpOpoL/n1UidT4kVxlGYgAVRTk4wCgYIKoZIzj0EAwMw\n" + + "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + + "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowOzEL\n" + + "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + + "dCBTZXJpdmNlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAENVQN1wXWFdgC6u/dDdiC\n" + + "y+WtMTF66oL/0BSm+1ZqsogamzCryawOcHgiuXgWzx5CQ3LuOC+tDFyXpGfHuCvb\n" + + "dkzxPrP5n9NrR8/uRPe5l1KOUbchviU8z9cTP+LZxnZDo1MwUTAdBgNVHQ4EFgQU\n" + + "SktSFArR1p/5mXV0kyo0RxIVa/UwHwYDVR0jBBgwFoAUSktSFArR1p/5mXV0kyo0\n" + + "RxIVa/UwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjBZvoNmq3/v\n" + + "RD2gBTyvxjS9h0rsMRLHDnvul/KWngytwGPTOBo0Y8ixQXSjdKoc3rkCMQDkiNgx\n" + + "IDxuHedmrLQKIPnVcthTmwv7//jHiqGoKofwChMo2a1P+DQdhszmeHD/ARQ=\n" + + "-----END CERTIFICATE-----", + "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDChlbt0NF8oIKODSxn2\n" + + "WXCXuJm3z78LRkzYQS3Nx5NMjei5ytkFZz4qvD4XXMWlTEyhZANiAAQ1VA3XBdYV\n" + + "2ALq790N2ILL5a0xMXrqgv/QFKb7VmqyiBqbMKvJrA5weCK5eBbPHkJDcu44L60M\n" + + "XJekZ8e4K9t2TPE+s/mf02tHz+5E97mXUo5RtyG+JTzP1xM/4tnGdkM="), + + CA_ECDSA_SECP521R1( + "EC", + // SHA512withECDSA, curve secp521r1 + // Validity + // Not Before: Jun 24 08:15:06 2019 GMT + // Not After : Jun 19 08:15:06 2039 GMT + // Subject Key Identifier: + // 25:ca:68:76:6d:29:17:9b:71:78:45:2d:d4:c6:e4:5d:fe:25:ff:90 + "-----BEGIN CERTIFICATE-----\n" + + "MIICUzCCAbSgAwIBAgIUJcpodm0pF5txeEUt1MbkXf4l/5AwCgYIKoZIzj0EAwQw\n" + + "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + + "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowOzEL\n" + + "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + + "dCBTZXJpdmNlMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAmFD5VmB2MdyJ6k+E\n" + + "eP4JncrE65ySL07gVmFwnr8otOt3NtRAyzmviMNNXXjo5R5NqNjKP4pr92JjT0sO\n" + + "D65yngkBtH151Ev/fiKPLxkXL9GzfKdWHVhDX7Zg6DUydzukzZV2/dIyloAIqwlz\n" + + "QVKJqT7RypDufdng8hnE9YfKo6ypZiujUzBRMB0GA1UdDgQWBBRAIrxa7WqtqUCe\n" + + "HFuKREDC92spvTAfBgNVHSMEGDAWgBRAIrxa7WqtqUCeHFuKREDC92spvTAPBgNV\n" + + "HRMBAf8EBTADAQH/MAoGCCqGSM49BAMEA4GMADCBiAJCAe22iirZnODCmlpxcv57\n" + + "3g5BEE60C+dtYmTqR4DtFyDaTRQ5CFf4ZxvQPIbD+SXi5Cbrl6qtrZG0cjUihPkC\n" + + "Hi1hAkIAiEcO7nMPgQLny+GrciojfN+bZXME/dPz6KHBm/89f8Me+jawVnv6y+df\n" + + "2Sbafh1KV6ntWQtB4bK3MXV8Ym9Eg1I=\n" + + "-----END CERTIFICATE-----", + "MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIAV8dZszV6+nLw3LeA\n" + + "Q+qLJLGaqyjlsQkaopCPcmoRdy1HX6AzB/YnKsPkHp/9DQN6A2JgUhFG5B0XvKSk\n" + + "BqNNuSGhgYkDgYYABACYUPlWYHYx3InqT4R4/gmdysTrnJIvTuBWYXCevyi063c2\n" + + "1EDLOa+Iw01deOjlHk2o2Mo/imv3YmNPSw4PrnKeCQG0fXnUS/9+Io8vGRcv0bN8\n" + + "p1YdWENftmDoNTJ3O6TNlXb90jKWgAirCXNBUompPtHKkO592eDyGcT1h8qjrKlm\n" + + "Kw=="), + + CA_RSA_2048( + "RSA", + // SHA256withRSA, 2048 bits + // Validity + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT + // Subject Key Identifier: + // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C + "-----BEGIN CERTIFICATE-----\n" + + "MIIDSTCCAjGgAwIBAgIJAI4ZF3iy8zG+MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALpMcY7aWieXDEM1/YJf\n" + + "JW27b4nRIFZyEYhEloyGsKTuQiiQjc8cqRZFNXe2vwziDB4IyTEl0Hjl5QF6ZaQE\n" + + "huPzzwvQm1pv64KrRXrmj3FisQK8B5OWLty9xp6xDqsaMRoyObLK+oIb20T5fSlE\n" + + "evmo1vYjnh8CX0Yzx5Gr5ye6YSEHQvYOWEws8ad17OlyToR2KMeC8w4qo6rs59pW\n" + + "g7Mxn9vo22ImDzrtAbTbXbCias3xlE0Bp0h5luyf+5U4UgksoL9B9r2oP4GrLNEV\n" + + "oJk57t8lwaR0upiv3CnS8LcJELpegZub5ggqLY8ZPYFQPjlK6IzLOm6rXPgZiZ3m\n" + + "RL0CAwEAAaNQME4wHQYDVR0OBBYEFA3dk8n+S701t+iZeJD721o92xVMMB8GA1Ud\n" + + "IwQYMBaAFA3dk8n+S701t+iZeJD721o92xVMMAwGA1UdEwQFMAMBAf8wDQYJKoZI\n" + + "hvcNAQELBQADggEBAJTRC3rKUUhVH07/1+stUungSYgpM08dY4utJq0BDk36BbmO\n" + + "0AnLDMbkwFdHEoqF6hQIfpm7SQTmXk0Fss6Eejm8ynYr6+EXiRAsaXOGOBCzF918\n" + + "/RuKOzqABfgSU4UBKECLM5bMfQTL60qx+HdbdVIpnikHZOFfmjCDVxoHsGyXc1LW\n" + + "Jhkht8IGOgc4PMGvyzTtRFjz01kvrVQZ75aN2E0GQv6dCxaEY0i3ypSzjUWAKqDh\n" + + "3e2OLwUSvumcdaxyCdZAOUsN6pDBQ+8VRG7KxnlRlY1SMEk46QgQYLbPDe/+W/yH\n" + + "ca4PejicPeh+9xRAwoTpiE2gulfT7Lm+fVM7Ruc=\n" + + "-----END CERTIFICATE-----", + "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC6THGO2lonlwxD\n" + + "Nf2CXyVtu2+J0SBWchGIRJaMhrCk7kIokI3PHKkWRTV3tr8M4gweCMkxJdB45eUB\n" + + "emWkBIbj888L0Jtab+uCq0V65o9xYrECvAeTli7cvcaes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+ + "2ZZLP9POWh/1Fh4pzTmwIDODGT2UPhSQy0zq3O0fwkyT7WzXRknsuiwd53u/dejg\n" + + "iEL2NPAJvulZ2+AuiHo5Z99LK8tMeidV46xoJDDUIMgTG+UQHNGhK5gNAoGAZn/S\n" + + "Cn7SgMC0CWSvBHnguULXZO9wH1wZAFYNLL44OqwuaIUFBh2k578M9kkke7woTmwx\n" + + "HxQTjmWpr6qimIuY6q6WBN8hJ2Xz/d1fwhYKzIp20zHuv5KDUlJjbFfqpsuy3u1C\n" + + "kts5zwI7pr1ObRbDGVyOdKcu7HI3QtR5qqyjwaUCgYABo7Wq6oHva/9V34+G3Goh\n" + + "63bYGUnRw2l5BD11yhQv8XzGGZFqZVincD8gltNThB0Dc/BI+qu3ky4YdgdZJZ7K\n" + + "z51GQGtaHEbrHS5caV79yQ8QGY5mUVH3E+VXSxuIqb6pZq2DH4sTAEFHyncddmOH\n" + + "zoXBInYwRG9KE/Bw5elhUw=="), + + CA_RSA_512( // for DisabledShortRSAKeys test + "RSA", + // md5WithRSAEncryption, 1024 bits + // Validity + // Not Before: Aug 19 01:52:19 2011 GMT + // Not After : Jul 29 01:52:19 2032 GMT + // X509v3 Authority Key Identifier: + // keyid:B9:7C:D5:D9:DF:A7:4C:03:AE:FD:0E:27:5B:31:95:6C:C7:F3:75:E1 + // DirName:/C=US/O=Java/OU=SunJSSE Test Serivce + // serial:00 + "-----BEGIN CERTIFICATE-----\n" + + "MIICkjCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" + + "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" + + "MTEwODE5MDE1MjE5WhcNMzIwNzI5MDE1MjE5WjA7MQswCQYDVQQGEwJVUzENMAsG\n" + + "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwgZ8wDQYJ\n" + + "KoZIhvcNAQEBBQAD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u57PB6GRamAihEAtoRTBQlH0ECIQDN08FgTtnesgCU\n" + + "DFYLLcw1CiHvc7fZw4neBDHCrC8NtQIgA8TOUkGnpCZlQ0KaI8KfKWI+vxFcgFnH\n" + + "3fnqsTgaUs4=" + + ), + + CA_DSA_2048( + "DSA", + // SHA256withDSA, 2048 bits + // Validity + // Not Before: May 22 07:18:18 2018 GMT + // Not After : May 17 07:18:18 2038 GMT + // Subject Key Identifier: + // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 + "-----BEGIN CERTIFICATE-----\n" + + "MIIErjCCBFSgAwIBAgIJAOktYLNCbr02MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + + "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + + "Y2UwHhcNMTgwNTIyMDcxODE4WhcNMzgwNTE3MDcxODE4WjA7MQswCQYDVQQGEwJV\n" + + "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" + + "ggNHMIICOQYHKoZIzjgEATCCAiwCggEBAO5GyPhSm0ze3LSu+gicdULLj05iOfTL\n" + + "UvZQ29sYz41zmqrLBQbdKiHqgJu2Re9sgTb5suLNjF047TOLPnU3jhPtWm2X8Xzi\n" + + "VGIcHym/Q/MeZxStt/88seqroI3WOKzIML2GcrishT+lcGrtH36Tf1+ue2Snn3PS\n" + + "WyxygNqPjllP5uUjYmFLvAf4QLMldkd/D2VxcwsHjB8y5iUZsXezc/LEhRZS/02m\n" + + "ivqlRw3AMkq/OVe/ZtxFWsP0nsfxEGdZuaUFpppGfixxFvymrB3+J51cTt+pZBDq\n" + + "D2y0DYfc+88iCs4jwHTfcDIpLb538HBjBj2rEgtQESQmB0ooD/+wsPsCIQC1bYch\n" + + "gElNtDYL3FgpLgNSUYp7gIWv9ehaC7LO2z7biQKCAQBitvFOnDkUja8NAF7lDpOV\n" + + "b5ipQ8SicBLW3kQamxhyuyxgZyy/PojZ/oPorkqW/T/A0rhnG6MssEpAtdiwVB+c\n" + + "rBYGo3bcwmExJhdOJ6dYuKFppPWhCwKMHs9npK+lqBMl8l5j58xlcFeC7ZfGf8GY\n" + + "GkhFW0c44vEQhMMbac6ZTTP4mw+1t7xJfmDMlLEyIpTXaAAk8uoVLWzQWnR40sHi\n" + + "ybvS0u3JxQkb7/y8tOOZu8qlz/YOS7lQ6UxUGX27Ce1E0+agfPphetoRAlS1cezq\n" + + "Wa7r64Ga0nkj1kwkcRqjgTiJx0NwnUXr78VAXFhVF95+O3lfqhvdtEGtkhDGPg7N\n" + + "A4IBBgACggEBAMmSHQK0w2i+iqUjOPzn0yNEZrzepLlLeQ1tqtn0xnlv5vBAeefD\n" + + "Pm9dd3tZOjufVWP7hhEz8xPobb1CS4e3vuQiv5UBfhdPL3f3l9T7JMAKPH6C9Vve\n" + + "OQXE5eGqbjsySbcmseHoYUt1WCSnSda1opX8zchX04e7DhGfE2/L9flpYEoSt8lI\n" + + "vMNjgOwvKdW3yvPt1/eBBHYNFG5gWPv/Q5KoyCtHS03uqGm4rNc/wZTIEEfd66C+\n" + + "QRaUltjOaHmtwOdDHaNqwhYZSVOip+Mo+TfyzHFREcdHLapo7ZXqbdYkRGxRR3d+\n" + + "3DfHaraJO0OKoYlPkr3JMvM/MSGR9AnZOcejUDBOMB0GA1UdDgQWBBR2Zp73O91F\n" + + "5TvZcjw/8FQ5hjEmUzAfBgNVHSMEGDAWgBR2Zp73O91F5TvZcjw/8FQ5hjEmUzAM\n" + + "BgNVHRMEBTADAQH/MAsGCWCGSAFlAwQDAgNHADBEAiBzriYE41M2y9Hy5ppkL0Qn\n" + + "dIlNc8JhXT/PHW7GDtViagIgMko8Qoj9gDGPK3+O9E8DC3wGiiF9CObM4LN387ok\n" + + "J+g=\n" + + "-----END CERTIFICATE-----", + "MIICZQIBADCCAjkGByqGSM44BAEwggIsAoIBAQDuRsj4UptM3ty0rvoInHVCy49O" + + "Yjn0y1L2UNvbGM+Nc5qqywUG3Soh6oCbtkXvbIE2+bLizYxdOO0ziz51N44T7Vpt" + + "l/F84lRiHB8pv0PzHmcUrbf/PLHqq6CN1jisyDC9hnK4rIU/pXBq7R9+k39frntk" + + "p59z0lsscoDaj45ZT+blI2JhS7wH+ECzJXZHfw9lcXMLB4wfMuYlGbF3s3PyxIUW" + + "Uv9Npor6pUcNwDJKvzlXv2bcRVrD9J7H8RBnWbmlBaaaRn4scRb8pqwd/iedXE7f" + + "qWQQ6g9stA2H3PvPIgrOI8B033AyKS2+d/BwYwY9qxILUBEkJgdKKA//sLD7AiEA" + + "tW2HIYBJTbQ2C9xYKS4DUlGKe4CFr/XoWguyzts+24kCggEAYrbxTpw5FI2vDQBe" + + "5Q6TlW+YqUPEonAS1t5EGpsYcrssYGcsvz6I2f6D6K5Klv0/wNK4ZxujLLBKQLXY" + + "sFQfnKwWBqN23MJhMSYXTienWLihaaT1oQsCjB7PZ6SvpagTJfJeY+fMZXBXgu2X" + + "xn/BmBpIRVtHOOLxEITDG2nOmU0z+JsPtbe8SX5gzJSxMiKU12gAJPLqFS1s0Fp0" + + "eNLB4sm70tLtycUJG+/8vLTjmbvKpc/2Dku5UOlMVBl9uwntRNPmoHz6YXraEQJU" + + "tXHs6lmu6+uBmtJ5I9ZMJHEao4E4icdDcJ1F6+/FQFxYVRfefjt5X6ob3bRBrZIQ" + + "xj4OzQQjAiEAsceWOM8do4etxp2zgnoNXV8PUUyqWhz1+0srcKV7FR4="), + + CA_DSA_1024( + "DSA", + // dsaWithSHA1, 1024 bits + // Validity + // Not Before: Apr 24 12:25:43 2020 GMT + // Not After : Apr 22 12:25:43 2030 GMT + // Authority Key Identifier: + // E1:3C:01:52:EB:D1:38:F7:CF:F1:E3:5E:DB:54:75:7F:5E:AB:2D:36 + "-----BEGIN CERTIFICATE-----\n" + + "MIIC9TCCArWgAwIBAgIUd52yKk0OxQuxdaYRAfq5VLuF1ZAwCQYHKoZIzjgEAzAu\n" + + "MQswCQYDVQQGEwJVUzENMAsGA1UECgwESmF2YTEQMA4GA1UECwwHU3VuSlNTRTAe\n" + + "Fw0yMDA0MjQxMjI1NDJaFw0zMDA0MjIxMjI1NDJaMC4xCzAJBgNVBAYTAlVTMQ0w\n" + + "CwYDVQQKDARKYXZhMRAwDgYDVQQLDAdTdW5KU1NFMIIBtjCCASsGByqGSM44BAEw\n" + + "ggEeAoGBAKgyb2XpANq43T8yBf5v0PTBOddLPxd0f0FotASron5rQr86JjBTfgIW\n" + + "oE4u7nYlO6bp/M4Dw6qZr+HaDu9taIDOj6LL51eUShVsOgS7XZcUzLT8vPnkEDDo\n" + + "u326x0B7fuNCbMLm+ipM2d4FhLUTt4Qb5TcY6l7dOGHeWiL7nl43AhUAoGr8DY2m\n" + + "WHZPHk2XbZ5wpaM2lLcCgYBKiFbFFViH/ylHJRPtYtjtJw4ls1scbVP4TRHnKoZc\n" + + "HPAird1fDYgGC2b0GQNAMABhI+L+ogxS7qakySpJCheuN25AjiSyilygQdlXoWRt\n" + + "Mggsh8EQZT7iP4V4e9m3xRHzb5ECvsSTdZB1BQMcC90W2Avq+orqgBnr2in9UEd8\n" + + "qwOBhAACgYAgVWxjYWlWIv7s4BnNMQoPKppi205f3aC6wv6Rqk4BnYYYrFONEmzQ\n" + + "hzj6lSXfxLpTu4lg2zNeIraZggoS0ztkbZNNADEmAHx+OLshiJJxu2/KfoopJOZg\n" + + "8ARmuaKOkWbkW9y4hWhfBlVwZbckG3Eibff0xronIXXy7B7UKaccyqNTMFEwHQYD\n" + + "VR0OBBYEFOE8AVLr0Tj3z/HjXttUdX9eqy02MB8GA1UdIwQYMBaAFOE8AVLr0Tj3\n" + + "z/HjXttUdX9eqy02MA8GA1UdEwEB/wQFMAMBAf8wCQYHKoZIzjgEAwMvADAsAhRC\n" + + "YLduLniBEJ51SfBWIkvNW6OG7QIUSKaTY6rgEFDEMoTqOjFChR22nkk=\n" + + "-----END CERTIFICATE-----", + "MIIBSgIBADCCASsGByqGSM44BAEwggEeAoGBAKgyb2XpANq43T8yBf5v0PTBOddL\n" + + "Pxd0f0FotASron5rQr86JjBTfgIWoE4u7nYlO6bp/M4Dw6qZr+HaDu9taIDOj6LL\n" + + "51eUShVsOgS7XZcUzLT8vPnkEDDou326x0B7fuNCbMLm+ipM2d4FhLUTt4Qb5TcY\n" + + "6l7dOGHeWiL7nl43AhUAoGr8DY2mWHZPHk2XbZ5wpaM2lLcCgYBKiFbFFViH/ylH\n" + + "JRPtYtjtJw4ls1scbVP4TRHnKoZcHPAird1fDYgGC2b0GQNAMABhI+L+ogxS7qak\n" + + "ySpJCheuN25AjiSyilygQdlXoWRtMggsh8EQZT7iP4V4e9m3xRHzb5ECvsSTdZB1\n" + + "BQMcC90W2Avq+orqgBnr2in9UEd8qwQWAhQ7rSn+WvIxeuZ/CK4p04eMe5JzpA=="), + + CA_ED25519( + "EdDSA", + // ED25519 + // Validity + // Not Before: May 24 23:32:35 2020 GMT + // Not After : May 22 23:32:35 2030 GMT + // X509v3 Authority Key Identifier: + // keyid:06:76:DB:88:EB:61:55:4C:C9:63:41:C2:A0:A8:57:3F:D7:F1:B8:EC + "-----BEGIN CERTIFICATE-----\n" + + "MIIByTCCAXugAwIBAgIUCyxKvhErehsygx50JYArsHby9hAwBQYDK2VwMDsxCzAJ\n" + + "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + + "U2VyaXZjZTAeFw0yMDA1MjQyMzMyMzVaFw0zMDA1MjIyMzMyMzVaMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTAqMAUGAytlcAMhAKdotuYIkH8PYbopSLbaf1BtqUY2d6AbTgK2prMzQ6B3\n" + + "o4GQMIGNMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFAZ224jrYVVMyWNBwqCo\n" + + "Vz/X8bjsMB8GA1UdIwQYMBaAFAZ224jrYVVMyWNBwqCoVz/X8bjsMA4GA1UdDwEB\n" + + "/wQEAwIBhjAqBgNVHSUBAf8EIDAeBggrBgEFBQcDAwYIKwYBBQUHAwgGCCsGAQUF\n" + + "BwMJMAUGAytlcANBADVAArvME8xFigFhCCCOTBoy/4ldGkDZQ/GT3Q6xnAP558FU\n" + + "0G32OprKQZP43D9bmFU0LMgCVM9bHWU+bu/10AU=\n" + + "-----END CERTIFICATE-----", + "MC4CAQAwBQYDK2VwBCIEII/VYp8nu/eqq2L5y7/3IzavBgis4LWP6Rikv0N8SpgL"), + + CA_ED448( + "EdDSA", + // ED448 + // Validity + // Not Before: May 24 23:23:43 2020 GMT + // Not After : May 22 23:23:43 2030 GMT + // X509v3 Authority Key Identifier: + // keyid:F5:D5:9D:FB:6F:B7:50:29:DF:F0:B8:83:10:5F:9B:C4:A8:1C:E9:F4 + "-----BEGIN CERTIFICATE-----\n" + + "MIICFDCCAZSgAwIBAgIUKcmLeKilq0LN40sniBJO7F1gb/owBQYDK2VxMDsxCzAJ\n" + + "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + + "U2VyaXZjZTAeFw0yMDA1MjQyMzIzNDNaFw0zMDA1MjIyMzIzNDNaMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTBDMAUGAytlcQM6APYP8iSXS8xPVDike5RgCByfTtg4GGtpYfoBtt6G5szA\n" + + "55ExAKjm03wtk29nEPU2mCHF2QgfBzUrgKOBkDCBjTAPBgNVHRMBAf8EBTADAQH/\n" + + "MB0GA1UdDgQWBBT11Z37b7dQKd/wuIMQX5vEqBzp9DAfBgNVHSMEGDAWgBT11Z37\n" + + "b7dQKd/wuIMQX5vEqBzp9DAOBgNVHQ8BAf8EBAMCAYYwKgYDVR0lAQH/BCAwHgYI\n" + + "KwYBBQUHAwMGCCsGAQUFBwMIBggrBgEFBQcDCTAFBgMrZXEDcwAlRXA2gPb52yV3\n" + + "MKJErjmKlYSFExj5w5jafbbd0QgI1yDs+qSaZLjQ8ljwabmLDg+KR+167m0djQDI\n" + + "OOoVuL7bgM0RL836KnuuBzm+gTdPp0gCXy3k9lL0KA0V2YLJHXXzu3suu+7rdgoP\n" + + "plCh2hWdLgA=\n" + + "-----END CERTIFICATE-----", + "MEcCAQAwBQYDK2VxBDsEOd6/hRZqkUyTlJSwdN5gO/HnoWYda1fD83YUm5j6m2Bg\n" + + "hAQi+QadFsQLD7R6PI/4Q0twXqlKnxU5Ug=="), + + EE_ECDSA_SECP256R1( + "EC", + // SHA256withECDSA, curve secp256r1 + // Validity + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT + // Authority Key Identifier: + // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 + "-----BEGIN CERTIFICATE-----\n" + + "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + + "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + + "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + + "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + + "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + + "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + + "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + + "-----END CERTIFICATE-----", + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + + "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + + "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6"), + + EE_ECDSA_SECP384R1( + "EC", + // SHA384withECDSA, curve secp384r1 + // Validity + // Not Before: Jun 24 08:15:06 2019 GMT + // Not After : Jun 19 08:15:06 2039 GMT + // Authority Key Identifier: + // 40:2D:AA:EE:66:AA:33:27:AD:9B:5D:52:9B:60:67:6A:2B:AD:52:D2 + "-----BEGIN CERTIFICATE-----\n" + + "MIICEjCCAZegAwIBAgIUS3F0AqAXWRg07CnbknJzxofyBQMwCgYIKoZIzj0EAwMw\n" + + "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + + "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowVTEL\n" + + "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + + "dCBTZXJpdmNlMRgwFgYDVQQDDA9SZWdyZXNzaW9uIFRlc3QwdjAQBgcqhkjOPQIB\n" + + "BgUrgQQAIgNiAARqElz8b6T07eyKomIinhztV3/3XBk9bKGtJ0W+JOltjuhMmP/w\n" + + "G8ASSevpgqgpi6EzpBZaaJxE3zNfkNnxXOZmQi2Ypd1uK0zRdbEOKg0XOcTTZwEj\n" + + "iLjYmt3O0pwpklijQjBAMB0GA1UdDgQWBBRALaruZqozJ62bXVKbYGdqK61S0jAf\n" + + "BgNVHSMEGDAWgBRKS1IUCtHWn/mZdXSTKjRHEhVr9TAKBggqhkjOPQQDAwNpADBm\n" + + "AjEArVDFKf48xijN6huVUJzKCOP0zlWB5Js+DItIkZmLQuhciPLhLIB/rChf3Y4C\n" + + "xuP4AjEAmfLhQRI0O3pifpYzYSVh2G7/jHNG4eO+2dvgAcU+Lh2IIj/cpLaPFSvL\n" + + "J8FXY9Nj\n" + + "-----END CERTIFICATE-----", + "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDASuI9EtK29APXPipkc\n" + + "qDA+qwlewMjv/OcjUJ77kP1Vz62oVF9iY9SRIyFIUju8wt+hZANiAARqElz8b6T0\n" + + "7eyKomIinhztV3/3XBk9bKGtJ0W+JOltjuhMmP/wG8ASSevpgqgpi6EzpBZaaJxE\n" + + "3zNfkNnxXOZmQi2Ypd1uK0zRdbEOKg0XOcTTZwEjiLjYmt3O0pwpklg="), + + EE_ECDSA_SECP521R1( + "EC", + // SHA512withECDSA, curve secp521r1 + // Validity + // Not Before: Jun 24 08:15:06 2019 GMT + // Not After : Jun 19 08:15:06 2039 GMT + // Authority Key Identifier: + // 7B:AA:79:A4:49:DD:59:34:F0:86:6C:51:C7:30:F4:CE:C5:81:8A:28 + "-----BEGIN CERTIFICATE-----\n" + + "MIICXDCCAb2gAwIBAgIUck4QTsbHNqUfPxfGPJLYbedFPdswCgYIKoZIzj0EAwQw\n" + + "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + + "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowVTEL\n" + + "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + + "dCBTZXJpdmNlMRgwFgYDVQQDDA9SZWdyZXNzaW9uIFRlc3QwgZswEAYHKoZIzj0C\n" + + "AQYFK4EEACMDgYYABAGa2zDLhYQHHCLI3YBqFYJTzrnDIjzwXrxhcRTS8DYkcrjZ\n" + + "+Fih1YyNhix0sdjH+3EqElXAHHuVzn3n3hPOtQCWlQCICkErB34S0cvmtRkeW8Fi\n" + + "hrR5tvJEzEZjPSgwn81kKyhV2L70je6i7Cw884Va8bODckpgw0vTmbQb7T9dupkv\n" + + "1aNCMEAwHQYDVR0OBBYEFHuqeaRJ3Vk08IZsUccw9M7FgYooMB8GA1UdIwQYMBaA\n" + + "FEAivFrtaq2pQJ4cW4pEQML3aym9MAoGCCqGSM49BAMEA4GMADCBiAJCAb33KHdY\n" + + "WDbusORWoY8Euglpd5zsF15hJsk7wtpD5HST1/NWmdCx405w+TV6a9Gr4VPHeaIQ\n" + + "99i/+f237ALL5p6IAkIBbwwFL1vt3c/bx+niyuffQPNjly80rdC9puqAqriSiboS\n" + + "efhxjidJ9HLaIRCMEPyd6vAsC8mO8YvL1uCuEQLsiGM=\n" + + "-----END CERTIFICATE-----", + "MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIB8C/2OX2Dt9vFszzV\n" + + "hcAe0CbkMlvu9uQ/L7Vz88heuIj0rUZIPGshvgIJt1hCMT8HZxYHvDa4lbUvqjFB\n" + + "+zafvPWhgYkDgYYABAGa2zDLhYQHHCLI3YBqFYJTzrnDIjzwXrxhcRTS8DYkcrjZ\n" + + "+Fih1YyNhix0sdjH+3EqElXAHHuVzn3n3hPOtQCWlQCICkErB34S0cvmtRkeW8Fi\n" + + "hrR5tvJEzEZjPSgwn81kKyhV2L70je6i7Cw884Va8bODckpgw0vTmbQb7T9dupkv\n" + + "1Q=="), + + EE_RSA_2048( + "RSA", + // SHA256withRSA, 2048 bits + // Validity + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT + // Authority Key Identifier: + // 0D:DD:93:C9:FE:4B:BD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XOGVls7UOIjnVZVd0r7KaPFjZhYh82/f4PA/A1SnIKd1+nfH\n" + + "2yk7mSJNC7Z3qIVDL8MM/jBVwiC3uNe5GPB2uwhd7k5LGAVN3j4HQQGB0Sz+VC1h\n" + + "92oi6xDa+YBva2fvHuCd8P50DDjxmp9CemC7rnZ5j8egj88w14X44Xjb/Fd/ApG9\n" + + "e57NnbT7KM+Grw==\n" + + "-----END CERTIFICATE-----", + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzN8GhtZ9kinwC\n" + + "ALo+JYMNq8/rmZK+AJdQbEAJvFU0B+QuE1FA6weuJEHdfVDee870960LrAqW8T2O\n" + + "WcMOPsP7WPWvUIc7uazV+ryt9xBh2RqcO27gCUejy/5JJZfXowhcVFgOPZVUebI+\n" + + "2BuW1yDjMYC7BPvjoV0sj3i5eMmOrUg6v+/RUiXATk5FYfldz7lOP6gVYrQThrgY\n" + + "cOC0oqGfabvaE3nr8aQ8oaSC4/k1FLWphhX8QWR3JAw5XwnUzsdqJxJ+3g4vp4qN\n" + + "OuCj3f6QeT62/QNzpylUGdqVfdOisbxAjoFwePVdB3vygCUAL7+MXilzSbCLS6fj\n" + + "2R0r2BF9AgMBAAECggEASIkPkMCuw4WdTT44IwERus3IOIYOs2IP3BgEDyyvm4B6\n" + + "JP/iihDWKfA4zEl1Gqcni1RXMHswSglXra682J4kui02Ov+vzEeJIY37Ibn2YnP5\n" + + "ZjRT2s9GtI/S2o4hl8A/mQb2IMViFC+xKehTukhV4j5d6NPKk0XzLR7gcMjnYxwn\n" + + "l21fS6D2oM1xRG/di7sL+uLF8EXLRzfiWDNi12uQv4nwtxPKvuKhH6yzHt7YqMH0\n" + + "46pmDKDaxV4w1JdycjCb6NrCJOYZygoQobuZqOQ30UZoZsPJrtovkncFr1e+lNcO\n" + + "+aWDfOLCtTH046dEQh5oCShyXMybNlry/QHsOtHOwQKBgQDh2iIjs+FPpQy7Z3EX\n" + + "DGEvHYqPjrYO9an2KSRr1m9gzRlWYxKY46WmPKwjMerYtra0GP+TBHrgxsfO8tD2\n" + + "wUAII6sd1qup0a/Sutgf2JxVilLykd0+Ge4/Cs51tCdJ8EqDV2B6WhTewOY2EGvg\n" + + "JiKYkeNwgRX/9M9CFSAMAk0hUQKBgQDLJAartL3DoGUPjYtpJnfgGM23yAGl6G5r\n" + + "NSXDn80BiYIC1p0bG3N0xm3yAjqOtJAUj9jZbvDNbCe3GJfLARMr23legX4tRrgZ\n" + + "nEdKnAFKAKL01oM+A5/lHdkwaZI9yyv+hgSVdYzUjB8rDmzeVQzo1BT7vXypt2yV\n" + + "6O1OnUpCbQKBgA/0rzDChopv6KRcvHqaX0tK1P0rYeVQqb9ATNhpf9jg5Idb3HZ8\n" + + "rrk91BNwdVz2G5ZBpdynFl9G69rNAMJOCM4KZw5mmh4XOEq09Ivba8AHU7DbaTv3\n" + + "7QL7KnbaUWRB26HHzIMYVh0el6T+KADf8NXCiMTr+bfpfbL3dxoiF3zhAoGAbCJD\n" + + "Qse1dBs/cKYCHfkSOsI5T6kx52Tw0jS6Y4X/FOBjyqr/elyEexbdk8PH9Ar931Qr\n" + + "NKMvn8oA4iA/PRrXX7M2yi3YQrWwbkGYWYjtzrzEAdzmg+5eARKAeJrZ8/bg9l3U\n" + + "ttKaItJsDPlizn8rngy3FsJpR9aSAMK6/+wOiYkCgYEA1tZkI1rD1W9NYZtbI9BE\n" + + "qlJVFi2PBOJMKNuWdouPX3HLQ72GJSQff2BFzLTELjweVVJ0SvY4IipzpQOHQOBy\n" + + "5qh/p6izXJZh3IHtvwVBjHoEVplg1b2+I5e3jDCfqnwcQw82dW5SxOJMg1h/BD0I\n" + + "qAL3go42DYeYhu/WnECMeis="), + + EE_EC_RSA_SECP256R1( + "EC", + // SHA256withRSA, curve secp256r1 + // Validity + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 21 07:18:16 2028 GMT + // Authority Key Identifier: + // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C + "-----BEGIN CERTIFICATE-----\n" + + "MIICazCCAVOgAwIBAgIJAO2+yPcFryUUMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0yODA1MjEwNzE4MTZaMFUxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" + + "AQcDQgAE59MERNTlVZ1eeps8Z3Oue5ZkgQdPtD+WIE6tj3PbIKpxGPDxvfNP959A\n" + + "yQjEK/ehWQVrCMmNoEkIzY+IIBgB06MjMCEwHwYDVR0jBBgwFoAUDd2Tyf5LvTW3\n" + + "6Jl4kPvbWj3bFUwwDQYJKoZIhvcNAQELBQADggEBAFOTVEqs70ykhZiIdrEsF1Ra\n" + + "I3B2rLvwXZk52uSltk2/bzVvewA577ZCoxQ1pL7ynkisPfBN1uVYtHjM1VA3RC+4\n" + + "+TAK78dnI7otYjWoHp5rvs4l6c/IbOspS290IlNuDUxMErEm5wxIwj+Aukx/1y68\n" + + "hOyCvHBLMY2c1LskH1MMBbDuS1aI+lnGpToi+MoYObxGcV458vxuT8+wwV8Fkpvd\n" + + "ll8IIFmeNPRv+1E+lXbES6CSNCVaZ/lFhPgdgYKleN7sfspiz50DG4dqafuEAaX5\n" + + "xaK1NWXJxTRz0ROH/IUziyuDW6jphrlgit4+3NCzp6vP9hAJQ8Vhcj0n15BKHIQ=\n" + + "-----END CERTIFICATE-----", + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGVc7hICpmp91jbYe\n" + + "nrr8nYHD37RZP3VENY+szuA7WjuhRANCAATn0wRE1OVVnV56mzxnc657lmSBB0+0\n" + + "P5YgTq2Pc9sgqnEY8PG980/3n0DJCMQr96FZBWsIyY2gSQjNj4ggGAHT"), + + EE_RSA_512( + "RSA", + // md5WithRSAEncryption, 512 bits + // Validity + // Not Before: Nov 7 13:55:52 2011 GMT + // Not After : Jul 25 13:55:52 2031 GMT + // X509v3 Authority Key Identifier: + // B9:7C:D5:D9:DF:A7:4C:03:AE:FD:0E:27:5B:31:95:6C:C7:F3:75:E1 + "-----BEGIN CERTIFICATE-----\n" + + "MIICNDCCAZ2gAwIBAgIBDDANBgkqhkiG9w0BAQQFADA7MQswCQYDVQQGEwJVUzEN\n" + + "MAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UwHhcN\n" + + "MTExMTA3MTM1NTUyWhcNMzEwNzI1MTM1NTUyWjBPMQswCQYDVQQGEwJVUzENMAsG\n" + + "A1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2UxEjAQBgNV\n" + + "BAMTCWxvY2FsaG9zdDBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQC3Pb49OSPfOD2G\n" + + "HSXFCFx1GJEZfqG9ZUf7xuIi/ra5dLjPGAaoY5QF2QOa8VnOriQCXDfyXHxsuRnE\n" + + "OomxL7EVAgMBAAGjeDB2MAsGA1UdDwQEAwID6DAdBgNVHQ4EFgQUXNCJK3/dtCIc\n" + + "xb+zlA/JINlvs/MwHwYDVR0jBBgwFoAUuXzV2d+nTAOu/Q4nWzGVbMfzdeEwJwYD\n" + + "VR0lBCAwHgYIKwYBBQUHAwEGCCsGAQUFBwMCBggrBgEFBQcDAzANBgkqhkiG9w0B\n" + + "AQQFAAOBgQB2qIDUxA2caMPpGtUACZAPRUtrGssCINIfItETXJZCx/cRuZ5sP4D9\n" + + "N1acoNDn0hCULe3lhXAeTC9NZ97680yJzregQMV5wATjo1FGsKY30Ma+sc/nfzQW\n" + + "+h/7RhYtoG0OTsiaDCvyhI6swkNJzSzrAccPY4+ZgU8HiDLzZTmM3Q==\n" + + "-----END CERTIFICATE-----", + "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAtz2+PTkj3zg9hh0l\n" + + "xQhcdRiRGX6hvWVH+8biIv62uXS4zxgGqGOUBdkDmvFZzq4kAlw38lx8bLkZxDqJ\n" + + "sS+xFQIDAQABAkByx/5Oo2hQ/w2q4L8z+NTRlJ3vdl8iIDtC/4XPnfYfnGptnpG6\n" + + "ZThQRvbMZiai0xHQPQMszvAHjZVme1eDl3EBAiEA3aKJHynPVCEJhpfCLWuMwX5J\n" + + "1LntwJO7NTOyU5m8rPECIQDTpzn5X44r2rzWBDna/Sx7HW9IWCxNgUD2Eyi2nA7W\n" + + "ZQIgJerEorw4aCAuzQPxiGu57PB6GRamAihEAtoRTBQlH0ECIQDN08FgTtnesgCU\n" + + "DFYLLcw1CiHvc7fZw4neBDHCrC8NtQIgA8TOUkGnpCZlQ0KaI8KfKWI+vxFcgFnH\n" + + "3fnqsTgaUs4=" + ), + + EE_DSA_2048( + "DSA", + // SHA256withDSA, 2048 bits + // Validity + // Not Before: May 22 07:18:20 2018 GMT + // Not After : May 17 07:18:20 2038 GMT + // Authority Key Identifier: + // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 + "-----BEGIN CERTIFICATE-----\n" + + "MIIEnDCCBEGgAwIBAgIJAP/jh1qVhNVjMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + + "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + + "Y2UwHhcNMTgwNTIyMDcxODIwWhcNMzgwNTE3MDcxODIwWjBVMQswCQYDVQQGEwJV\n" + + "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Ux\n" + + "GDA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zB4gMIvZMH26tBP2xK+i7FeEK9kT+nGdzQSZBAhFYpEVCBplHZO24/OYq\n" + + "1DNoU327nUuXIhmsfA8N0PjiWbIZIjTPwBGr9H0LpATI7DIDNcvRRvtROP+pBU9y\n" + + "fuykPkptg9C0rCM9t06bukpOSaEz/2VIQdLE8fHYFA6pHZ6CIc2+5cfvMgTPhcjz\n" + + "W2jCt6MjMCEwHwYDVR0jBBgwFoAUdmae9zvdReU72XI8P/BUOYYxJlMwCwYJYIZI\n" + + "AWUDBAMCA0gAMEUCIQCeI5fN08b9BpOaHdc3zQNGjp24FOL/RxlBLeBAorswJgIg\n" + + "JEZ8DhYxQy1O7mmZ2UIT7op6epWMB4dENjs0qWPmcKo=\n" + + "-----END CERTIFICATE-----", + "MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQCaVq+CgmsxyOpZFVwMTZ2ZYA9E\n" + + "SCfNC+d4QN5/rxymsPONLC86zlB4XLHvmJtp2jV7qM7+tbWmsIZYcMPWgD9Ofg+T\n" + + "e+7SdTHO+XWoBNz5olulRTk6nRu+notsKxBCyVX0V5GHsRvts/qClz+QcIHMSALV\n" + + "UIrumtxxdbL63pIw4ds0PeH5RtyR9JpS5pWxUk1MPUPoYSV9GPg2bPUEY99Ji8qi\n" + + "vA1kRTeBfAWC0OgBwbHu1zIKUukMd+pF/D/vKKovJ6I/sPiGXmUw2i4lYOUB0wWn\n" + + "QUyBLez1UMWKchyvpW0FYxMbv7j5zMcAH7d++vCWo3OEGfe4Uet6Q3/Dx83HAiEA\n" + + "mjtJp7XNrsgxbRDqETkHhv6zYH8Voo+gDgSO1m7XcH0CggEBAI5moswp++plZSBP\n" + + "Q9DdCNHt0AV13Toj1jf5M5DNmTX6P6/D/oRfi8Ui1fiCKFv+7lD0J2anCFUaLtu+\n" + + "j7v78gp5OChDp/n49K6DtKtZZRDmw/Bpm6LNdknmdN5kO5wVzbIXHTCCeNs/CJTF\n" + + "mSU5PvEaI4y3M5NraSgLPkq4gEv7/A8orGbKmj1Whj3F9t1Tosxdm/+WkPldMz2t\n" + + "gev+9RM2S6S9XoembRgwRaFVkpQmKoKpOoZcdqV47FLDq5BYH/5POeJ9wLuAHjxQ\n" + + "5CMKo4p/lW7BCd4kuGWFT+OFFXfG2v6EtlqFbXBiFWLxyMsOtkUqWARCqEHhyucl\n" + + "TSYlj60EIgIgLfA75+8KcKxdN8mr6gzGjQe7jPFGG42Ejhd7Q2F4wuw="), + + EE_DSA_1024( + "DSA", + // dsaWithSHA1, 1024 bits + // Validity + // Not Before: Apr 24 12:25:43 2020 GMT + // Not After : Apr 22 12:25:43 2030 GMT + // Authority Key Identifier: + // E1:3C:01:52:EB:D1:38:F7:CF:F1:E3:5E:DB:54:75:7F:5E:AB:2D:36 + "-----BEGIN CERTIFICATE-----\n" + + "MIIDADCCAr+gAwIBAgIUd2XJ5F2VTbk9a92w/NzLXR5zjUQwCQYHKoZIzjgEAzAu\n" + + "MQswCQYDVQQGEwJVUzENMAsGA1UECgwESmF2YTEQMA4GA1UECwwHU3VuSlNTRTAe\n" + + "Fw0yMDA0MjQxMjI1NDNaFw0zMDA0MjIxMjI1NDNaMEgxCzAJBgNVBAYTAlVTMQ0w\n" + + "CwYDVQQKDARKYXZhMRAwDgYDVQQLDAdTdW5KU1NFMRgwFgYDVQQDDA9SZWdyZXNz\n" + + "aW9uIFRlc3QwggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA7fSkxYISlMJT+i8N5VOb\n" + + "lHhjrPYAy3oR2/YXQW6T0hCMhm8jmxgk1bDId9ZKHrxsM05EkCtRYaqag4ZZeGde\n" + + "ywv3IwwYqCQfGtkPwT9QAsdSABYwGOrlhEtZtBG1yQ44c+Rz/Vs+PtkAyZbf5VG1\n" + + "iSxFb9bI5QFJWJ9a2VpZh58CFQCCGALQoK4MsQP8V72WlB7Bvt9erwKBgQDCxu0G\n" + + "M2iZr0J8DaAo9/ChS4m7E7h6Jz9KOm2cFhzYGekkUXNzny7nyz6Qpgbuf8KNFKjt\n" + + "qoUDC8tlcVQAUlTcESC0TZXR3h21hl9wzIBhE+kJ1j8v1KAxfOaJOxObk5QEvIaA\n" + + "5j+jiHGwRS5tDqywOatz+emwMZv1wKnCNBElNgOBhAACgYBHjuQKucCuuvy/4DpG\n" + + "rSIzdueK+HrzOW8h2pfvz3lzpsyV6XJPC6we9CjaQjU01VcjwN2PoYtbGyml0pbK\n" + + "We4sdgn6LDL1aCM/WKRSxGHVTx+wkhKQ719YtiC0T6sA+eLirc6VT3/6+FbQWC+2\n" + + "bG7N19sGpV/RAXMBpRXUnBJSQaNCMEAwHQYDVR0OBBYEFNNZxyxuQmKvWowofr/S\n" + + "HdCIS+W8MB8GA1UdIwQYMBaAFOE8AVLr0Tj3z/HjXttUdX9eqy02MAkGByqGSM44\n" + + "BAMDMAAwLQIUUzzMhZ9St/Vo/YdgNTHdTw4cm14CFQCE6tWG157Wl5YFyYsGHsLY\n" + + "NN8uCA==\n" + + "-----END CERTIFICATE-----", + "MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAO30pMWCEpTCU/ovDeVTm5R4Y6z2\n" + + "AMt6Edv2F0Fuk9IQjIZvI5sYJNWwyHfWSh68bDNORJArUWGqmoOGWXhnXssL9yMM\n" + + "GKgkHxrZD8E/UALHUgAWMBjq5YRLWbQRtckOOHPkc/1bPj7ZAMmW3+VRtYksRW/W\n" + + "yOUBSVifWtlaWYefAhUAghgC0KCuDLED/Fe9lpQewb7fXq8CgYEAwsbtBjNoma9C\n" + + "fA2gKPfwoUuJuxO4eic/SjptnBYc2BnpJFFzc58u58s+kKYG7n/CjRSo7aqFAwvL\n" + + "ZXFUAFJU3BEgtE2V0d4dtYZfcMyAYRPpCdY/L9SgMXzmiTsTm5OUBLyGgOY/o4hx\n" + + "sEUubQ6ssDmrc/npsDGb9cCpwjQRJTYEFgIUNRiLmNzfTYOuVsjkySPzP5gPImM="), + + EE_ED25519( + "EdDSA", + // ED25519 + // Validity + // Not Before: May 24 23:32:36 2020 GMT + // Not After : May 22 23:32:36 2030 GMT + // X509v3 Authority Key Identifier: + // keyid:06:76:DB:88:EB:61:55:4C:C9:63:41:C2:A0:A8:57:3F:D7:F1:B8:EC + "-----BEGIN CERTIFICATE-----\n" + + "MIIBlDCCAUagAwIBAgIUFTt/jcgQ65nhTG8LkrWFJhhEGuwwBQYDK2VwMDsxCzAJ\n" + + "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + + "U2VyaXZjZTAeFw0yMDA1MjQyMzMyMzZaFw0zMDA1MjIyMzMyMzZaMFUxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MCowBQYDK2VwAyEAGAYQmKb7\n" + + "WNYpVxIdsc49lI1emNjF06/Jl85zlG0wc9OjQjBAMB0GA1UdDgQWBBQkJ2E4/S8Z\n" + + "EIM1v9uTc0eYtYNk3zAfBgNVHSMEGDAWgBQGdtuI62FVTMljQcKgqFc/1/G47DAF\n" + + "BgMrZXADQQCVZnl/AyIEtZ8r45e/hcfxwuezgRX+7e9NHZFV1A/TMGcBRORDfDUi\n" + + "bbh72K528fjT7P4/WoXvm1zJKOAzUOUL\n" + + "-----END CERTIFICATE-----", + "MC4CAQAwBQYDK2VwBCIEIGBmdh4tfc0lng/LWokhfFLlo0ZlmTn2lbI639qou2KP"), + + EE_ED448( + "EdDSA", + // ED448 + // Validity + // Not Before: May 24 23:23:43 2020 GMT + // Not After : May 22 23:23:43 2030 GMT + // X509v3 Authority Key Identifier: + // keyid:F5:D5:9D:FB:6F:B7:50:29:DF:F0:B8:83:10:5F:9B:C4:A8:1C:E9:F4 + "-----BEGIN CERTIFICATE-----\n" + + "MIIB3zCCAV+gAwIBAgIUNlWzFrH2+BILqM3SNYQjKoY98S8wBQYDK2VxMDsxCzAJ\n" + + "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + + "U2VyaXZjZTAeFw0yMDA1MjQyMzIzNDNaFw0zMDA1MjIyMzIzNDNaMFUxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MEMwBQYDK2VxAzoAoIubPNAg\n" + + "F11u3MQ5d9wujg10+80I0xzYzTqzzXrfJNtw+eU8NbUk86xiCvlMzJRH0Oo3DbY8\n" + + "NAKAo0IwQDAdBgNVHQ4EFgQUUiI1+qT1x+HsDgfZRIU6hUaAbmUwHwYDVR0jBBgw\n" + + "FoAU9dWd+2+3UCnf8LiDEF+bxKgc6fQwBQYDK2VxA3MAx8P0mle08s5YDd/p58dt\n" + + "yORqvDPwo5IYPasqN8Zeen1B9u1xF/kvDGFxCJ6D9Gi4ynnDx0FZFMkA83evZcxJ\n" + + "+X+swt7FyHwXrdkZcvjRKEcsWhkj+0FlxYF/NZzLTGuGIPYJnRLEwf/zr+5NDxKs\n" + + "fCoA\n" + + "-----END CERTIFICATE-----", + "MEcCAQAwBQYDK2VxBDsEOfbhmUSuKP9WCO7Nr6JxVq5rfJESk1MNMyYhC134SiAP\n" + + "Suw0Cu7RZVadpfPR7Kiwb2b/JXjMdY1HAA=="), + + EE_RSASSA_PSS( + "RSASSA-PSS", + // Signature Algorithm: rsassaPss + // Hash Algorithm: sha256 + // Mask Algorithm: mgf1 with sha256 + // + // Validity + // Not Before: Jun 6 07:11:00 2018 GMT + // Not After : Jun 1 07:11:00 2038 GMT + // X509v3 Authority Key Identifier: + // 1F:16:2B:79:8A:55:89:99:98:02:5F:84:18:D0:7B:1A:23:D8:88:0C + "-----BEGIN CERTIFICATE-----\n" + + "MIIDZjCCAh2gAwIBAgIUHxwPs3eAgJ057nJw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QyzOuQPUBpI7nS7UtR\n" + + "Ug8VE9ACpBxxI3qChMahFZGHlXCCSjSmxpQa6UO4SQl8q5tPNnqdzWwvAW8qkCy4\n" + + "6barRQ4sMcGayhHh/uSTx7bcl0FMJpcI1ygbw7/Pc03zKtw0gMTBMns7q4yXjb/u\n" + + "ef47nW0t+LRAAg==\n" + + "-----END CERTIFICATE-----", + "MIIEuwIBADALBgkqhkiG9w0BAQoEggSnMIIEowIBAAKCAQEApfK+EK4NuwWFDv9V\n" + + "WtiMfEDxszf5b85irz+RX9uqLzVuL0VMevB8wIYYlrXJfj8C0myaia3hJE5ZXuz5\n" + + "0QMqW8t3zu2QCtGN2Ih6rmgYO3fu2BYYR8L/IBtJWXMgNAZFxSR6nau+qmq9MRwu\n" + + "g1Xs15tCt5nHHsphrRUfQc1pgI/uw2LEsL7U0O1jaEJn9HHQzEjO9SMGk8CML09s\n" + + "M19b7+YXHQ8l3a+uFhalkgPbDSdiumq8WmlNZJcCkoA6JBep42n1kOFMXUeu3eVt\n" + + "TGKIoqA7NmMt7rbDKTtjlM2VQWTXU4JK9Y7CYSLq6c/+SudZcCSEUAXsxBUm/utA\n" + + "BVaDCQIDAQABAoIBAAc4vRS0vlw5LUUtz2UYr2Ro3xvRf8Vh0eGWfpkRUiKjzJu6\n" + + "BE4FUSh/rWpBlvcrfs/xcfgz3OxbjIAZB/YUkS9Vd21F4VLXM7kMl2onlYZg/b/h\n" + + "lkTpM3kONu7xl6Er9LVTlRJveuinpHwSoeONRbVMSGb9BjFM1VtW4/lVGxZBG05D\n" + + "y9i/o4vCZqULn9cAumOwicKuCyTcS58XcMJ+puSPfRA71PYLxqFkASAoJsUwCXpo\n" + + "gs39lLsIFgrfO8mBO1ux/SE+QaRc+9XqFSHHKD1XqF/9zSYBgWjE910EcpdYEdZx\n" + + "GEkwea7Fn4brO5OpIrHY/45naqbUOBzv6gufMAECgYEAz7PHCdcrQvmOb8EiNbQH\n" + + "uvSimwObWJFeN1ykp6mfRbSnkXw7p8+M4Tc8HFi8QLpoq63Ev2AwoaQCQvHbFC2Y\n" + + "1Cz0EkC0aOp+tZP7U2AUBdkcDesZAJQTad0zV6KesyIUXdxZXDG8JJ1XSNWfTJV4\n" + + "QD+BjLZ0jiAyCIfVYvWQqYkCgYEAzIln1nKTixLMPr5CldSmR7ZarEtPJU+hHwVg\n" + + "dV/Lc6d2Yy9JgunOXRo4BXB1TEo8JFbK3HBQH6tS8li4qDr7WK5wyYfh8qb4WZyu\n" + + "lc562f2WVYntcN8/Ojb+Vyrt7lk9sq/8KoVHxEAWd6mqL9VTPYuAu1Vw9fTGIZfB\n" + + "lDeELYECgYAvdzU4UXzofGGJtohb332YwwlaBZP9xJLUcg6K5l+orWVSASMc8XiP\n" + + "i3DoRXsYC8GZ4kdBOPlEJ1gA9oaLcPQpIPDSLwlLpLM6Scw4vI822uvnXl/DWxOo\n" + + "sM1n7Jj59QLUhGPDhvYpI+/rjC4wcUQe4qR3hMbUKBVnD6u7RsU9iQKBgQCQ17VK\n" + + "7bSCRfuRaxaoGADww7gOTv5rQ6qr1xjpxb7D1hFGR9Rc+smCsPB/GZZXQjK44SWj\n" + + "WX3ED4Ubzaxmpe4cbNu+O5XMSmWQwB36RFBHUwdE5/nXdqDFzu/qNqJrqZLBmVKP\n" + + "ofaiiWffsaytVvotmT6+atElvAMbAua42V+nAQKBgHtIn3mYMHLriYGhQzpkFEA2\n" + + "8YcAMlKppueOMAKVy8nLu2r3MidmLAhMiKJQKG45I3Yg0/t/25tXLiOPJlwrOebh\n" + + "xQqUBI/JUOIpGAEnr48jhOXnCS+i+z294G5U/RgjXrlR4bCPvrtCmwzWwe0h79w2\n" + + "Q2hO5ZTW6UD9CVA85whf"); + + final String keyAlgo; + final String certStr; + final String privKeyStr; + + Cert(String keyAlgo, String certStr, String privKeyStr) { + this.keyAlgo = keyAlgo; + this.certStr = certStr; + this.privKeyStr = privKeyStr; } - - // Create an SSLContext object. - TrustManagerFactory tmf = - TrustManagerFactory.getInstance(params.tmAlgorithm); - tmf.init(ts); - - TrustManager[] tms = tmf.getTrustManagers(); - return tms[0]; } } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java 2024-01-09 21:18:15.000000000 +0000 @@ -51,7 +51,7 @@ * (wrap/unwrap) pass before any application data is consumed or * produced. */ -public class SSLEngineTemplate implements SSLContextTemplate { +public class SSLEngineTemplate extends SSLContextTemplate { protected final SSLEngine clientEngine; // client Engine protected final ByteBuffer clientOut; // write side of clientEngine protected final ByteBuffer clientIn; // read side of clientEngine diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLSocketSSLEngineTemplate.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,532 +0,0 @@ -/* - * Copyright (c) 2011, 2019, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -// -// SunJSSE does not support dynamic system properties, no way to re-use -// system properties in samevm/agentvm mode. -// - -/* - * @test - * @bug 7105780 - * @summary Add SSLSocket client/SSLEngine server to templates directory. - * @run main/othervm SSLSocketSSLEngineTemplate TLSv1 - * @run main/othervm SSLSocketSSLEngineTemplate TLSv1.1 - * @run main/othervm SSLSocketSSLEngineTemplate TLSv1.2 - * @run main/othervm SSLSocketSSLEngineTemplate TLSv1.3 - */ - -/** - * A SSLSocket/SSLEngine interop test case. This is not the way to - * code SSLEngine-based servers, but works for what we need to do here, - * which is to make sure that SSLEngine/SSLSockets can talk to each other. - * SSLEngines can use direct or indirect buffers, and different code - * is used to get at the buffer contents internally, so we test that here. - * - * The test creates one SSLSocket (client) and one SSLEngine (server). - * The SSLSocket talks to a raw ServerSocket, and the server code - * does the translation between byte [] and ByteBuffers that the SSLEngine - * can use. The "transport" layer consists of a Socket Input/OutputStream - * and two byte buffers for the SSLEngines: think of them - * as directly connected pipes. - * - * Again, this is a *very* simple example: real code will be much more - * involved. For example, different threading and I/O models could be - * used, transport mechanisms could close unexpectedly, and so on. - * - * When this application runs, notice that several messages - * (wrap/unwrap) pass before any application data is consumed or - * produced. (For more information, please see the SSL/TLS - * specifications.) There may several steps for a successful handshake, - * so it's typical to see the following series of operations: - * - * client server message - * ====== ====== ======= - * write() ... ClientHello - * ... unwrap() ClientHello - * ... wrap() ServerHello/Certificate - * read() ... ServerHello/Certificate - * write() ... ClientKeyExchange - * write() ... ChangeCipherSpec - * write() ... Finished - * ... unwrap() ClientKeyExchange - * ... unwrap() ChangeCipherSpec - * ... unwrap() Finished - * ... wrap() ChangeCipherSpec - * ... wrap() Finished - * read() ... ChangeCipherSpec - * read() ... Finished - */ -import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.net.*; -import java.security.*; -import java.nio.*; - -public class SSLSocketSSLEngineTemplate { - - /* - * Enables logging of the SSL/TLS operations. - */ - private static final boolean logging = true; - - /* - * Enables the JSSE system debugging system property: - * - * -Djavax.net.debug=all - * - * This gives a lot of low-level information about operations underway, - * including specific handshake messages, and might be best examined - * after gaining some familiarity with this application. - */ - private static final boolean debug = false; - private final SSLContext sslc; - private SSLEngine serverEngine; // server-side SSLEngine - private SSLSocket clientSocket; - - private final byte[] serverMsg = - "Hi there Client, I'm a Server.".getBytes(); - private final byte[] clientMsg = - "Hello Server, I'm a Client! Pleased to meet you!".getBytes(); - - private ByteBuffer serverOut; // write side of serverEngine - private ByteBuffer serverIn; // read side of serverEngine - - private volatile Exception clientException; - private volatile Exception serverException; - - /* - * For data transport, this example uses local ByteBuffers. - */ - private ByteBuffer cTOs; // "reliable" transport client->server - private ByteBuffer sTOc; // "reliable" transport server->client - - /* - * The following is to set up the keystores/trust material. - */ - private static final String pathToStores = "../etc"; - private static final String keyStoreFile = "keystore"; - private static final String trustStoreFile = "truststore"; - private static final String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores - + "/" + keyStoreFile; - private static final String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores - + "/" + trustStoreFile; - - /* - * Main entry point for this test. - */ - public static void main(String args[]) throws Exception { - String protocol = args[0]; - - // reset security properties to make sure that the algorithms - // and keys used in this test are not disabled. - Security.setProperty("jdk.tls.disabledAlgorithms", ""); - Security.setProperty("jdk.certpath.disabledAlgorithms", ""); - - if (debug) { - System.setProperty("javax.net.debug", "all"); - } - - /* - * Run the tests with direct and indirect buffers. - */ - SSLSocketSSLEngineTemplate test = - new SSLSocketSSLEngineTemplate(protocol); - log("-------------------------------------"); - log("Testing " + protocol + " for direct buffers ..."); - test.runTest(true); - - log("---------------------------------------"); - log("Testing " + protocol + " for indirect buffers ..."); - test.runTest(false); - - log("Test Passed."); - } - - /* - * Create an initialized SSLContext to use for these tests. - */ - public SSLSocketSSLEngineTemplate(String protocol) throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - try (FileInputStream keyFile = new FileInputStream(keyFilename); - FileInputStream trustFile = new FileInputStream(trustFilename)) { - ks.load(keyFile, passphrase); - ts.load(trustFile, passphrase); - } - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance(protocol); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - sslc = sslCtx; - } - - /* - * Run the test. - * - * Sit in a tight loop, with the server engine calling wrap/unwrap - * regardless of whether data is available or not. We do this until - * we get the application data. Then we shutdown and go to the next one. - * - * The main loop handles all of the I/O phases of the SSLEngine's - * lifetime: - * - * initial handshaking - * application data transfer - * engine closing - * - * One could easily separate these phases into separate - * sections of code. - */ - private void runTest(boolean direct) throws Exception { - clientSocket = null; - boolean serverClose = direct; - - // generates the server-side Socket - try (ServerSocket serverSocket = new ServerSocket()) { - serverSocket.setReuseAddress(false); - serverSocket.bind(null); - int port = serverSocket.getLocalPort(); - log("Port: " + port); - Thread thread = createClientThread(port, serverClose); - - createSSLEngine(); - createBuffers(direct); - - // server-side socket that will read - try (Socket socket = serverSocket.accept()) { - socket.setSoTimeout(500); - - boolean closed = false; - // will try to read one more time in case client message - // is fragmented to multiple pieces - boolean retry = true; - - InputStream is = socket.getInputStream(); - OutputStream os = socket.getOutputStream(); - - SSLEngineResult serverResult; // results from last operation - - /* - * Examining the SSLEngineResults could be much more involved, - * and may alter the overall flow of the application. - * - * For example, if we received a BUFFER_OVERFLOW when trying - * to write to the output pipe, we could reallocate a larger - * pipe, but instead we wait for the peer to drain it. - */ - byte[] inbound = new byte[8192]; - byte[] outbound = new byte[8192]; - - while (!isEngineClosed(serverEngine)) { - int len; - - // Inbound data - log("================"); - - // Read from the Client side. - try { - len = is.read(inbound); - if (len == -1) { - logSocketStatus(clientSocket); - if (clientSocket.isClosed() - || clientSocket.isOutputShutdown()) { - log("Client socket was closed or shutdown output"); - break; - } else { - throw new Exception("Unexpected EOF"); - } - } - cTOs.put(inbound, 0, len); - } catch (SocketTimeoutException ste) { - // swallow. Nothing yet, probably waiting on us. - } - - cTOs.flip(); - - serverResult = serverEngine.unwrap(cTOs, serverIn); - log("server unwrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); - cTOs.compact(); - - // Outbound data - log("----"); - - serverResult = serverEngine.wrap(serverOut, sTOc); - log("server wrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); - - sTOc.flip(); - - if ((len = sTOc.remaining()) != 0) { - sTOc.get(outbound, 0, len); - os.write(outbound, 0, len); - // Give the other side a chance to process - } - - sTOc.compact(); - - if (!closed && (serverOut.remaining() == 0)) { - closed = true; - - /* - * We'll alternate initiatating the shutdown. - * When the server initiates, it will take one more - * loop, but tests the orderly shutdown. - */ - if (serverClose) { - serverEngine.closeOutbound(); - } - serverIn.flip(); - - /* - * A sanity check to ensure we got what was sent. - */ - if (serverIn.remaining() != clientMsg.length) { - if (retry && - serverIn.remaining() < clientMsg.length) { - log("Need to read more from client"); - serverIn.compact(); - retry = false; - continue; - } else { - throw new Exception( - "Client: Data length error"); - } - } - - for (int i = 0; i < clientMsg.length; i++) { - if (clientMsg[i] != serverIn.get()) { - throw new Exception( - "Client: Data content error"); - } - } - serverIn.compact(); - } - } - } catch (Exception e) { - serverException = e; - } finally { - // Wait for the client to join up with us. - if (thread != null) { - thread.join(); - } - } - } finally { - if (serverException != null) { - if (clientException != null) { - serverException.initCause(clientException); - } - throw serverException; - } - if (clientException != null) { - if (serverException != null) { - clientException.initCause(serverException); - } - throw clientException; - } - } - } - - /* - * Create a client thread which does simple SSLSocket operations. - * We'll write and read one data packet. - */ - private Thread createClientThread(final int port, - final boolean serverClose) throws Exception { - - Thread t = new Thread("ClientThread") { - - @Override - public void run() { - // client-side socket - try (SSLSocket sslSocket = (SSLSocket)sslc.getSocketFactory(). - createSocket("localhost", port)) { - clientSocket = sslSocket; - - OutputStream os = sslSocket.getOutputStream(); - InputStream is = sslSocket.getInputStream(); - - // write(byte[]) goes in one shot. - os.write(clientMsg); - - byte[] inbound = new byte[2048]; - int pos = 0; - - int len; - while ((len = is.read(inbound, pos, 2048 - pos)) != -1) { - pos += len; - // Let the client do the closing. - if ((pos == serverMsg.length) && !serverClose) { - sslSocket.close(); - break; - } - } - - if (pos != serverMsg.length) { - throw new Exception("Client: Data length error"); - } - - for (int i = 0; i < serverMsg.length; i++) { - if (inbound[i] != serverMsg[i]) { - throw new Exception("Client: Data content error"); - } - } - } catch (Exception e) { - clientException = e; - } - } - }; - t.start(); - return t; - } - - /* - * Using the SSLContext created during object creation, - * create/configure the SSLEngines we'll use for this test. - */ - private void createSSLEngine() throws Exception { - /* - * Configure the serverEngine to act as a server in the SSL/TLS - * handshake. - */ - serverEngine = sslc.createSSLEngine(); - serverEngine.setUseClientMode(false); - serverEngine.getNeedClientAuth(); - } - - /* - * Create and size the buffers appropriately. - */ - private void createBuffers(boolean direct) { - - SSLSession session = serverEngine.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - /* - * We'll make the input buffers a bit bigger than the max needed - * size, so that unwrap()s following a successful data transfer - * won't generate BUFFER_OVERFLOWS. - * - * We'll use a mix of direct and indirect ByteBuffers for - * tutorial purposes only. In reality, only use direct - * ByteBuffers when they give a clear performance enhancement. - */ - if (direct) { - serverIn = ByteBuffer.allocateDirect(appBufferMax + 50); - cTOs = ByteBuffer.allocateDirect(netBufferMax); - sTOc = ByteBuffer.allocateDirect(netBufferMax); - } else { - serverIn = ByteBuffer.allocate(appBufferMax + 50); - cTOs = ByteBuffer.allocate(netBufferMax); - sTOc = ByteBuffer.allocate(netBufferMax); - } - - serverOut = ByteBuffer.wrap(serverMsg); - } - - /* - * If the result indicates that we have outstanding tasks to do, - * go ahead and run them in this thread. - */ - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - log("\trunning delegated task..."); - runnable.run(); - } - HandshakeStatus hsStatus = engine.getHandshakeStatus(); - if (hsStatus == HandshakeStatus.NEED_TASK) { - throw new Exception( - "handshake shouldn't need additional tasks"); - } - log("\tnew HandshakeStatus: " + hsStatus); - } - } - - private static boolean isEngineClosed(SSLEngine engine) { - return (engine.isOutboundDone() && engine.isInboundDone()); - } - - private static void logSocketStatus(Socket socket) { - log("##### " + socket + " #####"); - log("isBound: " + socket.isBound()); - log("isConnected: " + socket.isConnected()); - log("isClosed: " + socket.isClosed()); - log("isInputShutdown: " + socket.isInputShutdown()); - log("isOutputShutdown: " + socket.isOutputShutdown()); - } - - /* - * Logging code - */ - private static boolean resultOnce = true; - - private static void log(String str, SSLEngineResult result) { - if (!logging) { - return; - } - if (resultOnce) { - resultOnce = false; - log("The format of the SSLEngineResult is: \n" - + "\t\"getStatus() / getHandshakeStatus()\" +\n" - + "\t\"bytesConsumed() / bytesProduced()\"\n"); - } - HandshakeStatus hsStatus = result.getHandshakeStatus(); - log(str - + result.getStatus() + "/" + hsStatus + ", " - + result.bytesConsumed() + "/" + result.bytesProduced() - + " bytes"); - if (hsStatus == HandshakeStatus.FINISHED) { - log("\t...ready for application data"); - } - } - - private static void log(String str) { - if (logging) { - if (debug) { - System.err.println(str); - } else { - System.out.println(str); - } - } - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java --- openjdk-17-17.0.9+9/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -34,27 +34,17 @@ * @run main/othervm SSLSocketTemplate */ -import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; -import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLServerSocketFactory; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManagerFactory; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.SocketTimeoutException; -import java.security.KeyStore; -import java.security.PrivateKey; -import java.security.KeyFactory; -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.security.spec.PKCS8EncodedKeySpec; -import java.util.Base64; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -66,7 +56,7 @@ * test/jdk/sun/security/ssl/ServerHandshaker/AnonCipherWithWantClientAuth.java * test/jdk/sun/net/www/protocol/https/HttpsClient/ServerIdentityTest.java */ -public class SSLSocketTemplate { +public class SSLSocketTemplate extends SSLContextTemplate { /* * ================== @@ -129,53 +119,6 @@ } /* - * Create an instance of SSLContext for client use. - */ - protected SSLContext createClientSSLContext() throws Exception { - return createSSLContext(TRUSTED_CERTS, END_ENTITY_CERTS, - getClientContextParameters()); - } - - /* - * Create an instance of SSLContext for server use. - */ - protected SSLContext createServerSSLContext() throws Exception { - return createSSLContext(TRUSTED_CERTS, END_ENTITY_CERTS, - getServerContextParameters()); - } - - /* - * The parameters used to configure SSLContext. - */ - protected static final class ContextParameters { - final String contextProtocol; - final String tmAlgorithm; - final String kmAlgorithm; - - ContextParameters(String contextProtocol, - String tmAlgorithm, String kmAlgorithm) { - - this.contextProtocol = contextProtocol; - this.tmAlgorithm = tmAlgorithm; - this.kmAlgorithm = kmAlgorithm; - } - } - - /* - * Get the client side parameters of SSLContext. - */ - protected ContextParameters getClientContextParameters() { - return new ContextParameters("TLS", "PKIX", "NewSunX509"); - } - - /* - * Get the server side parameters of SSLContext. - */ - protected ContextParameters getServerContextParameters() { - return new ContextParameters("TLS", "PKIX", "NewSunX509"); - } - - /* * Does the client side use customized connection other than * explicit Socket.connect(), for example, URL.openConnection()? */ @@ -361,114 +304,6 @@ } /* - * ============================================= - * Stuffs to customize the SSLContext instances. - */ - - /* - * ======================================= - * Certificates and keys used in the test. - */ - // Trusted certificates. - protected final static Cert[] TRUSTED_CERTS = { - Cert.CA_ECDSA_SECP256R1, - Cert.CA_RSA_2048, - Cert.CA_DSA_2048 }; - - // End entity certificate. - protected final static Cert[] END_ENTITY_CERTS = { - Cert.EE_ECDSA_SECP256R1, - Cert.EE_RSA_2048, - Cert.EE_EC_RSA_SECP256R1, - Cert.EE_DSA_2048 }; - - /* - * Create an instance of SSLContext with the specified trust/key materials. - */ - public static SSLContext createSSLContext( - Cert[] trustedCerts, - Cert[] endEntityCerts, - ContextParameters params) throws Exception { - - KeyStore ts = null; // trust store - KeyStore ks = null; // key store - char passphrase[] = "passphrase".toCharArray(); - - // Generate certificate from cert string. - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - - // Import the trused certs. - ByteArrayInputStream is; - if (trustedCerts != null && trustedCerts.length != 0) { - ts = KeyStore.getInstance("JKS"); - ts.load(null, null); - - Certificate[] trustedCert = new Certificate[trustedCerts.length]; - for (int i = 0; i < trustedCerts.length; i++) { - is = new ByteArrayInputStream(trustedCerts[i].certStr.getBytes()); - try { - trustedCert[i] = cf.generateCertificate(is); - } finally { - is.close(); - } - - ts.setCertificateEntry( - "trusted-cert-" + trustedCerts[i].name(), trustedCert[i]); - } - } - - // Import the key materials. - if (endEntityCerts != null && endEntityCerts.length != 0) { - ks = KeyStore.getInstance("JKS"); - ks.load(null, null); - - for (int i = 0; i < endEntityCerts.length; i++) { - // generate the private key. - PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( - Base64.getMimeDecoder().decode(endEntityCerts[i].privKeyStr)); - KeyFactory kf = - KeyFactory.getInstance( - endEntityCerts[i].keyAlgo); - PrivateKey priKey = kf.generatePrivate(priKeySpec); - - // generate certificate chain - is = new ByteArrayInputStream( - endEntityCerts[i].certStr.getBytes()); - Certificate keyCert = null; - try { - keyCert = cf.generateCertificate(is); - } finally { - is.close(); - } - - Certificate[] chain = new Certificate[] { keyCert }; - - // import the key entry. - ks.setKeyEntry("cert-" + endEntityCerts[i].name(), - priKey, passphrase, chain); - } - } - - // Create an SSLContext object. - TrustManagerFactory tmf = - TrustManagerFactory.getInstance(params.tmAlgorithm); - tmf.init(ts); - - SSLContext context = SSLContext.getInstance(params.contextProtocol); - if (endEntityCerts != null && endEntityCerts.length != 0 && ks != null) { - KeyManagerFactory kmf = - KeyManagerFactory.getInstance(params.kmAlgorithm); - kmf.init(ks, passphrase); - - context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - } else { - context.init(null, tmf.getTrustManagers(), null); - } - - return context; - } - - /* * ================================================= * Stuffs to boot up the client-server mode testing. */ @@ -597,7 +432,7 @@ } } - private void startClient(boolean newThread) throws Exception { + private void startClient(boolean newThread) { if (newThread) { clientThread = new Thread() { @Override @@ -629,573 +464,4 @@ cause.printStackTrace(System.out); } - public static enum Cert { - - CA_ECDSA_SECP256R1( - "EC", - // SHA256withECDSA, curve secp256r1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Subject Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + - "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + - "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + - "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + - "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + - "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + - "2YEHlSQUAbwwqCDEVB5KxaqP\n" + - "-----END CERTIFICATE-----", - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd\n" + - "XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd\n" + - "LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp"), - - CA_ECDSA_SECP384R1( - "EC", - // SHA384withECDSA, curve secp384r1 - // Validity - // Not Before: Jun 24 08:15:06 2019 GMT - // Not After : Jun 19 08:15:06 2039 GMT - // Subject Key Identifier: - // 0a:93:a9:a0:bf:e7:d5:48:9d:4f:89:15:c6:51:98:80:05:51:4e:4e - "-----BEGIN CERTIFICATE-----\n" + - "MIICCDCCAY6gAwIBAgIUCpOpoL/n1UidT4kVxlGYgAVRTk4wCgYIKoZIzj0EAwMw\n" + - "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowOzEL\n" + - "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + - "dCBTZXJpdmNlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAENVQN1wXWFdgC6u/dDdiC\n" + - "y+WtMTF66oL/0BSm+1ZqsogamzCryawOcHgiuXgWzx5CQ3LuOC+tDFyXpGfHuCvb\n" + - "dkzxPrP5n9NrR8/uRPe5l1KOUbchviU8z9cTP+LZxnZDo1MwUTAdBgNVHQ4EFgQU\n" + - "SktSFArR1p/5mXV0kyo0RxIVa/UwHwYDVR0jBBgwFoAUSktSFArR1p/5mXV0kyo0\n" + - "RxIVa/UwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjBZvoNmq3/v\n" + - "RD2gBTyvxjS9h0rsMRLHDnvul/KWngytwGPTOBo0Y8ixQXSjdKoc3rkCMQDkiNgx\n" + - "IDxuHedmrLQKIPnVcthTmwv7//jHiqGoKofwChMo2a1P+DQdhszmeHD/ARQ=\n" + - "-----END CERTIFICATE-----", - "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDChlbt0NF8oIKODSxn2\n" + - "WXCXuJm3z78LRkzYQS3Nx5NMjei5ytkFZz4qvD4XXMWlTEyhZANiAAQ1VA3XBdYV\n" + - "2ALq790N2ILL5a0xMXrqgv/QFKb7VmqyiBqbMKvJrA5weCK5eBbPHkJDcu44L60M\n" + - "XJekZ8e4K9t2TPE+s/mf02tHz+5E97mXUo5RtyG+JTzP1xM/4tnGdkM="), - - CA_ECDSA_SECP521R1( - "EC", - // SHA512withECDSA, curve secp521r1 - // Validity - // Not Before: Jun 24 08:15:06 2019 GMT - // Not After : Jun 19 08:15:06 2039 GMT - // Subject Key Identifier: - // 25:ca:68:76:6d:29:17:9b:71:78:45:2d:d4:c6:e4:5d:fe:25:ff:90 - "-----BEGIN CERTIFICATE-----\n" + - "MIICUzCCAbSgAwIBAgIUJcpodm0pF5txeEUt1MbkXf4l/5AwCgYIKoZIzj0EAwQw\n" + - "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowOzEL\n" + - "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + - "dCBTZXJpdmNlMIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAmFD5VmB2MdyJ6k+E\n" + - "eP4JncrE65ySL07gVmFwnr8otOt3NtRAyzmviMNNXXjo5R5NqNjKP4pr92JjT0sO\n" + - "D65yngkBtH151Ev/fiKPLxkXL9GzfKdWHVhDX7Zg6DUydzukzZV2/dIyloAIqwlz\n" + - "QVKJqT7RypDufdng8hnE9YfKo6ypZiujUzBRMB0GA1UdDgQWBBRAIrxa7WqtqUCe\n" + - "HFuKREDC92spvTAfBgNVHSMEGDAWgBRAIrxa7WqtqUCeHFuKREDC92spvTAPBgNV\n" + - "HRMBAf8EBTADAQH/MAoGCCqGSM49BAMEA4GMADCBiAJCAe22iirZnODCmlpxcv57\n" + - "3g5BEE60C+dtYmTqR4DtFyDaTRQ5CFf4ZxvQPIbD+SXi5Cbrl6qtrZG0cjUihPkC\n" + - "Hi1hAkIAiEcO7nMPgQLny+GrciojfN+bZXME/dPz6KHBm/89f8Me+jawVnv6y+df\n" + - "2Sbafh1KV6ntWQtB4bK3MXV8Ym9Eg1I=\n" + - "-----END CERTIFICATE-----", - "MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIAV8dZszV6+nLw3LeA\n" + - "Q+qLJLGaqyjlsQkaopCPcmoRdy1HX6AzB/YnKsPkHp/9DQN6A2JgUhFG5B0XvKSk\n" + - "BqNNuSGhgYkDgYYABACYUPlWYHYx3InqT4R4/gmdysTrnJIvTuBWYXCevyi063c2\n" + - "1EDLOa+Iw01deOjlHk2o2Mo/imv3YmNPSw4PrnKeCQG0fXnUS/9+Io8vGRcv0bN8\n" + - "p1YdWENftmDoNTJ3O6TNlXb90jKWgAirCXNBUompPtHKkO592eDyGcT1h8qjrKlm\n" + - "Kw=="), - - CA_RSA_2048( - "RSA", - // SHA256withRSA, 2048 bits - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Subject Key Identifier: - // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C - "-----BEGIN CERTIFICATE-----\n" + - "MIIDSTCCAjGgAwIBAgIJAI4ZF3iy8zG+MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALpMcY7aWieXDEM1/YJf\n" + - "JW27b4nRIFZyEYhEloyGsKTuQiiQjc8cqRZFNXe2vwziDB4IyTEl0Hjl5QF6ZaQE\n" + - "huPzzwvQm1pv64KrRXrmj3FisQK8B5OWLty9xp6xDqsaMRoyObLK+oIb20T5fSlE\n" + - "evmo1vYjnh8CX0Yzx5Gr5ye6YSEHQvYOWEws8ad17OlyToR2KMeC8w4qo6rs59pW\n" + - "g7Mxn9vo22ImDzrtAbTbXbCias3xlE0Bp0h5luyf+5U4UgksoL9B9r2oP4GrLNEV\n" + - "oJk57t8lwaR0upiv3CnS8LcJELpegZub5ggqLY8ZPYFQPjlK6IzLOm6rXPgZiZ3m\n" + - "RL0CAwEAAaNQME4wHQYDVR0OBBYEFA3dk8n+S701t+iZeJD721o92xVMMB8GA1Ud\n" + - "IwQYMBaAFA3dk8n+S701t+iZeJD721o92xVMMAwGA1UdEwQFMAMBAf8wDQYJKoZI\n" + - "hvcNAQELBQADggEBAJTRC3rKUUhVH07/1+stUungSYgpM08dY4utJq0BDk36BbmO\n" + - "0AnLDMbkwFdHEoqF6hQIfpm7SQTmXk0Fss6Eejm8ynYr6+EXiRAsaXOGOBCzF918\n" + - "/RuKOzqABfgSU4UBKECLM5bMfQTL60qx+HdbdVIpnikHZOFfmjCDVxoHsGyXc1LW\n" + - "Jhkht8IGOgc4PMGvyzTtRFjz01kvrVQZ75aN2E0GQv6dCxaEY0i3ypSzjUWAKqDh\n" + - "3e2OLwUSvumcdaxyCdZAOUsN6pDBQ+8VRG7KxnlRlY1SMEk46QgQYLbPDe/+W/yH\n" + - "ca4PejicPeh+9xRAwoTpiE2gulfT7Lm+fVM7Ruc=\n" + - "-----END CERTIFICATE-----", - "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC6THGO2lonlwxD\n" + - "Nf2CXyVtu2+J0SBWchGIRJaMhrCk7kIokI3PHKkWRTV3tr8M4gweCMkxJdB45eUB\n" + - "emWkBIbj888L0Jtab+uCq0V65o9xYrECvAeTli7cvcaesQ6rGjEaMjmyyvqCG9tE\n" + - "+X0pRHr5qNb2I54fAl9GM8eRq+cnumEhB0L2DlhMLPGndezpck6EdijHgvMOKqOq\n" + - "7OfaVoOzMZ/b6NtiJg867QG0212womrN8ZRNAadIeZbsn/uVOFIJLKC/Qfa9qD+B\n" + - "qyzRFaCZOe7fJcGkdLqYr9wp0vC3CRC6XoGbm+YIKi2PGT2BUD45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mWpr6qimIuY6q6WBN8hJ2Xz/d1fwhYKzIp20zHuv5KDUlJjbFfqpsuy3u1C\n" + - "kts5zwI7pr1ObRbDGVyOdKcu7HI3QtR5qqyjwaUCgYABo7Wq6oHva/9V34+G3Goh\n" + - "63bYGUnRw2l5BD11yhQv8XzGGZFqZVincD8gltNThB0Dc/BI+qu3ky4YdgdZJZ7K\n" + - "z51GQGtaHEbrHS5caV79yQ8QGY5mUVH3E+VXSxuIqb6pZq2DH4sTAEFHyncddmOH\n" + - "zoXBInYwRG9KE/Bw5elhUw=="), - - CA_DSA_2048( - "DSA", - // SHA256withDSA, 2048 bits - // Validity - // Not Before: May 22 07:18:18 2018 GMT - // Not After : May 17 07:18:18 2038 GMT - // Subject Key Identifier: - // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 - "-----BEGIN CERTIFICATE-----\n" + - "MIIErjCCBFSgAwIBAgIJAOktYLNCbr02MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + - "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + - "Y2UwHhcNMTgwNTIyMDcxODE4WhcNMzgwNTE3MDcxODE4WjA7MQswCQYDVQQGEwJV\n" + - "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" + - "ggNHMIICOQYHKoZIzjgEATCCAiwCggEBAO5GyPhSm0ze3LSu+gicdULLj05iOfTL\n" + - "UvZQ29sYz41zmqrLBQbdKiHqgJu2Re9sgTb5suLNjF047TOLPnU3jhPtWm2X8Xzi\n" + - "VGIcHym/Q/MeZxStt/88seqroI3WOKzIML2GcrishT+lcGrtH36Tf1+ue2Snn3PS\n" + - "WyxygNqPjllP5uUjYmFLvAf4QLMldkd/D2VxcwsHjB8y5iUZsXezc/LEhRZS/02m\n" + - "ivqlRw3AMkq/OVe/ZtxFWsP0nsfxEGdZuaU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9Hy5ppkL0Qn\n" + - "dIlNc8JhXT/PHW7GDtViagIgMko8Qoj9gDGPK3+O9E8DC3wGiiF9CObM4LN387ok\n" + - "J+g=\n" + - "-----END CERTIFICATE-----", - "MIICZQIBADCCAjkGByqGSM44BAEwggIsAoIBAQDuRsj4UptM3ty0rvoInHVCy49O" + - "Yjn0y1L2UNvbGM+Nc5qqywUG3Soh6oCbtkXvbIE2+bLizYxdOO0ziz51N44T7Vpt" + - "l/F84lRiHB8pv0PzHmcUrbf/PLHqq6CN1jisyDC9hnK4rIU/pXBq7R9+k39frntk" + - "p59z0lsscoDaj45ZT+blI2JhS7wH+ECzJXZHfw9lcXMLB4wfMuYlGbF3s3PyxIUW" + - "Uv9Npor6pUcNwDJKvzlXv2bcRVrD9J7H8RBnWbmlBaaaRn4scRb8pqwd/iedXE7f" + - "qWQQ6g9stA2H3PvPIgrOI8B033AyKS2+d/BwYwY9qxILUBEkJgdKKA//sLD7AiEA" + - "tW2HIYBJTbQ2C9xYKS4DUlGKe4CFr/XoWguyzts+24kCggEAYrbxTpw5FI2vDQBe" + - "5Q6TlW+YqUPEonAS1t5EGpsYcrssYGcsvz6I2f6D6K5Klv0/wNK4ZxujLLBKQLXY" + - "sFQfnKwWBqN23MJhMSYXTienWLihaaT1oQsCjB7PZ6SvpagTJfJeY+fMZXBXgu2X" + - "xn/BmBpIRVtHOOLxEITDG2nOmU0z+JsPtbe8SX5gzJSxMiKU12gAJPLqFS1s0Fp0" + - "eNLB4sm70tLtycUJG+/8vLTjmbvKpc/2Dku5UOlMVBl9uwntRNPmoHz6YXraEQJU" + - "tXHs6lmu6+uBmtJ5I9ZMJHEao4E4icdDcJ1F6+/FQFxYVRfefjt5X6ob3bRBrZIQ" + - "xj4OzQQjAiEAsceWOM8do4etxp2zgnoNXV8PUUyqWhz1+0srcKV7FR4="), - - CA_DSA_1024( - "DSA", - // dsaWithSHA1, 1024 bits - // Validity - // Not Before: Apr 24 12:25:43 2020 GMT - // Not After : Apr 22 12:25:43 2030 GMT - // Authority Key Identifier: - // E1:3C:01:52:EB:D1:38:F7:CF:F1:E3:5E:DB:54:75:7F:5E:AB:2D:36 - "-----BEGIN CERTIFICATE-----\n" + - "MIIC9TCCArWgAwIBAgIUd52yKk0OxQuxdaYRAfq5VLuF1ZAwCQYHKoZIzjgEAzAu\n" + - "MQswCQYDVQQGEwJVUzENMAsGA1UECgwESmF2YTEQMA4GA1UECwwHU3VuSlNTRTAe\n" + - "Fw0yMDA0MjQxMjI1NDJaFw0zMDA0MjIxMjI1NDJaMC4xCzAJBgNVBAYTAlVTMQ0w\n" + - "CwYDVQQKDARKYXZhMRAwDgYDVQQLDAdTdW5KU1NFMIIBtjCCASsGByqGSM44BAEw\n" + - "ggEeAoGBAKgyb2XpANq43T8yBf5v0PTBOddLPxd0f0FotASron5rQr86JjBTfgIW\n" + - "oE4u7nYlO6bp/M4Dw6qZr+HaDu9taIDOj6LL51eUShVsOgS7XZcUzLT8vPnkEDDo\n" + - "u326x0B7fuNCbMLm+ipM2d4FhLUTt4Qb5TcY6l7dOGHeWiL7nl43AhUAoGr8DY2m\n" + - "WHZPHk2XbZ5wpaM2lLcCgYBKiFbFFViH/ylHJRPtYtjtJw4ls1scbVP4TRHnKoZc\n" + - "HPAird1fDYgGC2b0GQNAMABhI+L+ogxS7qakySpJCheuN25AjiSyilygQdlXoWRt\n" + - "Mggsh8EQZT7iP4V4e9m3xRHzb5ECvsSTdZB1BQMcC90W2Avq+orqgBnr2in9UEd8\n" + - "qwOBhAACgYAgVWxjYWlWIv7s4BnNMQoPKppi205f3aC6wv6Rqk4BnYYYrFONEmzQ\n" + - "hzj6lSXfxLpTu4lg2zNeIraZggoS0ztkbZNNADEmAHx+OLshiJJxu2/KfoopJOZg\n" + - "8ARmuaKOkWbkW9y4hWhfBlVwZbckG3Eibff0xronIXXy7B7UKaccyqNTMFEwHQYD\n" + - "VR0OBBYEFOE8AVLr0Tj3z/HjXttUdX9eqy02MB8GA1UdIwQYMBaAFOE8AVLr0Tj3\n" + - "z/HjXttUdX9eqy02MA8GA1UdEwEB/wQFMAMBAf8wCQYHKoZIzjgEAwMvADAsAhRC\n" + - "YLduLniBEJ51SfBWIkvNW6OG7QIUSKaTY6rgEFDEMoTqOjFChR22nkk=\n" + - "-----END CERTIFICATE-----", - "MIIBSgIBADCCASsGByqGSM44BAEwggEeAoGBAKgyb2XpANq43T8yBf5v0PTBOddL\n" + - "Pxd0f0FotASron5rQr86JjBTfgIWoE4u7nYlO6bp/M4Dw6qZr+HaDu9taIDOj6LL\n" + - "51eUShVsOgS7XZcUzLT8vPnkEDDou326x0B7fuNCbMLm+ipM2d4FhLUTt4Qb5TcY\n" + - "6l7dOGHeWiL7nl43AhUAoGr8DY2mWHZPHk2XbZ5wpaM2lLcCgYBKiFbFFViH/ylH\n" + - "JRPtYtjtJw4ls1scbVP4TRHnKoZcHPAird1fDYgGC2b0GQNAMABhI+L+ogxS7qak\n" + - "ySpJCheuN25AjiSyilygQdlXoWRtMggsh8EQZT7iP4V4e9m3xRHzb5ECvsSTdZB1\n" + - "BQMcC90W2Avq+orqgBnr2in9UEd8qwQWAhQ7rSn+WvIxeuZ/CK4p04eMe5JzpA=="), - - CA_ED25519( - "EdDSA", - // ED25519 - // Validity - // Not Before: May 24 23:32:35 2020 GMT - // Not After : May 22 23:32:35 2030 GMT - // X509v3 Authority Key Identifier: - // keyid:06:76:DB:88:EB:61:55:4C:C9:63:41:C2:A0:A8:57:3F:D7:F1:B8:EC - "-----BEGIN CERTIFICATE-----\n" + - "MIIByTCCAXugAwIBAgIUCyxKvhErehsygx50JYArsHby9hAwBQYDK2VwMDsxCzAJ\n" + - "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + - "U2VyaXZjZTAeFw0yMDA1MjQyMzMyMzVaFw0zMDA1MjIyMzMyMzVaMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAqMAUGAytlcAMhAKdotuYIkH8PYbopSLbaf1BtqUY2d6AbTgK2prMzQ6B3\n" + - "o4GQMIGNMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFAZ224jrYVVMyWNBwqCo\n" + - "Vz/X8bjsMB8GA1UdIwQYMBaAFAZ224jrYVVMyWNBwqCoVz/X8bjsMA4GA1UdDwEB\n" + - "/wQEAwIBhjAqBgNVHSUBAf8EIDAeBggrBgEFBQcDAwYIKwYBBQUHAwgGCCsGAQUF\n" + - "BwMJMAUGAytlcANBADVAArvME8xFigFhCCCOTBoy/4ldGkDZQ/GT3Q6xnAP558FU\n" + - "0G32OprKQZP43D9bmFU0LMgCVM9bHWU+bu/10AU=\n" + - "-----END CERTIFICATE-----", - "MC4CAQAwBQYDK2VwBCIEII/VYp8nu/eqq2L5y7/3IzavBgis4LWP6Rikv0N8SpgL"), - - CA_ED448( - "EdDSA", - // ED448 - // Validity - // Not Before: May 24 23:23:43 2020 GMT - // Not After : May 22 23:23:43 2030 GMT - // X509v3 Authority Key Identifier: - // keyid:F5:D5:9D:FB:6F:B7:50:29:DF:F0:B8:83:10:5F:9B:C4:A8:1C:E9:F4 - "-----BEGIN CERTIFICATE-----\n" + - "MIICFDCCAZSgAwIBAgIUKcmLeKilq0LN40sniBJO7F1gb/owBQYDK2VxMDsxCzAJ\n" + - "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + - "U2VyaXZjZTAeFw0yMDA1MjQyMzIzNDNaFw0zMDA1MjIyMzIzNDNaMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTBDMAUGAytlcQM6APYP8iSXS8xPVDike5RgCByfTtg4GGtpYfoBtt6G5szA\n" + - "55ExAKjm03wtk29nEPU2mCHF2QgfBzUrgKOBkDCBjTAPBgNVHRMBAf8EBTADAQH/\n" + - "MB0GA1UdDgQWBBT11Z37b7dQKd/wuIMQX5vEqBzp9DAfBgNVHSMEGDAWgBT11Z37\n" + - "b7dQKd/wuIMQX5vEqBzp9DAOBgNVHQ8BAf8EBAMCAYYwKgYDVR0lAQH/BCAwHgYI\n" + - "KwYBBQUHAwMGCCsGAQUFBwMIBggrBgEFBQcDCTAFBgMrZXEDcwAlRXA2gPb52yV3\n" + - "MKJErjmKlYSFExj5w5jafbbd0QgI1yDs+qSaZLjQ8ljwabmLDg+KR+167m0djQDI\n" + - "OOoVuL7bgM0RL836KnuuBzm+gTdPp0gCXy3k9lL0KA0V2YLJHXXzu3suu+7rdgoP\n" + - "plCh2hWdLgA=\n" + - "-----END CERTIFICATE-----", - "MEcCAQAwBQYDK2VxBDsEOd6/hRZqkUyTlJSwdN5gO/HnoWYda1fD83YUm5j6m2Bg\n" + - "hAQi+QadFsQLD7R6PI/4Q0twXqlKnxU5Ug=="), - - EE_ECDSA_SECP256R1( - "EC", - // SHA256withECDSA, curve secp256r1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Authority Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + - "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + - "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + - "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + - "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + - "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + - "-----END CERTIFICATE-----", - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + - "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + - "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6"), - - EE_ECDSA_SECP384R1( - "EC", - // SHA384withECDSA, curve secp384r1 - // Validity - // Not Before: Jun 24 08:15:06 2019 GMT - // Not After : Jun 19 08:15:06 2039 GMT - // Authority Key Identifier: - // 40:2D:AA:EE:66:AA:33:27:AD:9B:5D:52:9B:60:67:6A:2B:AD:52:D2 - "-----BEGIN CERTIFICATE-----\n" + - "MIICEjCCAZegAwIBAgIUS3F0AqAXWRg07CnbknJzxofyBQMwCgYIKoZIzj0EAwMw\n" + - "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowVTEL\n" + - "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + - "dCBTZXJpdmNlMRgwFgYDVQQDDA9SZWdyZXNzaW9uIFRlc3QwdjAQBgcqhkjOPQIB\n" + - "BgUrgQQAIgNiAARqElz8b6T07eyKomIinhztV3/3XBk9bKGtJ0W+JOltjuhMmP/w\n" + - "G8ASSevpgqgpi6EzpBZaaJxE3zNfkNnxXOZmQi2Ypd1uK0zRdbEOKg0XOcTTZwEj\n" + - "iLjYmt3O0pwpklijQjBAMB0GA1UdDgQWBBRALaruZqozJ62bXVKbYGdqK61S0jAf\n" + - "BgNVHSMEGDAWgBRKS1IUCtHWn/mZdXSTKjRHEhVr9TAKBggqhkjOPQQDAwNpADBm\n" + - "AjEArVDFKf48xijN6huVUJzKCOP0zlWB5Js+DItIkZmLQuhciPLhLIB/rChf3Y4C\n" + - "xuP4AjEAmfLhQRI0O3pifpYzYSVh2G7/jHNG4eO+2dvgAcU+Lh2IIj/cpLaPFSvL\n" + - "J8FXY9Nj\n" + - "-----END CERTIFICATE-----", - "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDASuI9EtK29APXPipkc\n" + - "qDA+qwlewMjv/OcjUJ77kP1Vz62oVF9iY9SRIyFIUju8wt+hZANiAARqElz8b6T0\n" + - "7eyKomIinhztV3/3XBk9bKGtJ0W+JOltjuhMmP/wG8ASSevpgqgpi6EzpBZaaJxE\n" + - "3zNfkNnxXOZmQi2Ypd1uK0zRdbEOKg0XOcTTZwEjiLjYmt3O0pwpklg="), - - EE_ECDSA_SECP521R1( - "EC", - // SHA512withECDSA, curve secp521r1 - // Validity - // Not Before: Jun 24 08:15:06 2019 GMT - // Not After : Jun 19 08:15:06 2039 GMT - // Authority Key Identifier: - // 7B:AA:79:A4:49:DD:59:34:F0:86:6C:51:C7:30:F4:CE:C5:81:8A:28 - "-----BEGIN CERTIFICATE-----\n" + - "MIICXDCCAb2gAwIBAgIUck4QTsbHNqUfPxfGPJLYbedFPdswCgYIKoZIzj0EAwQw\n" + - "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowVTEL\n" + - "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + - "dCBTZXJpdmNlMRgwFgYDVQQDDA9SZWdyZXNzaW9uIFRlc3QwgZswEAYHKoZIzj0C\n" + - "AQYFK4EEACMDgYYABAGa2zDLhYQHHCLI3YBqFYJTzrnDIjzwXrxhcRTS8DYkcrjZ\n" + - "+Fih1YyNhix0sdjH+3EqElXAHHuVzn3n3hPOtQCWlQCICkErB34S0cvmtRkeW8Fi\n" + - "hrR5tvJEzEZjPSgwn81kKyhV2L70je6i7Cw884Va8bODckpgw0vTmbQb7T9dupkv\n" + - "1aNCMEAwHQYDVR0OBBYEFHuqeaRJ3Vk08IZsUccw9M7FgYooMB8GA1UdIwQYMBaA\n" + - "FEAivFrtaq2pQJ4cW4pEQML3aym9MAoGCCqGSM49BAMEA4GMADCBiAJCAb33KHdY\n" + - "WDbusORWoY8Euglpd5zsF15hJsk7wtpD5HST1/NWmdCx405w+TV6a9Gr4VPHeaIQ\n" + - "99i/+f237ALL5p6IAkIBbwwFL1vt3c/bx+niyuffQPNjly80rdC9puqAqriSiboS\n" + - "efhxjidJ9HLaIRCMEPyd6vAsC8mO8YvL1uCuEQLsiGM=\n" + - "-----END CERTIFICATE-----", - "MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIB8C/2OX2Dt9vFszzV\n" + - "hcAe0CbkMlvu9uQ/L7Vz88heuIj0rUZIPGshvgIJt1hCMT8HZxYHvDa4lbUvqjFB\n" + - "+zafvPWhgYkDgYYABAGa2zDLhYQHHCLI3YBqFYJTzrnDIjzwXrxhcRTS8DYkcrjZ\n" + - "+Fih1YyNhix0sdjH+3EqElXAHHuVzn3n3hPOtQCWlQCICkErB34S0cvmtRkeW8Fi\n" + - "hrR5tvJEzEZjPSgwn81kKyhV2L70je6i7Cw884Va8bODckpgw0vTmbQb7T9dupkv\n" + - "1Q=="), - - EE_RSA_2048( - "RSA", - // SHA256withRSA, 2048 bits - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Authority Key Identifier: - // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C - "-----BEGIN CERTIFICATE-----\n" + - "MIIDNjCCAh6gAwIBAgIJAO2+yPcFryUTMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC\n" + - "AQ8AMIIBCgKCAQEAszfBobWfZIp8AgC6PiWDDavP65mSvgCXUGxACbxVNAfkLhNR\n" + - "QOsHriRB3X1Q3nvO9PetC6wKlvE9jlnDDj7D+1j1r1CHO7ms1fq8rfcQYdkanDtu\n" + - "4AlHo8v+SSWX16MIXFRYDj2VVHmyPtgbltcg4zGAuwT746FdLI94uXjJjq1IOr/v\n" + - "0VIlwE5ORWH5Xc+5Tj+oFWK0E4a4GHDgtKKhn2m72hN56/GkPKGkguP5NRS1qYYV\n" + - "/EFkdyQMOV8J1M7HaicSft4OL6eKjTrgo93+kHk+tv0Dc6cpVBnalX3TorG8QI6B\n" + - "cHj1XQd78oAlAC+/jF4pc0mwi0un49kdK9gRfQIDAQABoyMwITAfBgNVHSMEGDAW\n" + - "gBQN3ZPJ/ku9NbfomXiQ+9taPdsVTDANBgkqhkiG9w0BAQsFAAOCAQEApXS0nKwm\n" + - "Kp8gpmO2yG1rpd1+2wBABiMU4JZaTqmma24DQ3RzyS+V2TeRb29dl5oTUEm98uc0\n" + - "GPZvhK8z5RFr4YE17dc04nI/VaNDCw4y1NALXGs+AHkjoPjLyGbWpi1S+gfq2sNB\n" + - "Ekkjp6COb/cb9yiFXOGVls7UOIjnVZVd0r7KaPFjZhYh82/f4PA/A1SnIKd1+nfH\n" + - "2yk7mSJNC7Z3qIVDL8MM/jBVwiC3uNe5GPB2uwhd7k5LGAVN3j4HQQGB0Sz+VC1h\n" + - "92oi6xDa+YBva2fvHuCd8P50DDjxmp9CemC7rnZ5j8egj88w14X44Xjb/Fd/ApG9\n" + - "e57NnbT7KM+Grw==\n" + - "-----END CERTIFICATE-----", - "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzN8GhtZ9kinwC\n" + - "ALo+JYMNq8/rmZK+AJdQbEAJvFU0B+QuE1FA6weuJEHdfVDee870960LrAqW8T2O\n" + - "WcMOPsP7WPWvUIc7uazV+ryt9xBh2RqcO27gCUejy/5JJZfXowhcVFgOPZVUebI+\n" + - "2BuW1yDjMYC7BPvjoV0sj3i5eMmOrUg6v+/RUiXATk5FYfldz7lOP6gVYrQThrgY\n" + - "cOC0oqGfabvaE3nr8aQ8oaSC4/k1FLWphhX8QWR3JAw5XwnUzsdqJxJ+3g4vp4qN\n" + - "OuCj3f6QeT62/QNzpylUGdqVfdOisbxAjoFwePVdB3vygCUAL7+MXilzSbCLS6fj\n" + - "2R0r2BF9AgMBAAECggEASIkPkMCuw4WdTT44IwERus3IOIYOs2IP3BgEDyyvm4B6\n" + - "JP/iihDWKfA4zEl1Gqcni1RXMHswSglXra682J4kui02Ov+vzEeJIY37Ibn2YnP5\n" + - "ZjRT2s9GtI/S2o4hl8A/mQb2IMViFC+xKehTukhV4j5d6NPKk0XzLR7gcMjnYxwn\n" + - "l21fS6D2oM1xRG/di7sL+uLF8EXLRzfiWDNi12uQv4nwtxPKvuKhH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AL3go42DYeYhu/WnECMeis="), - - EE_EC_RSA_SECP256R1( - "EC", - // SHA256withRSA, curve secp256r1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 21 07:18:16 2028 GMT - // Authority Key Identifier: - // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C - "-----BEGIN CERTIFICATE-----\n" + - "MIICazCCAVOgAwIBAgIJAO2+yPcFryUUMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0yODA1MjEwNzE4MTZaMFUxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" + - "AQcDQgAE59MERNTlVZ1eeps8Z3Oue5ZkgQdPtD+WIE6tj3PbIKpxGPDxvfNP959A\n" + - "yQjEK/ehWQVrCMmNoEkIzY+IIBgB06MjMCEwHwYDVR0jBBgwFoAUDd2Tyf5LvTW3\n" + - "6Jl4kPvbWj3bFUwwDQYJKoZIhvcNAQELBQADggEBAFOTVEqs70ykhZiIdrEsF1Ra\n" + - "I3B2rLvwXZk52uSltk2/bzVvewA577ZCoxQ1pL7ynkisPfBN1uVYtHjM1VA3RC+4\n" + - "+TAK78dnI7otYjWoHp5rvs4l6c/IbOspS290IlNuDUxMErEm5wxIwj+Aukx/1y68\n" + - "hOyCvHBLMY2c1LskH1MMBbDuS1aI+lnGpToi+MoYObxGcV458vxuT8+wwV8Fkpvd\n" + - "ll8IIFmeNPRv+1E+lXbES6CSNCVaZ/lFhPgdgYKleN7sfspiz50DG4dqafuEAaX5\n" + - "xaK1NWXJxTRz0ROH/IUziyuDW6jphrlgit4+3NCzp6vP9hAJQ8Vhcj0n15BKHIQ=\n" + - "-----END CERTIFICATE-----", - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGVc7hICpmp91jbYe\n" + - "nrr8nYHD37RZP3VENY+szuA7WjuhRANCAATn0wRE1OVVnV56mzxnc657lmSBB0+0\n" + - "P5YgTq2Pc9sgqnEY8PG980/3n0DJCMQr96FZBWsIyY2gSQjNj4ggGAHT"), - - EE_DSA_2048( - "DSA", - // SHA256withDSA, 2048 bits - // Validity - // Not Before: May 22 07:18:20 2018 GMT - // Not After : May 17 07:18:20 2038 GMT - // Authority Key Identifier: - // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 - "-----BEGIN CERTIFICATE-----\n" + - "MIIEnDCCBEGgAwIBAgIJAP/jh1qVhNVjMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + - "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + - "Y2UwHhcNMTgwNTIyMDcxODIwWhcNMzgwNTE3MDcxODIwWjBVMQswCQYDVQQGEwJV\n" + - "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Ux\n" + - "GDAWBgNVBAMMD1JlZ3Jlc3Npb24gVGVzdDCCA0cwggI6BgcqhkjOOAQBMIICLQKC\n" + - "AQEAmlavgoJrMcjqWRVcDE2dmWAPREgnzQvneEDef68cprDzjSwvOs5QeFyx75ib\n" + - "ado1e6jO/rW1prCGWHDD1oA/Tn4Pk3vu0nUxzvl1qATc+aJbpUU5Op0bvp6LbCsQ\n" + - "QslV9FeRh7Eb7bP6gpc/kHCBzEgC1VCK7prccXWy+t6SMOHbND3h+UbckfSaUuaV\n" + - "sVJNTD1D6GElfRj4Nmz1BGPfSYvKorwNZEU3gXwFgtDoAcGx7tc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swJgIg\n" + - "JEZ8DhYxQy1O7mmZ2UIT7op6epWMB4dENjs0qWPmcKo=\n" + - "-----END CERTIFICATE-----", - "MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQCaVq+CgmsxyOpZFVwMTZ2ZYA9E\n" + - "SCfNC+d4QN5/rxymsPONLC86zlB4XLHvmJtp2jV7qM7+tbWmsIZYcMPWgD9Ofg+T\n" + - "e+7SdTHO+XWoBNz5olulRTk6nRu+notsKxBCyVX0V5GHsRvts/qClz+QcIHMSALV\n" + - "UIrumtxxdbL63pIw4ds0PeH5RtyR9JpS5pWxUk1MPUPoYSV9GPg2bPUEY99Ji8qi\n" + - "vA1kRTeBfAWC0OgBwbHu1zIKUukMd+pF/D/vKKovJ6I/sPiGXmUw2i4lYOUB0wWn\n" + - "QUyBLez1UMWKchyvpW0FYxMbv7j5zMcAH7d++vCWo3OEGfe4Uet6Q3/Dx83HAiEA\n" + - "mjtJp7XNrsgxbRDqETkHhv6zYH8Voo+gDgSO1m7XcH0CggEBAI5moswp++plZSBP\n" + - "Q9DdCNHt0AV13Toj1jf5M5DNmTX6P6/D/oRfi8Ui1fiCKFv+7lD0J2anCFUaLtu+\n" + - "j7v78gp5OChDp/n49K6DtKtZZRDmw/Bpm6LNdknmdN5kO5wVzbIXHTCCeNs/CJTF\n" + - "mSU5PvEaI4y3M5NraSgLPkq4gEv7/A8orGbKmj1Whj3F9t1Tosxdm/+WkPldMz2t\n" + - "gev+9RM2S6S9XoembRgwRaFVkpQmKoKpOoZcdqV47FLDq5BYH/5POeJ9wLuAHjxQ\n" + - "5CMKo4p/lW7BCd4kuGWFT+OFFXfG2v6EtlqFbXBiFWLxyMsOtkUqWARCqEHhyucl\n" + - "TSYlj60EIgIgLfA75+8KcKxdN8mr6gzGjQe7jPFGG42Ejhd7Q2F4wuw="), - - EE_DSA_1024( - "DSA", - // dsaWithSHA1, 1024 bits - // Validity - // Not Before: Apr 24 12:25:43 2020 GMT - // Not After : Apr 22 12:25:43 2030 GMT - // Authority Key Identifier: - // E1:3C:01:52:EB:D1:38:F7:CF:F1:E3:5E:DB:54:75:7F:5E:AB:2D:36 - "-----BEGIN CERTIFICATE-----\n" + - "MIIDADCCAr+gAwIBAgIUd2XJ5F2VTbk9a92w/NzLXR5zjUQwCQYHKoZIzjgEAzAu\n" + - "MQswCQYDVQQGEwJVUzENMAsGA1UECgwESmF2YTEQMA4GA1UECwwHU3VuSlNTRTAe\n" + - "Fw0yMDA0MjQxMjI1NDNaFw0zMDA0MjIxMjI1NDNaMEgxCzAJBgNVBAYTAlVTMQ0w\n" + - "CwYDVQQKDARKYXZhMRAwDgYDVQQLDAdTdW5KU1NFMRgwFgYDVQQDDA9SZWdyZXNz\n" + - "aW9uIFRlc3QwggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA7fSkxYISlMJT+i8N5VOb\n" + - "lHhjrPYAy3oR2/YXQW6T0hCMhm8jmxgk1bDId9ZKHrxsM05EkCtRYaqag4ZZeGde\n" + - "ywv3IwwYqCQfGtkPwT9QAsdSABYwGOrlhEtZtBG1yQ44c+Rz/Vs+PtkAyZbf5VG1\n" + - "iSxFb9bI5QFJWJ9a2VpZh58CFQCCGALQoK4MsQP8V72WlB7Bvt9erwKBgQDCxu0G\n" + - "M2iZr0J8DaAo9/ChS4m7E7h6Jz9KOm2cFhzYGekkUXNzny7nyz6Qpgbuf8KNFKjt\n" + - "qoUDC8tlcVQAUlTcESC0TZXR3h21hl9wzIBhE+kJ1j8v1KAxfOaJOxObk5QEvIaA\n" + - "5j+jiHGwRS5tDqywOatz+emwMZv1wKnCNBElNgOBhAACgYBHjuQKucCuuvy/4DpG\n" + - "rSIzdueK+HrzOW8h2pfvz3lzpsyV6XJPC6we9CjaQjU01VcjwN2PoYtbGyml0pbK\n" + - "We4sdgn6LDL1aCM/WKRSxGHVTx+wkhKQ719YtiC0T6sA+eLirc6VT3/6+FbQWC+2\n" + - "bG7N19sGpV/RAXMBpRXUnBJSQaNCMEAwHQYDVR0OBBYEFNNZxyxuQmKvWowofr/S\n" + - "HdCIS+W8MB8GA1UdIwQYMBaAFOE8AVLr0Tj3z/HjXttUdX9eqy02MAkGByqGSM44\n" + - "BAMDMAAwLQIUUzzMhZ9St/Vo/YdgNTHdTw4cm14CFQCE6tWG157Wl5YFyYsGHsLY\n" + - "NN8uCA==\n" + - "-----END CERTIFICATE-----", - "MIIBSwIBADCCASwGByqGSM44BAEwggEfAoGBAO30pMWCEpTCU/ovDeVTm5R4Y6z2\n" + - "AMt6Edv2F0Fuk9IQjIZvI5sYJNWwyHfWSh68bDNORJArUWGqmoOGWXhnXssL9yMM\n" + - "GKgkHxrZD8E/UALHUgAWMBjq5YRLWbQRtckOOHPkc/1bPj7ZAMmW3+VRtYksRW/W\n" + - "yOUBSVifWtlaWYefAhUAghgC0KCuDLED/Fe9lpQewb7fXq8CgYEAwsbtBjNoma9C\n" + - "fA2gKPfwoUuJuxO4eic/SjptnBYc2BnpJFFzc58u58s+kKYG7n/CjRSo7aqFAwvL\n" + - "ZXFUAFJU3BEgtE2V0d4dtYZfcMyAYRPpCdY/L9SgMXzmiTsTm5OUBLyGgOY/o4hx\n" + - "sEUubQ6ssDmrc/npsDGb9cCpwjQRJTYEFgIUNRiLmNzfTYOuVsjkySPzP5gPImM="), - - EE_ED25519( - "EdDSA", - // ED25519 - // Validity - // Not Before: May 24 23:32:36 2020 GMT - // Not After : May 22 23:32:36 2030 GMT - // X509v3 Authority Key Identifier: - // keyid:06:76:DB:88:EB:61:55:4C:C9:63:41:C2:A0:A8:57:3F:D7:F1:B8:EC - "-----BEGIN CERTIFICATE-----\n" + - "MIIBlDCCAUagAwIBAgIUFTt/jcgQ65nhTG8LkrWFJhhEGuwwBQYDK2VwMDsxCzAJ\n" + - "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + - "U2VyaXZjZTAeFw0yMDA1MjQyMzMyMzZaFw0zMDA1MjIyMzMyMzZaMFUxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MCowBQYDK2VwAyEAGAYQmKb7\n" + - "WNYpVxIdsc49lI1emNjF06/Jl85zlG0wc9OjQjBAMB0GA1UdDgQWBBQkJ2E4/S8Z\n" + - "EIM1v9uTc0eYtYNk3zAfBgNVHSMEGDAWgBQGdtuI62FVTMljQcKgqFc/1/G47DAF\n" + - "BgMrZXADQQCVZnl/AyIEtZ8r45e/hcfxwuezgRX+7e9NHZFV1A/TMGcBRORDfDUi\n" + - "bbh72K528fjT7P4/WoXvm1zJKOAzUOUL\n" + - "-----END CERTIFICATE-----", - "MC4CAQAwBQYDK2VwBCIEIGBmdh4tfc0lng/LWokhfFLlo0ZlmTn2lbI639qou2KP"), - - EE_ED448( - "EdDSA", - // ED448 - // Validity - // Not Before: May 24 23:23:43 2020 GMT - // Not After : May 22 23:23:43 2030 GMT - // X509v3 Authority Key Identifier: - // keyid:F5:D5:9D:FB:6F:B7:50:29:DF:F0:B8:83:10:5F:9B:C4:A8:1C:E9:F4 - "-----BEGIN CERTIFICATE-----\n" + - "MIIB3zCCAV+gAwIBAgIUNlWzFrH2+BILqM3SNYQjKoY98S8wBQYDK2VxMDsxCzAJ\n" + - "BgNVBAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3Qg\n" + - "U2VyaXZjZTAeFw0yMDA1MjQyMzIzNDNaFw0zMDA1MjIyMzIzNDNaMFUxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKDARqYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MEMwBQYDK2VxAzoAoIubPNAg\n" + - "F11u3MQ5d9wujg10+80I0xzYzTqzzXrfJNtw+eU8NbUk86xiCvlMzJRH0Oo3DbY8\n" + - "NAKAo0IwQDAdBgNVHQ4EFgQUUiI1+qT1x+HsDgfZRIU6hUaAbmUwHwYDVR0jBBgw\n" + - "FoAU9dWd+2+3UCnf8LiDEF+bxKgc6fQwBQYDK2VxA3MAx8P0mle08s5YDd/p58dt\n" + - "yORqvDPwo5IYPasqN8Zeen1B9u1xF/kvDGFxCJ6D9Gi4ynnDx0FZFMkA83evZcxJ\n" + - "+X+swt7FyHwXrdkZcvjRKEcsWhkj+0FlxYF/NZzLTGuGIPYJnRLEwf/zr+5NDxKs\n" + - "fCoA\n" + - "-----END CERTIFICATE-----", - "MEcCAQAwBQYDK2VxBDsEOfbhmUSuKP9WCO7Nr6JxVq5rfJESk1MNMyYhC134SiAP\n" + - "Suw0Cu7RZVadpfPR7Kiwb2b/JXjMdY1HAA=="); - - final String keyAlgo; - final String certStr; - final String privKeyStr; - - Cert(String keyAlgo, String certStr, String privKeyStr) { - this.keyAlgo = keyAlgo; - this.certStr = certStr; - this.privKeyStr = privKeyStr; - } - } } diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java openjdk-17-17.0.10+7/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java --- openjdk-17-17.0.9+9/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/print/PrintServiceLookup/FlushCustomClassLoader.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,83 @@ +/* + * Copyright Amazon.com Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.lang.ref.Reference; +import java.lang.ref.WeakReference; +import java.net.URL; +import java.net.URLClassLoader; + +import javax.print.DocFlavor; +import javax.print.PrintServiceLookup; + +/** + * @test + * @bug 8273831 + * @summary Tests custom class loader cleanup + * @library /javax/swing/regtesthelpers + * @build Util + * @run main/timeout=60/othervm -mx32m FlushCustomClassLoader + */ +public final class FlushCustomClassLoader { + + public static void main(String[] args) throws Exception { + Reference loader = getLoader("testMethod"); + + int attempt = 0; + while (loader.get() != null) { + Util.generateOOME(); + System.out.println("Not freed, attempt: " + attempt++); + } + } + + public static void testMethod() { + DocFlavor flavor = DocFlavor.SERVICE_FORMATTED.PRINTABLE; + PrintServiceLookup.lookupPrintServices(flavor, null); + } + + private static Reference getLoader(String m) throws Exception { + /* + * The print services are stored per the AppContext, and each AppContext + * caches the "current" class loader during creation. + * see javax.print.PrintServiceLookup. + * + * To prevent AppContext from cache our test loader we force AppContext + * creation early by the invokeAndWait. + * The "EventQueue.invokeAndWait(() -> {});" can be removed when the + * AppContext usage will be deleted in the PrintServiceLookup + */ + EventQueue.invokeAndWait(() -> {}); + + URL url = FlushCustomClassLoader.class.getProtectionDomain() + .getCodeSource().getLocation(); + URLClassLoader loader = new URLClassLoader(new URL[]{url}, null); + + Thread ct = Thread.currentThread(); + ct.setContextClassLoader(loader); + Class cls = Class.forName("FlushCustomClassLoader", true, loader); + cls.getDeclaredMethod(m).invoke(null); + ct.setContextClassLoader(null); + loader.close(); + return new WeakReference<>(loader); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java openjdk-17-17.0.10+7/test/jdk/javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java --- openjdk-17-17.0.9+9/test/jdk/javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/security/auth/callback/PasswordCallback/CheckCleanerBound.java 2024-01-09 21:18:15.000000000 +0000 @@ -47,6 +47,7 @@ // Wait to trigger the cleanup. for (int i = 0; i < 10 && weakHashMap.size() != 0; i++) { System.gc(); + Thread.sleep(100); } // Check if the object has been collected. The collection will not diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java openjdk-17-17.0.10+7/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java --- openjdk-17-17.0.9+9/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright Amazon.com Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +import javax.sound.midi.InvalidMidiDataException; +import javax.sound.midi.MidiSystem; + +/** + * @test + * @bug 8312535 + * @summary MidiSystem.getSoundbank() throws unexpected SecurityException + * @run main/othervm/policy=security.policy GetSoundBankSecurityException + */ +public final class GetSoundBankSecurityException { + + public static void main(String[] args) throws Exception { + File tempFile = new File("sound.bank"); + tempFile.createNewFile(); + try { + MidiSystem.getSoundbank(tempFile); + throw new RuntimeException("InvalidMidiDataException is expected"); + } catch (InvalidMidiDataException ignore) { + } finally { + Files.delete(Paths.get(tempFile.getAbsolutePath())); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy openjdk-17-17.0.10+7/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy --- openjdk-17-17.0.9+9/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/sound/midi/Soundbanks/GetSoundBankSecurityException/security.policy 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,4 @@ +grant { + permission java.io.FilePermission "*", "read,write,delete"; + permission java.util.PropertyPermission "user.dir", "read"; +}; diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/JMenuItem/8031573/bug8031573.java openjdk-17-17.0.10+7/test/jdk/javax/swing/JMenuItem/8031573/bug8031573.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/JMenuItem/8031573/bug8031573.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/JMenuItem/8031573/bug8031573.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -32,18 +32,18 @@ import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; -import javax.swing.JMenuItem; import javax.swing.JPanel; +import javax.swing.JRadioButtonMenuItem; import javax.swing.JTextArea; -import javax.swing.JTextField; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.text.JTextComponent; /* @test - * @bug 8031573 8040279 8143064 - * @summary [macosx] Checkmarks of JCheckBoxMenuItems aren't rendered + * @bug 8031573 8040279 8143064 8294427 + * @summary Checkmarks of JCheckBoxMenuItems aren't rendered * in high resolution on Retina + * @requires (os.family != "linux") * @run main/manual bug8031573 */ @@ -54,14 +54,21 @@ private static final CountDownLatch latch = new CountDownLatch(1); public static final String INSTRUCTIONS = "INSTRUCTIONS:\n\n" - + "Verify that high resolution system icons are used for JCheckBoxMenuItem on HiDPI displays.\n" - + "If the display does not support HiDPI mode press PASS.\n" - + "1. Run the test on HiDPI Display.\n" - + "2. Open the Menu.\n" - + "3. Check that the icon on the JCheckBoxMenuItem is smooth.\n" - + " If so, press PASS, else press FAIL.\n"; + + "Verify that the check and radio-check icons are rendered smoothly\n" + + "for both JCheckBoxMenuItem and JRadioButtonMenuItem.\n" + + "1. Open the Menu.\n" + + "2. Check that the icon on the JCheckBoxMenuItem is smooth.\n" + + "3. Check that the icon on the JRadioButtonMenuItem is smooth.\n" + + "4. If you're on Windows:\n" + + " Test the markers are still crisp after changing the scale in Windows settings.\n" + + " This could be done on same monitor by changing its scale or\n" + + " by moving the window to a secondary monitor with a different scale.\n" + + " Then go to step 6.\n" + + "5. If you're on Mac OS:\n" + + " If you tested on a Retina display, go to step 6.\n" + + "6. If both icons render smoothly, press PASS, otherwise press FAIL.\n"; - public static void main(String args[]) throws Exception { + public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); try { SwingUtilities.invokeAndWait(() -> createTestGUI()); @@ -88,6 +95,9 @@ JCheckBoxMenuItem checkBoxMenuItem = new JCheckBoxMenuItem("JCheckBoxMenuItem"); checkBoxMenuItem.setSelected(true); menu.add(checkBoxMenuItem); + JRadioButtonMenuItem radioButtonMenuItem = new JRadioButtonMenuItem("JRadioButtonMenuItem"); + radioButtonMenuItem.setSelected(true); + menu.add(radioButtonMenuItem); bar.add(menu); frame.setJMenuBar(bar); diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java openjdk-17-17.0.10+7/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/JMenuItem/JMenuItemSetAcceleratorTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2016, 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; + +/* + * @test + * @key headful + * @bug 8296275 + * @summary To verify the setAccelerator method of JMenuItem. + * @requires (os.family=="mac") + * @run main JMenuItemSetAcceleratorTest + */ + +public class JMenuItemSetAcceleratorTest { + private static JFrame frame; + private static final CountDownLatch actionLatch = new CountDownLatch(1); + private volatile static Point frameAt; + private volatile static Dimension frameSize; + + private static void createAndShow() { + frame = new JFrame("JMenuItem.setAccelerator"); + frame.setLayout(new FlowLayout()); + + JMenuBar bar = new JMenuBar(); + JMenu menu = new JMenu("File"); + JMenuItem menuItem = new JMenuItem("Menu Item"); + + menuItem.setAccelerator( + KeyStroke.getKeyStroke(KeyEvent.VK_M, InputEvent.META_DOWN_MASK)); + menuItem.addActionListener(e -> { + System.out.println("menu item action."); + actionLatch.countDown(); + }); + + menu.add(menuItem); + bar.add(menu); + + frame.setJMenuBar(bar); + frame.setSize(200, 200); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + } + + public static void main(String[] args) throws Exception { + try { + SwingUtilities.invokeAndWait(JMenuItemSetAcceleratorTest::createAndShow); + + Robot robot = new Robot(); + robot.setAutoDelay(50); + robot.setAutoWaitForIdle(true); + + EventQueue.invokeAndWait(() -> { + frameAt = frame.getLocationOnScreen(); + frameSize = frame.getSize(); + }); + + robot.mouseMove(frameAt.x + frameSize.width / 2, + frameAt.y + frameSize.height / 2); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); + robot.waitForIdle(); + + robot.keyPress(KeyEvent.VK_META); + robot.keyPress(KeyEvent.VK_M); + robot.keyRelease(KeyEvent.VK_M); + robot.keyRelease(KeyEvent.VK_META); + + if (!actionLatch.await(5, TimeUnit.SECONDS)) { + throw new RuntimeException( + "Hasn't received the JMenuItem action event by pressing " + + "accelerator keys, test fails."); + } + System.out.println("Test passed, received action event on menu item."); + } finally { + SwingUtilities.invokeAndWait(JMenuItemSetAcceleratorTest::disposeFrame); + } + } + + public static void disposeFrame() { + if (frame != null) { + frame.dispose(); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java openjdk-17-17.0.10+7/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/JTableHeader/6889007/bug6889007.java 2024-01-09 21:18:15.000000000 +0000 @@ -53,7 +53,6 @@ public static void main(String[] args) throws Exception { try { robot = new Robot(); - robot.setAutoDelay(100); SwingUtilities.invokeAndWait(() -> { frame = new JFrame(); @@ -69,6 +68,7 @@ frame.add(th); frame.pack(); frame.setLocationRelativeTo(null); + frame.setAlwaysOnTop(true); frame.setVisible(true); }); robot.waitForIdle(); @@ -83,7 +83,7 @@ int y = point.y + height/2; for(int i = -shift; i < width + 2*shift; i++) { robot.mouseMove(x++, y); - robot.waitForIdle(); + robot.delay(100); } robot.waitForIdle(); // 9 is a magic test number @@ -109,6 +109,8 @@ Cursor cursor = Cursor.getPredefinedCursor(Cursor.E_RESIZE_CURSOR); if (oldColumn != -1 && newColumn != -1 && header.getCursor() != cursor) { + System.out.println("oldColumn " + oldColumn + " newColumn " + newColumn + + "header.getCursor " + header.getCursor() + " cursor " + cursor); try { Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java openjdk-17-17.0.10+7/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/ProgressMonitor/ProgressTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 6445283 + * @library /java/awt/regtesthelpers + * @build PassFailJFrame + * @summary Tests if ProgressMonitorInputStream reports progress accurately + * @run main/manual ProgressTest + */ + +import java.io.InputStream; + +import javax.swing.ProgressMonitorInputStream; + +public class ProgressTest { + + private static final String instructionsText = + "A ProgressMonitor will be shown.\n" + + " If it shows blank progressbar after 2048MB bytes read,\n"+ + " press Fail else press Pass"; + + public static void main(String[] args) throws Exception { + + PassFailJFrame pfjFrame = new PassFailJFrame("JScrollPane " + + "Test Instructions", instructionsText, 5); + PassFailJFrame.positionTestWindow(null, PassFailJFrame.Position.VERTICAL); + + final long SIZE = (long) (Integer.MAX_VALUE * 1.5); + + InputStream fileIn = new InputStream() { + long read = 0; + + @Override + public int available() { + return (int) Math.min(SIZE - read, Integer.MAX_VALUE); + } + + @Override + public int read() { + return (SIZE - read++ > 0) ? 1 : -1; + } + }; + + ProgressMonitorInputStream pmis = + new ProgressMonitorInputStream(null, "Reading File", fileIn); + + Thread thread = new Thread() { + public void run() { + byte[] buffer = new byte[512]; + int nb = 0; + long total = 0; + while (true) { + try { + nb = pmis.read(buffer); + } catch (Exception e){} + if (nb == 0) break; + total += nb; + + pmis.getProgressMonitor().setNote(total/(1024*1024)+" MB Read"); + } + } + }; + thread.start(); + + pfjFrame.awaitAndCheck(); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/dnd/7171812/bug7171812.java openjdk-17-17.0.10+7/test/jdk/javax/swing/dnd/7171812/bug7171812.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/dnd/7171812/bug7171812.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/dnd/7171812/bug7171812.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 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 @@ -26,26 +26,40 @@ * @key headful * @bug 7171812 * @summary [macosx] Views keep scrolling back to the drag position after DnD - * @author Alexander Zuev * @run main bug7171812 */ -import java.awt.*; -import java.awt.dnd.*; +import java.awt.BorderLayout; +import java.awt.Point; +import java.awt.Robot; +import java.awt.dnd.DnDConstants; +import java.awt.dnd.DropTarget; +import java.awt.dnd.DropTargetDragEvent; +import java.awt.dnd.DropTargetDropEvent; +import java.awt.dnd.DropTargetEvent; +import java.awt.dnd.DropTargetListener; import java.awt.event.InputEvent; -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.SwingUtilities; public class bug7171812 { static JFrame mainFrame; static String listData[]; static JListWithScroll list; static JScrollPane scrollPane; + static volatile Point pt; + static volatile int height; /** * @param args the command line arguments */ public static void main(String[] args) throws Exception{ + Robot robot = new Robot(); + robot.setAutoDelay(100); + robot.setAutoWaitForIdle(true); + SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { @@ -53,18 +67,21 @@ } }); - Robot robot = new Robot(); - robot.setAutoDelay(10); robot.waitForIdle(); - robot.mouseMove(scrollPane.getLocationOnScreen().x + 5, scrollPane.getLocationOnScreen().y + 5); - robot.mousePress(InputEvent.BUTTON1_MASK); - for(int offset = 5; offset < scrollPane.getHeight()-20; offset++) { - robot.mouseMove(scrollPane.getLocationOnScreen().x+5, scrollPane.getLocationOnScreen().y+offset); + robot.delay(1000); + SwingUtilities.invokeAndWait(() -> { + pt = scrollPane.getLocationOnScreen(); + height = scrollPane.getHeight(); + }); + robot.mouseMove(pt.x + 5, pt.y + 5); + robot.mousePress(InputEvent.BUTTON1_DOWN_MASK); + for(int offset = 5; offset < height - 20; offset++) { + robot.mouseMove(pt.x + 5, pt.y + offset); } for(int offset = 5; offset < 195; offset++) { - robot.mouseMove(scrollPane.getLocationOnScreen().x+offset, scrollPane.getLocationOnScreen().y+scrollPane.getHeight()-20); + robot.mouseMove(pt.x + offset, pt.y + height - 20); } - robot.mouseRelease(InputEvent.BUTTON1_MASK); + robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK); try { SwingUtilities.invokeAndWait(new Runnable() { @Override diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4357975.java openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4357975.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4357975.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/HTMLEditorKit/bug4357975.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2000, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4357975 + * @summary Tests if InsertUnorderedListItem generates the proper tag sequence + * @run main bug4357975 + */ + +import java.awt.event.ActionEvent; + +import javax.swing.Action; +import javax.swing.JEditorPane; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.AttributeSet; +import javax.swing.text.Element; +import javax.swing.text.StyleConstants; +import javax.swing.text.html.HTML; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.HTMLDocument; + +public class bug4357975 { + + public static void main(String[] args) throws Exception { + JEditorPane jep = new JEditorPane(); + HTMLEditorKit kit = new HTMLEditorKit(); + jep.setEditorKit(kit); + jep.setDocument(kit.createDefaultDocument()); + + HTMLDocument doc = (HTMLDocument) jep.getDocument(); + + DocumentListener l = new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + int offset = e.getOffset(); + HTMLDocument doc = (HTMLDocument)e.getDocument(); + + Element el = doc.getCharacterElement(offset + 1); + AttributeSet attrs = el.getAttributes(); + Object name = attrs.getAttribute(StyleConstants.NameAttribute); + boolean passed = (name == HTML.Tag.CONTENT); + + el = el.getParentElement(); + attrs = el.getAttributes(); + name = attrs.getAttribute(StyleConstants.NameAttribute); + passed = (passed && (name == HTML.Tag.IMPLIED)); + + el = el.getParentElement(); + attrs = el.getAttributes(); + name = attrs.getAttribute(StyleConstants.NameAttribute); + passed = (passed && (name == HTML.Tag.LI)); + + el = el.getParentElement(); + attrs = el.getAttributes(); + name = attrs.getAttribute(StyleConstants.NameAttribute); + passed = (passed && (name == HTML.Tag.UL)); + if (!passed) { + throw new RuntimeException("Test failed"); + } + } + + @Override + public void changedUpdate(DocumentEvent e) {} + @Override + public void removeUpdate(DocumentEvent e) {} + }; + doc.addDocumentListener(l); + + Action[] actions = kit.getActions(); + for (int i = 0; i < actions.length; i++){ + Action a = actions[i]; + if (a.getValue(Action.NAME) == "InsertUnorderedListItem") { + a.actionPerformed(new ActionEvent(jep, + ActionEvent.ACTION_PERFORMED, + (String) a.getValue(Action.ACTION_COMMAND_KEY))); + break; + } + } + + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/text/html/HTMLWriter/bug4841760.java openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/HTMLWriter/bug4841760.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/text/html/HTMLWriter/bug4841760.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/HTMLWriter/bug4841760.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4841760 + * @summary Tests if HTML tags are correctly shown for + StyleEditorKit.ForegroundAction() in JTextPane output. + * @run main bug4841760 + */ + +import javax.swing.JTextPane; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; +import javax.swing.text.html.HTMLEditorKit; + +public class bug4841760 { + + public static void main(String[] args) throws Exception { + JTextPane jep = new JTextPane(); + jep.setEditorKit(new HTMLEditorKit()); + jep.setText("hellojavaworld"); + + SimpleAttributeSet set = new SimpleAttributeSet(); + StyleConstants.setForeground(set, java.awt.Color.BLUE); + jep.getStyledDocument().setCharacterAttributes(3, 5, set, false); + + String gotText = jep.getText(); + System.out.println("gotText: " + gotText); + // there should be color attribute set + // and 3 font tags + int i = gotText.indexOf("color"); + if (i > 0) { + i = gotText.indexOf(" 0) { + i = gotText.indexOf(" 0) { + i = gotText.indexOf(" { + bug4329185 test = new bug4329185(); + test.start(); + }); + robot.waitForIdle(); + robot.delay(1000); + boolean passed = ((views[0].getAlignment(View.Y_AXIS) == 0.0) + && (views[1].getAlignment(View.Y_AXIS) == 0.5) + && (views[2].getAlignment(View.Y_AXIS) == 1.0)); + if (!passed) { + throw new RuntimeException("Test failed."); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (f != null) { + f.dispose(); + } + }); + } + } + + public void start() { + String text = "aaa"; + f = new JFrame("bug4329185"); + JEditorPane jep = new JEditorPane(); + jep.setEditorKit(new MyHTMLEditorKit()); + jep.setEditable(false); + + jep.setText(text); + + f.getContentPane().add(jep); + f.setSize(500, 500); + f.setLocationRelativeTo(null); + f.setVisible(true); + } + + + static class MyHTMLEditorKit extends HTMLEditorKit { + + private final ViewFactory defaultFactory = new MyHTMLFactory(); + + @Override + public ViewFactory getViewFactory() { + return defaultFactory; + } + + static class MyHTMLFactory extends HTMLEditorKit.HTMLFactory { + private int i = 0; + + @Override + public View create(Element elem) { + Object o = elem.getAttributes() + .getAttribute(StyleConstants.NameAttribute); + if (o instanceof HTML.Tag kind) { + if (kind == HTML.Tag.IMG) { + View v = super.create(elem); + views[i++] = v; + return v; + } + } + return super.create(elem); + } + } + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/javax/swing/text/html/InlineView/bug4623342.java openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/InlineView/bug4623342.java --- openjdk-17-17.0.9+9/test/jdk/javax/swing/text/html/InlineView/bug4623342.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/javax/swing/text/html/InlineView/bug4623342.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2003, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 4623342 + * @summary Tests if InlineView causes extra spacing around images in JTable + * @key headful + * @run main bug4623342 + */ + +import java.awt.Robot; +import java.awt.Shape; + +import javax.swing.JFrame; +import javax.swing.JEditorPane; +import javax.swing.SwingUtilities; +import javax.swing.text.View; +import javax.swing.text.html.HTMLEditorKit; + +public class bug4623342 { + + private static volatile boolean passed; + + private JEditorPane jep; + private static JFrame f; + + public static void main(String[] args) throws Exception { + Robot robot = new Robot(); + robot.setAutoDelay(100); + try { + bug4623342 test = new bug4623342(); + SwingUtilities.invokeAndWait(test::init); + robot.waitForIdle(); + robot.delay(100); + SwingUtilities.invokeAndWait(test::start); + if (!passed) { + throw new RuntimeException("Test failed."); + } + } finally { + SwingUtilities.invokeAndWait(() -> { + if (f != null) { + f.dispose(); + } + }); + } + } + + public void init() { + + String text = + "" + + "" + + "
" + + "
" + + "
"; + + f = new JFrame(); + jep = new JEditorPane(); + jep.setEditorKit(new HTMLEditorKit()); + jep.setEditable(false); + + jep.setText(text); + + f.getContentPane().add(jep); + f.setSize(500, 500); + f.setLocationRelativeTo(null); + f.setVisible(true); + } + + private void start() { + Shape r = jep.getBounds(); + View v = jep.getUI().getRootView(jep); + int tableHeight = 0; + while (!(v instanceof javax.swing.text.html.ParagraphView)) { + int n = v.getViewCount(); + Shape sh = v.getChildAllocation(n - 1, r); + String viewName = v.getClass().getName(); + if (viewName.endsWith("TableView")) { + tableHeight = r.getBounds().height; + } + v = v.getView(n - 1); + if (sh != null) { + r = sh; + } + } + // tableHeight should be the sum of TD's heights (46) + passed = (tableHeight == 46); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMCrash.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMCrash.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMCrash.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMCrash.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2022, 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 @@ -36,14 +36,14 @@ * @library /test/lib /test/jdk * @modules jdk.jfr jdk.attach java.base/jdk.internal.misc * - * @run main/othervm jdk.jfr.api.consumer.streaming.TestJVMCrash + * @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMCrash */ public class TestJVMCrash { public static void main(String... args) throws Exception { int id = 1; while (true) { - try (TestProcess process = new TestProcess("crash-application-" + id++)) { + try (TestProcess process = new TestProcess("crash-application-" + id++, false /* createCore */)) { AtomicInteger eventCounter = new AtomicInteger(); try (EventStream es = EventStream.openRepository(process.getRepository())) { // Start from first event in repository diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMExit.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMExit.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMExit.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestJVMExit.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2021, 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 @@ -35,7 +35,7 @@ * @library /test/lib /test/jdk * @modules jdk.jfr jdk.attach java.base/jdk.internal.misc * - * @run main/othervm jdk.jfr.api.consumer.streaming.TestJVMExit + * @run main/othervm -Dsun.tools.attach.attachTimeout=100000 jdk.jfr.api.consumer.streaming.TestJVMExit */ public class TestJVMExit { diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2022, 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 @@ -54,11 +54,16 @@ private final Path path; public TestProcess(String name) throws IOException { + this(name, true /* createCore */); + } + + public TestProcess(String name, boolean createCore) throws IOException { this.path = Paths.get("action-" + System.currentTimeMillis()).toAbsolutePath(); String[] args = { "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:StartFlightRecording:settings=none", + "-XX:" + (createCore ? "+" : "-") + "CreateCoredumpOnCrash", TestProcess.class.getName(), path.toString() }; ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java 2024-01-09 21:18:15.000000000 +0000 @@ -49,12 +49,16 @@ // This test can not always trigger the expected event. // Test is ok even if no events found. List events = RecordingFile.readAllEvents(Paths.get(jfr_file)); + int minObjectAlignment = 8; for (RecordedEvent event : events) { System.out.println("Event: " + event); long smallestSize = Events.assertField(event, "promotionFailed.smallestSize").atLeast(1L).getValue(); + Asserts.assertTrue((smallestSize % minObjectAlignment) == 0, "smallestSize " + smallestSize + " is not a valid size."); long firstSize = Events.assertField(event, "promotionFailed.firstSize").atLeast(smallestSize).getValue(); + Asserts.assertTrue((firstSize % minObjectAlignment) == 0, "firstSize " + firstSize + " is not a valid size."); long totalSize = Events.assertField(event, "promotionFailed.totalSize").atLeast(firstSize).getValue(); long objectCount = Events.assertField(event, "promotionFailed.objectCount").atLeast(1L).getValue(); + Asserts.assertTrue((totalSize % minObjectAlignment) == 0, "totalSize " + totalSize + " is not a valid size."); Asserts.assertLessThanOrEqual(smallestSize * objectCount, totalSize, "smallestSize * objectCount <= totalSize"); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java 2024-01-09 21:18:15.000000000 +0000 @@ -76,13 +76,17 @@ // Verify recording List events = Events.fromRecording(recording); + int minObjectAlignment = 8; Events.hasEvents(events); for (RecordedEvent event : events) { long objectCount = Events.assertField(event, "evacuationFailed.objectCount").atLeast(1L).getValue(); long smallestSize = Events.assertField(event, "evacuationFailed.smallestSize").atLeast(1L).getValue(); + Asserts.assertTrue((smallestSize % minObjectAlignment) == 0, "smallestSize " + smallestSize + " is not a valid size."); long firstSize = Events.assertField(event, "evacuationFailed.firstSize").atLeast(smallestSize).getValue(); + Asserts.assertTrue((firstSize % minObjectAlignment) == 0, "firstSize " + firstSize + " is not a valid size."); long totalSize = Events.assertField(event, "evacuationFailed.totalSize").atLeast(firstSize).getValue(); + Asserts.assertTrue((totalSize % minObjectAlignment) == 0, "totalSize " + totalSize + " is not a valid size."); Asserts.assertLessThanOrEqual(smallestSize * objectCount, totalSize, "smallestSize * objectCount <= totalSize"); } recording.close(); diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 2024-01-09 21:18:15.000000000 +0000 @@ -59,25 +59,17 @@ String msg = "hello!"; byte[] buf = msg.getBytes(); forceEndChunk(); - // Send a few packets both to the loopback address as well to an - // external + // Send a few packets to the loopback address DatagramPacket packet = new DatagramPacket(buf, buf.length, InetAddress.getLoopbackAddress(), 12345); for (int i = 0; i < packetSendCount; ++i) { socket.send(packet); } - packet = new DatagramPacket(buf, buf.length, InetAddress.getByName("10.0.0.0"), 12345); - for (int i = 0; i < packetSendCount; ++i) { - socket.send(packet); - } forceEndChunk(); socket.close(); - // Now there should have been traffic on at least two different - // interfaces recording.stop(); Set networkInterfaces = new HashSet<>(); List events = Events.fromRecording(recording); - Events.hasEvents(events); for (RecordedEvent event : events) { System.out.println(event); Events.assertField(event, "writeRate").atLeast(0L).atMost(1000L * Integer.MAX_VALUE); @@ -87,13 +79,10 @@ networkInterfaces.add(event.getString("networkInterface")); } } - - if (Platform.isWindows()) { - // Windows does not track statistics for the loopback - // interface + // Windows does not track statistics for the loopback + // interface + if (!Platform.isWindows()) { Asserts.assertGreaterThanOrEqual(networkInterfaces.size(), 1); - } else { - Asserts.assertGreaterThanOrEqual(networkInterfaces.size(), 2); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java --- openjdk-17-17.0.9+9/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 2022, 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 @@ -92,6 +92,7 @@ ProcessBuilder pb = ProcessTools.createTestJvm( "-Xlog:jfr=debug", "-XX:-CreateCoredumpOnCrash", + "-XX:-TieredCompilation", "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED", "-XX:StartFlightRecording:filename=./dumped.jfr,dumponexit=true,settings=default", "jdk.jfr.event.runtime.TestShutdownEvent$TestMain", diff -Nru openjdk-17-17.0.9+9/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java openjdk-17-17.0.10+7/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java --- openjdk-17-17.0.9+9/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/jdk/security/jarsigner/JarWithOneNonDisabledDigestAlg.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 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 @@ -27,6 +27,7 @@ * @summary Check that jar entry with at least one non-disabled digest * algorithm in manifest is treated as signed * @modules java.base/sun.security.tools.keytool + * @modules java.base/sun.security.util * @library /test/lib * @build jdk.test.lib.util.JarUtils * jdk.test.lib.security.SecurityUtils @@ -34,61 +35,94 @@ */ import java.io.InputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; +import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.security.CodeSigner; import java.security.KeyStore; +import java.security.cert.CertPathValidatorException; +import java.util.Collections; +import java.util.Date; import java.util.Enumeration; -import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.zip.ZipFile; import jdk.security.jarsigner.JarSigner; import jdk.test.lib.util.JarUtils; -import jdk.test.lib.security.SecurityUtils; +import sun.security.util.ConstraintsParameters; +import sun.security.util.DisabledAlgorithmConstraints; +import sun.security.util.JarConstraintsParameters; public class JarWithOneNonDisabledDigestAlg { private static final String PASS = "changeit"; - private static final String TESTFILE1 = "testfile1"; - private static final String TESTFILE2 = "testfile2"; + private static final Path TESTFILE1 = Path.of("testfile1"); + private static final Path TESTFILE2 = Path.of("testfile2"); + private static final Path UNSIGNED_JAR = Path.of("unsigned.jar"); + private static final Path SIGNED_JAR = Path.of("signed.jar"); + private static final Path SIGNED_TWICE_JAR = Path.of("signed2.jar"); + private static final Path MULTI_SIGNED_JAR = Path.of("multi-signed.jar"); + private static final Path CURRENT_DIR = Path.of("."); public static void main(String[] args) throws Exception { - SecurityUtils.removeFromDisabledAlgs("jdk.jar.disabledAlgorithms", - List.of("SHA1")); - Files.write(Path.of(TESTFILE1), TESTFILE1.getBytes()); - JarUtils.createJarFile(Path.of("unsigned.jar"), Path.of("."), - Path.of(TESTFILE1)); + // Sanity check: Assert that MD5 is disabled, SHA-256 enabled + checkDigestAlgorithmPermits(); - genkeypair("-alias SHA1 -sigalg SHA1withRSA"); - genkeypair("-alias SHA256 -sigalg SHA256withRSA"); - - KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); - try (FileInputStream fis = new FileInputStream("keystore")) { - ks.load(fis, PASS.toCharArray()); - } + // Create an unsigned JAR with a single file + Files.write(TESTFILE1, TESTFILE1.toString().getBytes()); + JarUtils.createJarFile(UNSIGNED_JAR, CURRENT_DIR, TESTFILE1); + + // Generate a keystore with two different signers + genkeypair("-alias SIGNER1"); + genkeypair("-alias SIGNER2"); + KeyStore ks = loadKeyStore(); // Sign JAR twice with same signer but different digest algorithms // so that each entry in manifest file contains two digest values. - signJarFile(ks, "SHA1", "MD5", "unsigned.jar", "signed.jar"); - signJarFile(ks, "SHA1", "SHA1", "signed.jar", "signed2.jar"); - checkThatJarIsSigned("signed2.jar", false); + // Note that MD5 is a disabled digest algorithm, while SHA-256 is not + signJarFile(ks, "SIGNER1", "MD5", UNSIGNED_JAR, SIGNED_JAR); + signJarFile(ks, "SIGNER1", "SHA256", SIGNED_JAR, SIGNED_TWICE_JAR); + checkThatJarIsSigned(SIGNED_TWICE_JAR, Map.of(TESTFILE1.toString(), 1)); // add another file to the JAR - Files.write(Path.of(TESTFILE2), "testFile2".getBytes()); - JarUtils.updateJarFile(Path.of("signed2.jar"), Path.of("."), - Path.of(TESTFILE2)); - - // Sign again with different signer (SHA256) and SHA-1 digestalg. - // TESTFILE1 should have two signers and TESTFILE2 should have one - // signer. - signJarFile(ks, "SHA256", "SHA1", "signed2.jar", "multi-signed.jar"); + Files.write(TESTFILE2, TESTFILE2.toString().getBytes()); + JarUtils.updateJarFile(SIGNED_TWICE_JAR, CURRENT_DIR, TESTFILE2); + + // Sign the updated JAR, now with a different signer and with an enabled digest alg + signJarFile(ks, "SIGNER2", "SHA256", SIGNED_TWICE_JAR, MULTI_SIGNED_JAR); - checkThatJarIsSigned("multi-signed.jar", true); + // TESTFILE1 should have two signers and TESTFILE2 should have one signer. + checkThatJarIsSigned(MULTI_SIGNED_JAR, + Map.of(TESTFILE1.toString(), 2, + TESTFILE2.toString(), 1) + ); + } + + private static void checkDigestAlgorithmPermits() throws Exception { + ConstraintsParameters cp = new JarConstraintsParameters(Collections.emptyList(), new Date()); + DisabledAlgorithmConstraints jarConstraints = DisabledAlgorithmConstraints.jarConstraints(); + try { + jarConstraints.permits("MD5", cp, false); + throw new Exception("This test assumes that MD5 is disabled"); + } catch (CertPathValidatorException e) { + // Ignore + } + try { + jarConstraints.permits("SHA256", cp, false); + } catch (CertPathValidatorException e) { + throw new Exception("This test assumes that SHA256 is enabled"); + } + } + + private static KeyStore loadKeyStore() throws Exception { + KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType()); + try (InputStream fis = Files.newInputStream(Path.of("keystore"))) { + ks.load(fis, PASS.toCharArray()); + } + return ks; } private static KeyStore.PrivateKeyEntry getEntry(KeyStore ks, String alias) @@ -101,12 +135,13 @@ private static void genkeypair(String cmd) throws Exception { cmd = "-genkeypair -keystore keystore -storepass " + PASS + - " -keypass " + PASS + " -keyalg rsa -dname CN=Duke " + cmd; + " -keypass " + PASS + " -keyalg rsa -sigalg SHA256withRSA " + + "-dname CN=Duke " + cmd; sun.security.tools.keytool.Main.main(cmd.split(" ")); } private static void signJarFile(KeyStore ks, String alias, - String digestAlg, String inputFile, String outputFile) + String digestAlg, Path inputFile, Path outputFile) throws Exception { JarSigner signer = new JarSigner.Builder(getEntry(ks, alias)) @@ -114,38 +149,36 @@ .signerName(alias) .build(); - try (ZipFile in = new ZipFile(inputFile); - FileOutputStream out = new FileOutputStream(outputFile)) { + try (ZipFile in = new ZipFile(inputFile.toFile()); + OutputStream out = Files.newOutputStream(outputFile)) { signer.sign(in, out); } } - private static void checkThatJarIsSigned(String jarFile, boolean multi) + private static void checkThatJarIsSigned(Path jarFile, Map expected) throws Exception { - try (JarFile jf = new JarFile(jarFile, true)) { + try (JarFile jf = new JarFile(jarFile.toFile(), true)) { Enumeration entries = jf.entries(); while (entries.hasMoreElements()) { JarEntry entry = entries.nextElement(); if (entry.isDirectory() || isSigningRelated(entry.getName())) { continue; } - InputStream is = jf.getInputStream(entry); - while (is.read() != -1); + try (InputStream is = jf.getInputStream(entry)) { + is.transferTo(OutputStream.nullOutputStream()); + } CodeSigner[] signers = entry.getCodeSigners(); - if (signers == null) { - throw new Exception("JarEntry " + entry.getName() + - " is not signed"); - } else if (multi) { - if (entry.getName().equals(TESTFILE1) && - signers.length != 2) { - throw new Exception("Unexpected number of signers " + - "for " + entry.getName() + ": " + signers.length); - } else if (entry.getName().equals(TESTFILE2) && - signers.length != 1) { - throw new Exception("Unexpected number of signers " + - "for " + entry.getName() + ": " + signers.length); - } + if (!expected.containsKey(entry.getName())) { + throw new Exception("Unexpected entry " + entry.getName()); + } + int expectedSigners = expected.get(entry.getName()); + int actualSigners = signers == null ? 0 : signers.length; + + if (expectedSigners != actualSigners) { + throw new Exception("Unexpected number of signers " + + "for " + entry.getName() + ": " + actualSigners + + ", expected " + expectedSigners); } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ActalisCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2017, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8189131 - * @summary Interoperability tests with Actalis CA - * @build ValidatePathWithParams - * @run main/othervm/timeout=180 -Djava.security.debug=certpath ActalisCA OCSP - * @run main/othervm/timeout=180 -Djava.security.debug=certpath ActalisCA CRL - */ - - /* - * Obtain test artifacts for Actalis CA from: - * - * Test website with *active* TLS Server certificate: - * https://ssltest-active.actalis.it/ - * - * Test website with *revoked* TLS Server certificate: - * https://ssltest-revoked.actalis.it/ - * - * Test website with *expired* TLS Server certificate: - * https://ssltest-expired.actalis.it/ - */ -public class ActalisCA { - - // Owner: CN=Actalis Organization Validated Server CA G3, O=Actalis S.p.A., - // L=Ponte San Pietro, ST=Bergamo, C=IT - // Issuer: CN=Actalis Authentication Root CA, O=Actalis S.p.A ./03358520967, - // L=Milan, C=IT - // Serial number: 5c3b3f37adfc28fe0fcfd3abf83f8551 - // Valid from: Mon Jul 06 00:20:55 PDT 2020 until: Sun Sep 22 04:22:02 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIHdTCCBV2gAwIBAgIQXDs/N638KP4Pz9Or+D+FUTANBgkqhkiG9w0BAQsFADBr\n" + - "MQswCQYDVQQGEwJJVDEOMAwGA1UEBwwFTWlsYW4xIzAhBgNVBAoMGkFjdGFsaXMg\n" + - "Uy5wLkEuLzAzMzU4NTIwOTY3MScwJQYDVQQDDB5BY3RhbGlzIEF1dGhlbnRpY2F0\n" + - "aW9uIFJvb3QgQ0EwHhcNMjAwNzA2MDcyMDU1WhcNMzAwOTIyMTEyMjAyWjCBiTEL\n" + - "MAkGA1UEBhMCSVQxEDAOBgNVBAgMB0JlcmdhbW8xGTAXBgNVBAcMEFBvbnRlIFNh\n" + - "biBQaWV0cm8xFzAVBgNVBAoMDkFjdGFsaXMgUy5wLkEuMTQwMgYDVQQDDCtBY3Rh\n" + - "bGlzIE9yZ2FuaXphdGlvbiBWYWxpZGF0ZWQgU2VydmVyIENBIEczMIICIjANBgkq\n" + - "hkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAs73Ch+t2owm3ayTkyqy0OPuCTiybxTyS\n" + - "4cU4y0t2RGSwCNjLh/rcutO0yoriZxVtPrNMcIRQ544BQhHFt/ypW7e+t8wWKrHa\n" + - "r3BkKwSUbqNwpDWP1bXs7IJTVhHXWGAm7Ak1FhrrBmtXk8QtdzTzDDuxfFBK7sCL\n" + - "N0Jdqoqb1V1z3wsWqAvr4KlSCFW05Nh4baWm/kXOmb8U+XR6kUmuoVvia3iBhotR\n" + - "TzAHTO9SWWkgj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cnkwPaA7oDmGN2h0dHA6Ly9jcmwwNS5hY3Rh\n" + - "bGlzLml0L1JlcG9zaXRvcnkvQVVUSC1ST09UL2dldExhc3RDUkwwHQYDVR0OBBYE\n" + - "FJ+KsbXxsd6C9Cd8vojN3qlDgaNLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0B\n" + - "AQsFAAOCAgEAJbygMnKJ5M6byr5Ectq05ODqwNMtky8TEF3O55g6RHhxblf6OegZ\n" + - "4ui4+ElHNOIXjycbeuUGuFA4LScCC9fnI1Rnn8TI2Q7OP5YWifEfnrdp99t/tJzQ\n" + - "hfdi7ZTdRRZZGV9x+grfR/RtjT2C3Lt9X4lcbuSxTea3PHAwwi0A3bYRR1L5ciPm\n" + - "eAnYtG9kpat8/RuC22oxiZZ5FdjU6wrRWkASRLiIwNcFIYfvpUbMWElaCUhqaB2y\n" + - "YvWF8o02pnaYb4bvTCg4cVabVnojUuuXH81LeQhhsSXLwcdwSdew0NL4zCiNCn2Q\n" + - "iDZpz2biCWDggibmWxsUUF6AbqMHnwsdS8vsKXiFQJHeAdNAhA+kwpqYAdhUiCdj\n" + - "RTUdtRNUucLvZEN1OAvVYyog9xYCfhtkqgXQROMANP+Z/+yaZahaP/Vgak/V00se\n" + - "Hdh7F+B6h5HVdwdh+17E2jl+aMTfyvBFcg2H/9Qjyl4TY8NW/6v0DPK52sVt8a35\n" + - "I+7xLGLPohAl4z6pEf2OxgjMNfXXCXS33smRgz1dLQFo8UpAb3rf84zkXaqEI6Qi\n" + - "2P+5pibVFQigRbn4RcE+K2a/nm2M/o+WZTSio+E+YXacnNk71VcO82biOof+jBKT\n" + - "iC3Xi7rAlypmme+QFBw9F1J89ig3smV/HaN8tO0lfTpvm7Zvzd5TkMs=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=ssltest-active.actalis.it, O=Actalis S.p.A., L=Ponte San Pietro, - // ST=Bergamo, C=IT - // Issuer: CN=Actalis Organization Validated Server CA G3, O=Actalis S.p A., - // L=Ponte San Pietro, ST=Bergamo, C=IT - // Serial number: 4a49e2afcd448af3b7f5f14e1cd5954 - // Valid from: Tue Mar 08 08:00:57 PST 2022 until: Wed Mar 08 08:00:57 PST 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIH0jCCBbqgAwIBAgIQBKSeKvzUSK87f18U4c1ZVDANBgkqhkiG9w0BAQsFADCB\n" + - "iTELMAkGA1UEBhMCSVQxEDAOBgNVBAgMB0JlcmdhbW8xGTAXBgNVBAcMEFBvbnRl\n" + - "IFNhbiBQaWV0cm8xFzAVBgNVBAoMDkFjdGFsaXMgUy5wLkEuMTQwMgYDVQQDDCtB\n" + - "Y3RhbGlzIE9yZ2FuaXphdGlvbiBWYWxpZGF0ZWQgU2VydmVyIENBIEczMB4XDTIy\n" + - "MDMwODE2MDA1N1oXDTIzMDMwODE2MDA1N1owdzELMAkGA1UEBhMCSVQxEDAOBgNV\n" + - "BAgMB0JlcmdhbW8xGTAXBgNVBAcMEFBvbnRlIFNhbiBQaWV0cm8xFzAVBgNVBAoM\n" + - "DkFjdGFsaXMgUy5wLkEuMSIwIAYDVQQDDBlzc2x0ZXN0LWFjdGl2ZS5hY3RhbGlz\n" + - "Lml0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsJnlOatNNth7gfqZ\n" + - "WN8HMfp9qlkDf/YW8ReNXyTtqFEy2xZrVVmAV2XIqL1lJDYJz86mdVsz3AqIMTzo\n" + - "GxPlmn/oEnF0YeRYQ1coKRdwP7hWSwqyMMhh+C7r5zMA9gQQVXV5wWR5U+bgvt23\n" + - "Y/55DOqk3Fp5Odt6Lyu6xA45MwHrj2Gr/nMKe8L7f8UYPWT98MJa1+TXB24yllOw\n" + - "rZE8gZByLBCVzDkVwRwTgu+HgY6zm5sJTvBT4tyJy4QD8u2xLWoZ5sXodrU0Z3Nf\n" + - "xU9keMFp6CIh1t+akqFgpW81b/HWkfUO0+L6PH4hgaSPtiwp2dVFsF9v5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9KR7apAB2AG9Tdqwx8DEZ2JkApFEV/3cVHBHZAsEAKQaNsgiaN9kTAAAB\n" + - "f2pMUYEAAAQDAEcwRQIgdCNjaV7nQcCiVefX28u1vtQMy+rqT4F4i9EVJ2xbqbQC\n" + - "IQCrpcYqt53tX/rSMoGnjFhDGnMhnYyc2AqzpokfhmdcVTANBgkqhkiG9w0BAQsF\n" + - "AAOCAgEAfXISBKP1dZQv1kkWZVDXiVY/fv+068DKq2e8hgBcsN6b9a2rlVfBU2iq\n" + - "W9KqFNET5GDWf1wjM71Itjau8b1A3+apcNdEGQk3eqIOymK5kVtVvAI2ahp4926x\n" + - "Kkt/sexmi1pJGA+eLfTixkCoaESh5P8U7HDW/vUFXm2AtLQih+oT5OVoYt5e9pXr\n" + - "hr8oadm/ZDJxiyDL1vcTIsl2TM4/Fpo2IWxYzUC+YshnuLiRwWI840maJmWFx/lJ\n" + - "Pzdik3P51Uef7VsCSBhTxER09/B4IrEUMDAhVgG5QNbcFSHvnmpV8JLrNuBKUROU\n" + - "xnDsWieKlb5YO6S6PjGOncOrd+k4RCIYRaekSnx52WBKkpqxMEv/rjY1Glx4Cota\n" + - "mpNiYDvZHGzrRQtY2eH17XhFatBxEEbJMA+0QPbFksHcKxAxJgMDncqag4TDq5fT\n" + - "I2NUxqiB51F5w0x+++lyLnUZ+z4BJFZ73VdtfoJ2fsuRhemOoZjHPi/V2exXpAfb\n" + - "pomha3KCrTcuFv1lj8mPx5L4ciNPxuDFgjeXEaTGjS8IvdNoJIrgdHdahMwkwS/y\n" + - "wei7FJ1Ey0maqRUpUlAY6sIQPQ/KDltTuKX/C94C5pYLI0JXCScr5xg6C+r2ckbA\n" + - "rjhpn3C/NptVyZgT8bL4XT5ITrAjwPciBj0yxYzUkrLZO1wKQSQ=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=ssltest-revoked.actalis.it, O=Actalis S.p.A., L=Ponte San Pietro, ST=Bergamo, C=IT - // Issuer: CN=Actalis Organization Validated Server CA G3, O=Actalis S.p.A., - // L=Ponte San Pietro, ST=Bergamo, C=IT - // Serial number: 320955171b78d49507508910da2c5bc4 - // Valid from: Tue Sep 27 03:40:43 PDT 2022 until: Wed Sep 27 03:40:43 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIH1TCCBb2gAwIBAgIQMglVFxt41JUHUIkQ2ixbxDANBgkqhkiG9w0BAQsFADCB\n" + - "iTELMAkGA1UEBhMCSVQxEDAOBgNVBAgMB0JlcmdhbW8xGTAXBgNVBAcMEFBvbnRl\n" + - "IFNhbiBQaWV0cm8xFzAVBgNVBAoMDkFjdGFsaXMgUy5wLkEuMTQwMgYDVQQDDCtB\n" + - "Y3RhbGlzIE9yZ2FuaXphdGlvbiBWYWxpZGF0ZWQgU2VydmVyIENBIEczMB4XDTIy\n" + - "MDkyNzEwNDA0M1oXDTIzMDkyNzEwNDA0M1oweDELMAkGA1UEBhMCSVQxEDAOBgNV\n" + - "BAgMB0JlcmdhbW8xGTAXBgNVBAcMEFBvbnRlIFNhbiBQaWV0cm8xFzAVBgNVBAoM\n" + - "DkFjdGFsaXMgUy5wLkEuMSMwIQYDVQQDDBpzc2x0ZXN0LXJldm9rZWQuYWN0YWxp\n" + - "cy5pdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKdBnbeFtw/Ejp1U\n" + - "gr86BQ5rqgGXWWXb7fsOhPb5On9RXTojg6oaeIV4GxHsMZhEDKQdcZ6JWAo2dbtp\n" + - "/7ereFEDWG/YJahLHFZ/ihXG4AmfObYEhoGbKitW75fOs/aWC7Veck/sXsw7cjLW\n" + - "GY623ybcF9DBExg3S4uLRaSkv5hXUDu/CzphUgwiEd5YNBZjcryOiS8+Y5EQ+2q+\n" + - "g+tdRG9m5G5YxeHWgQz2HDDwLDsJhWkb8/RsUurU/I+avHPhYk13K5Ysf311gww8\n" + - "bAsplfdJ2gdn8Is+EAEH4GJHqMybC95YDh1w5dY7dk/lIoNX4hYUIQimirIr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6AHPlNdQB2AG9Tdqwx8DEZ2JkApFEV/3cVHBHZAsEAKQaNsgiaN9kT\n" + - "AAABg36SGU0AAAQDAEcwRQIhAOCD/dOs4HjyC+GQaQRh4U+/mUwWyu+CnlHdebmD\n" + - "hAvFAiAvBE0rbxgm8TpZLG2TaMk3dqZj7Q6FFdLlqTsvwhKa3jANBgkqhkiG9w0B\n" + - "AQsFAAOCAgEAEnPALMVp1pySJgHhugLWAUgiD6stpDWCKfaBxPr+jf34A5wS+m5r\n" + - "2VhYyNQpOwIQB76K2RSJQrdpg7Dg2L6EiUnbbClSTrOkZ4XX5ggBIjldDEx4ZxhI\n" + - "zwSw4KB6+DDAVMwsCL0q0E7AAPOMaZ0RDLteusqQYIYm08TXfJPWD8LjQPt/8Uie\n" + - "LOqm1eLUuwJc+eHFWV+Xr8Uea6SFwqNEj7qPHb2MElctET/MhSIIUKI1ObmrFwyB\n" + - "ElKEPaUh9L0HXpnuD8IWc7tw2mdvnWJhuGG8G6JkasTGvtZ4gKIDBdTrJcuj7MCS\n" + - "amz3ZBCY47tP1ohgImjqwg4ITYjX6UQXgj/nBVDdu+nXkEhx16uPJkTYWaun9Nio\n" + - "8RjYIOxXmDD39QbGUElP0Epsr2wcVT9tIFYMGzUpIO51mCk3Aq1AmiQZwZZhqOIN\n" + - "RDx7lGESPj3IgdVfJi9Ing/OUNtS46Ug9DSuDcGqdY7KnTYEUdWGsUJNtnpjd4lS\n" + - "U6oIAeW1aKuOve6iNg1vsFAN57aJNh1ih3BOup58J9ve42bNlAYWN8wiNxM+Aeba\n" + - "ArUSTnH/QEYCyMRD0XqIREVR9VhNODgSZbL3XedYBAW9wImi1whp+u+8aReXd7lC\n" + - "Q3kD9KRyfZ9Kk05Glf3DsZMWvp1N2ZZWaU2Ms5U3ijUheCiBrqrs8a8=\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Sep 27 03:52:40 PDT 2022", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/AmazonCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,613 +0,0 @@ -/* - * Copyright (c) 2019, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8233223 - * @summary Interoperability tests with Amazon's CA1, CA2, CA3, and CA4 - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath AmazonCA OCSP - * @run main/othervm -Djava.security.debug=certpath AmazonCA CRL - */ - -/* - * Obtain TLS test artifacts for Amazon CAs from: - * - * Amazon Root CA 1 - * Valid - https://good.sca1a.amazontrust.com/ - * Revoked - https://revoked.sca1a.amazontrust.com/ - * Amazon Root CA 2 - * Valid - https://good.sca2a.amazontrust.com/ - * Revoked - https://revoked.sca2a.amazontrust.com/ - * Amazon Root CA 3 - * Valid - https://good.sca3a.amazontrust.com/ - * Revoked - https://revoked.sca3a.amazontrust.com/ - * Amazon Root CA 4 - * Valid - https://good.sca4a.amazontrust.com/ - * Revoked - https://revoked.sca4a.amazontrust.com/ - */ -public class AmazonCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new AmazonCA_1().runTest(pathValidator); - new AmazonCA_2().runTest(pathValidator); - new AmazonCA_3().runTest(pathValidator); - new AmazonCA_4().runTest(pathValidator); - } -} - -class AmazonCA_1 { - - // Owner: CN=Amazon RSA 2048 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US - // Serial number: 773124a4bcbd44ec7b53beaf194842d3a0fa1 - // Valid from: Tue Aug 23 15:25:30 PDT 2022 until: Fri Aug 23 15:25:30 PDT 2030 - private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEXjCCA0agAwIBAgITB3MSSkvL1E7HtTvq8ZSELToPoTANBgkqhkiG9w0BAQsF\n" + - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAxMB4XDTIyMDgyMzIyMjUzMFoXDTMwMDgyMzIyMjUzMFowPDEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + - "QSAyMDQ4IE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beodizeBB8nXmeyD33Ep7VATj4ozcd31YFV\n" + - "fgRhvTSxNrrTlNpWkUk0m3BMPv8sg381HhA6uEYokE5q9uws/3YkKqRiEz3TsaWm\n" + - "JqIRZhMbgAfp7O7FUwFIb7UIspogZSKxPIWJpxiPo3TcBambbVtQOcNRWz5qCQdD\n" + - "slI2yayq0n2TXoHyNCLEH8rpsJRVILFsg0jc7BaFrMnF462+ajSehgj12IidNeRN\n" + - "4zl+EoNaWdpnWndvSpAEkq2P\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=Amazon RSA 2048 M01, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 1, O=Amazon, C=US - // Serial number: 77312380b9d6688a33b1ed9bf9ccda68e0e0f - // Valid from: Tue Aug 23 15:21:28 PDT 2022 until: Fri Aug 23 15:21:28 PDT 2030 - private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEXjCCA0agAwIBAgITB3MSOAudZoijOx7Zv5zNpo4ODzANBgkqhkiG9w0BAQsF\n" + - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAxMB4XDTIyMDgyMzIyMjEyOFoXDTMwMDgyMzIyMjEyOFowPDEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + - "QSAyMDQ4IE0wMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOtxLKnL\n" + - "H4gokjIwr4pXD3i3NyWVVYesZ1yX0yLI2qIUZ2t88Gfa4gMqs1YSXca1R/lnCKeT\n" + - "epWSGA+0+fkQNpp/L4C2T7oTTsddUx7g3ZYzByDTlrwS5HRQQqEFE3O1T5tEJP4t\n" + - "f+28IoXsNiEzl3UGzicYgtzj2cWCB41eJgEmJmcf2T8TzzK6a614ZPyq/w4CPAff\n" + - "nAV4coz96nW3AyiE2uhuB4zQUIXvgVSycW7sbWLvj5TDXunEpNCRwC4kkZjK7rol\n" + - "jtT2cbb7W2s4Bkg3R42G3PLqBvt2N32e/0JOTViCk8/iccJ4sXqrS1uUN4iB5Nmv\n" + - "JK74csVl+0u0UecCAwEAAaOCAVowggFWMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD\n" + - "VR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAdBgNV\n" + - "HQ4EFgQUgbgOY4qJEhjl+js7UJWf5uWQE4UwHwYDVR0jBBgwFoAUhBjMhTTsvAyU\n" + - "lC4IWZzHshBOCggwewYIKwYBBQUHAQEEbzBtMC8GCCsGAQUFBzABhiNodHRwOi8v\n" + - "b2NzcC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbTA6BggrBgEFBQcwAoYuaHR0cDov\n" + - "L2NydC5yb290Y2ExLmFtYXpvbnRydXN0LmNvbS9yb290Y2ExLmNlcjA/BgNVHR8E\n" + - "ODA2MDSgMqAwhi5odHRwOi8vY3JsLnJvb3RjYTEuYW1hem9udHJ1c3QuY29tL3Jv\n" + - "b3RjYTEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMA0GCSqGSIb3DQEBCwUAA4IB\n" + - "AQCtAN4CBSMuBjJitGuxlBbkEUDeK/pZwTXv4KqPK0G50fOHOQAd8j21p0cMBgbG\n" + - "kfMHVwLU7b0XwZCav0h1ogdPMN1KakK1DT0VwA/+hFvGPJnMV1Kx2G4S1ZaSk0uU\n" + - "5QfoiYIIano01J5k4T2HapKQmmOhS/iPtuo00wW+IMLeBuKMn3OLn005hcrOGTad\n" + - "hcmeyfhQP7Z+iKHvyoQGi1C0ClymHETx/chhQGDyYSWqB/THwnN15AwLQo0E5V9E\n" + - "SJlbe4mBlqeInUsNYugExNf+tOiybcrswBy8OFsd34XOW3rjSUtsuafd9AWySa3h\n" + - "xRRrwszrzX/WWGm6wyB+f7C4\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca1.demo.amazontrust.com - // Issuer: CN=Amazon RSA 2048 M02, O=Amazon, C=US - // Serial number: 60c6e837b2e7586d8464eb34f4a85fe - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIGKDCCBRCgAwIBAgIQBgxug3sudYbYRk6zT0qF/jANBgkqhkiG9w0BAQsFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDIwNDggTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLTEr\n" + - "MCkGA1UEAxMidmFsaWQucm9vdGNhMS5kZW1vLmFtYXpvbnRydXN0LmNvbTCCASIw\n" + - "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3hA+omhUcO8nYO8/+dkpbYz8WI\n" + - "1ms7Y7JA2pPFfp2N/aWcf6m5ORm1BkyGLOttjTu318Qpa9eahQ1Pi3RNe3BtqjD9\n" + - "jcHncpwAFMsXy1beZA7sZ7AA4vKltA3t6yrU5ruTLUGQwUndeIBBSTW5QpdT9I/p\n" + - "EM7d+Miwre63kofbJ1lVPAJvN/udMVqGWNF8V5qscklUUHoSKA3FWWsiCyIgnthg\n" + - "G3u6R1KH66Qionp0ho/ttvrBCI0C/bdrdH+wybFv8oFFvAW2U9xn2Azt47/2kHHm\n" + - "tTRjrgufhDbcz/MLR6hwBXAJuwVvJZmSqe7B4IILFexu6wjxZfyqVm2FMr8CAwEA\n" + - "AaOCAzMwggMvMB8GA1UdIwQYMBaAFMAxUs1aUMOCfHRxzsvpnPl664LiMB0GA1Ud\n" + - "DgQWBBSkrnsTnjwYhDRAeLy/9FXm/7hApDBlBgNVHREEXjBcgiJ2YWxpZC5yb290\n" + - "Y2ExLmRlbW8uYW1hem9udHJ1c3QuY29tghpnb29kLnNjYTBhLmFtYX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oeKSXJXdoIpqSr10bzMPX9SHvemgOUtzP3JNqWPHw1uW9YFyeDE6yWj/B13\n" + - "Xj1hv1cqYIwyaOZBerU/9PT5PaCn20AC9DHbc7iBv+zs+DYiqlAFJ1GVaprwLul4\n" + - "8wp3gnC3Hjb8NykydCo6vw0AJ2UzjpjiTyVZ93jITzLOiboOUa1gQGnojzWlYaet\n" + - "sXe+RDylBp/Wuj1ZS7v/etltzYm5GanPi4y/p7Ta3Uky6std/GM6XbPRdBEFboFR\n" + - "B2IP0divd9c74Q+tLgpsAz5yXm9LtYPMcEPC2YRN2PgBg67c5+A7eIOluuw=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca1.demo.amazontrust.com - // Issuer: CN=Amazon RSA 2048 M01, O=Amazon, C=US - // Serial number: e1023665b1268d788cc25bf69a9d05e - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGMjCCBRqgAwIBAgIQDhAjZlsSaNeIzCW/aanQXjANBgkqhkiG9w0BAQsFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDIwNDggTTAxMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLzEt\n" + - "MCsGA1UEAxMkcmV2b2tlZC5yb290Y2ExLmRlbW8uYW1hem9udHJ1c3QuY29tMIIB\n" + - "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxSPd1PWACxZohFCAJT1JWuXK\n" + - "GY29wZZ9yY0zoiq6+qYiUIU0crktytUNNI1ZpW/3qXpEw2ZQkM6WF1LshXtwGwrA\n" + - "zJwSeX1L9T5rOKhoBvoFeqfX7xu4VBM1/fDGt5X+NRFfD9Op9UfK5OsnL05TYach\n" + - "rdnfOA5wKGvMgFiN5CeOD0AtumXSuAnTZC85ojJTHjPF+hqV893WvrrUxLyyxtvh\n" + - "lq/WttFOjhfQu2IkfyDAFiH939uzUi0WSTAdsbsHuko5mDTDnOfMRbaaWZu0At01\n" + - "EgaIPeK+kGdi7EYwVndIwTKLeQ4mjIM8aj8Heg/y2hZ0kOmfCUZdUmJFlNoCIQID\n" + - "AQABo4IDOzCCAzcwHwYDVR0jBBgwFoAUgbgOY4qJEhjl+js7UJWf5uWQE4UwHQYD\n" + - "VR0OBBYEFMeBhIOkuWUY4DYqFrfgbD2eUeFtMG0GA1UdEQRmMGSCJHJldm9rZWQu\n" + - "cm9vdGNhMS5kZW1vLmFtYXpvbnRydXN0LmNvbYIdcmV2b2tlZC5zY2EwYS5hbWF6\n" + - "b250cnVzdC5jb22CHXJldm9rZWQuc2NhMWEuYW1hem9udHJ1c3QuY29tMA4GA1Ud\n" + - "DwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOwYDVR0f\n" + - "BDQwMjAwoC6gLIYqaHR0cDovL2NybC5yMm0wMS5hbWF6b250cnVzdC5jb20vcjJt\n" + - "MDEuY3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkwZzAtBggr\n" + - "BgEFBQcwAYYhaHR0cDovL29jc3AucjJtMDEuYW1hem9udHJ1c3QuY29tMDYGCCsG\n" + - "AQUFBzAChipodHRwOi8vY3J0LnIybTAxLmFtYXpvbnRydXN0LmNvbS9yMm0wMS5j\n" + - "ZXIwDAYDVR0TAQH/BAIwADCCAX4GCisGAQQB1nkCBAIEggFuBIIBagFoAHYA7s3Q\n" + - "ZNXbGs7FXLedtM0TojKHRny87N7DUUhZRnEftZsAAAGIB72TggAABAMARzBFAiAZ\n" + - "naLbRHRuaRrE304GSuWX/79MU/e+SSlr0cNJ0kNNaAIhAPnz9HayL4txhkTEZiMs\n" + - "nttNnNqD17I0J17JLVOF4i/4AHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/\n" + - "qznYhHMAAAGIB72TmwAABAMARzBFAiEAgEqT7CYGQ/u36/3YcxBH78QfknI9kgcY\n" + - "sgJLkurUF6cCIFZZ/b803+ek6o+bmdV/uVx2UlskAyyolZ2okBAb6IscAHYA2ra/\n" + - "az+1tiKfm8K7XGvocJFxbLtRhIU0vaQ9MEjX+6sAAAGIB72TbQAABAMARzBFAiEA\n" + - "6z2RSoK263hvYF71rj1d0TpC70/6zagSRR4glHOT6IACICYvaMAnrCNSTSiZ20Wz\n" + - "Ju5roTippO3BWKhQYrTKZuu4MA0GCSqGSIb3DQEBCwUAA4IBAQB4S1JGulFpMIaP\n" + - "NtLUJmjWz8eexQdWLDVF+H8dd6xpZgpiYtig/Ynphzuk1IIF8DkT3CeK/9vrezgI\n" + - "igNjneN9B4eIuzi/rJzIKeUwpZ2k5D+36Ab4esseoc+TopmNerw8hidt2g818jER\n" + - "D71ppSMakeQFPGe/Hs2/cVa/G1DNVcU2XAut45yRZ/+xsZ0/mcBDVsG9P5uGCN5O\n" + - "7SAp4J959WnKDqgVuU9WowPE5IjmS9BAv2gjniFYdDV2yksyf7+8edHd1KfSVX06\n" + - "pLx6CuCVZGJFG4Q2Aa1YAh1Wvt9hqWeXXpNRO2/wChL5rhT4GajsrGepsk4bjxYX\n" + - "Wf2iZ8mX\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT_VALID}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:36:57 PDT 2023", System.out); - } -} - -class AmazonCA_2 { - - // Owner: CN=Amazon RSA 4096 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 2, O=Amazon, C=US - // Serial number: 773125b0c34c3c940299a9f04a39e5a52ccd9 - // Valid from: Tue Aug 23 15:29:13 PDT 2022 until: Fri Aug 23 15:29:13 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGXjCCBEagAwIBAgITB3MSWww0w8lAKZqfBKOeWlLM2TANBgkqhkiG9w0BAQwF\n" + - "ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" + - "b24gUm9vdCBDQSAyMB4XDTIyMDgyMzIyMjkxM1oXDTMwMDgyMzIyMjkxM1owPDEL\n" + - "MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEcMBoGA1UEAxMTQW1hem9uIFJT\n" + - "QSA0MDk2IE0wMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMGMl/pZ\n" + - "1OsxHY9gw/YfdON4mmrANkPwi7z2djHA5ELt/vRI3Su0le6OoipLf03iyoCnYy4Y\n" + - "rpfTbhyDriE8NJpps2ODJ5W1h0rz6FM1Q5Jt35wfk+4CEfATBTegHVlUJ0rJgzK5\n" + - "Yl/jrk12ZsC4ZeRn54shszcK6bHj4LZIHXhrYIIfetBMMD8V7hlhd54AclEWutUV\n" + - "eBEjkSCzDSk+pQKIjCL0crqvRSPvUNry/BV65zfGmceSYxpcLmV7k7Spwpo+1z8w\n" + - "+Odfnx2vsm7olPldfaThqk6fXBtInORl4Ef32xF3VDT13UeXtQPolFhnp8UOci64\n" + - "bW+R8tbtGpUXIA8Dhr8SgYPH6NW4jhUD4+AG8yer8ctA1Hl9tq+6tYr26q3yuCLu\n" + - "5rwJdfMG634fWIRXSj+GJi8SfAdGtPyXwu5799NWesV4vUkrkSXdIBK4TQCuK+jx\n" + - "aJ5Y+Zo2l3GFsWyMPNORLjoQXbjF6KAyjTyICLq9VzoQKhyx4Ll2CNrQv8CxqtDC\n" + - "GvXi9kREJYAF6lscOB0xglAAF5lndcaNkVHEVOMdg9ZZtdJywHWm8Qed1Wty2qr+\n" + - "hmA7booWQNRE12nW1niC5D4cP2ykPK9HSgb7xWdUF32VidUc9tNKM6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vQBmod/ipmOpND95/BeA2mllBZgZ53S0nvDXDzbzR9Fd81PAz9Qruo\n" + - "dOJKcD6plKQjZjkLzNh1v/RoCFO8kiJGE4UBMTM8FUk0DXH4bALII4wwmDelrSUu\n" + - "lKvDTDxZvPF4dbEXICNPd51EMGPgETxwboOV+bzWFVI0IWQ8PhZ2VuMPDk2taOMp\n" + - "NsuLtlYc2twPb9r/Hvgv7G6+ItpBHZwOVt1oI3pHbjMp7P3pOZSPr6G1WkNy9mX8\n" + - "rVc=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca2.demo.amazontrust.com - // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US - // Serial number: 662f7646d76193cbb76946d111e49fa - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIICzCCBfOgAwIBAgIQBmL3ZG12GTy7dpRtER5J+jANBgkqhkiG9w0BAQwFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDQwOTYgTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLTEr\n" + - "MCkGA1UEAxMidmFsaWQucm9vdGNhMi5kZW1vLmFtYXpvbnRydXN0LmNvbTCCAiIw\n" + - "DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAON5EbEKoBiujI7Ja8mLZLJbaY7f\n" + - "RtoWIjU/F0l9ueWFogXmEaA1jWsl97F3WTHTyGKz6ChCjPMSyoXXpY+yoE90QUyX\n" + - "w35uWEhNrc40drMJkyN+QXitSrH346GCOKvpYVvu18UD4W8hDhg8vvbOQYhtmSf7\n" + - "Rfrs7/qUdXpzpvR9VjWktbQAzJT8fB/jFNjNQJTknynjGiYO5GF51+peOCLK6qw8\n" + - "9kKYEigR4K8/aWL283rC4xRxZqVioy433VG02l/Fwdv8o/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bHunkroS97VkoK/9j9pNJki+qAH9XTLYWcm/5+cTSGRsN+escRgZwV6KWg/\n" + - "JQQe5LbwU2HHzNqWuk63GC/ngVlWXjaVFfbNVmYEKZFFazcZchesN1YyDu+WndOx\n" + - "+rTcuke2feOvQ4EnVviM0k85JZNiqPDH2iafAWyqZFUYTnb7XK3HhJflAniv/SLq\n" + - "DQfbJmtQtNHdJYgVmC1u2RT9gbJDIAj0ZI4vU2WVB5Hmd9F31un6jundEuG4+S4=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca2.demo.amazontrust.com - // Issuer: CN=Amazon RSA 4096 M02, O=Amazon, C=US - // Serial number: 788baa8f47bc5b1c624424216240fd3 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIEjCCBfqgAwIBAgIQB4i6qPR7xbHGJEJCFiQP0zANBgkqhkiG9w0BAQwFADA8\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRwwGgYDVQQDExNBbWF6b24g\n" + - "UlNBIDQwOTYgTTAyMB4XDTIzMDUxMDAwMDAwMFoXDTI0MDYwNzIzNTk1OVowLzEt\n" + - "MCsGA1UEAxMkcmV2b2tlZC5yb290Y2EyLmRlbW8uYW1hem9udHJ1c3QuY29tMIIC\n" + - "IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAzJfddWdrWhA9dSJdmy23veN9\n" + - "oLvSqpM4YaXGZmPtKUmbFMLs2I3vCKrzflRKeOpl3MCc2hh6TH/3z+Q/fGugXLsY\n" + - "H8QcjSbiIOd15n+3dUFTLKaoWMyseMcWiOIVaN5rCDVXiAHdt1pc147wyFQIzqNK\n" + - "J/xiV1u9eT2MFue+4bd7kUNAcmI8M+SXruhto4jtAV8ugpTEChTDlyO/l8xmaM1Q\n" + - "HkijsHX7Aq72Q/3PH/U+wbJ9pmpTp4x2AEJoo45I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" + - "ADCCAX0GCisGAQQB1nkCBAIEggFtBIIBaQFnAHYA7s3QZNXbGs7FXLedtM0TojKH\n" + - "Rny87N7DUUhZRnEftZsAAAGIB72CzgAABAMARzBFAiEA2vPYIPfGJeynPaZHq/c0\n" + - "GGvyT6MpvFGMW0s0woLRT28CIEFbZbFSCnKugaqw9QDNi7vYmIF3Gyi3s6G2cCxY\n" + - "4RJXAHYASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/qznYhHMAAAGIB72DDgAA\n" + - "BAMARzBFAiAvfNcgtFEwk5C9dvMUYANbIAv0IOdF1new8Umn3cM+JwIhALbs/3L9\n" + - "0ndF7sRKDZmfronNruptFlrI528P5Qi2P528AHUA2ra/az+1tiKfm8K7XGvocJFx\n" + - "bLtRhIU0vaQ9MEjX+6sAAAGIB72CxQAABAMARjBEAiBKUns2FPbs0cThb6e7SnyL\n" + - "y4/qP3V1Q/ASt/ZDRTeEQQIgWSQO4Gsz32srtqYuTM9AsFd92WA44kJHincdcGVX\n" + - "XbIwDQYJKoZIhvcNAQEMBQADggIBAAnaNbn2wXylTCS7dtgB3rWdUf6hja1UDuvB\n" + - "uZEL2dUOvyXfVFLNxKdeWBPzqpwEBNNwPQXhoI97TXlyu2x60jLzQamoGoRQ3s0P\n" + - "NLhasLGEIQH/oYdMV/yp8EI8fUuRVE3xyw39FRqOrmsUFAnxNQmBO/09JM7sLcvS\n" + - "wwh14p9dFTTolJHgnL4ZEtmZxSddFG+GBSTJ/A7dVSmwIudwzd+goA6173BI6yeT\n" + - "hhQumLctQiOM7y1MzFeV8rL+oIpd2xuzyhKKT1EgvU6/wyt0Ib8QqsFsrXPnUOKk\n" + - "HAq3SeZyq35QUaTKoaH9L1iZMbSCG9Jm6FMb12SdAz53653tYvAiUS76oD8Jot13\n" + - "RZu5NUlWAVLLq0OaEtuGp0bh+cVtzVnCC9m1qa46YpY0SojpvSbakgQMMGIgDlT3\n" + - "wFE7tST4WlsDC1f/m+H9V5qz/j0U8D3eNNdowxPqx/JZq/sk9ZK5KyMFARrvM+fh\n" + - "YrVYjKt91mu7JaS4pPOyZmJ8OQ14EvrN7BXc7IkNrI1reeaRFe49k5DAETB8VmP5\n" + - "2F0SWou2KkgtJvU4Z7YjlZ2HNHnpjTK5KdPNpRSt7EUy2zn9NCNoyQhnws70FyXv\n" + - "oPFyG92lnUQOKaAUhVRwTr9fvnkdMOzSKg/spxi2Ogdzym5Jw68eguwi0dVqX2+9\n" + - "3zViP2aH\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:38:54 PDT 2023", System.out); - } -} - -class AmazonCA_3 { - - // Owner: CN=Amazon ECDSA 256 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US - // Serial number: 773126de2c2fafd2c47ad88b1566e0182046d - // Valid from: Tue Aug 23 15:33:24 PDT 2022 until: Fri Aug 23 15:33:24 PDT 2030 - private static final String INT_VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIC1DCCAnmgAwIBAgITB3MSbeLC+v0sR62IsVZuAYIEbTAKBggqhkjOPQQDAjA5\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSAzMB4XDTIyMDgyMzIyMzMyNFoXDTMwMDgyMzIyMzMyNFowPTELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + - "IDI1NiBNMDIwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS9vQLD4W/Kg4AnFRl8\n" + - "x/FUbLqtd5ICYjUijGsytF9hmgb/Dyk+Ebt4cw6rAlGbaiOLapSJKZiZr+UQdh3I\n" + - "QOr+o4IBWjCCAVYwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYw\n" + - "HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBS7eJrXaDMy\n" + - "nRq7bP2xNEwB3svQdTAfBgNVHSMEGDAWgBSrttvXBp43rDCGB5Fwx5zEGbF4wDB7\n" + - "BggrBgEFBQcBAQRvMG0wLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tMDoGCCsGAQUFBzAChi5odHRwOi8vY3J0LnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tL3Jvb3RjYTMuY2VyMD8GA1UdHwQ4MDYwNKAyoDCGLmh0\n" + - "dHA6Ly9jcmwucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNhMy5jcmwwEwYD\n" + - "VR0gBAwwCjAIBgZngQwBAgEwCgYIKoZIzj0EAwIDSQAwRgIhAKSYEcDcp3kcPMzh\n" + - "OIYDWZOLu4InPod4fQhRTmc2zBAgAiEAmwdGE4AuNWhw9N8REhf82rJLNm7h9Myg\n" + - "TsR9Wu0bQYU=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=Amazon ECDSA 256 M01, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 3, O=Amazon, C=US - // Serial number: 773126684d577c0fcf8d3a342bea86f94fc8f - // Valid from: Tue Aug 23 15:31:46 PDT 2022 until: Fri Aug 23 15:31:46 PDT 2030 - private static final String INT_REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIC0zCCAnmgAwIBAgITB3MSZoTVd8D8+NOjQr6ob5T8jzAKBggqhkjOPQQDAjA5\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSAzMB4XDTIyMDgyMzIyMzE0NloXDTMwMDgyMzIyMzE0NlowPTELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + - "IDI1NiBNMDEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAT80w+2RwNHzyXmVUM/\n" + - "OUKBZpJkTzHyCKDl4sBrUfjzVjot/lNba9kYzMKSHYv95CUDoMaF2h2KAqx65uLQ\n" + - "Y8ago4IBWjCCAVYwEgYDVR0TAQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYw\n" + - "HQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB0GA1UdDgQWBBRPWfy8BhYo\n" + - "v6LI2wj7zxMkumlCXDAfBgNVHSMEGDAWgBSrttvXBp43rDCGB5Fwx5zEGbF4wDB7\n" + - "BggrBgEFBQcBAQRvMG0wLwYIKwYBBQUHMAGGI2h0dHA6Ly9vY3NwLnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tMDoGCCsGAQUFBzAChi5odHRwOi8vY3J0LnJvb3RjYTMu\n" + - "YW1hem9udHJ1c3QuY29tL3Jvb3RjYTMuY2VyMD8GA1UdHwQ4MDYwNKAyoDCGLmh0\n" + - "dHA6Ly9jcmwucm9vdGNhMy5hbWF6b250cnVzdC5jb20vcm9vdGNhMy5jcmwwEwYD\n" + - "VR0gBAwwCjAIBgZngQwBAgEwCgYIKoZIzj0EAwIDSAAwRQIhALRfxq3SQIhj5xA4\n" + - "S5UAY/KlKqayZDpnbBdCDH8Kqmf/AiAUVZddALefnqRe+ifxN2FUp461LL6/cgVM\n" + - "EH3Ty27f1Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca3.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 256 M02, O=Amazon, C=US - // Serial number: 8e2f14864fb28e4a1da0f15a5118cc8 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEfjCCBCWgAwIBAgIQCOLxSGT7KOSh2g8VpRGMyDAKBggqhkjOPQQDAjA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMjU2IE0wMjAeFw0yMzA1MTAwMDAwMDBaFw0yNDA2MDcyMzU5NTlaMC0xKzAp\n" + - "BgNVBAMTInZhbGlkLnJvb3RjYTMuZGVtby5hbWF6b250cnVzdC5jb20wWTATBgcq\n" + - "hkjOPQIBBggqhkjOPQMBBwNCAAQfWc7gBGBBBmseCb2XWWRQVhCUQDVml3mVgvj5\n" + - "RmnP1y5wpifUTFqu8ELdI7YGZ4JMSnetiKNmLtg5yhTEjzCQo4IDFTCCAxEwHwYD\n" + - "VR0jBBgwFoAUu3ia12gzMp0au2z9sTRMAd7L0HUwHQYDVR0OBBYEFHCE8orvZDUK\n" + - "5TI9MYadzxWR9CZGMEkGA1UdEQRCMECCInZhbGlkLnJvb3RjYTMuZGVtby5hbWF6\n" + - "b250cnVzdC5jb22CGmdvb2Quc2NhM2EuYW1hem9udHJ1c3QuY29tMA4GA1UdDwEB\n" + - "/wQEAwIHgDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwOwYDVR0fBDQw\n" + - "MjAwoC6gLIYqaHR0cDovL2NybC5lMm0wMi5hbWF6b250cnVzdC5jb20vZTJtMDIu\n" + - "Y3JsMBMGA1UdIAQMMAowCAYGZ4EMAQIBMHUGCCsGAQUFBwEBBGkwZzAtBggrBgEF\n" + - "BQcwAYYhaHR0cDovL29jc3AuZTJtMDIuYW1hem9udHJ1c3QuY29tMDYGCCsGAQUF\n" + - "BzAChipodHRwOi8vY3J0LmUybTAyLmFtYXpvbnRydXN0LmNvbS9lMm0wMi5jZXIw\n" + - "DAYDVR0TAQH/BAIwADCCAXwGCisGAQQB1nkCBAIEggFsBIIBaAFmAHUA7s3QZNXb\n" + - "Gs7FXLedtM0TojKHRny87N7DUUhZRnEftZsAAAGIB71y/gAABAMARjBEAiAEAXIb\n" + - "aOVR26HgFaI+qoIasCb8w2sOqVxGAxf5iPgX6QIgdAlMjqeoihi1arnJpzN8Bqxy\n" + - "5ULMUO7GK3JEgcogJHMAdgBIsONr2qZHNA/lagL6nTDrHFIBy1bdLIHZu7+rOdiE\n" + - "cwAAAYgHvXLkAAAEAwBHMEUCIF7wDDmWxTHwBZM7Me8eOCM1aQ/g1c1rJg/I+NJa\n" + - "HkZYAiEA8p+IviuY5piHBELjUtVlZLiS9XSSMxpQNhUerqC/YFoAdQDatr9rP7W2\n" + - "Ip+bwrtca+hwkXFsu1GEhTS9pD0wSNf7qwAAAYgHvXKvAAAEAwBGMEQCIFLskZDs\n" + - "UG4+/88D/5/QbD9zT6ZmZlwXiPZ6H2YR/KiJAiBvi4vvNsb9KNAhJMgI2T2iCg9U\n" + - "CIru+US6y3ua7dKKDTAKBggqhkjOPQQDAgNHADBEAiAzvgzKV/kvBbKWCT1NNUBD\n" + - "AF9okIEcJx/ukFgzmYMwUQIgXeJeVf3izkxsgiEUSknwHsErLFs/cEme2PSRj2AW\n" + - "dYA=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca3.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 256 M01, O=Amazon, C=US - // Serial number: c458bfaeedae16a5e61fe64773fc898 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEhzCCBC2gAwIBAgIQDEWL+u7a4WpeYf5kdz/ImDAKBggqhkjOPQQDAjA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMjU2IE0wMTAeFw0yMzA1MTAwMDAwMDBaFw0yNDA2MDcyMzU5NTlaMC8xLT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dm7v6s52IRzAAABiAe9lQ4AAAQDAEcwRQIhAIPVMj6IfjAUKeGYbpG9s0DRdWbc\n" + - "b8OzsOf+kRqk03NMAiB777hfoFCUMPrN0g8o5v6zp3T3qOhRnYY0TZN4q4NnMgB1\n" + - "ANq2v2s/tbYin5vCu1xr6HCRcWy7UYSFNL2kPTBI1/urAAABiAe9lN4AAAQDAEYw\n" + - "RAIgL0qoVbKLFD+Y3f/V6Rw+euZrPO6d1HEVPQGo7wLzkl8CIGHp3PQmmrEofl76\n" + - "4da7bY0L+csFW0sB8clN0KziMfe6MAoGCCqGSM49BAMCA0gAMEUCIQC+6VdX9X5g\n" + - "x3NSUmJ7py01Zxf26TNBv1ildxqesvZ/7wIgIrefriRzPiIFDHCUbdjk0VlmMwZR\n" + - "VzXXHINsGCiCKOs=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT_VALID}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT_REVOKED}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:41:22 PDT 2023", System.out); - } -} - -class AmazonCA_4 { - - // Owner: CN=Amazon ECDSA 384 M02, O=Amazon, C=US - // Issuer: CN=Amazon Root CA 4, O=Amazon, C=US - // Serial number: 773127dfaa6b9e2b95538aa76dde4307f17c4 - // Valid from: Tue Aug 23 15:36:58 PDT 2022 until: Fri Aug 23 15:36:58 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDETCCApagAwIBAgITB3MSffqmueK5VTiqdt3kMH8XxDAKBggqhkjOPQQDAzA5\n" + - "MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g\n" + - "Um9vdCBDQSA0MB4XDTIyMDgyMzIyMzY1OFoXDTMwMDgyMzIyMzY1OFowPTELMAkG\n" + - "A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEdMBsGA1UEAxMUQW1hem9uIEVDRFNB\n" + - "IDM4NCBNMDIwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATNYzWQDXV0NoNmR0hJPwJq\n" + - "hjYOOS9z0B2Z7MQudxg5x3Vsib6N+tJkq8dljRq5o6K0bbh/kRVfoi9wfKhB03Yz\n" + - "gkerrwRCH7Z9gU5nbBY+Y5+EtImq4yOB0n7JQgQxWemjggFaMIIBVjASBgNVHRMB\n" + - "Af8ECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcD\n" + - "AQYIKwYBBQUHAwIwHQYDVR0OBBYEFKbZqzuHmTP/6Gj4i2GDbNCyuq+9MB8GA1Ud\n" + - "IwQYMBaAFNPsxzplbszh2naaVvuc84ZtV+WBMHsGCCsGAQUFBwEBBG8wbTAvBggr\n" + - "BgEFBQcwAYYjaHR0cDovL29jc3Aucm9vdGNhNC5hbWF6b250cnVzdC5jb20wOgYI\n" + - "KwYBBQUHMAKGLmh0dHA6Ly9jcnQucm9vdGNhNC5hbWF6b250cnVzdC5jb20vcm9v\n" + - "dGNhNC5jZXIwPwYDVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NybC5yb290Y2E0LmFt\n" + - "YXpvbnRydXN0LmNvbS9yb290Y2E0LmNybDATBgNVHSAEDDAKMAgGBmeBDAECATAK\n" + - "BggqhkjOPQQDAwNpADBmAjEA2zCG6x0xMlgSXWEGLN8+1XN+OCYF5vj0Z1jtVy+A\n" + - "pdLlzuxNt9HBWn3hvqvO2W8KAjEApNdsZOCmk5uZBYiuCSBnDH3jyKhN6dWyuuHW\n" + - "9Wj7SxKnOU5+wYWZA0BQAv1KT62i\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.rootca4.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US - // Serial number: f579bed3369f1a147ea5d0e8e6532d3 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEvjCCBESgAwIBAgIQD1eb7TNp8aFH6l0OjmUy0zAKBggqhkjOPQQDAzA9MQsw\n" + - "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMR0wGwYDVQQDExRBbWF6b24gRUNE\n" + - "U0EgMzg0IE0wMjAeFw0yMzA1MTAwMDAwMDBaFw0yNDA2MDcyMzU5NTlaMC0xKzAp\n" + - "BgNVBAMTInZhbGlkLnJvb3RjYTQuZGVtby5hbWF6b250cnVzdC5jb20wdjAQBgcq\n" + - "hkjOPQIBBgUrgQQAIgNiAAT6/95JFuvx5t9MVeRZmBtXq63Q2fXZnSwEy2U2F4Qc\n" + - "ejhDwcYfD2HmT6S6GrKqLNJMa5n2YOvet4LZpKJLFF+BQo6FJt5cXkzHHxZ1I4z3\n" + - "8pGU79CpCgFOFy6QUlF68NajggMXMIIDEzAfBgNVHSMEGDAWgBSm2as7h5kz/+ho\n" + - "+Ithg2zQsrqvvTAdBgNVHQ4EFgQUR/GnpQkrUsCj8jF6/JIE1Rs07zswSQYDVR0R\n" + - "BEIwQIIidmFsaWQucm9vdGNhNC5kZW1vLmFtYXpvbnRydXN0LmNvbYIaZ29vZC5z\n" + - "Y2E0YS5hbWF6b250cnVzdC5jb20wDgYDVR0PAQH/BAQDAgeAMB0GA1UdJQQWMBQG\n" + - "CCsGAQUFBwMBBggrBgEFBQcDAjA7BgNVHR8ENDAyMDCgLqAshipodHRwOi8vY3Js\n" + - "LmUzbTAyLmFtYXpvbnRydXN0LmNvbS9lM20wMi5jcmwwEwYDVR0gBAwwCjAIBgZn\n" + - "gQwBAgEwdQYIKwYBBQUHAQEEaTBnMC0GCCsGAQUFBzABhiFodHRwOi8vb2NzcC5l\n" + - "M20wMi5hbWF6b250cnVzdC5jb20wNgYIKwYBBQUHMAKGKmh0dHA6Ly9jcnQuZTNt\n" + - "MDIuYW1hem9udHJ1c3QuY29tL2UzbTAyLmNlcjAMBgNVHRMBAf8EAjAAMIIBfgYK\n" + - "KwYBBAHWeQIEAgSCAW4EggFqAWgAdgDuzdBk1dsazsVct520zROiModGfLzs3sNR\n" + - "SFlGcR+1mwAAAYgHvZA9AAAEAwBHMEUCIQCmzmQOzunsuAg1GpIcNx0isG6ylbhP\n" + - "y9JP4UFclL2hdwIgBtTM89mE7QJDj7h7xr2eRPio1ehgmeYH1PHXxCqHIGYAdgBI\n" + - "sONr2qZHNA/lagL6nTDrHFIBy1bdLIHZu7+rOdiEcwAAAYgHvZB1AAAEAwBHMEUC\n" + - "IF9hbi82CLU5umfRze4NpX6u4jlT+N8KSaBe6UbhqjBZAiEAi2Y6PTt2+107LxtM\n" + - "oBpHprph7hQvGfjPE+p+rfM/X+EAdgDatr9rP7W2Ip+bwrtca+hwkXFsu1GEhTS9\n" + - "pD0wSNf7qwAAAYgHvZBeAAAEAwBHMEUCIAI+m4mVE3HtZOEMC5VI7m0nEPdPPJUq\n" + - "fxUKPpeIVmk5AiEA0scVJy7g3Fv+2nTVhbcwWCwn/Gvc+0txQrc529juflcwCgYI\n" + - "KoZIzj0EAwMDaAAwZQIxAKV837BpqlNHg35EsCCtrJPoQ6RuY9UoHm1O2CdsCXGR\n" + - "Z3kAnlgIV8A/waI6wQqfsQIwdCqaC+qN60JCnX09YKRD15eQjq1rN3w+llI+lEbS\n" + - "FSMsnoHJcqMZLo9s+4Rf0zS3\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.rootca4.demo.amazontrust.com - // Issuer: CN=Amazon ECDSA 384 M02, O=Amazon, C=US - // Serial number: 4a5d392936b4decb818b7fb106ebbd8 - // Valid from: Tue May 09 17:00:00 PDT 2023 until: Fri Jun 07 16:59:59 PDT 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIExjCCBEygAwIBAgIQBKXTkpNrTey4GLf7EG672DAKBggqhkjOPQQDAzA9MQsw\n" + - "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QAAAGIB72QJQAABAMARzBFAiA74zKrlL+y5rYwSLxBL8fs\n" + - "QYRYXF0s0sGoaSEeAg1DkgIhAPu8Z0TLIFoppmyiv+A5z6S+SG+v/kOsAYmQmiUO\n" + - "5scIAHcASLDja9qmRzQP5WoC+p0w6xxSActW3SyB2bu/qznYhHMAAAGIB72QJgAA\n" + - "BAMASDBGAiEAg+x7JBT3oIaZdnfgGN1G6SAiNUL7zR/tBhbWIG9tz94CIQDGwBiV\n" + - "Tslt11+W3ZaNsS7UtUIiB45YHUc4qKm5ry2fTAB2ANq2v2s/tbYin5vCu1xr6HCR\n" + - "cWy7UYSFNL2kPTBI1/urAAABiAe9kAgAAAQDAEcwRQIgPvKfSpMJKRocGk9+GNr3\n" + - "hUj8x8WySB//0X116TNgA0gCIQDhGRqxnEZmEFGEfj5GY9vjEfm0kKwcL0lCuwBu\n" + - "NZG4dzAKBggqhkjOPQQDAwNoADBlAjEA1PLdsrko3tDs50aAeEU9Gn+0CG8QKy7R\n" + - "fQaXBTjGETDgGJk/7zGNpGelKPr/UYV9AjASwdA32S8jIADxA8HrqiMsVYDFMnbU\n" + - "jLLwR6CTLtAcWtwVmoQ2x0usvTvN8YJBPoA=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon May 15 13:42:48 PDT 2023", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/BuypassCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,330 +0,0 @@ -/* - * Copyright (c) 2017, 2021, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8189131 - * @summary Interoperability tests with Buypass Class 2 and Class 3 CA - * @build ValidatePathWithParams - * @run main/othervm/timeout=180 -Djava.security.debug=certpath BuypassCA OCSP - * @run main/othervm/timeout=180 -Djava.security.debug=certpath BuypassCA CRL - */ - - /* - * Obtain test artifacts for Buypass Class 2 and Class 3 CAs from: - * Buypass Class 3 CA 2 - * https://valid.qcevident.ca23.ssl.buypass.no/ - * https://revoked.qcevident.ca23.ssl.buypass.no/ - * https://expired.qcevident.ca23.ssl.buypass.no/ - * https://valid.evident.ca23.ssl.buypass.no/ - * https://revoked.evident.ca23.ssl.buypass.no/ - * https://expired.evident.ca23.ssl.buypass.no/ - * https://valid.businessplus.ca23.ssl.buypass.no - * https://revoked.businessplus.ca23.ssl.buypass.no - * https://expired.businessplus.ca23.ssl.buypass.no - - * Buypass Class 2 CA 2 - * https://valid.business.ca22.ssl.buypass.no - * https://revoked.business.ca22.ssl.buypass.no - * https://expired.business.ca22.ssl.buypass.no - * https://valid.domain.ca22.ssl.buypass.no - * https://revoked.domain.ca22.ssl.buypass.no - * https://expired.domain.ca22.ssl.buypass.no/ - */ -public class BuypassCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new BuypassClass2().runTest(pathValidator); - new BuypassClass3().runTest(pathValidator); - } -} - -class BuypassClass2 { - - // Owner: CN=Buypass Class 2 CA 2, O=Buypass AS-983163327, C=NO - // Issuer: CN=Buypass Class 2 Root CA, O=Buypass AS-983163327, C=NO - // Serial number: 1b781c6d5e34ce1f77 - // Valid from: Mon Mar 25 05:17:10 PDT 2019 until: Sat Oct 26 02:16:17 PDT 2030 - private static final String INT_CLASS_2 = "-----BEGIN CERTIFICATE-----\n" + - "MIIFKTCCAxGgAwIBAgIJG3gcbV40zh93MA0GCSqGSIb3DQEBCwUAME4xCzAJBgNV\n" + - "BAYTAk5PMR0wGwYDVQQKDBRCdXlwYXNzIEFTLTk4MzE2MzMyNzEgMB4GA1UEAwwX\n" + - "QnV5cGFzcyBDbGFzcyAyIFJvb3QgQ0EwHhcNMTkwMzI1MTIxNzEwWhcNMzAxMDI2\n" + - "MDkxNjE3WjBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMx\n" + - "NjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAyMIIBIjANBgkqhkiG\n" + - "9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnKtnxpZLDQ+R0uzKzDMr83L8Dn+5ToSpD31z\n" + - "qiYMykj7I2geNQ7javKsBOzhgeVr7GP4yJ5bK/P0dhoKesYvQITihfwztbMP6DyH\n" + - "q1QJLQBqQnF0Lk8GhxSSNAZnlkCgX3aazoL32p9BeEfHuUE/8BlPywJY/RyE5/39\n" + - "w3EKmWylhUkeRCMo3dUZr4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cYC2n7wqrLZz5e4FG+Wn9teFW\n" + - "Rt5pO6ZUZAkDS59ZVojbbjOdQzNw3QHtZl0IMHeNYXJlPIUlHi4hGL3maGZ9sBF+\n" + - "AMfMLDu56+J2DewIuTXPzCeJeSTam/ybNt5FxTznxCSCIDqwmZMy3AQEz9nGSbE8\n" + - "zfwB5VT2ijLB0PpPX4YbLf33Vodf0NAkBUv6N5It30XiTUPhdk+caBYPoljz/J9U\n" + - "15T5+EGHs8ccHQWyYQ6gqYk8o4JgP4rSJqO1sMI=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.domain.ca22.ssl.buypass.no - // Issuer: CN=Buypass Class 2 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 34e2bff8063debd18d79 - // Valid from: Mon Sep 23 04:12:34 PDT 2019 until: Mon Oct 11 14:59:00 PDT 2021 - private static final String VALID_CLASS_2 = "-----BEGIN CERTIFICATE-----\n" + - "MIIF8jCCBNqgAwIBAgIKNOK/+AY969GNeTANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMiBDQSAyMB4XDTE5MDkyMzExMTIzNFoXDTIxMTAxMTIx\n" + - "NTkwMFowKzEpMCcGA1UEAwwgdmFsaWQuZG9tYWluLmNhMjIuc3NsLmJ1eXBhc3Mu\n" + - "bm8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCeu/8j7y55R3OucDek\n" + - "gtdoVOEJQb2XaCR4OwiRzn74hLYhKGdFmFwSp+bPCT62NzjdK1urVeKrCQdC1Gkm\n" + - "e7iSOsHHO5aC8oxkgdv8mwEwwvH7xHCcpEVLDlE5Oc0d4cS4QIwFAhNIC77slixL\n" + - "fEdupc5e8FfQf3MlnhX+8gpgRzTx3iw8sb3gUwi3+7PRommHOhC7Ll+iI9LiLODJ\n" + - "qr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- "1ljso5jKzIUcBpSW0HnTcuKiB3VxGpL7GFVWAHUAb1N2rDHwMRnYmQCkURX/dxUc\n" + - "EdkCwQApBo2yCJo32RMAAAFtXdLYSAAABAMARjBEAiADoZr6Cp5AGM1eT2aUeRaQ\n" + - "kv0vRaegjRGIhKRCvRGyFAIgWLU/7zh28LI8vAyWr8mpDqlUXvF13i3zSD3whq4L\n" + - "Lu4wDQYJKoZIhvcNAQELBQADggEBAJH1RhTuMbhEOYlw+Efbx7PP7EEC/GQ1ijET\n" + - "vZS45jFQyTKhFUcdP2QPAtEVo1nS8PBs0txQJBf0xceWUjer9ruxiAS+JlW21AOi\n" + - "Uq9Kahpj5k63Z7tN8KTeOUE8wZGmHyvVcPP6mkC94RbjYIb4gd13eYxd2Vv1a7YX\n" + - "dNI+J3g7sX5ijssfJxzDd0hORj2584YY2WiKKvIGxwDnLkxk09i3IvjEKsAi4Cgn\n" + - "5798X5sSL1Q9C6gHEWt+cB5UtfILCfbLNRczS9zGku6gjh1c8dB7zc63mn7oCf1C\n" + - "gnQ2xqwbZb3Wau8CPwcMqJWgQZLQFPbZd+4Xo5SDDqYppV4oN2A=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.domain.ca22.ssl.buypass.no - // Issuer: CN=Buypass Class 2 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 34e4b97261795f98c495 - // Valid from: Mon Sep 23 04:52:42 PDT 2019 until: Thu Sep 23 14:59:00 PDT 2021 - private static final String REVOKED_CLASS_2 = "-----BEGIN CERTIFICATE-----\n" + - "MIIF9zCCBN+gAwIBAgIKNOS5cmF5X5jElTANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMiBDQSAyMB4XDTE5MDkyMzExNTI0MloXDTIxMDkyMzIx\n" + - "NTkwMFowLTErMCkGA1UEAwwic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pAHYAu9nfvB+KcbWTlCOXqpJ7\n" + - "RzhXlQqrUugakJZkNo4e0YUAAAFtXfeApgAABAMARzBFAiARoEDgK57YWEW2R21d\n" + - "jFMphF5c9PypIwbZFHiWxdyCyAIhALsjjtPGgcrT/7KebYFPuKDyQO6rc8YYvm0z\n" + - "Q+Xt7NhxAHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFtXfeD\n" + - "eQAABAMARzBFAiBCXKlCGkqa85QVqMR5dYDDz3F5aQgLXPubrQLX7cAZ0wIhALRr\n" + - "p8F6OfIdccSUhzEcNdtensQ/7zxgn81bUzn1ar9EAHcAb1N2rDHwMRnYmQCkURX/\n" + - "dxUcEdkCwQApBo2yCJo32RMAAAFtXfeBSQAABAMASDBGAiEAyrR31T85HGekHZdD\n" + - "r/m6flxqQaUIGcAJ5WcrBuIBuYkCIQD0rDdm+vM5/lNXIfjjrPLhATFEvrxpXJvu\n" + - "+sW4Ntm94jANBgkqhkiG9w0BAQsFAAOCAQEAjbMEFeNXFy3YQSr8O0+fY7qwaAzk\n" + - "vq65Ef/B2zvqO375+JI21grUikmFUnDiAaM8Y+8PJkOXDiuxR2/XCLsXpxCcPqQh\n" + - "V0MZlqXtjKZjBACILBX7aqGibojJTIlo0Dkd+LfPwswfXscTbb1CUXpUPn7CiUj5\n" + - "0WwfvjjQXny0NAB6WEkBMEBx6/Q75dvltoV9N1BZVer9hov6UTDuSad86faX2QF2\n" + - "aIEjrTJY3m2HqnIYf/lQxuDUDW0h7ddGGsIEBDM8z7M/rvT068ssRqJ8uecGjMaz\n" + - "JElX8VDgMux2kyjTAiAFD5QO+KTfySri9QXptik3wo66zDOmkVES1snvVQ==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID_CLASS_2, INT_CLASS_2}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED_CLASS_2, INT_CLASS_2}, - ValidatePathWithParams.Status.REVOKED, - "Mon Sep 23 04:53:18 PDT 2019", System.out); - } -} - -class BuypassClass3 { - - // Owner: CN=Buypass Class 3 CA 2, O=Buypass AS-983163327, C=NO - // Issuer: CN=Buypass Class 3 Root CA, O=Buypass AS-983163327, C=NO - // Serial number: 1be0dc6a3e7f220475 - // Valid from: Mon Mar 25 05:12:16 PDT 2019 until: Sat Oct 26 01:16:17 PDT 2030 - private static final String INT_CLASS_3 = "-----BEGIN CERTIFICATE-----\n" + - "MIIFKTCCAxGgAwIBAgIJG+Dcaj5/IgR1MA0GCSqGSIb3DQEBCwUAME4xCzAJBgNV\n" + - "BAYTAk5PMR0wGwYDVQQKDBRCdXlwYXNzIEFTLTk4MzE2MzMyNzEgMB4GA1UEAwwX\n" + - "QnV5cGFzcyBDbGFzcyAzIFJvb3QgQ0EwHhcNMTkwMzI1MTIxMjE2WhcNMzAxMDI2\n" + - "MDgxNjE3WjBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMx\n" + - "NjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAyMIIBIjANBgkqhkiG\n" + - "9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvU4V2hRFFe4K7BMEmm4IoMTwS7NyDQB4JEar\n" + - "dV1qBsKHIIQJDm9hbCakcLIWXVv6vYrJZ1AEF0b6awBwhhlqXlyNnOtNa9uR+IAP\n" + - "86d4yOGpgHSlNAhdtOOk9Qw6MUzzBo1lyoYmoL0f5n02SMrlMcArSg458o08eDUx\n" + - "4iZs4dXDR9Hjxac2s+mdAO35Js8VK/D50AIMDJvHVeCMw+rumZkNZuRqM7PjIK+u\n" + - "BmbqO8A95PeqQEWHvM5nchlV1+ZGNVqHHSJenlMnVKytGv+4KJp7U741H/9cMbd2\n" + - "X2PXsewWWFhGXoS8R9VXQ5xb3hF6324FQXvcA1mXRv6DAJedXQIDAQABo4IBC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7zh0X/3YVz++g/6bd7iqRD9nRRZxACekRbza7AqU5xN1UjvVtCJQ9VC74K9KP\n" + - "pBoLWE2Bz5ksL9VUc4kS+WGORvZrSE1EpBq6cHc=\n" + - "-----END CERTIFICATE-----"; - - // Owner: SERIALNUMBER=983163327, CN=valid.businessplus.ca23.ssl.buypass.no, O=BUYPASS AS, - // L=OSLO, OID.2.5.4.17=0484, C=NO - // Issuer: CN=Buypass Class 3 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 267b7a9f0c3da9b94b39 - // Valid from: Mon Sep 23 04:17:42 PDT 2019 until: Mon Oct 11 14:59:00 PDT 2021 - private static final String VALID_CLASS_3 = "-----BEGIN CERTIFICATE-----\n" + - "MIIGUTCCBTmgAwIBAgIKJnt6nww9qblLOTANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMyBDQSAyMB4XDTE5MDkyMzExMTc0MloXDTIxMTAxMTIx\n" + - "NTkwMFowgYUxCzAJBgNVBAYTAk5PMQ0wCwYDVQQRDAQwNDg0MQ0wCwYDVQQHDARP\n" + - "U0xPMRMwEQYDVQQKDApCVVlQQVNTIEFTMS8wLQYDVQQDDCZ2YWxpZC5idXNpbmVz\n" + - "c3BsdXMuY2EyMy5zc2wuYnV5cGFzcy5ubzESMBAGA1UEBRMJOTgzMTYzMzI3MIIB\n" + - "IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArqj6dPVIQUULBV/S+u2/Rfko\n" + - "3BljX/KMEAclJHPu6AbJ2Dw5oLqCynOfTwLmGl3IRBQuDUAuoLdaptIhaXR2VTsF\n" + - "8SWdHNXkykC2eD0XkAUdTuKgRm/3U4f0T3XQsjwKOEQGECwGEWJekBL73retSRWe\n" + - "Ccc19NpSKZ5rmRnQSlKLfqUyihmw2xXmIWwEmBq0OOyG8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Y\n" + - "8z+V9m+6SutZ5WTD+Arg3K8O6/dvyKu0QmEAdQBvU3asMfAxGdiZAKRRFf93FRwR\n" + - "2QLBACkGjbIImjfZEwAAAW1d13cSAAAEAwBGMEQCIFLqxvNOKVFlTjHPXwk93VeW\n" + - "zCqFtcxJkunD/iiv0Kn9AiBoyvUrjYn4MPTht9zb0OyaSMWb00/HXP/4AVmUzHrz\n" + - "YzANBgkqhkiG9w0BAQsFAAOCAQEAsmQAOn1f1CbvnOpggS2efmy1pQXvvw+YeCYP\n" + - "bElO578h7scn8al4N7huQZ/z14BELe0chGWNA/ReW5nAu3SUOiv+E8/kv9i9Y8ul\n" + - "MJPL62nXW6Z/mkyystuBNtON420iWL/gS/vduxSZE/iBB4znctDpXS917/XWf31Y\n" + - "ZonemF3MSfi/s9V0Ic82ZY/+HZ4NLTDyKRd4kFF58OoH9RZNb6g8MbTp+gPadiUG\n" + - "UcfPGV3yGiugQa7WHTl7QJ9ishyafiZ4hpeKem6TMDEztgGyLIZ4MSxQvoeI2jJP\n" + - "KjHd5fW/HClbEcrN+w0a0MUNMaAOaZfMS7jS6sDpaVL8D0EX5A==\n" + - "-----END CERTIFICATE-----"; - - // Owner: SERIALNUMBER=983163327, CN=revoked.businessplus.ca23.ssl.buypass.no, O=BUYPASS AS, - // L=OSLO, OID.2.5.4.17=0484, C=NO - // Issuer: CN=Buypass Class 3 CA 2, O=Buypass AS-983163327, C=NO - // Serial number: 267cee3fab06c615fb27 - // Valid from: Mon Sep 23 04:56:56 PDT 2019 until: Thu Sep 23 14:59:00 PDT 2021 - private static final String REVOKED_CLASS_3 = "-----BEGIN CERTIFICATE-----\n" + - "MIIGWDCCBUCgAwIBAgIKJnzuP6sGxhX7JzANBgkqhkiG9w0BAQsFADBLMQswCQYD\n" + - "VQQGEwJOTzEdMBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMM\n" + - "FEJ1eXBhc3MgQ2xhc3MgMyBDQSAyMB4XDTE5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JmiWd5uUxev0nVw0saqvlo4yAEBq4rI/DieKcQI4qEI8myzoS0R0azMfLM=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID_CLASS_3, INT_CLASS_3}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED_CLASS_3, INT_CLASS_3}, - ValidatePathWithParams.Status.REVOKED, - "Mon Sep 23 04:57:31 PDT 2019", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,695 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test id=actalisauthenticationrootca + * @bug 8189131 + * @summary Interoperability tests with Actalis CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp + * CAInterop actalisauthenticationrootca OCSP + * @run main/othervm/timeout=180 -Djava.security.debug=certpath,ocsp + * CAInterop actalisauthenticationrootca CRL + */ + +/* + * @test id=amazonrootca1 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca1 CRL + */ + +/* + * @test id=amazonrootca2 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA2 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca2 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca2 CRL + */ + +/* + * @test id=amazonrootca3 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA3 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca3 CRL + */ + +/* + * @test id=amazonrootca4 + * @bug 8233223 + * @summary Interoperability tests with Amazon's CA4 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop amazonrootca4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop amazonrootca4 CRL + */ + +/* + * @test id=buypassclass2ca + * @bug 8189131 + * @summary Interoperability tests with Buypass Class 2 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca OCSP + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass2ca CRL + */ + +/* + * @test id=buypassclass3ca + * @bug 8189131 + * @summary Interoperability tests with Buypass Class 3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca OCSP + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop buypassclass3ca CRL + */ + +/* + * @test id=comodorsaca + * @bug 8189131 + * @summary Interoperability tests with Comodo RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop comodorsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop comodorsaca CRL + */ + +/* + * @test id=comodoeccca + * @bug 8189131 + * @summary Interoperability tests with Comodo ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop comodoeccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop comodoeccca CRL + */ + +/* + * @test id=usertrustrsaca + * @bug 8189131 + * @summary Interoperability tests with Comodo userTrust RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop usertrustrsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop usertrustrsaca CRL + */ + +/* + * @test id=usertrusteccca + * @bug 8189131 + * @summary Interoperability tests with Comodo userTrust ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop usertrusteccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop usertrusteccca CRL + */ + +/* + * @test id=letsencryptisrgx1 + * @bug 8189131 + * @summary Interoperability tests with Let's Encrypt ISRG Root X1 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx1 DEFAULT + */ + +/* + * @test id=letsencryptisrgx2 + * @bug 8317374 + * @summary Interoperability tests with Let's Encrypt ISRG Root X2 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop letsencryptisrgx2 DEFAULT + */ + +/* + * @test id=globalsignrootcar6 + * @bug 8216577 + * @summary Interoperability tests with GlobalSign R6 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsignrootcar6 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop globalsignrootcar6 CRL + */ + +/* + * @test id=entrustrootcaec1 + * @bug 8195774 + * @summary Interoperability tests with Entrust CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop entrustrootcaec1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop entrustrootcaec1 CRL + */ + +/* + * @test id=entrustrootcag4 + * @bug 8243321 + * @summary Interoperability tests with Entrust CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop entrustrootcag4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop entrustrootcag4 CRL + */ + +/* + * @test id=godaddyrootg2ca + * @bug 8196141 + * @summary Interoperability tests with GoDaddy CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop godaddyrootg2ca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop godaddyrootg2ca CRL + */ + +/* + * @test id=starfieldrootg2ca + * @bug 8196141 + * @summary Interoperability tests with Starfield CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop starfieldrootg2ca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop starfieldrootg2ca CRL + */ + +/* + * @test id=globalsigneccrootcar4 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsigneccrootcar4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop globalsigneccrootcar4 CRL + */ + +/* + * @test id=gtsrootcar1 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootcar1 CRL + */ + +/* + * @test id=gtsrootcar2 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootcar2 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootcar2 CRL + */ + +/* + * @test id=gtsrootecccar3 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootecccar3 CRL + */ + +/* + * @test id=gtsrootecccar4 + * @bug 8307134 + * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop gtsrootecccar4 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop gtsrootecccar4 CRL + */ + +/* + * @test id=microsoftecc2017 + * @bug 8304760 + * @summary Interoperability tests with Microsoft TLS root CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop microsoftecc2017 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop microsoftecc2017 CRL + */ + +/* + * @test id=microsoftrsa2017 + * @bug 8304760 + * @summary Interoperability tests with Microsoft TLS root CAs + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop microsoftrsa2017 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop microsoftrsa2017 CRL + */ + +/* + * @test id=quovadisrootca1g3 + * @bug 8189131 + * @summary Interoperability tests with QuoVadis Root CA1 G3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca1g3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca1g3 CRL + */ + +/* + * @test id=quovadisrootca2g3 + * @bug 8189131 + * @summary Interoperability tests with QuoVadis Root CA2 G3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca2g3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca2g3 CRL + */ + +/* + * @test id=quovadisrootca3g3 + * @bug 8189131 + * @summary Interoperability tests with QuoVadis Root CA3 G3 CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop quovadisrootca3g3 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop quovadisrootca3g3 CRL + */ + +/* + * @test id=digicerttlseccrootg5 + * @bug 8318759 + * @summary Interoperability tests with DigiCert TLS ECC P384 Root G5 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop digicerttlseccrootg5 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop digicerttlseccrootg5 CRL + */ + +/* + * @test id=digicerttlsrsarootg5 + * @bug 8318759 + * @summary Interoperability tests with DigiCert TLS RSA4096 Root G5 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop digicerttlsrsarootg5 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop digicerttlsrsarootg5 CRL + */ + +/* + * @test id=sslrootrsaca + * @bug 8243320 + * @summary Interoperability tests with SSL.com's RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrootrsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop sslrootrsaca CRL + */ + +/* + * @test id=sslrootevrsaca + * @bug 8243320 + * @summary Interoperability tests with SSL.com's EV RSA CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrootevrsaca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop sslrootevrsaca CRL + */ + +/* + * @test id=sslrooteccca + * @bug 8243320 + * @summary Interoperability tests with SSL.com's ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop sslrooteccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop sslrooteccca CRL + */ + +/* + * @test id=teliasonerarootcav1 + * @bug 8210432 + * @summary Interoperability tests with TeliaSonera Root CA v1 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop teliasonerarootcav1 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop teliasonerarootcav1 CRL + */ + +/* + * @test id=twcaglobalrootca + * @bug 8305975 + * @summary Interoperability tests with TWCA Global Root CA from TAIWAN-CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop twcaglobalrootca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop twcaglobalrootca CRL + */ + +/* + * @test id=certignarootca + * @bug 8314960 + * @summary Interoperability tests with Certigna Root CAs from Dhimyotis + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop certignarootca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop certignarootca CRL + */ + +/* + * @test id=affirmtrustcommercialca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Commercial CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustcommercialca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustcommercialca CRL + */ + +/* + * @test id=affirmtrustnetworkingca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Networking CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustnetworkingca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustnetworkingca CRL + */ + +/* + * @test id=affirmtrustpremiumca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Premium CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustpremiumca CRL + */ + +/* + * @test id=affirmtrustpremiumeccca + * @bug 8040012 + * @summary Interoperability tests with AffirmTrust Premium ECC CA + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop affirmtrustpremiumeccca OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop affirmtrustpremiumeccca CRL + */ + +/* + * @test id=teliarootcav2 + * @bug 8317373 + * @summary Interoperability tests with Telia Root CA V2 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop teliarootcav2 OCSP + * @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 + */ +public class CAInterop { + + /** + * Returns the test configuration for CA + * + * @param alias from the cacerts file without [jdk] + * @return CATestURLs + */ + private CATestURLs getTestURLs(String alias) { + return switch (alias) { + case "actalisauthenticationrootca" -> + new CATestURLs("https://ssltest-active.actalis.it", + "https://ssltest-revoked.actalis.it"); + + case "amazonrootca1" -> + new CATestURLs("https://valid.rootca1.demo.amazontrust.com", + "https://revoked.rootca1.demo.amazontrust.com"); + case "amazonrootca2" -> + new CATestURLs("https://valid.rootca2.demo.amazontrust.com", + "https://revoked.rootca2.demo.amazontrust.com"); + case "amazonrootca3" -> + new CATestURLs("https://valid.rootca3.demo.amazontrust.com", + "https://revoked.rootca3.demo.amazontrust.com"); + case "amazonrootca4" -> + new CATestURLs("https://valid.rootca4.demo.amazontrust.com", + "https://revoked.rootca4.demo.amazontrust.com"); + + case "buypassclass2ca" -> + new CATestURLs("https://valid.business.ca22.ssl.buypass.no", + "https://revoked.business.ca22.ssl.buypass.no"); + case "buypassclass3ca" -> + new CATestURLs("https://valid.qcevident.ca23.ssl.buypass.no", + "https://revoked.qcevident.ca23.ssl.buypass.no"); + + case "comodorsaca" -> + new CATestURLs("https://comodorsacertificationauthority-ev.comodoca.com", + "https://comodorsacertificationauthority-ev.comodoca.com:444"); + case "comodoeccca" -> + new CATestURLs("https://comodoecccertificationauthority-ev.comodoca.com", + "https://comodoecccertificationauthority-ev.comodoca.com:444"); + case "usertrustrsaca" -> + new CATestURLs("https://usertrustrsacertificationauthority-ev.comodoca.com", + "https://usertrustrsacertificationauthority-ev.comodoca.com:444"); + case "usertrusteccca" -> + new CATestURLs("https://usertrustecccertificationauthority-ev.comodoca.com", + "https://usertrustecccertificationauthority-ev.comodoca.com:444"); + + case "letsencryptisrgx1" -> + new CATestURLs("https://valid-isrgrootx1.letsencrypt.org", + "https://revoked-isrgrootx1.letsencrypt.org"); + case "letsencryptisrgx2" -> + new CATestURLs("https://valid-isrgrootx2.letsencrypt.org", + "https://revoked-isrgrootx2.letsencrypt.org"); + + case "globalsignrootcar6" -> + new CATestURLs("https://valid.r6.roots.globalsign.com", + "https://revoked.r6.roots.globalsign.com"); + + case "entrustrootcaec1" -> + new CATestURLs("https://validec.entrust.net", + "https://revokedec.entrust.net"); + case "entrustrootcag4" -> + new CATestURLs("https://validg4.entrust.net", + "https://revokedg4.entrust.net"); + + case "godaddyrootg2ca" -> + new CATestURLs("https://valid.gdig2.catest.godaddy.com", + "https://revoked.gdig2.catest.godaddy.com"); + case "starfieldrootg2ca" -> + new CATestURLs("https://valid.sfig2.catest.starfieldtech.com", + "https://revoked.sfig2.catest.starfieldtech.com"); + + case "globalsigneccrootcar4" -> + new CATestURLs("https://good.gsr4.demo.pki.goog", + "https://revoked.gsr4.demo.pki.goog"); + case "gtsrootcar1" -> + new CATestURLs("https://good.gtsr1.demo.pki.goog", + "https://revoked.gtsr1.demo.pki.goog"); + case "gtsrootcar2" -> + new CATestURLs("https://good.gtsr2.demo.pki.goog", + "https://revoked.gtsr2.demo.pki.goog"); + case "gtsrootecccar3" -> + new CATestURLs("https://good.gtsr3.demo.pki.goog", + "https://revoked.gtsr3.demo.pki.goog"); + case "gtsrootecccar4" -> + new CATestURLs("https://good.gtsr4.demo.pki.goog", + "https://revoked.gtsr4.demo.pki.goog"); + + case "microsoftecc2017" -> + new CATestURLs("https://acteccroot2017.pki.microsoft.com", + "https://rvkeccroot2017.pki.microsoft.com"); + case "microsoftrsa2017" -> + new CATestURLs("https://actrsaroot2017.pki.microsoft.com", + "https://rvkrsaroot2017.pki.microsoft.com"); + + // Test URLs are listed at https://www.digicert.com/kb/digicert-root-certificates.htm + case "quovadisrootca1g3" -> + new CATestURLs("https://quovadis-root-ca-1-g3.chain-demos.digicert.com", + "https://quovadis-root-ca-1-g3-revoked.chain-demos.digicert.com"); + case "quovadisrootca2g3" -> + new CATestURLs("https://quovadis-root-ca-2-g3.chain-demos.digicert.com", + "https://quovadis-root-ca-2-g3-revoked.chain-demos.digicert.com"); + case "quovadisrootca3g3" -> + new CATestURLs("https://quovadis-root-ca-3-g3.chain-demos.digicert.com", + "https://quovadis-root-ca-3-g3-revoked.chain-demos.digicert.com"); + case "digicerttlseccrootg5" -> + new CATestURLs("https://digicert-tls-ecc-p384-root-g5.chain-demos.digicert.com", + "https://digicert-tls-ecc-p384-root-g5-revoked.chain-demos.digicert.com"); + case "digicerttlsrsarootg5" -> + new CATestURLs("https://digicert-tls-rsa4096-root-g5.chain-demos.digicert.com", + "https://digicert-tls-rsa4096-root-g5-revoked.chain-demos.digicert.com"); + + case "sslrootrsaca" -> + new CATestURLs("https://test-dv-rsa.ssl.com", + "https://revoked-rsa-dv.ssl.com"); + case "sslrootevrsaca" -> + new CATestURLs("https://test-ev-rsa.ssl.com", + "https://revoked-rsa-ev.ssl.com"); + case "sslrooteccca" -> + new CATestURLs("https://test-dv-ecc.ssl.com", + "https://revoked-ecc-dv.ssl.com"); + + case "teliasonerarootcav1" -> + new CATestURLs("https://juolukka.cover.sonera.net:10443", + "https://juolukka.cover.sonera.net:10444"); + + case "twcaglobalrootca" -> + new CATestURLs("https://evssldemo6.twca.com.tw", + "https://evssldemo7.twca.com.tw"); + + case "certignarootca" -> + new CATestURLs("https://valid.servicesca.dhimyotis.com", + "https://revoked.servicesca.dhimyotis.com"); + + // These are listed at https://www.affirmtrust.com/resources/ + case "affirmtrustcommercialca" -> + new CATestURLs("https://validcommercial.affirmtrust.com", + "https://revokedcommercial.affirmtrust.com"); + case "affirmtrustnetworkingca" -> + new CATestURLs("https://validnetworking.affirmtrust.com", + "https://revokednetworking.affirmtrust.com"); + case "affirmtrustpremiumca" -> + new CATestURLs("https://validpremium.affirmtrust.com", + "https://revokedpremium.affirmtrust.com"); + case "affirmtrustpremiumeccca" -> + new CATestURLs("https://validpremiumecc.affirmtrust.com", + "https://revokedpremiumecc.affirmtrust.com"); + + case "teliarootcav2" -> + new CATestURLs("https://juolukka.cover.telia.fi:10600", + "https://juolukka.cover.telia.fi:10601"); + + case "emsignrootcag1" -> + new CATestURLs("https://testovg1.emsign.com/RootOVG1.html", + "https://testovg1r.emsign.com/RootOVG1MR.html"); + case "emsigneccrootcag3" -> + new CATestURLs("https://testovg3.emsign.com/RootOVG3.html", + "https://testovg3r.emsign.com/RootOVG3MR.html"); + + default -> throw new RuntimeException("No test setup found for: " + alias); + }; + } + + public static void main(String[] args) throws Exception { + if (args.length < 2) { + throw new RuntimeException("Run as: CAInterop "); + } + + String caAlias = args[0]; + + CAInterop caInterop = new CAInterop(args[1]); + CATestURLs caTestURLs = caInterop.getTestURLs(caAlias); + + caInterop.validate(caAlias + " [jdk]", + caTestURLs.getVALID_URL(), + caTestURLs.getREVOKED_URL()); + } + + static class CATestURLs { + final String VALID_URL; + final String REVOKED_URL; + + public CATestURLs(String validURL, + String revokedURL) { + VALID_URL = validURL; + REVOKED_URL = revokedURL; + } + + public String getVALID_URL() { + return VALID_URL; + } + + public String getREVOKED_URL() { + return REVOKED_URL; + } + } + + /** + * Constructor for interoperability test with third party CA. + * + * @param revocationMode revocation checking mode to use + */ + public CAInterop(String revocationMode) { + if ("CRL".equalsIgnoreCase(revocationMode)) { + ValidatePathWithURL.enableCRLOnly(); + } else if ("OCSP".equalsIgnoreCase(revocationMode)) { + ValidatePathWithURL.enableOCSPOnly(); + } else { + // OCSP and CRL check by default + ValidatePathWithURL.enableOCSPAndCRL(); + } + + ValidatePathWithURL.logRevocationSettings(); + } + + /** + * Validates provided URLs using HttpsURLConnection making sure they + * anchor to the root CA found in cacerts using provided alias. + * + * @param caAlias CA alis from cacerts file + * @param validCertURL valid test URL + * @param revokedCertURL revoked test URL + * @throws Exception thrown when certificate can't be validated as valid or revoked + */ + public void validate(String caAlias, + String validCertURL, + String revokedCertURL) throws Exception { + + ValidatePathWithURL validatePathWithURL = new ValidatePathWithURL(caAlias); + + if (validCertURL != null) { + validatePathWithURL.validateDomain(validCertURL, false); + } + + if (revokedCertURL != null) { + validatePathWithURL.validateDomain(revokedCertURL, true); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaCA.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,220 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8245654 8256895 + * @summary Interoperability tests with Certigna Root CAs from Dhimyotis + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=certpath CertignaCA OCSP + * @run main/othervm -Djava.security.debug=certpath CertignaCA CRL + */ +public class CertignaCA { + // Owner: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, + // OU=0002 48146308100036, O=DHIMYOTIS, C=FR + // Issuer: CN=Certigna, O=Dhimyotis, C=FR + // Serial number: 6f82fa28acd6f784bb5b120ba87367ad + // Valid from: Wed Nov 25 03:33:52 PST 2015 until: Sat Nov 22 03:33:52 PST 2025 + private static final String INT_CERTIGNA = "-----BEGIN CERTIFICATE-----\n" + + "MIIGFjCCBP6gAwIBAgIQb4L6KKzW94S7WxILqHNnrTANBgkqhkiG9w0BAQsFADA0\n" + + "MQswCQYDVQQGEwJGUjESMBAGA1UECgwJRGhpbXlvdGlzMREwDwYDVQQDDAhDZXJ0\n" + + "aWduYTAeFw0xNTExMjUxMTMzNTJaFw0yNTExMjIxMTMzNTJaMH0xCzAJBgNVBAYT\n" + + "AkZSMRIwEAYDVQQKDAlESElNWU9USVMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgx\n" + + "MDAwMzYxHTAbBgNVBGEMFE5UUkZSLTQ4MTQ2MzA4MTAwMDM2MR0wGwYDVQQDDBRD\n" + + "ZXJ0aWduYSBTZXJ2aWNlcyBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC\n" + + "ggIBALPM+7LpWBz9wFcPaTc3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zOi8vd3d3LmNlcnRpZ25hLmZyL2F1dG9y\n" + + "aXRlcy8wfAYIKwYBBQUHAQEEcDBuMDQGCCsGAQUFBzAChihodHRwOi8vYXV0b3Jp\n" + + "dGUuY2VydGlnbmEuZnIvY2VydGlnbmEuZGVyMDYGCCsGAQUFBzAChipodHRwOi8v\n" + + "YXV0b3JpdGUuZGhpbXlvdGlzLmNvbS9jZXJ0aWduYS5kZXIwYQYDVR0fBFowWDAp\n" + + "oCegJYYjaHR0cDovL2NybC5jZXJ0aWduYS5mci9jZXJ0aWduYS5jcmwwK6ApoCeG\n" + + "JWh0dHA6Ly9jcmwuZGhpbXlvdGlzLmNvbS9jZXJ0aWduYS5jcmwwDQYJKoZIhvcN\n" + + "AQELBQADggEBAGLft7gIuGPZVfg0cTM+HT2xAZFPDb/2+siH06x+dH044zMKbBIN\n" + + "bRzhKipwB1A3MW8FQjveE9tyrfyuqZE/X+o2SlGcdNV44ybYkxo4f6kcLEavV/IW\n" + + "+oFEnojZlhpksYcxrvQoEyqkAwshe8IS2KtZHKVACrt+XSs0lwvy7ALGmHaF7A4b\n" + + "y6cZWItA7Lhj8XWp+8tBJDj7HocRbWtxzEODdBuyMgJzFrNjc+97J0vH/K0+3yjm\n" + + "kczpKshMA0tM+MF9XDMN/MuwrPmUWGO/fHiqHgUp8yqeWtl1n44ZxkkK1t9GRwhn\n" + + "DWLv73/xhTmdhWYQ/reo0GbgBoLiltKmIJQ=\n" + + "-----END CERTIFICATE-----"; + + // Owner: SERIALNUMBER=S266241169, CN=valid.servicesca.dhimyotis.com, O=DHIMYOTIS, + // L=VILLENEUVE D'ASCQ, C=FR + // Issuer: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, OU=0002 + // 48146308100036, O=DHIMYOTIS, C=FR + // Serial number: c641ef7b0340c21515d8c462e729dc0e + // Valid from: Thu Mar 09 15:00:00 PST 2023 until: Mon Mar 11 15:59:59 PDT 2024 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n"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SERIALNUMBER=S266251168, CN=revoked.servicesca.certigna.com, O=DHIMYOTIS, + // L=VILLENEUVE D'ASCQ, C=FR + // Issuer: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, OU=0002 + // 48146308100036, O=DHIMYOTIS, C=FR + // Serial number: e863f752a23a735e3ccf958abf18565b + // Valid from: Thu Mar 09 15:00:00 PST 2023 until: Fri Mar 08 14:59:59 PST 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIIezCCBmOgAwIBAgIRAOhj91KiOnNePM+Vir8YVlswDQYJKoZIhvcNAQELBQAw\n" + + "fTELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURISU1ZT1RJUzEcMBoGA1UECwwTMDAw\n" + + "MiA0ODE0NjMwODEwMDAzNjEdMBsGA1UEYQwUTlRSRlItNDgxNDYzMDgxMDAwMzYx\n" + + "HTAbBgNVBAMMFENlcnRpZ25hIFNlcnZpY2VzIENBMB4XDTIzMDMwOTIzMDAwMFoX\n" + + "DTI0MDMwODIyNTk1OVowfDELMAkGA1UEBhMCRlIxGjAYBgNVBAcMEVZJTExFTkVV\n" + + "VkUgRCdBU0NRMRIwEAYDVQQKDAlESElNWU9USVMxKDAmBgNVBAMMH3Jldm9rZWQu\n" + + "c2VydmljZXNjYS5jZXJ0aWduYS5jb20xEzARBgNVBAUTClMyNjYyNTExNjgwggEi\n" + + "MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCBqKNjMkHqJ9EQa3CjuZ6EYMz6\n" + + "mWODrEucRcJDihYMigaV1oRyquGlFQ82ootXaK5bU+EYSMmUwbRpdZ9G/oZUn2+K\n" + + "MKAFDI+MoZoFhQC+2w0AzJycCf/hShUVxcRREKRKdfzv+k5YHj3e8ic16tGlTFXT\n" + + "IF1x3y2Uru7mzZARsZJqnRqaqPPghT/QlBpcA04yLi3iSpgO++mRrJxTUoUHlDw/\n" + + "a1nhqnDgH2yKN7tSfwFTetnXat6/UVt0CJ/6dJF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uNSnb2BVz0/\n" + + "keo1Kif/GSak+JUBpJ8hkJWygtrWCETUNfoseQhqo3gism0EGxJ04tBp+DRvfbrz\n" + + "X4aBgALRro3jSIR1Ibp+e0fxePwShy715SF2H4SfjvplTAKq5bwztZtQUkPR6fJ7\n" + + "5xT0f762c1yytKP1rHFMvzl6k7QWvC6zb2FeG5UqXJw3wFxxWsCuAUu5SPFfXdno\n" + + "5lIHTTV5rpZBN+PzTZsz\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + + // Added to test for JDK-8256895 + System.setProperty("jdk.security.certpath.ocspNonce", "true"); + + // OCSP check by default + boolean ocspEnabled = args.length < 1 || !"CRL".equalsIgnoreCase(args[0]); + + ValidatePathWithParams pathValidator; + String[] validChainToValidate; + String[] revChainToValidate; + + if (!ocspEnabled) { + pathValidator = new ValidatePathWithParams(null); + pathValidator.enableCRLCheck(); + + validChainToValidate = new String[]{VALID, INT_CERTIGNA}; + revChainToValidate = new String[]{REVOKED, INT_CERTIGNA}; + } else { + // int certificate doesn't specify OCSP responder + pathValidator = new ValidatePathWithParams(new String[]{INT_CERTIGNA}); + pathValidator.enableOCSPCheck(); + + validChainToValidate = new String[]{VALID}; + revChainToValidate = new String[]{REVOKED}; + } + + // Validate valid + pathValidator.validate(validChainToValidate, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(revChainToValidate, + ValidatePathWithParams.Status.REVOKED, + "Fri Mar 10 03:39:51 PST 2023", System.out); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CertignaRoots.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,293 +0,0 @@ -/* - * Copyright (c) 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8245654 8314960 - * @summary Interoperability tests with Certigna Root CAs from Dhimyotis - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath CertignaRoots OCSP - * @run main/othervm -Djava.security.debug=certpath CertignaRoots CRL - */ - -/* - * Obtain TLS test artifacts for Certigna Root CAs from: - * - * Valid TLS Certificates: - * https://valid.servicesca.dhimyotis.com/ - * - * Revoked TLS Certificates: - * https://revoked.servicesca.dhimyotis.com/ - */ -public class CertignaRoots { - - // Owner: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, - // OU=0002 48146308100036, O=DHIMYOTIS, C=FR - // Issuer: CN=Certigna Root CA, OU=0002 48146308100036, O=Dhimyotis, C=FR - // Serial number: fd30cf04344fc38dd90c4e70753d0623 - // Valid from: Wed Nov 25 03:37:21 PST 2015 until: Fri Jun 03 04:37:21 PDT 2033 - private static final String INT_CERTIGNA_ROOT_CA = "-----BEGIN CERTIFICATE-----\n" + - "MIIHETCCBPmgAwIBAgIRAP0wzwQ0T8ON2QxOcHU9BiMwDQYJKoZIhvcNAQELBQAw\n" + - "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op9dPyuLWjaRrZ0LMx4a3EM3sQDPDqmsG0lHtfFj2PiJvq\n" + - "4lEYA+gDiLKODI+3DJMqo559m3QSS52DsShomHX/Txd0lJoZwepCE6X4KkG9FHjV\n" + - "WXyLgYFwCOcn+hkLhdpblms0wtjeSPITGOioSkefzhleJnDgJ9X4M3svd0HLTpJi\n" + - "lC1DmDZgdrXWITVdOoCogr2LFKNiGd0tbpKG533eKpfBALlm+afc6j73p1KhJEAn\n" + - "AfydDZqBRqv6+HHYplNDn/K2I1CZdkwaGrx3HOR/voGUi1sUI+hYbsPAFu8ZxrhD\n" + - "9UiysmLCfEUhqkbojony+L2mKsoLqyd24emQzn7GgMa7emlWX2jQUTwrD4SliZ2u\n" + - "OetVaZX5RLyqJWs4Igo/xye0xtMQN8INJ4hSZvnMQ1qFtuSRcQ==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, - // OU=0002 48146308100036, O=DHIMYOTIS, C=FR - // Issuer: CN=Certigna, O=Dhimyotis, C=FR - // Serial number: 6f82fa28acd6f784bb5b120ba87367ad - // Valid from: Wed Nov 25 03:33:52 PST 2015 until: Sat Nov 22 03:33:52 PST 2025 - private static final String INT_CERTIGNA = "-----BEGIN CERTIFICATE-----\n" + - "MIIGFjCCBP6gAwIBAgIQb4L6KKzW94S7WxILqHNnrTANBgkqhkiG9w0BAQsFADA0\n" + - "MQswCQYDVQQGEwJGUjESMBAGA1UECgwJRGhpbXlvdGlzMREwDwYDVQQDDAhDZXJ0\n" + - "aWduYTAeFw0xNTExMjUxMTMzNTJaFw0yNTExMjIxMTMzNTJaMH0xCzAJBgNVBAYT\n" + - "AkZSMRIwEAYDVQQKDAlESElNWU9USVMxHDAaBgNVBAsMEzAwMDIgNDgxNDYzMDgx\n" + - "MDAwMzYxHTAbBgNVBGEMFE5UUkZSLTQ4MTQ2MzA4MTAwMDM2MR0wGwYDVQQDDBRD\n" + - "ZXJ0aWduYSBTZXJ2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zjAQ/JSP8wSQYDVR0gBEIwQDA+BgoqgXoBgTEB\n" + - "AAECMDAwLgYIKwYBBQUHAgEWImh0dHBzOi8vd3d3LmNlcnRpZ25hLmZyL2F1dG9y\n" + - "aXRlcy8wfAYIKwYBBQUHAQEEcDBuMDQGCCsGAQUFBzAChihodHRwOi8vYXV0b3Jp\n" + - "dGUuY2VydGlnbmEuZnIvY2VydGlnbmEuZGVyMDYGCCsGAQUFBzAChipodHRwOi8v\n" + - "YXV0b3JpdGUuZGhpbXlvdGlzLmNvbS9jZXJ0aWduYS5kZXIwYQYDVR0fBFowWDAp\n" + - "oCegJYYjaHR0cDovL2NybC5jZXJ0aWduYS5mci9jZXJ0aWduYS5jcmwwK6ApoCeG\n" + - "JWh0dHA6Ly9jcmwuZGhpbXlvdGlzLmNvbS9jZXJ0aWduYS5jcmwwDQYJKoZIhvcN\n" + - "AQELBQADggEBAGLft7gIuGPZVfg0cTM+HT2xAZFPDb/2+siH06x+dH044zMKbBIN\n" + - "bRzhKipwB1A3MW8FQjveE9tyrfyuqZE/X+o2SlGcdNV44ybYkxo4f6kcLEavV/IW\n" + - "+oFEnojZlhpksYcxrvQoEyqkAwshe8IS2KtZHKVACrt+XSs0lwvy7ALGmHaF7A4b\n" + - "y6cZWItA7Lhj8XWp+8tBJDj7HocRbWtxzEODdBuyMgJzFrNjc+97J0vH/K0+3yjm\n" + - "kczpKshMA0tM+MF9XDMN/MuwrPmUWGO/fHiqHgUp8yqeWtl1n44ZxkkK1t9GRwhn\n" + - "DWLv73/xhTmdhWYQ/reo0GbgBoLiltKmIJQ=\n" + - "-----END CERTIFICATE-----"; - - // Owner: SERIALNUMBER=S266241169, CN=valid.servicesca.dhimyotis.com, O=DHIMYOTIS, - // L=VILLENEUVE D'ASCQ, C=FR - // Issuer: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, OU=0002 - // 48146308100036, O=DHIMYOTIS, C=FR - // Serial number: c641ef7b0340c21515d8c462e729dc0e - // Valid from: Thu Mar 09 15:00:00 PST 2023 until: Mon Mar 11 15:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIIdzCCBl+gAwIBAgIRAMZB73sDQMIVFdjEYucp3A4wDQYJKoZIhvcNAQELBQAw\n" + - "fTELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURISU1ZT1RJUzEcMBoGA1UECwwTMDAw\n" + - "MiA0ODE0NjMwODEwMDAzNjEdMBsGA1UEYQwUTlRSRlItNDgxNDYzMDgxMDAwMzYx\n" + - "HTAbBgNVBAMMFENlcnRpZ25hIFNlcnZpY2VzIENBMB4XDTIzMDMwOTIzMDAwMFoX\n" + - "DTI0MDMxMTIyNTk1OVowezELMAkGA1UEBhMCRlIxGjAYBgNVBAcMEVZJTExFTkVV\n" + - "VkUgRCdBU0NRMRIwEAYDVQQKDAlESElNWU9USVMxJzAlBgNVBAMMHnZhbGlkLnNl\n" + - "cnZpY2VzY2EuZGhpbXlvdGlzLmNvbTETMBEGA1UEBRMKUzI2NjI0MTE2OTCCASIw\n" + - "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJDrFpZWEeBJoMUuG37wEmJ7XVeX\n" + - "Jde1bgURpFbLwifRj2TVmMdtfg9hXHL7B7Mh/+I8/e7kJz8mlU9qUYKyH24oAitE\n" + - "myXYHAKTydqTseiM3mp92n4PM+DrgsdbT7bpmiirNM0/sqWFNyGUz7kP6Z5E3uuU\n" + - "HSlzX1LBBj8S0ORNZWvomQho11gjuZJRS72X4XTnSc0DESwnLp2irUfx7pflBNt0\n" + - "sLE8BhpNSSQd91naJVKtCtn0H7df+o4gGBt2ZceCLBwU0NwN8+KXz06KjP8298V4\n" + - "P3+eR2QxAw4QBIanRaG6Gd4AmpdIaT7TpiYHotjrJ/Pbx5C8/cmgxxlmtI0CAwEA\n" + - "AaOCA/IwggPuMIHkBggrBgEFBQcBAQSB1zCB1DA2BggrBgEFBQcwAoYqaHR0cDov\n" + - "L2F1dG9yaXRlL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095LsRptWhzxUByhee3JI0jljBTaKowy\n" + - "jPv8oekm7zqCLzY=\n" + - "-----END CERTIFICATE-----"; - - // Owner: SERIALNUMBER=S266251168, CN=revoked.servicesca.certigna.com, O=DHIMYOTIS, - // L=VILLENEUVE D'ASCQ, C=FR - // Issuer: CN=Certigna Services CA, OID.2.5.4.97=NTRFR-48146308100036, OU=0002 - // 48146308100036, O=DHIMYOTIS, C=FR - // Serial number: e863f752a23a735e3ccf958abf18565b - // Valid from: Thu Mar 09 15:00:00 PST 2023 until: Fri Mar 08 14:59:59 PST 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIezCCBmOgAwIBAgIRAOhj91KiOnNePM+Vir8YVlswDQYJKoZIhvcNAQELBQAw\n" + - "fTELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURISU1ZT1RJUzEcMBoGA1UECwwTMDAw\n" + - "MiA0ODE0NjMwODEwMDAzNjEdMBsGA1UEYQwUTlRSRlItNDgxNDYzMDgxMDAwMzYx\n" + - "HTAbBgNVBAMMFENlcnRpZ25hIFNlcnZpY2VzIENBMB4XDTIzMDMwOTIzMDAwMFoX\n" + - "DTI0MDMwODIyNTk1OVowfDELMAkGA1UEBhMCRlIxGjAYBgNVBAcMEVZJTExFTkVV\n" + - "VkUgRCdBU0NRMRIwEAYDVQQKDAlESElNWU9USVMxKDAmBgNVBAMMH3Jldm9rZWQu\n" + - "c2VydmljZXNjYS5jZXJ0aWduYS5jb20xEzARBgNVBAUTClMyNjYyNTExNjgwggEi\n" + - "MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCBqKNjMkHqJ9EQa3CjuZ6EYMz6\n" + - "mWODrEucRcJDihYMigaV1oRyquGlFQ82ootXaK5bU+EYSMmUwbRpdZ9G/oZUn2+K\n" + - "MKAFDI+MoZoFhQC+2w0AzJycCf/hShUVxcRREKRKdfzv+k5YHj3e8ic16tGlTFXT\n" + - "IF1x3y2Uru7mzZARsZJqnRqaqPPghT/Q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DT09RFB3a+1rcYjiS\n" + - "ijCBB+Lqx0xfLQnfBv1A0wjNqUY+gyEe0SpXqB4edqy5uaqawRRKMuNSnb2BVz0/\n" + - "keo1Kif/GSak+JUBpJ8hkJWygtrWCETUNfoseQhqo3gism0EGxJ04tBp+DRvfbrz\n" + - "X4aBgALRro3jSIR1Ibp+e0fxePwShy715SF2H4SfjvplTAKq5bwztZtQUkPR6fJ7\n" + - "5xT0f762c1yytKP1rHFMvzl6k7QWvC6zb2FeG5UqXJw3wFxxWsCuAUu5SPFfXdno\n" + - "5lIHTTV5rpZBN+PzTZsz\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - // OCSP check by default - boolean ocspEnabled = args.length < 1 || !"CRL".equalsIgnoreCase(args[0]); - - // CN=Certigna - new CertignaCAs().runTest(ocspEnabled, - VALID, - REVOKED, - INT_CERTIGNA); - - // CN=Certigna Root CA - new CertignaCAs().runTest(ocspEnabled, - VALID, - REVOKED, - INT_CERTIGNA_ROOT_CA); - } -} - -class CertignaCAs { - public void runTest(boolean ocspEnabled, - final String VALID, - final String REVOKED, - final String INT_CERT) throws Exception { - - ValidatePathWithParams pathValidator; - String[] validChainToValidate; - String[] revChainToValidate; - - if (!ocspEnabled) { - pathValidator = new ValidatePathWithParams(null); - pathValidator.enableCRLCheck(); - - validChainToValidate = new String[]{VALID, INT_CERT}; - revChainToValidate = new String[]{REVOKED, INT_CERT}; - } else { - // int certificate doesn't specify OCSP responder - pathValidator = new ValidatePathWithParams(new String[]{INT_CERT}); - pathValidator.enableOCSPCheck(); - - validChainToValidate = new String[]{VALID}; - revChainToValidate = new String[]{REVOKED}; - } - - // Validate valid - pathValidator.validate(validChainToValidate, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(revChainToValidate, - ValidatePathWithParams.Status.REVOKED, - "Fri Mar 10 03:39:51 PST 2023", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ComodoCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,643 +0,0 @@ -/* - * Copyright (c) 2017, 2021, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8189131 8231887 - * @summary Interoperability tests with Comodo RSA, ECC, userTrust RSA, and - * userTrust ECC CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath ComodoCA OCSP - * @run main/othervm -Djava.security.debug=certpath ComodoCA CRL - */ - - /* - * Obtain TLS test artifacts for Comodo CAs from: - * - * Valid TLS Certificates: - * https://comodorsacertificationauthority-ev.comodoca.com - * https://comodoecccertificationauthority-ev.comodoca.com - * https://usertrustrsacertificationauthority-ev.comodoca.com - * https://usertrustecccertificationauthority-ev.comodoca.com - * - * Revoked TLS Certificates: - * https://comodorsacertificationauthority-ev.comodoca.com:444 - * https://comodoecccertificationauthority-ev.comodoca.com:444 - * https://usertrustrsacertificationauthority-ev.comodoca.com:444 - * https://usertrustecccertificationauthority-ev.comodoca.com:444 - */ -public class ComodoCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new ComodoRSA().runTest(pathValidator); - new ComodoECC().runTest(pathValidator); - new ComodoUserTrustRSA().runTest(pathValidator); - new ComodoUserTrustECC().runTest(pathValidator); - } -} - -class ComodoRSA { - - // Owner: CN=COMODO RSA Extended Validation Secure Server CA, - // O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB - // Issuer: CN=COMODO RSA Certification Authority, O=COMODO CA Limited, - // L=Salford, ST=Greater Manchester, C=GB - // Serial number: 6a74380d4ebfed435b5a3f7e16abdd8 - // Valid from: Sat Feb 11 16:00:00 PST 2012 until: Thu Feb 11 15:59:59 PST 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIGDjCCA/agAwIBAgIQBqdDgNTr/tQ1taP34Wq92DANBgkqhkiG9w0BAQwFADCB\n" - + "hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\n" - + "A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV\n" - + "BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTIwMjEy\n" - + "MDAwMDAwWhcNMjcwMjExMjM1OTU5WjCBkjELMAkGA1UEBhMCR0IxGzAZBgNVBAgT\n" - + "EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR\n" - + "Q09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMTL0NPTU9ETyBSU0EgRXh0ZW5kZW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XtBLMeJPNBy3IX6WK/VJeQT+FhlZ58N/1eLqYVeyqZLsKeyLeCMIs37/3mk\n" - + "jCuN/gI9JN6pXV/kD0fQ22YlPodHDK4ixVAihNftSlka9pOlk7DgG4HyVsTIEFPk\n" - + "1Hax0VtpS3ey4E/EhOfUoFDuPPpE/NBXueEoU/1Tzdy5H3pAvTA/2GzS8+cHnx8i\n" - + "teoiccsq8FZ8/qyo0QYPFBRSTP5kKwxpKrgNUG4+BAe/eiCL+O5lCeHHSQgyPQ0o\n" - + "fkkdt0rvAucNgBfIXOBhYsvss2B5JdoaZXOcOBCgJjqwyBZ9kzEi7nQLiMBciUEA\n" - + "KKlHMd99SUWa9eanRRrSjhMQ34Ovmw2tfn6dNVA0BM7pINae253UqNpktNEvWS5e\n" - + "ojZh1CSggjMziqHRbO9haKPl0latxf1eYusVqHQSTC8xjOnB3xBLAer2VBvNfzu9\n" - + "XJ/B288ByvK6YBIhMe2pZLiySVgXbVrXzYxtvp5/4gJYp9vDLVj2dAZqmvZh+fYA\n" - + "tmnYOosxWd2R5nwnI4fdAw+PKowegwFOAWEMUnNt/AiiuSpm5HZNMaBWm9lTjaK2\n" - + "jwLI5jqmBNFI+8NKAnb9L9K8E7bobTQk+p0pisehKxTxlgBzuRPpwLk6R1YCcYAn\n" - + "pLwltum95OmYdBbxN4SBB7SC\n" - + "-----END CERTIFICATE-----"; - - // Owner: CN=comodorsacertificationauthority-ev.comodoca.com, - // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, - // L=Salford, ST=Manchester, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization, - // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO RSA Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 9eb246629030e0b527ca2f93e5ebf25a - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHSzCCBjOgAwIBAgIRAJ6yRmKQMOC1J8ovk+Xr8lowDQYJKoZIhvcNAQELBQAw\n" + - "gZIxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n" + - "BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTgwNgYD\n" + - "VQQDEy9DT01PRE8gUlNBIEV4dGVuZGVkIFZhbGlkYXRpb24gU2VjdXJlIFNlcnZl\n" + - "ciBDQTAeFw0yMTAzMDIwMDAwMDBaFw0yMjA0MDIyMzU5NTlaMIIBNzERMA8GA1UE\n" + - "BRMIMDQwNTg2OTAxEzARBgsrBgEEAYI3PAIBAxMCR0IxHTAbBgNVBA8TFFByaXZh\n" + - "dGUgT3JnYW5pemF0aW9uMQswCQYDVQQGEwJHQjEPMA0GA1UEERMGTTUgM0VRMRMw\n" + - "EQYDVQQIEwpNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRYwFAYDVQQJEw1U\n" + - "cmFmZm9yZCBSb2FkMRYwFAYDVQQJEw1FeGNoYW5nZSBRdWF5MSUwIwYDVQQJExwz\n" + - "cmQgRmxvb3IsIDI2IE9mZmljZSBWaWxsYWdlMRgwFgYDVQQKEw9TZWN0aWdvIExp\n" + - "bWl0ZWQxODA2BgNVBAMTL2NvbW9kb3JzYWNlcnRpZmljYXRpb25hdXRob3JpdHkt\n" + - "ZXYuY29tb2RvY2EuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\n" + - "0P95lAFOOkEOy614rCX7OlOK0Xy0nPAcCFxAcLYBosX8YmXWuePHg596UyEqE3U5\n" + - "30pTqiccY53bDiYPgSJgr1OlfC7BPLN+QKaeSrFmNgrcoAk3TXejgv7zLXOwZVS6\n" + - "Wk38Z8xrFNvhd2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JbHPgbqK21/Nugwl5mgMO81YQSHOm4VcQ8UvOJjnN\n" + - "JQIgWw9fortwJBtv2Mts6xJYr5D6itPpEYP8uegURneBwRsAdgBvU3asMfAxGdiZ\n" + - "AKRRFf93FRwR2QLBACkGjbIImjfZEwAAAXfyqEjyAAAEAwBHMEUCIDifAsuw37D4\n" + - "beHZ9Ed5/Pab0Eg6Cobrh4jv3bjfA6KIAiEAmiA/XD+AccfI85c+C2zH9wNIs+Zm\n" + - "/V/uo/sv0i9eCAYwDQYJKoZIhvcNAQELBQADggEBADRFnOFgb3mzCUpXxiU5/mM5\n" + - "ECRj3NzXKXjcYlSMhVcWA7Eqa5rhJuh11vbPoDQzQcGxntS/zhRwJFRF3hnyFa3m\n" + - "4t+7ZnUaJN+GOMTABh4kYiOSpE9id12URdJzWv2IHg4CU3OLnsBHGh7H9eWfbPvn\n" + - "OW4owV1ChpiEHh40i/NQkTn9JzjlZepI9+EsSdhn2tpis7tko6PX/plgw8bRgm7f\n" + - "ong2QaX/DE6z4VIdomW8TQhB9turhKxwjzPTbtYDQIgZfRP/H1S5jYutqbE5yL5B\n" + - "r+VOiSuB8234P4xWg1IBL2EFbxPdgOSMTWRJutUcj44kJKmwp5GUQtySSccw4gk=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=comodorsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, - // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, - // L=Salford, OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization, - // OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO RSA Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: a0c7cabcc25ed9358ded02cc1d485545 - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIF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l94fp4pkmke7AiBsJOvPE6irgcOO1/lnP7NRuln7iPJjU7T20PEK5/rm\n" + - "KwB2AFWB1MIWkDYBSuoLm1c8U/DA5Dh4cCUIFy+jqh0HE9MMAAABbYMBd0kAAAQD\n" + - "AEcwRQIhALgUI5XxM1NHbJDdr19h2pe3LhzK4tpuB/OQ9BgCyrGXAiBdr6mNCB/G\n" + - "rbdVx0u7iezwC7mq7iaWugR3rrWlSA8fWQB2ALvZ37wfinG1k5Qjl6qSe0c4V5UK\n" + - "q1LoGpCWZDaOHtGFAAABbYMBd1oAAAQDAEcwRQIgXbG32dagMeLhuZb+LSpJO1vI\n" + - "BmxmRnNdiz5FbG9cCbwCIQCr1X9f+ebT5fhlDUNBURUorTtM8QQciBiueBqvHk7+\n" + - "1DANBgkqhkiG9w0BAQsFAAOCAQEAM/A/1dgoc5NP1n+w3SX9qWcN7QT7ExdrnZSl\n" + - "Ygn0PF2fx4gz7cvNKucbpQJNA4C9awGydyYK8/o5KDUXt3K7eb1OAZ/NZBjygsJs\n" + - "ikXvxlBh8oEoqBOfOtr24l0NGUWnP8Qeu/VPcIMER4V8qX+in0pCXkSd67nkp6Bs\n" + - "EcqhDPgmzdSC1gQHsZuBdotG14OfdH1cG1bRK6GadISLG1h8BFukVem42B149v8F\n" + - "MCIUQAYprAVv2WlTZKBx9XzuK6IK3+klHZ07Jfvjvt7PPG5HKSMWBMnMaTHKcyQI\n" + - "G3t91yw7BnNNInZlBSsFtqjbHhDcr7uruZdbi0rerSsi2qDr0w==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:51:39 PST 2021", System.out); - } -} - -class ComodoECC { - - // Owner: CN=COMODO ECC Extended Validation Secure Server CA, - // O=COMODO CA Limited, L=Salford, ST=Greater Manchester, C=GB - // Issuer: CN=COMODO ECC Certification Authority, O=COMODO CA Limited, - // L=Salford, ST=Greater Manchester, C=GB - // Serial number: 61d4643b412b5d8d715499d8553aa03 - // Valid from: Sun Apr 14 17:00:00 PDT 2013 until: Fri Apr 14 16:59:59 PDT 2028 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIDojCCAyigAwIBAgIQBh1GQ7QStdjXFUmdhVOqAzAKBggqhkjOPQQDAzCBhTEL\n" - + "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n" - + "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT\n" - + "IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTMwNDE1MDAw\n" - + "MDAwWhcNMjgwNDE0MjM1OTU5WjCBkjELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy\n" - + "ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N\n" - + "T0RPIENBIExpbWl0ZWQxODA2BgNVBAMTL0NPTU9ETyBFQ0MgRXh0ZW5kZWQgVmFs\n" - + "aWRhdGlvbiBTZWN1cmUgU2VydmVyIENBMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" - + "QgAEV3AaPyeTQy0aWXXkBJMR42DsJ5pnbliJe7ndaHzCDslVlY8ofpxeFiqluZrK\n" - + "KNcJeBU/Jl1YI9jLMyMZKsfSoaOCAWkwggFlMB8GA1UdIwQYMBaAFHVxpxlIGbyd\n" - + "nepBR9+UxEh3mdN5MB0GA1UdDgQWBBTTTsMZulhZ0Rxgt2FTRzund4/4ijAOBgNV\n" - + "HQ8BAf8EBAMCAYYwEgYDVR0TAQH/BAgwBgEB/wIBADA+BgNVHSAENzA1MDMGBFUd\n" - + "IAAwKzApBggrBgEFBQcCARYdaHR0cHM6Ly9zZWN1cmUuY29tb2RvLmNvbS9DUFMw\n" - + "TAYDVR0fBEUwQzBBoD+gPYY7aHR0cDovL2NybC5jb21vZG9jYS5jb20vQ09NT0RP\n" - + "RUNDQ2VydGlmaWNhdGlvbkF1dGhvcml0eS5jcmwwcQYIKwYBBQUHAQEEZTBjMDsG\n" - + "CCsGAQUFBzAChi9odHRwOi8vY3J0LmNvbW9kb2NhLmNvbS9DT01PRE9FQ0NBZGRU\n" - + "cnVzdENBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29t\n" - + "MAoGCCqGSM49BAMDA2gAMGUCMQDmPWS98nREWdt4xB83r9MVvgG5INpKHi6V1dUY\n" - + "lCqvSvXXjK0QvZSrOB7cj9RavGgCMG2xJNG+SvlTWEYpmK7eXSgmRUgoBDeQ0yDK\n" - + "lnxmeeOBnnCaDIxAcA3aCj2Gtdt3sA==\n" - + "-----END CERTIFICATE-----"; - - // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, O=Sectigo Limited, STREET="3rd Floor, - // 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Manchester, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: db437a31e5be29a62443e3caa1479001 - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFvzCCBWWgAwIBAgIRANtDejHlvimmJEPjyqFHkAEwCgYIKoZIzj0EAwIwgZIx\n" + - "CzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNV\n" + - "BAcT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- "ZWN0aWdvLmNvbS9DUFMwBwYFZ4EMAQEwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDov\n" + - "L2NybC5jb21vZG9jYS5jb20vQ09NT0RPRUNDRXh0ZW5kZWRWYWxpZGF0aW9uU2Vj\n" + - "dXJlU2VydmVyQ0EuY3JsMIGHBggrBgEFBQcBAQR7MHkwUQYIKwYBBQUHMAKGRWh0\n" + - "dHA6Ly9jcnQuY29tb2RvY2EuY29tL0NPTU9ET0VDQ0V4dGVuZGVkVmFsaWRhdGlv\n" + - "blNlY3VyZVNlcnZlckNBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29t\n" + - "b2RvY2EuY29tMDoGA1UdEQQzMDGCL2NvbW9kb2VjY2NlcnRpZmljYXRpb25hdXRo\n" + - "b3JpdHktZXYuY29tb2RvY2EuY29tMIIBBAYKKwYBBAHWeQIEAgSB9QSB8gDwAHYA\n" + - "RqVV63X6kSAwtaKJafTzfREsQXS+/Um4havy/HD+bUcAAAF38qtH4AAABAMARzBF\n" + - "AiBsKoB1TTfoUYUNqF160/vlOENHyK1zzARcnfGKYURHTwIhANKYWg1CO7jyCPk+\n" + - "IrrLaR+461snNK4LJZXJm4o/9GeeAHYAb1N2rDHwMRnYmQCkURX/dxUcEdkCwQAp\n" + - "Bo2yCJo32RMAAAF38qtJIAAABAMARzBFAiEA1hgxkYZb5Tc9+vQsDnsfXVewClN2\n" + - "7gzwd4hZdqAsOSYCID9CWcBvkKrL44mfe9ky1Z6BnAWHUBMCxTjt8MO/IMZ8MAoG\n" + - "CCqGSM49BAMCA0gAMEUCIBa3sfOiVb0q4LcXU9umKjzVw3Ib8VdiPTtXSnyl0oLb\n" + - "AiEAnpRB53UtLAF7xw98ELmK/LEk1b5KSlqoO8sFHgwQ8vI=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=comodoecccertificationauthority-ev.comodoca.com, OU=COMODO EV SSL, O=Sectigo Limited, - // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=COMODO ECC Extended Validation Secure Server CA, O=COMODO CA Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 7972d9d8472a2d52ad1ee6edfb16cbe1 - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGPzCCBeWgAwIBAgIQeXLZ2EcqLVKtHubt+xbL4TAKBggqhkjOPQQDAjCBkjEL\n" + - "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE\n" + - "BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxODA2BgNVBAMT\n" + - "L0NPTU9ETyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n" + - "MB4XDTE5MDkzMDAwMDAwMFoXDTIxMTIyODIzNTk1OVowggE6MREwDwYDVQQFEwgw\n" + - "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n" + - "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExEDAOBgNV\n" + - "BAcTB1NhbGZvcmQxFjAUBgNVBAkTDVRyYWZmb3JkIFJvYWQxFjAUBgNVBAkTDUV4\n" + - "Y2hhbmdlIFF1YXkxJTAjBgNVBAkTHDNyZCBGbG9vciwgMjYgT2ZmaWNlIFZpbGxh\n" + - "Z2UxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDEWMBQGA1UECxMNQ09NT0RPIEVW\n" + - "IFNTTDE4MDYGA1UEAxMvY29tb2RvZWNjY2VydGl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\n" + - "0VFTWHEmAVjaV23fGj3Ybu3mpSiHr6viGlgA2lYaAHUAVYHUwhaQNgFK6gubVzxT\n" + - "8MDkOHhwJQgXL6OqHQcT0wwAAAFtgwQTKAAABAMARjBEAiBb/gW1RU7kgFBiNpHx\n" + - "LStujKIocyENUTXsMbsac+LktwIgXbEr8vOOCEdBdXQ2F/FKec8ft6gz57mHNmwl\n" + - "pp7phbQAdgC72d+8H4pxtZOUI5eqkntHOFeVCqtS6BqQlmQ2jh7RhQAAAW2DBBM6\n" + - "AAAEAwBHMEUCIQDjKN3h86ofR94+JxLFoYuoA+DRtxEY8XGg+NQXlZfUrgIgEoO2\n" + - "ZzKbGfohdwj/WtDwJDRX5pjXF4M0nECiwtYXDIwwCgYIKoZIzj0EAwIDSAAwRQIg\n" + - "AkIRVQBwrElFjrnqk5XPvnlnwkIm1A70ayqOf1FexoQCIQC8tBTn//RCfrhcgTjd\n" + - "ER4wRjFfFoc6lC68OHGVg9CZZg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:53:40 PST 2021", System.out); - } -} - -class ComodoUserTrustRSA { - - // Owner: CN=Sectigo RSA Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Issuer: CN=USERTrust RSA Certification Authority, O=The USERTRUST Network, L=Jersey City, ST=New Jersey, C=US - // Serial number: 284e39c14b386d889c7299e58cd05a57 - // Valid from: Thu Nov 01 17:00:00 PDT 2018 until: Tue Dec 31 15:59:59 PST 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGNDCCBBygAwIBAgIQKE45wUs4bYiccpnljNBaVzANBgkqhkiG9w0BAQwFADCB\n" + - "iDELMAkGA1UEBh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reSPJvZHHNDyCmoyjXvNhR+u3arXUoHWxO+MZBeXbi\n" + - "iF7Nwn/IEmQvWBW8l6D26CXIavcY1kAJcfyzHkrPbLo+fAOa/KFl3lIU+0biEVNk\n" + - "Q9zXE6hC6X4=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, O=Sectigo Limited, STREET="3rd Floor, - // 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Manchester, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo RSA Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 4e484426dbfed0c222b2ed152465614a - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHTzCCBjegAwIBAgIQTkhEJtv+0MIisu0VJGVhSjANBgkqhkiG9w0BAQsFADCB\n" + - "kTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G\n" + - "A1UEBxMHU2FsZm9yZDEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTkwNwYDVQQD\n" + - "EzBTZWN0aWdvIFJTQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIg\n" + - "Q0EwHhcNMjEwMzAyMDAwMDAwWhcNMjIwNDAyMjM1OTU5WjCCAToxETAPBgNVBAUT\n" + - "CDA0MDU4NjkwMRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0wGwYDVQQPExRQcml2YXRl\n" + - "IE9yZ2FuaXphdGlvbjELMAkGA1UEBhMCR0IxDzANBgNVBBETBk01IDNFUTETMBEG\n" + - "A1UECBMKTWFuY2hlc3RlcjEQMA4GA1UE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x5cdtmQFLIkntus\n" + - "DCfN+n51HPUo8r4PUhQtOiRUB3K871LTdwyv4/CRXS2fIhtO1pxYNKFOw0yrUf6j\n" + - "ECgk\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustrsacertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, O=Sectigo Limited, - // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, ST=Manchester, - // OID.2.5.4.17=M5 3EQ, C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo RSA Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: b07fd164b5790c9d5d1fddff5819cdb2 - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIH5TCCBs2gAwIBAgIRALB/0WS1eQydXR/d/1gZzbIwDQYJKoZIhvcNAQELBQAw\n" + - "gZExCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO\n" + - "BgNVBAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE5MDcGA1UE\n" + - "AxMwU2VjdGlnbyBSU0EgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVy\n" + - "IENBMB4XDTE5MDkzMDAwMDAwMFoXDTIxMTIyODIzNTk1OVowggFWMREwDwYDVQQF\n" + - "EwgwNDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0\n" + - "ZSBPcmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExEzAR\n" + - "BgNVBAgTCk1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxF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n" + - "JeLyloDqhvmT/CG/hdwrfZ3Sv3N2xpetGcnW5S3oEi3m+/M1ls9eD+x1vybqV9Kd\n" + - "lcjuV7SYDlbvAS9w7TcygudhdW0cI8XTCvesGKohBkAlqaQ/MWYpt4WvsxHjbWgn\n" + - "5ZlIYR6A1ZFEjADifViH/5AA79lgGhAskkIWPjvRFalEVKTKtjhRK76eCfZs4Frr\n" + - "CEOpon+BeNKk+x/K/r10dSoWe0SV2uGVxTD83zkP++eREwo1hTgn8bXn7ftlnA3j\n" + - "7ml+Usz6udaD\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:55:42 PST 2021", System.out); - } -} - -class ComodoUserTrustECC { - - // Owner: CN=Sectigo ECC Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Issuer: CN=USERTrust ECC Certification Authority, O=The USERTRUST Network, L=Jersey City, ST=New Jersey, C=US - // Serial number: 80f5606d3a162b143adc12fbe8c2066f - // Valid from: Thu Nov 01 17:00:00 PDT 2018 until: Tue Dec 31 15:59:59 PST 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDyTCCA0+gAwIBAgIRAID1YG06FisUOtwS++jCBm8wCgYIKoZIzj0EAwMwgYgx\n" + - "CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpOZXcgSmVyc2V5MRQwEgYDVQQHEwtKZXJz\n" + - "ZXkgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMS4wLAYDVQQD\n" + - "EyVVU0VSVHJ1c3QgRUNDIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTE4MTEw\n" + - "MjAwMDAwMFoXDTMwMTIzM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W7DihtY5XE0XCLCw+git0NjxiFB6FaOFIlyDdqT\n" + - "j+Th+DJ92JLvICVD/g==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, O=Sectigo Limited, - // STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, L=Salford, - // ST=Manchester, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo ECC Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 9aa5da67480446fd7bf408fd5fdaa1d8 - // Valid from: Mon Mar 01 16:00:00 PST 2021 until: Sat Apr 02 16:59:59 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFwTCCBWigAwIBAgIRAJql2mdIBEb9e/QI/V/aodgwCgYIKoZIzj0EAwIwgZEx\n" + - "CzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNV\n" + - "BAcTB1NhbGZvcmQxGDAWBgNVBAoTD1NlY3RpZ28gTGltaXRlZDE5MDcGA1UEAxMw\n" + - "U2VjdGlnbyBFQ0MgRXh0ZW5kZWQgVmFsaWRhdGlvbiBTZWN1cmUgU2VydmVyIENB\n" + - "MB4XDTIxMDMwMjAwMDAwMFoXDTIyMDQwMjIzNTk1OVowggE6MREwDwYDVQQFEwgw\n" + - "NDA1ODY5MDETMBEGCysGAQQBgjc8AgEDEwJHQjEdMBsGA1UEDxMUUHJpdmF0ZSBP\n" + - "cmdhbml6YXRpb24xCzAJBgNVBAYTAkdCMQ8wDQYDVQQREwZNNSAzRVExEzARBgNV\n" + - "BAgTCk1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxFjAUBgNVBAkTDVRyYWZm\n" + - "b3JkIFJvYWQxFjAUBgNVBA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9kb2NhLmNvbTCCAQMGCisGAQQB1nkCBAIEgfQEgfEA\n" + - "7wB2AEalVet1+pEgMLWiiWn0830RLEF0vv1JuIWr8vxw/m1HAAABd/Kung0AAAQD\n" + - "AEcwRQIhAI16l52NctGAphhc6eh2kK2vO5QYk5nyouL3P6U/gG/dAiBfJRJ+iqE/\n" + - "noco35RpNtlV4GABrwmw1I/1R+L79VzwEAB1AG9Tdqwx8DEZ2JkApFEV/3cVHBHZ\n" + - "AsEAKQaNsgiaN9kTAAABd/KunvwAAAQDAEYwRAIgS+r3C10ua38DPJKvUJvW5bvL\n" + - "SCQ949n3sBJvhV6aXq4CIH/oEGgvJmKtMEjVKUQg8TrZO6LwQ+0sYfL79Qvm8wL3\n" + - "MAoGCCqGSM49BAMCA0cAMEQCID4Q9cc8OQ9tmKnnKZyplPsPipI5apVGkBqFRUSt\n" + - "zzM3AiAw5tw3cv/oabDsYdU+lmp5kZ/S3Z97ANAAaHE0AfXe/Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=usertrustecccertificationauthority-ev.comodoca.com, OU=COMODO EV SGC SSL, - // O=Sectigo Limited, STREET="3rd Floor, 26 Office Village", STREET=Exchange Quay, STREET=Trafford Road, - // L=Salford, OID.2.5.4.17=M5 3EQ, - // C=GB, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB, SERIALNUMBER=04058690 - // Issuer: CN=Sectigo ECC Extended Validation Secure Server CA, O=Sectigo Limited, L=Salford, - // ST=Greater Manchester, C=GB - // Serial number: 8b72489b7f505a55e2a22659c90ed2ab - // Valid from: Sun Sep 29 17:00:00 PDT 2019 until: Tue Dec 28 15:59:59 PST 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGRTCCBeugAwIBAgIRAItySJt/UFpV4qImWckO0qswCgYIKoZIzj0EAwIwgZEx\n" + - "CzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOB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j0EAwID\n" + - "SAAwRQIhAPwQWGWd3oR7YJ7ngCDQ9TAbdPgND51SiR34WfEgaTQtAiAxD4umKm02\n" + - "59GEMj5NpyF2ZQEq5mEGcjJNojrn+PC4zg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 02 02:59:25 PST 2021", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/DigicertCSRootG5.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,303 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8318759 + * @summary Interoperability tests with Digicert CS Root G5 certificates + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=ocsp,certpath DigicertCSRootG5 OCSP + * @run main/othervm -Djava.security.debug=certpath DigicertCSRootG5 CRL + */ + +public class DigicertCSRootG5 { + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + new Digicert_CS_ECC().runTest(pathValidator); + new Digicert_CS_RSA().runTest(pathValidator); + } +} + +class Digicert_CS_ECC { + + // Owner: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Issuer: CN=DigiCert CS ECC P384 Root G5, O="DigiCert, Inc.", C=US + // Serial number: d926818addd3c47758f0ace9379b2e7 + // Valid from: Wed Feb 10 16:00:00 PST 2021 until: Sun Feb 10 15:59:59 PST 2036 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIDOTCCAsCgAwIBAgIQDZJoGK3dPEd1jwrOk3my5zAKBggqhkjOPQQDAzBNMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJTAjBgNVBAMTHERp\n" + + "Z2lDZXJ0IENTIEVDQyBQMzg0IFJvb3QgRzUwHhcNMjEwMjExMDAwMDAwWhcNMzYw\n" + + "MjEwMjM1OTU5WjBTMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIElu\n" + + "Yy4xKzApBgNVBAMTIkRpZ2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEw\n" + + "djAQBgcqhkjOPQIBBgUrgQQAIgNiAAS/zvKH4sLLu/zze3/+vHyfRE5OcO77TNw3\n" + + "MCMAlad2Y/ja50KTooGSmXhfwMXpbBTob7hsoxpvIU92W6DhFn9lg4pcKf5UHLEi\n" + + "0iDdHQ9w0hpFJiMABwK60nk+OwsGTZSjggFdMIIBWTASBgNVHRMBAf8ECDAGAQH/\n" + + "AgEAMB0GA1UdDgQWBBTXHcf6xvqCdCBFcTQSL1XVmEGSXjAfBgNVHSMEGDAWgBTw\n" + + "jJhxOThlwjobphdmHcjtZd6SNjAOBgNVHQ8BAf8EBAMCAYYwEwYDVR0lBAwwCgYI\n" + + "KwYBBQUHAwMweQYIKwYBBQUHAQEEbTBrMCQGCCsGAQUFBzABhhhodHRwOi8vb2Nz\n" + + "cC5kaWdpY2VydC5jb20wQwYIKwYBBQUHMAKGN2h0dHA6Ly9jYWNlcnRzLmRpZ2lj\n" + + "ZXJ0LmNvbS9EaWdpQ2VydENTRUNDUDM4NFJvb3RHNS5jcnQwRQYDVR0fBD4wPDA6\n" + + "oDigNoY0aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0Q1NFQ0NQMzg0\n" + + "Um9vdEc1LmNybDAcBgNVHSAEFTATMAcGBWeBDAEDMAgGBmeBDAEEATAKBggqhkjO\n" + + "PQQDAwNnADBkAjByCWijRCnJogZf94U5HG/5S4QFMxEOBSAyxECbFxgrXMKXh5qa\n" + + "7oS2F+hT2DPzxTwCMCIthK0X/14bxZvrNNiNSWzer2TDUyRw6HNIfnkHgqaGFQVA\n" + + "KyS5I77prv53stK0XQ==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN="Win The Customer, LLC", O="Win The Customer, LLC", L=Saratoga + // Springs, ST=Utah, C=US, SERIALNUMBER=9637546-0160, OID.2.5.4.15=Private + // Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Utah, OID.1.3.6.1.4.1.311.60.2.1.3=US + // Issuer: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: b13737c3caf58eecb4359f441522133 + // Valid from: Wed Jan 25 16:00:00 PST 2023 until: Tue Jan 28 15:59:59 PST 2025 + private static final String VALID = "-----BEGIN C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IxQ0Ex\n" + + "LmNybDA9BgNVHSAENjA0MDIGBWeBDAEDMCkwJwYIKwYBBQUHAgEWG2h0dHA6Ly93\n" + + "d3cuZGlnaWNlcnQuY29tL0NQUzB+BggrBgEFBQcBAQRyMHAwJAYIKwYBBQUHMAGG\n" + + "GGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBIBggrBgEFBQcwAoY8aHR0cDovL2Nh\n" + + "Y2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0RzVDU0VDQ1NIQTM4NDIwMjFDQTEu\n" + + "Y3J0MAwGA1UdEwEB/wQCMAAwCgYIKoZIzj0EAwMDZwAwZAIwLkWJc/eLxftorFCv\n" + + "ocOA1dfUFx7Al18d5Xsgpkx47kj2DWgQU+/bQEbbyPrKzYgCAjAP5ErLauJRC2to\n" + + "pPk/yXZYXsusmWVH7ozl9O5WR7+a3gVQ1zwVFWuqdjbq3zWWqJM=\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Win the Customer LLC, O=Win the Customer LLC, L=Saratoga Springs, ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS ECC SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: 201e51cb1ec8a56a1e8438c95adf024 + // Valid from: Sun Oct 22 17:00:00 PDT 2023 until: Tue Oct 22 16:59:59 PDT 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIFdjCCBP2gAwIBAgIQAgHlHLHsilah6EOMla3wJDAKBggqhkjOPQQDAzBTMQsw\n" + + "CQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xKzApBgNVBAMTIkRp\n" + + "Z2lDZXJ0IEc1IENTIEVDQyBTSEEzODQgMjAyMSBDQTEwHhcNMjMxMDIzMDAwMDAw\n" + + "WhcNMjQxMDIyMjM1OTU5WjB1MQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRhaDEZ\n" + + "MBcGA1UEBxMQU2FyYXRvZ2EgU3By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ljZXJ0LmNv\n" + + "bS9DUFMwDgYDVR0PAQH/BAQDAgeAMBMGA1UdJQQMMAoGCCsGAQUFBwMDMIGNBgNV\n" + + "HR8EgYUwgYIwP6A9oDuGOWh0dHA6Ly9jcmwzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2Vy\n" + + "dEc1Q1NFQ0NTSEEzODQyMDIxQ0ExLmNybDA/oD2gO4Y5aHR0cDovL2NybDQuZGln\n" + + "aWNlcnQuY29tL0RpZ2lDZXJ0RzVDU0VDQ1NIQTM4NDIwMjFDQTEuY3JsMH4GCCsG\n" + + "AQUFBwEBBHIwcDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuZGlnaWNlcnQuY29t\n" + + "MEgGCCsGAQUFBzAChjxodHRwOi8vY2FjZXJ0cy5kaWdpY2VydC5jb20vRGlnaUNl\n" + + "cnRHNUNTRUNDU0hBMzg0MjAyMUNBMS5jcnQwCQYDVR0TBAIwADAKBggqhkjOPQQD\n" + + "AwNnADBkAjA9aX3CSzCOZiHdC6JBF0nQwPLGNipPdHFMSbINmfpuHCC3Go4prf8M\n" + + "WCsWEQr2gQYCMErfcrU8zfxnQ9SxsmGJ8jkM3MDGvAr0CtzDwmWis32V60jAUFBQ\n" + + "lGm/Mdb5/EqKpw==\n" + + "-----END CERTIFICATE-----"; + + public void runTest(ValidatePathWithParams pathValidator) throws Exception { + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Mon Oct 23 14:48:38 PDT 2023", System.out); + } +} + +class Digicert_CS_RSA { + + // Owner: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Issuer: CN=DigiCert CS RSA4096 Root G5, O="DigiCert, Inc.", C=US + // Serial number: 10262e16224ca6dfef584f8c63048db + // Valid from: Wed Feb 10 16:00:00 PST 2021 until: Sun Feb 10 15:59:59 PST 2036 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGjDCCBHSgAwIBAgIQAQJi4WIkym3+9YT4xjBI2zANBgkqhkiG9w0BAQwFADBM\n" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xJDAiBgNVBAMT\n" + + "G0RpZ2lDZXJ0IENTIFJTQTQwOTYgUm9vdCBHNTAeFw0yMTAyMTEwMDAwMDBaFw0z\n" + + "NjAyMTAyMzU5NTlaMFcxCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5EaWdpQ2VydCwg\n" + + "SW5jLjEvMC0GA1UEAxMmRGlnaUNlcnQgRzUgQ1MgUlNBNDA5NiBTSEEzODQgMjAy\n" + + "MSBDQTEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC1GOMV0tdTLLBk\n" + + "Ylmccgb6bFa9By5zkuLg9NfFMl4y9P9f21C7N+mMA4fWgfjEs+7/3ByGLaB+7/Pi\n" + + "TT3qXpvBz4uVWob9xv3lkAsIpwh/TMJulijy3GdpAQBMdvW/+HFrbRJGaJ3MM9d1\n" + + "pC3CRPmFWyXUpxqhb0FbMPA8OlsZNjg9fd/zCLevSJlL6ZdjfZ/4FiF26OfO60V6\n" + + "bOuTnd8JbDuwPfMWLP6qEinlFr7V9mjcZc4dfUWH70y7M6av7R1Tc68YQjrtPwIA\n" + + "5pdEcG/VeBVplpne1uxuc61ucVgTpjwOTV6E2KrCe+OCG8/m4voN7T4GC1RfPH3n\n" + + "PlCNV6MeiCVwExPhJFxZ+eTvhVJe0W7mriYpEo2kNR4pnSUhiS92vF4lI3ToAdnH\n" + + "LV+yx0VdsPVwEO344rsVNQvP/hrCHefKm3HsirlazTKpiI9OgZlkXohHanp8IgMx\n" + + "2HvBE/6HcCq/5PiRaeSzvFfRuotLS/LMCXaQEGV9JNSd1omKeNyaDqs89cNbf0g7\n" + + "Tn1AhAxb/TDIkIAV/1bU1UFeq48uf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ZKS9k0Z36/m4D7z5nVXkmUvRvE2\n" + + "70BhJ0NnM5lHtytTR+OgiaPapeiDy6AA+VbdnV7hhINGEhP7tF3IZPPfmKZN7/bN\n" + + "Qr7wuKZx/jO5sTBtblBaOU2+xric+MlTt2k3ilDnO3EzkZOp1JMWnNjAZciRa8Gy\n" + + "bYAXrsxY4vQnxgA7dj1/3KDB+pCRT7CTMOJJQu27OOv0MuNkb1E+8chPx/eFwfrN\n" + + "rft1Eiqp3Te0w4njDkzukP6EMhebcTp3POm0YhMZl8s1fTI6DCcHFwcMVywXiWwv\n" + + "QG+Td+dHlFT0P8jq/ecaMj6s8j69q36MER+QMyrxGAl3MHyEA7BBut1WCh9dsOnY\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN="Win The Customer, LLC", O="Win The Customer, LLC", L=Saratoga + // Springs, ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: bfec2fd49eeacb347ddbea5c1576083 + // Valid from: Fri Jun 23 17:00:00 PDT 2023 until: Wed Jun 26 16:59:59 PDT 2024 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGqzCCBJOgAwIBAgIQC/7C/UnurLNH3b6lwVdggzANBgkqhkiG9w0BAQsFADBX" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLzAtBgNVBAMT" + + "JkRpZ2lDZXJ0IEc1IENTIFJTQTQwOTYgU0hBMzg0IDIwMjEgQ0ExMB4XDTIzMDYy" + + "NDAwMDAwMFoXDTI0MDYyNjIzNTk1OVowdzELMAkGA1UEBhMCVVMxDTALBgNVBAgT" + + "BFV0YWgxGTAXBgNVBAcTEFNhcmF0b2dhIFNwcmluZ3MxHjAcBgNVBAoTFVdpbiBU" + + "aGUgQ3VzdG9tZXIsIExMQzEeMBwGA1UEAxMVV2luIFRoZSBDdXN0b21lciwgTExD" + + "MIIBojANBgkqhkiG9w0BAQE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wYBBQUHMAGGGGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBMBggrBgEFBQcwAoZA" + + "aHR0cDovL2NhY2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0RzVDU1JTQTQwOTZT" + + "SEEzODQyMDIxQ0ExLmNydDAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4ICAQCj" + + "HCYM2aGyHFpdWRkbxa+so37uyPDJ27wpn4oNhaSKKletB8Xr6rMa5JBJ1NUa2S9Q" + + "3CYvdH9pGjjThUJPR0Lg8DrZNkPtqyjQLQ86tYfjteoKe5SXTxZ0epXikRTXySFa" + + "NM1KOEf5CJq7OywLLXVxm+F2VEX2+PzLAtHxViGeN7AsZMbWGlp3VkymVITcKkP3" + + "vnsoF6Teacb019xxBDCLuhNG91rlzhG0YrJ3qMlPyStmzxqy+2UIlPwFeLRkBkRG" + + "K7Kxi2xvYbgdFP93kRbwJbp8d3x/JG3LpwAZv+NV0TY3jBj7ymGoGuiSV0nU9XPt" + + "yDm1FYYZAH2ykwo8YPZqAcu+EHvyxi1dgOM3ABfoLJfOIYJv2gxPx+KIKzn1wzBS" + + "kk1HMf8xbYXs40vF2Lrb7AQIyLa2ZskJTyfb0dyEyOq+vvVgLA9ZdwidzD1RnVf6" + + "vOb7KbMSBCLK+HGqHrW+hhSDi2vHvSit7Cn+q80ZmzRqvJ/+mVl+ppnjDC7nSLIa" + + "qeG0fvUz6SabPX7yV92D5ARrJJ3xgAvgmgWfuKBV7WlEGCmj0QTWZ0/AFBLzNcq7" + + "+0rgP0GM98MZpKa8pHZaS1A3uP1TFzamfVGdv0FVHXSkN5Kvg0iPh4Qz9TRiCkyE" + + "boJeU1LYdyTrP/+q3zQqsGa9xdQ50EovjWymbvWzCQ==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=Win the Customer LLC, O=Win the Customer LLC, L=Saratoga Springs, + // ST=Utah, C=US + // Issuer: CN=DigiCert G5 CS RSA4096 SHA384 2021 CA1, O="DigiCert, Inc.", C=US + // Serial number: f409d101094769abaf06f085f11ca4f + // Valid from: Sun Oct 22 17:00:00 PDT 2023 until: Tue Oct 22 16:59:59 PDT 2024 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIHKTCCBRGgAwIBAgIQD0CdEBCUdpq68G8IXxHKTzANBgkqhkiG9w0BAQsFADBX\n" + + "MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xLzAtBgNVBAMT\n" + + "JkRpZ2lDZXJ0IEc1IENTIFJTQTQwOTYgU0hBMzg0IDIwMjEgQ0ExMB4XDTIzMTAy\n" + + "MzAwMDAwMFoXDTI0MTAyMjIzNTk1OVowdTELMAkGA1UEBhMCVVMxDTALBgNVBAgT\n" + + "BFV0YWgxGTAXBgNVBAcTEFNhcmF0b2dhIFNwcmluZ3MxHTAbBgNVBAoTFFdpbiB0\n" + + "aGUgQ3VzdG9tZXIgTExDMR0wGwYDVQQDExRXaW4gdGhlIEN1c3RvbWVyIExMQzCC\n" + + "AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANKPhVjUn2MyZs/l4AO0kQCE\n" + + "HdR9aWJ86nT8jSSbHdRv56n3h5P3sxMfFne4jCY3DzrykndeLp4gAt2sot1ziinh\n" + + "ahMOYOZtvyUzt5/McvQyuQjdXLaSuWcvlKaTl67U3QWQe+P6kmkRDsrCH0S51UeH\n" + + "8Tct/bq7ZUyX9Jb80VPVegUN80YzDgkJ2OrLngD6EKVYKQlV5K+KGyQpCOWq5CEB\n" + + "1aX63EnGiSMy0OOsS/J8aFz3BoYpEcrLSSnW84P6AhbevMfO7kr4mTLZKkx0Ic0Q\n" + + "s6TuaXcf84OuF2T/HwM0qzP7iQhE18TJmsyumVZID7t1+Br43037pb3CXcWTTJvO\n" + + "+zTkiArWy3SqAabyHirbssa75qCVHzcOHviy2wEDhc51cu1MZE8xtSDT4Hee87t0\n" + + "ptwC6v6CWaCn4XjOM6PFHr2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/B6uHrez1xy/RH/MlL/B+TF6YTg+ILqtKR/PyJrg\n" + + "N+1RON0Eg3AEWWDtGl3KBYFlklz8Szo+xmXf5GYiqueejbxscH1BA0PU/5CgGkr6\n" + + "1Kk4OXqKqmpuPeQCxca1ARDD749E/2IFsDGC8kBCWepV62l0/xcDKWD5Zn+y4Tkh\n" + + "5+YJJ21D746sNDOsDNJ4DuqEYrXWUH6BlT5EDYelGqRCOdyTYUdDg+QcSFWnH7wR\n" + + "O+eIA3BLSw0x1Vh6DJRKm5H644sPVppaI1jVZDe+zBwp2e/j8XH7KDlp/WaRUhcU\n" + + "bjGg2Ss5TMbBjR6B4nMwjvqaCIFoAD6aFRYc80px/KY6KTSyOFF0FBQNuhSsUZQy\n" + + "p74aRjUraSu/RiJMA8A6OYGo1b7W9o/UOg0MB4WQkfwl+Mxh+58QKjLjZr9VVapW\n" + + "4yv0G/G6rT/pHrRiyBcT7Kt4xNFsmMFAN4BXL9WI9mkGDa4iwDmWVjIjAaiilaaC\n" + + "MIXwwm3eg/QBgWBUrwXf3YC+1HXkaFDZc5apQ5uaNJPjQo9nQ6xqfpnACXTJ/Lwm\n" + + "JBu4YlXPby5Vh6mWWSyVdbICrCD7BtGP8aSBPFGPEuPEjK32uyeoGWVwwSubVFPX\n" + + "ARhLX5oSFZUySvHgYg==\n" + + "-----END CERTIFICATE-----"; + + public void runTest(ValidatePathWithParams pathValidator) throws Exception { + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Mon Oct 23 14:44:23 PDT 2023", System.out); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EmSignRootG2CA.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,179 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8319187 + * @summary Interoperability tests with eMudhra emSign Root CA G2 CS root + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA OCSP + * @run main/othervm -Djava.security.debug=certpath EmSignRootG2CA CRL + */ + +public class EmSignRootG2CA { + + // Owner: CN=emSign CS 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: c084e666596139a1fa9b + // Valid from: Sun Feb 18 10:30:00 PST 2018 until: Fri Feb 18 10:30:00 PST 2033 + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIIGeDCCBGCgAwIBAgILAMCE5mZZYTmh+pswDQYJKoZIhvcNAQEMBQAwZzELMAkG\n" + + "A1UEBhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0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tSzQ4nmA9aXBCAAxrABlY/hk10ImeBa1SPjocRb/vuCaGp74T\n" + + "n8oADP42XudDnp8wlOKWxFJulhNi960Rev+5vZOPF/LGfS78GI6yzBjR49VJGhOP\n" + + "EJK8NSNmK3FNblQfOyFM7VE0uOGHOUwpMGVM2A==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=test, OU=test, O=test, L=test, ST=test, C=IN + // Issuer: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: 7c9ade672c0ad1b6 + // Valid from: Wed Aug 30 05:39:25 PDT 2023 until: Sat Aug 30 05:39:25 PDT 2025 + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIGNjCCBB6gAwIBAgIIfJreZywK0bYwDQYJKoZIhvcNAQEMBQAwZTELMAkGA1UE\n" + + "BhMCSU4xEzARBgNVBAsTCmVtU2lnbiBQS0kxJTAjBgNVBAoTHGVNdWRocmEgVGVj\n" + + "aG5vbG9naWVzIExpbWl0ZWQxGjAYBgNVBAMTEWVtU2lnbiBDUyBDQSAtIEcyMB4X\n" + + "DTIzMDgzMDEyMzkyNVoXDTI1MDgzMDEyMzkyNVowWDELMAkGA1UEBhMCSU4xDTAL\n" + + "BgNVBAgTBHRlc3QxDTALBgNVBAcTBHRlc3QxDTALBgNVBAoMBHRlc3QxDTALBgNV\n" + + "BAsTBHRlc3QxDTALBgNVBAMTBHRlc3QwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAw\n" + + "ggGKAoIBgQC04pOiSFbl7Bd4wFYXzzyukKh+EmwIq8xRGQDkuYH+C6Zao36VAV+k\n" + + "xGw7lmM3rf4YUcArgZYHfrxgPJNBbGrCi/YnEPYQTNwSrBAePUx1tt13LVBxHfNu\n" + + "cQQT+kqE7064WsYfmfr/uzJZemqVH7lG82DN23+8E/235AIh3lz/pn7T9ByLj7TV\n" + + "zWP40oT0UfQXQvWUpFevPONu/RksRP+NiKV3ji6/wYpvrfodzkrGxw2DPfO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bp6p3lvBArK2BbabTs8+16xvmkHEK3d3l3Bu6qTEbQRgUI5XsVXmXXn8Pg\n" + + "IANliTEsbsN9CMWrJ56ciEujU7w2L+IBfvKhl10N1AQNHwpQzwfFyz2BUbACN75o\n" + + "feIUBarM3ssNzpnt7idgkCTwWVrdEL1NHyW967aEMWyVwaRrtkjFOW/0xuSr2rEI\n" + + "jBpPj5RPdP6ZEaqnmg5PIgSrJ8FBjx6JmvVgZH/XEl5MZ7PsvJFfIMun6RxXtGn7\n" + + "QP0+ipkRrI6USNFS84H53Q0WJhQWZUgd3cdm37wpFGvxOVEskIgJNW9SbOgiT9sB\n" + + "zTIy3ceOK2onmUkDM2Q2+Hbc7A4BmNIlW4fpYXvZlM7IXSl9U3Voks92Hi45azgz\n" + + "StWZv9+Ronmmp+b7JKCe7MZXIBHfj0JhAVNJiYTZ9BqkY2VRvuQPVUdKxske9fQ6\n" + + "ciFJ5a6RDOhce6pFloaQu39ci2XCY1N4mIR3vFzpmBNkttlEXviK07XNTv9cnQt6\n" + + "3CW5aMAsfTbmOw==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=test, OU=test, O=test, L=test, ST=test, C=IN + // Issuer: CN=emSign CS CA - G2, O=eMudhra Technologies Limited, OU=emSign PKI, C=IN + // Serial number: cf02dedd03d2f509 + // Valid from: Thu Oct 05 22:38:51 PDT 2023 until: Sun Oct 05 22:38:51 PDT 2025 + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGNzCCBB+gAwIBAgIJAM8C3t0D0vUJMA0GCSqGSIb3DQEBDAUAMGUxCzAJBgNV\n" + + "BAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVkaHJhIFRl\n" + + "Y2hub2xvZ2llcyBMaW1pdGVkMRowGAYDVQQDExFlbVNpZ24gQ1MgQ0EgLSBHMjAe\n" + + "Fw0yMzEwMDYwNTM4NTFaFw0yNTEwMDYwNTM4NTFaMFgxCzAJBgNVBAYTA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nku\n" + + "ZW1TaWduLmNvbTAIBgZngQwBBAEwcwYIKwYBBQUHAQEEZzBlMCIGCCsGAQUFBzAB\n" + + "hhZodHRwOi8vb2NzcC5lbVNpZ24uY29tMD8GCCsGAQUFBzAChjNodHRwOi8vcmVw\n" + + "b3NpdG9yeS5lbXNpZ24uY29tL2NlcnRzL2VtU2lnbkNTQ0FHMi5jcnQwDAYDVR0T\n" + + "AQH/BAIwADANBgkqhkiG9w0BAQwFAAOCAgEAGa2XSoRkoIkHHHGXrdzTBCf/+KgK\n" + + "FlHhqlBOk5rwLDX1sfNlmsaz10I69phE90Ac8Coa/xCrBaFrTYqRvmkY9gU19jkn\n" + + "FdVcwQEHNku7Ro/Z/mbyi+aTBzHMTy0Vl4HqVnQInjV891n64SerUuAB7wNVOOho\n" + + "GoBfpf6lzDzzuEmetFokHYv1tWGQqPF/dHLARQraUlQpWjsnOx0QcZ5cM79REONE\n" + + "y6uzXT2vaatT3ns8Mtx8zooq+t8pnZlXJqlrwNTcnPad9gSsVu6vfsnWhLhz0VLG\n" + + "sYPXcWIssLbBQW3v5z0l1Isj7vy2UFfbn8AmZ0PanPo3v3C2sk19DK+Zlc9xBAXc\n" + + "KKwc4m8le6QkP/EB2wUA7ey5Cf29hjNDJpZznquEaWl9aKbBRdJDKsK88IBJjzK0\n" + + "Gbpw9fYJ3txuGA7Q27gyaZAeGAIrFvOtRY0XFbr20qSh2GBBYN57+lBPh4UKqgy8\n" + + "Z2Kk/2jK9k+nm41JYCmwVZHg3Va9RRfW8FkeE95gAUFPDWjeV+GvcimCbcB3DwaZ\n" + + "9fy1qfV4xsduhC3ei6f7Ask8LbAEWaEIXmgK10YbIfhzomCyCzlA+E+gwkq/bmkv\n" + + "B8hh27KWA6IRt7URI51MZlh0e8fULyXlOZcoJA/IPX9RdePa2RHFuPSypBHjoN7z\n" + + "6bCML1XZ2xnHIAg=\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Thu Oct 05 22:51:36 PDT 2023", System.out); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2018, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8195774 8243321 - * @summary Interoperability tests with Entrust CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath EntrustCA OCSP - * @run main/othervm -Djava.security.debug=certpath EntrustCA CRL - */ - -/* - * Obtain test artifacts for Entrust CA from: - * - * EC CA: - * Valid: https://validec.entrust.net - * Revoked https://revokedec.entrust.net - * - * G4 CA: - * Valid: https://validg4.entrust.net - * Revoked: https://revokedg4.entrust.net - */ -public class EntrustCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - ocspEnabled = true; - } - - new Entrust_ECCA().runTest(pathValidator, ocspEnabled); - new Entrust_G4().runTest(pathValidator, ocspEnabled); - } -} - -class Entrust_ECCA { - - // Owner: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Issuer: CN=Entrust Root Certification Authority - EC1, OU="(c) 2012 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIID5zCCA2ygAwIBAgIQCoPUgD5+n1EAAAAAUdTB9zAKBggqhkjOPQQDAzCBvzEL\n" + - "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + - "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEy\n" + - "IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UE\n" + - "AxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4X\n" + - "DTE2MDQwNTIwMTk1NFoXDTM3MTAwNTIwNDk1NFowgboxCzAJBgNVBAYTAlVTMRYw\n" + - "FAY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CERTIFICATE-----"; - - // Owner: CN=validec.entrust.net, SERIALNUMBER=D15576572, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", - // OID.1.3.6.1.4.1.311.60.2.1.2=Maryland, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFrTCCBTKgAwIBAgIQYtgW4DLwh74AAAAAVqBXkTAKBggqhkjOPQQDAjCBujEL\n" + - "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + - "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDE2\n" + - "IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwGA1UE\n" + - "AxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSjAeFw0xODA2\n" + - "MjUxMzE1NTdaFw0xOTA2MjUxMzQ1NTBaMIHJMQswCQYDVQQGEwJDQTEQMA4GA1UE\n" + - "CBMHT250YXJpbzEPMA0GA1UEBxMGS2FuYXRhMRMwEQYLKwYBBAGCNzwCAQMTAlVT\n" + - "MRkwFwYLKwYBBAGCNzwCAQITCE1hcnlsYW5kMRYwFAYDVQQKEw1FbnRydXN0LCBJ\n" + - "bmMuMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjESMBAGA1UEBRMJRDE1\n" + - "NTc2NTcyMRwwGgYDVQQDExN2YWxpZGVjLmVudHJ1c3QubmV0MFkwEwYHKoZIzj0C\n" + - "AQYIKoZIzj0DAQcDQgAEHQe7lUaAUgIwR9EiLJlhkbx+HfSr22M3JvQD6+fnYgqd\n" + - "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AcGBWeBDAEBMB8GA1UdIwQYMBaAFMP5RQO+yPkLPEU18+ty7Ofo65Sb\n" + - "MB0GA1UdDgQWBBT+J7OhS6gskCanmOGnx10DPSF8ATAJBgNVHRMEAjAAMAoGCCqG\n" + - "SM49BAMCA2kAMGYCMQCQLUQABT74TmdHzAtB97uNF5+Zy15wzkmlKeRSOXCIf2C5\n" + - "YKjsgdkR1OdzZXcpjNgCMQDfWcdPhodNXZC4l1lLPOPaTzPPw6uVqqoITQlc6r1t\n" + - "dRkkD6K9ii/X8EtwoFp7s80=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revokedec.entrust.net, SERIALNUMBER=115868500, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", - // OID.1.3.6.1.4.1.311.60.2.1.2=Texas, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGJzCCBaygAwIBAgIRAM0WDfag1taIAAAAAFagJ5gwCgYIKoZIzj0EAwIwgbox\n" + - "CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9T\n" + - "ZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAx\n" + - "NiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNV\n" + - "BAMTJUVudHJ1c3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowHhcNMTcw\n" + - "NTI0MTcwNzA4WhcNMTkwNTI0MTczNjU1WjCByDELMAkGA1UEBhMCQ0ExEDAOBgNV\n" + - "BAgTB09udGFyaW8xDzANBgNVBAcTBkthbmF0YTETMBEGCysGAQQ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KlpEOyWqDKWPSUeYCIQCwI5tDyyaJtyFY9/OVqLG+BKPKjscUtTqGJYl4\n" + - "XbOo1jAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF\n" + - "BwMCMGMGCCsGAQUFBwEBBFcwVTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50\n" + - "cnVzdC5uZXQwLgYIKwYBBQUHMAKGImh0dHA6Ly9haWEuZW50cnVzdC5uZXQvbDFq\n" + - "LWVjMS5jZXIwMwYDVR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5l\n" + - "dC9sZXZlbDFqLmNybDBKBgNVHSAEQzBBMDYGCmCGSAGG+mwKAQIwKDAmBggrBgEF\n" + - "BQcCARYaaHR0cDovL3d3dy5lbnRydXN0Lm5ldC9ycGEwBwYFZ4EMAQEwHwYDVR0j\n" + - "BBgwFoAUw/lFA77I+Qs8RTXz63Ls5+jrlJswHQYDVR0OBBYEFIj28ytR8ulo1p2t\n" + - "ZnBQOLK0rlLUMAkGA1UdEwQCMAAwCgYIKoZIzj0EAwIDaQAwZgIxANzqGRI0en5P\n" + - "gSUDcdwoQSNKrBPBfGz2AQVLHAXsxvIlGhKZAQtM49zxA8AdFy/agwIxAMEjJH6A\n" + - "4UbcGZc40eYu6wUbAxiUDD3gwSElNQ8Z6IhNLPCCdMM6KZORyaagAcXn4A==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Wed May 24 10:39:28 PDT 2017", System.out); - } -} - -class Entrust_G4 { - - // Owner: CN=Entrust Certification Authority - L1N, OU="(c) 2014 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Issuer: CN=Entrust Root Certification Authority - G4, OU="(c) 2015 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGMjCCBBqgAwIBAgIRAKvsd/8bQQwHAAAAAFVl2AUwDQYJKoZIhvcNAQELBQAw\n" + - "gb4xCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQL\n" + - "Ex9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykg\n" + - "MjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMjAw\n" + - "BgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEc0\n" + - "MB4XDTE3MTEyMjIwMDQyMFoXDTMwMTIyMjIwMzQyMFowgboxCzAJBgNVBAYTAlVT\n" + - "MRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1\n" + - "c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNCBFbnRydXN0LCBJ\n" + - "bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3Qg\n" + - "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMU4wggEiMA0GCSqGSIb3DQEBAQUA\n" + - "A4IBDwAwggEKAoIBAQDcSG+caYQ4xcvf+dt8bgCEHorO0g5j0H1NOtQzRXgUoG8y\n" + - "QuRbJX9swyKqQZbsc18YvTV8OKA/uSNE46Jvq47TFPojWWTVLbNDqpM07e4EFYKs\n" + - "A9NFzAUngijnf3ivnXA6iNPAMXaEhXmhY/YFjk8NoM7Y1PFsA0oj5hamKQ06iO/j\n" + - "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XfsXmB+qB6y5gaajiTIMscGIcZIKTe2YdKrLoicvEz8k+loM7favik\n" + - "vzFioTNTDHYGx3mkfElBE7ycY8n+jZE3QBBv33k28MeQi7XNgEaMc4tYwoZIdE9A\n" + - "xVccXTzEQzka82dOkRB1dU0XZId9XAWv+CtNc2TjF6Wgx2seA/c6H8S0IfgQBIV2\n" + - "8iN2wZns2QFdawkdy3hMUqPnA++kuGhLW3GemsIY5dP/WxY8rd+OfLb/Ks9T1pCd\n" + - "28t7PQRcQsgkYmouzrOW9ASBvYqLLdhl4y+fFXff8RkPIKMNoYP06WJvRKmky9R/\n" + - "41/nXRas\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=validg4.entrust.net, SERIALNUMBER=1913605, OID.2.5.4.15=Private Organization, - // O=Entrust Datacard Limited, OID.1.3.6.1.4.1.311.60.2.1.2=Ontario, OID.1.3.6.1.4.1.311.60.2.1.3=CA, - // L=Ottawa, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1N, OU="(c) 2014 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Serial number: 83790beb78eeb966007ad3dbf11d570 - // Valid from: Fri May 29 13:29:00 PDT 2020 until: Sun Aug 28 13:34:23 PDT 2022 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFpjCCBI6gAwIBAgIQCDeQvreO65ZgB609vxHVcDANBgkqhkiG9w0BAQsFADCB\n" + - "ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT\n" + - "H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy\n" + - "MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG\n" + - "A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTjAeFw0y\n" +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AKGJ2h0dHA6Ly9haWEuZW50cnVzdC5uZXQvbDFuLWNoYWluMjU2\n" + - "LmNlcjAzBgNVHR8ELDAqMCigJqAkhiJodHRwOi8vY3JsLmVudHJ1c3QubmV0L2xl\n" + - "dmVsMW4uY3JsMB4GA1UdEQQXMBWCE3ZhbGlkZzQuZW50cnVzdC5uZXQwSwYDVR0g\n" + - "BEQwQjA3BgpghkgBhvpsCgECMCkwJwYIKwYBBQUHAgEWG2h0dHBzOi8vd3d3LmVu\n" + - "dHJ1c3QubmV0L3JwYTAHBgVngQwBATANBgkqhkiG9w0BAQsFAAOCAQEAOExxxxEk\n" + - "iAZZ4RJSWwI/CBQYAlUmd2wb/SBk9eYNAu/UL0XiAbwbOjH2dV6JHwAdwn0eoPR1\n" + - "KK/E1/OVoVibVBdxLMISPqdodRgHps6kGCOJxS8Zz8d3AEvx27EQ/Hg/EwIJZsUK\n" + - "dyb48V6a3XzExqLiwGu9oI9Ozm3/mo11ixmhvSFXH+FZf93qvvCSO+XTGGrLv5ja\n" + - "Tkazn/HgnwUBHd1TiO0jLhAdc+rZyd/SDjXMAXsa99zVfc2MY0Mb8+MohNHOwqYg\n" + - "tuYuirvtt9P0oteauL+iEBCRcqsmJaHGeaEyJH2QMxC5W22KpW245eHisW7rMoGQ\n" + - "9nbGmfe97p7bHQ==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revokedg4.entrust.net, SERIALNUMBER=1913605, OID.2.5.4.15=Private Organization, - // O=Entrust Datacard Limited, OID.1.3.6.1.4.1.311.60.2.1.2=Ontario, OID.1.3.6.1.4.1.311.60.2.1.3=CA, - // L=Ottawa, ST=Ontario, C=CA - // Issuer: CN=Entrust Certification Authority - L1N, OU="(c) 2014 Entrust, Inc. - for authorized use only", - // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US - // Serial number: 24c5f46412b9dcc242a93017176979d6 - // Valid from: Fri May 29 13:36:00 PDT 2020 until: Sun Aug 28 13:40:43 PDT 2022 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFqjCCBJKgAwIBAgIQJMX0ZBK53MJCqTAXF2l51jANBgkqhkiG9w0BAQsFADCB\n" + - "ujELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsT\n" + - "H1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAy\n" + - "MDE0IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwG\n" + - "A1UEAxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxTjAeFw0y\n" + - "MDA1MjkyMDM2MDBaFw0yMjA4MjgyMDQwNDNaMIHTMQswCQYDVQQGEwJDQTEQMA4G\n" + - "A1UECBMHT250YXJpbzEPMA0GA1UEBxMGT3R0YXdhMRMwEQYLKwYBBAGCNzwCAQMT\n" + - "AkNBMRgwFgYLKwYBBAGCNzwCAQITB09udGFyaW8xITAfBgNVBAoTGEVudHJ1c3Qg\n" + - "RGF0YWNhcmQgTGltaXRlZDEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24x\n" + - "EDAOBgNVBAUTBzE5MTM2MDUxHjAcBgNVBAMTFXJldm9rZWRnNC5lbnRydXN0Lm5l\n" + - "dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN6Bvaj7EG752e15UQH9\n" + - "4o8+660Gi3caUAAu45vZebO7EfRgrz0zyalpiexmQzocGn6Zog2yVqmMZjrMY11a\n" + - "q96s0pzVKImnA/787G7J5lRncP+PM6/WGtUUGS2hHiifoW5Ya/kcI1uk6EDT0leb\n" + - "HIedOiwcfDkq38g5ckuWNae24DAD8AM9XBJXMuNbuiqo03wMlDL3Jif8wNQfpmPD\n" + - "b+KR6IwGJdYwLBMoMcPmZF0rykW3YTO2NTDGCwvT8zzvjIKp8caRkI6pfkKmc89U\n"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ri26VbD5A=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri May 29 13:42:13 PDT 2020", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GlobalSignR6CA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2019, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8216577 8249176 - * @summary Interoperability tests with GlobalSign R6 CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath GlobalSignR6CA OCSP - * @run main/othervm -Djava.security.debug=certpath GlobalSignR6CA CRL - */ - - /* - * - * Obtain TLS test artifacts for GlobalSign R6 CA from: - * - * Valid TLS Certificates: - * https://valid.r6.roots.globalsign.com/ - * - * Revoked TLS Certificates: - * https://revoked.r6.roots.globalsign.com/ - */ -public class GlobalSignR6CA { - - // Owner: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE - // Issuer: CN=GlobalSign, O=GlobalSign, OU=GlobalSign Root CA - R6 - // Serial number: 7803182afbecd89eb19309bb4a25bdaa - // Valid from: Mon Jul 27 17:00:00 PDT 2020 until: Sat Jul 27 17:00:00 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGwDCCBKigAwIBAgIQeAMYKvvs2J6xkwm7SiW9qjANBgkqhkiG9w0BAQwFADBM\n" + - "MSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xv\n" + - "YmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjAeFw0yMDA3MjgwMDAwMDBaFw0z\n" + - "MDA3MjgwMDAwMDBaMFUxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWdu\n" + - "IG52LXNhMSswKQYDVQQDEyJHbG9iYWxTaWduIEF0bGFzIFI2IEVWIFRMUyBDQSAy\n" + - "MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtQ8IiN2Ukq/Clynv\n" + - "HhqugFQg5SXIyVO4ZRnxo0hNnaek78LRn4Bkaqcwv6Ls0Ftn4bK2zvBaS1zsfUTA\n" + - "vfup/s86zHCRvOqAL8zO/WiMV1G5ikHSlD6RtpIOHRX4y0oIGW59ADY0ANwDeDWL\n" + - "x/RgSltuQIqeGXwZnyZFwWtxVkSE4p5tn2Lb6USzwcD22taiXmeYsPMWfJfmWPRj\n" + - "ZuYBgxn6tvUVRO+ZzAUKEEaJK/LVLieAVEm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JlcG9zaXRvcnkvMAcGBWeBDAEB\n" + - "MA0GCSqGSIb3DQEBDAUAA4ICAQBD+97H2N1BgiliKQFrb+jcWjkmPP8cdF/eiBW1\n" + - "cEzOOhsuVqxbyIk8qdw3UueHSDjqWUjHYoo8TV3DLqUXmIy1Ks3MkESsFKeLpEbk\n" + - "VMZga0lbDnqqRc5a2yzrXmwVYDeWVeD20s5vPoKCnFzmcR+2v9TKD4bI6XWVl84q\n" + - "GzfFRVdY9f8KN+7891+47ZhptvxtNqJKVI2O+EAP/PvTpwes983LkFzsev4/+Qxs\n" + - "EszD7/pE+Byj3t9CMat2XoX0jfJjbEXgewFb/gCwHvqNKLNWrYfE9qN8b6qm4xQk\n" + - "qGQKTrFKsBJx4TU+h10qXDhpmOBswiJqoG16XCV32oSn0JUYvXVAvP6YjueOv/jr\n" + - "0ZMTWGh8wCz6v3XBaXR0rxDAz9GImpU+xPx2XjuHac7OnYbN+i8p7cJPUxABjHiA\n" + - "LWXIZtCn5ziCfvYC6+SCp8x9TPJzAIfJ4NKv/8SpvvzuchVkAQqlQaGFBEdkX84R\n" + - "I/WYYG+2BliFIpbQnfljYWCURbfsYz7+Zxb94+4yzva49p8T6lALoK3s2kqIVLKN\n" + - "s6qAnk/qX6JihkaR3W+iViHMC5tqQX/pd8QIXccF3PA2OdeNGU4iUNZqUbYB4VZd\n" + - "AaOaeaUl0LwAta6DB5w344eUIqDgaitSwQZBnxppmwL3tGzP1ero2e2RvBmphbxI\n" + - "atIdxA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid.r6.roots.globalsign.com, - // O=GMO GlobalSign LTD, STREET="Springfield House, Sandling Road", OID.2.5.4.17=ME14 2LP, L=Maidstone, ST=Kent, - // C=GB, SERIALNUMBER=04705639, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB - // Issuer: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE - // Serial number: 1aff2829dd8bf07aa65a7b3c920ca4b - // Valid from: Thu Aug 27 00:20:06 PDT 2020 until: Tue Sep 28 00:20:06 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHyjCCBbKgAwIBAgIQAa/ygp3YvweqZaezySDKSzANBgkqhkiG9w0BAQsFADBV\n" + - "MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTErMCkGA1UE\n" + - "AxMiR2xvYmFsU2lnbiBBdGxhcyBSNiBFViBUTFMgQ0EgMjAyMDAeFw0yMDA4Mjcw\n" + - "NzIwMDZaFw0yMTA5MjgwNzIwMDZaMIH6MRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0w\n" + - "GwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjERMA8GA1UEBRMIMDQ3MDU2Mzkx\n" + - "CzAJBgNVBAYTAkdCMQ0wCwYDVQQIDARLZW50MRIwEAYDVQQHDAlNYWlkc3RvbmUx\n" + - "ETAPBgNVBBEMCE1FMTQgMkxQMSkwJwYDVQQJDCBTcHJpbmdmaWVsZCBIb3VzZSwg\n" + - "U2FuZGxpbmcgUm9hZDEbMBkGA1UECgwSR01PIEdsb2JhbFNpZ24gTFREMSYwJAYD\n" + - "VQQDDB12YWxpZC5yNi5yb290cy5nbG9iYWxzaWduLmNvbTCCASIwDQYJKoZIhvcN\n" + - "AQEBBQADggEPADCCAQoCggEBAMOxbh7fZVLUB06xxNBePa9vpOuAS5km1w8ngsTu\n" + - "SvH1LZnPFd4nu40fi8bPbHd4J2oRWZ28f7LKVQgBupn9knrTQxfTV361WpmwqCcH\n" + - "MxornKyHx4t5uGrtTtX2fYoNQQk330dIKAfKpUrOiaDybB7irG2JEHdGD3Iv7ud8\n" + - "FXfXgXte26mUDX3XeCvE0pbuNKpTKApqOeojlVR6TCNB1n6KGYLMIz/1ow6XBZ64\n" + - "1zKG/9o0gSHelkUHGmGLzOAE5YpkhwzhpND9opycnfieHuy5BcoBIpeMqGNwOs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RMAAAF0Lsm7JAAA\n" + - "BAMARjBEAiALOZvdNiA9q1Ysr7ejTGdivUqNJNm9KftmGXwHFGwf2QIgDodNLmbZ\n" + - "JFGt8l5ul0fHw2Gn8KqhRUW6CMRT58svhcswDQYJKoZIhvcNAQELBQADggIBAByb\n" + - "hoL/sArmkNjTFiEEBocMfb+brgRQdb08NKC1BDxGnfIFjUmOFzI2SVgtBmcoF8FI\n" + - "0WyXQv6ZxVE01DFZpeZpsJJYfBAjg9NR4/B7UjajvOJwQNpaciAGQ0ZzTu+SmHja\n" + - "jIiC2KqiA7Me2MoUne6hhxZ3dXEneIml8hnbTf2mjSBCVpQqyf2goslhGduPitI6\n" + - "guTtVD2PVaNCVkjlRn4Euspl2JjQWzGcEruqGyQN+Bu4yt1hsD4Jj6V9Hmzo8Vrd\n" + - "5LUxFPRGIgCUDiiwnENVsQB/D24y3IapPkojujrvsVsmQN42GIgOY5tLK/8cCziD\n" + - "vf0GzZnmL1D2ezi3TaBj+XBWFcAyF2Y9AnVRmC9CrVcp6EX0KhD4g9ZgbpJZpVlk\n" + - "G3xfOiZWTeqLnQhCMXcdcutWIwXAX5gueyF1t545vECCE4PeGZNAeWqdbrj7xaS8\n" + - "3rKQdgwF9r6p7F5HHwEVCckhovEYU4DNFzYb9n/YmC3hmskFB1keTYqydKUYEGZ5\n" + - "fvLvsjRj9xwOCqIs5j1vuKw2CaqmHxrfYaDMMSZPq/iYrOWrf72wZIvtnAHePt3X\n" + - "atQMqNbDMQrjul31ljDP9CIbbtuZSkSACyMxiC10l4uTTLQiTxtZPkwIazOjnbBe\n" + - "A4fruOEQ2k1gu5oFgqmo+xuclOKNjwd/RkK4FXnD\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.r6.roots.globalsign.com, - // O=GMO GlobalSign LTD, STREET="Springfield House, Sandling Road", OID.2.5.4.17=ME14 2LP, L=Maidstone, ST=Kent, - // C=GB, SERIALNUMBER=04705639, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.3=GB - // Issuer: CN=GlobalSign Atlas R6 EV TLS CA 2020, O=GlobalSign nv-sa, C=BE - // Serial number: 1df30d84796ac20c47da63b8e681e8f - // Valid from: Thu Aug 27 00:37:53 PDT 2020 until: Tue Sep 28 00:37:53 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHzzCCBbegAwIBAgIQAd8w2EeWrCDEfaY7jmgejzANBgkqhkiG9w0BAQsFADBV\n" + - "MQswCQYDVQQGEwJCRTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTErMCkGA1UE\n" + - "AxMiR2xvYmFsU2lnbiBBdGxhcyBSNiBFViBUTFMgQ0EgMjAyMDAeFw0yMDA4Mjcw\n" + - "NzM3NTNaFw0yMTA5MjgwNzM3NTNaMIH8MRMwEQYLKwYBBAGCNzwCAQMTAkdCMR0w\n" + - "GwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjERMA8GA1UEBRMIMDQ3MDU2Mzkx\n" + - "CzAJBgNVBAYTAkdCMQ0wCwYDVQQIDARLZW50MRIwEAYDVQQHDAlNYWlkc3RvbmUx\n" + - "ETAPBgNVBBEMCE1FMTQgMkxQMSkwJwYDVQQJDCBTcHJpbmdmaWVsZCBIb3VzZSwg\n" + - "U2FuZGxpbmcgUm9hZDEbMBkGA1UECgwSR01PIEdsb2JhbFNpZ24gTFREMSgwJgYD\n" + - "VQQDDB9yZXZva2VkLnI2LnJvb3RzLmdsb2JhbHNpZ24uY29tMIIBIjANBgkqhkiG\n" + - "9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvaNcp7bzmm02Z0S92ZzJ/ul3uQWz3EnBORcI\n" + - "RuEzm0HY4t0n9DGnxpxOi/aWGX/Vj7qZC4m3G7uCE7dMy6CfXTwh4UZ+nPVijImo\n" + - "q/msJzmju/pk8HVeOEhk88yvwfzmzYLjoQagmHnDUSQULEmNWihejIh4B61qx4SI\n" + - "UoBPoBgqDfZW27HkJeqNA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8ECIQD3RoE13/MBVMVBLCQ2ErKsB5+7F31dX/tv\n" + - "Z/muQi5UrQB2AH0+8viP/4hVaCTCwMqeUol5K8UOeAl/LmqXaJl+IvDXAAABdC7a\n" + - "AegAAAQDAEcwRQIhALl0LXt6pFqS0cHF/XkxSfDJJdhppR2eSlcMFpZY0q1PAiBJ\n" + - "YkKHqq/YD0gwtZAUEPSk54G1cLxFoUiounjya1XTRzANBgkqhkiG9w0BAQsFAAOC\n" + - "AgEAdeQotBhB7bn+CztQmF13rdBphHrGkkyHC3hL1bxkmHJcrLQ5ochqPvgdgAVq\n" + - "DXcV8zSyNwVxW6REi+uYzcsOPKo/llmgF7Psqn1t/EDcutWlykh8UwE5UaLJ2EWD\n" + - "HnIu06n47lWtAwlNMXJ/ce0oVjqsgY52Y1u54e8wFXt6lsSw02tzIC6eo1BFKxQ3\n" + - "lDKYVXgg0OvMG/C2rvH/EIq5r+st49rNGWfcWRoHsDUruChZOHwJ9PrXKBLB/QVd\n" + - "4uw2V/0ipOETDudly7yLodXP8quhet4bCEO9gweXppL/MikLrE5xt46HW1/6w+jF\n" + - "wKCHWlq4ViswlaQ8q0oY/97o2udnuDQaNdrLgW3VofMeBIMNPBgkLDicOH6bLwNf\n" + - "lV68qi1ZBxBuOdoOqQyZ9RU9d3EL50XEJ4MtUvjJRAT5EWdFaB8SGGZbD5fyza8c\n" + - "KmeO5tkZWYecLd8CKqwKcW7umPflEwOzw60Cxg6eyBYA8Jfagpbdb/kXsF6Ov8IW\n" + - "vxNdHCnXnR3oBWm2uHddESO2zGF1ZfOb0O3cHHG5nCgVkWW68VpgX/LaN90u6Dzw\n" + - "diJX7esZV5ZaniqD+flWldgAdcfeXlJ5b7I7GnFr61ycmZT/qupagUS1WDq/zfct\n" + - "QcB4QmnAzGe6kcqiDOSyIYWpiw09jha63KpJtJDWRemrlQI=\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Thu Aug 27 00:38:11 PDT 2020", System.out); - } -} - diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoDaddyCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,346 +0,0 @@ -/* - * Copyright (c) 2018, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -/* - * @test - * @bug 8196141 - * @summary Interoperability tests with GoDaddy/Starfield CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath GoDaddyCA OCSP - * @run main/othervm -Djava.security.debug=certpath GoDaddyCA CRL - */ - -/* - * Obtain test artifacts for GoDaddy/Starfield CAs from: - * - * Go Daddy Root Certificate Authority - G2: - * valid: https://valid.gdig2.catest.godaddy.com/ - * expired: https://expired.gdig2.catest.godaddy.com/ - * revoked: https://revoked.gdig2.catest.godaddy.com/ - * - * Starfield Root Certificate Authority - G2: - * valid: https://valid.sfig2.catest.starfieldtech.com/ - * expired: https://expired.sfig2.catest.starfieldtech.com/ - * revoked: https://revoked.sfig2.catest.starfieldtech.com/ - */ -public class GoDaddyCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - // CRL check - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new GoDaddyGdig2().runTest(pathValidator); - new GoDaddySfig2().runTest(pathValidator); - } -} - -class GoDaddyGdig2 { - - // Owner: CN=Go Daddy Secure Certificate Authority - G2, - // OU=http://certs.godaddy.com/repository/, O="GoDaddy.com, Inc.", - // L=Scottsdale, ST=Arizona, C=US - // Issuer: CN=Go Daddy Root Certificate Authority - G2, O="GoDaddy.com, Inc.", - // L=Scottsdale, ST=Arizona, C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIE0DCCA7igAwIBAgIBBzANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx\n" - + "EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT\n" - + "EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp\n" - + "ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTExMDUwMzA3MDAwMFoXDTMxMDUwMzA3\n" - + "MDAwMFowgbQxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH\n"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SqGSIb3DQEBCwUAA4IBAQAIfmyTEMg4uJapkEv/oV9PBO9sPpyIBslQj6Zz\n" - + "91cxG7685C/b+LrTW+C05+Z5Yg4MotdqY3MxtfWoSKQ7CC2iXZDXtHwlTxFWMMS2\n" - + "RJ17LJ3lXubvDGGqv+QqG+6EnriDfcFDzkSnE3ANkR/0yBOtg2DZ2HKocyQetawi\n" - + "DsoXiWJYRBuriSUBAA/NxBti21G00w9RKpv0vHP8ds42pM3Z2Czqrpv1KrKQ0U11\n" - + "GIo/ikGQI31bS/6kA1ibRrLDYGCD+H1QQc7CoZDDu+8CL9IVVO5EFdkKrqeKM+2x\n" - + "LXY2JtwE65/3YR8V3Idv7kaWKK2hJn0KCacuBKONvPi8BDAB\n" - + "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/businessCategory=Private - // Organization/serialNumber=5510922, C=US, ST=Arizona, L=Scottsdale, O=GoDaddy INC., CN=valid.gdig2.catest.godaddy.com - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHbzCCBlegAwIBAgIIC3Go9uPeseowDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV\n" + - "BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRow\n" + - "GAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjEtMCsGA1UECxMkaHR0cDovL2NlcnRz\n" + - "LmdvZGFkZHkuY29tL3JlcG9zaXRvcnkvMTMwMQYDVQQDEypHbyBEYWRkeSBTZWN1\n" + - "cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIwHhcNMTcwOTE1MjMyMzAyWhcN\n" + - "MTkwOTE1MjMyMzAyWjCB1TETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQB\n" + - "gjc8AgECEwhEZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YX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DUWa1Rr4WFqZMkZIxzREQCYC8HXSYqLA1oPuoMMog8dId7XSalBmGJ4\n" + - "KQVsZ0/Hpi0y9k/Zw5obGcEYJWMbuU1iaEkvdtXOiXEQfJ1WS+Yy55J4GSjpIiop\n" + - "qDZD88xA9r7ttzM/khao7jfIpVWG2HuX0JlHWdh3y9aegiw=\n" + - "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Delaware/businessCategory=Private - // Organization/serialNumber=5510922, C=US, ST=Arizona, L=Scottsdale, O=GoDaddy INC., CN=revoked.gdig2.catest.godaddy.com - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHdDCCBlygAwIBAgIIEBJV3vmogM8wDQYJKoZIhvcNAQELBQAwgbQxCzAJBgNV\n" + - "BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRow\n" + - "GAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjEtMCsGA1UECxMkaHR0cDovL2NlcnRz\n" + - "LmdvZGFkZHkuY29tL3JlcG9zaXRvcnkvMTMwMQYDVQQDEypHbyBEYWRkeSBTZWN1\n" + - "cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIwHhcNMTcwOTE1MjMyMzAzWhcN\n" + - "MTkwOTE1MjMyMzAzWjCB1zETMBEGCysGAQQBgjc8AgEDEwJVUzEZMBcGCysGAQQB\n" + - "gjc8AgECEwhEZWxhd2FyZTEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24x\n" + - "EDAOBgNVBAUTBzU1MTA5MjIxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25h\n" + - "MRMwEQYDVQQHEwpTY290dHNkYWxlMRUwEwYDVQQKEwxHb0RhZGR5IElOQy4xKTAn\n" + - "BgNVBAMTIHJldm9rZWQuZ2RpZzIuY2F0ZXN0LmdvZGFkZHkuY29tMI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ERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, null, System.out); - } -} - -class GoDaddySfig2 { - - // Owner: CN=Starfield Secure Certificate Authority - G2, - // OU=http://certs.starfieldtech.com/repository/, O="Starfield Technologies, Inc.", - // L=Scottsdale, ST=Arizona, C=US - // Issuer: CN=Starfield Root Certificate Authority - G2, - // O="Starfield Technologies, Inc.", L=Scottsdale, ST=Arizona, C=US - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIFADCCA+igAwIBAgIBBzANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx\n" - + "EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT\n" - + "HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs\n" - + "ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTExMDUwMzA3MDAw\n" - + "MFoXDTMxMDUwMzA3MDAwMFowgcYxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6\n" - + "b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj\n" - + "aG5vbG9naWVzLCBJbmMuMTMwMQYDVQQLEypodHRwOi8vY2VydHMuc3RhcmZpZWxk\n" - + "dGVjaC5jb20vcmVwb3NpdG9yeS8xNDAyBgNVBAMTK1N0YXJmaWVsZCBTZWN1cmUg\n" - + "Q2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" - + "DwAwggEKAoIBAQDlkGZL7PlGcakgg77pbL9KyUhpgXVObST2yxcT+LBxWYR6ayuF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wKlhR8Cbds4cLYVdQYoKpBaXAko7nv6VrcPuuUSvC33l8Odvr7+2kDRUBQ\n" - + "7nIMpBKGgc0T0U7EPMpODdIm8QC3tKai4W56gf0wrHofx1l7\n" - + "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Arizona/businessCategory=Private - // Organization/serialNumber=R17247416, C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, LLC, - // CN=valid.sfig2.catest.starfieldtech.com - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHuzCCBqOgAwIBAgIIaZoUcUIjkGwwDQYJKoZIhvcNAQELBQAwgcYxCzAJBgNV\n" + - "BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUw\n" + - "IwYDVQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTMwMQYDVQQLEypo\n" + - "dHRwOi8vY2VydHMuc3RhcmZpZWxkdGVjaC5jb20vcmVwb3NpdG9yeS8xNDAyBgNV\n" + - "BAMTK1N0YXJmaWVsZCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IC0gRzIw\n" + - "HhcNMTcwOTE3MDM0ODAxWhcNMTkwOTE3MDM0ODAxWjCB6zETMBEGCysGAQQBgjc8\n" + - "AgEDEwJVUzEYMBYGCysGAQQBgjc8AgECEwdBcml6b25hMR0wGwYDVQQPExRQcml2\n" + - "YXRlIE9yZ2FuaXphdGlvbjESMBAGA1UEBRMJUjE3MjQ3NDE2MQswCQYDVQQGEwJV\n" + - "UzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEkMCIGA1UE\n" + - "ChMbU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgTExDMS0wKwYDVQQDEyR2YWxpZC5z\n" + - "ZmlnMi5jYXRlc3Quc3RhcmZpZWxkdGVjaC5jb20wggEiMA0GCS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+ - "k5pMoIv5EsFIm0Cs+DfF\n" + - "-----END CERTIFICATE-----"; - - // 1.3.6.1.4.1.311.60.2.1.3=US/1.3.6.1.4.1.311.60.2.1.2=Arizona/businessCategory=Private - // Organization/serialNumber=R17247416, C=US, ST=Arizona, L=Scottsdale, O=Starfield Technologies, LLC, - // CN=revoked.sfig2.catest.starfieldtech.com - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHwTCCBqmgAwIBAgIJAPc1qVz+WDxpMA0GCSqGSIb3DQEBCwUAMIHGMQswCQYD\n" + - "VQQGEwJVUzEQMA4GA1UECBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEl\n" + - "MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEzMDEGA1UECxMq\n" + - "aHR0cDovL2NlcnRzLnN0YXJmaWVsZHRlY2guY29tL3JlcG9zaXRvcnkvMTQwMgYD\n" + - "VQQDEytTdGFyZmllbGQgU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcy\n" + - "MB4XDTE3MDkxOTEzMDkwMVoXDTE5MDkxOTEzMDkwMVowge0xEzARBgsrBgEEAYI3\n" + - "PAIBAxMCVVMxGDAWBgsrBgEEAYI3PAIBAhMHQXJpem9uYTEdMBsGA1UEDxMUUHJp\n" + - "dmF0ZSBPcmdhbml6YXRpb24xEjAQBgNVBAUTCVIxNzI0NzQxNjELMAkGA1UEBhMC\n" + - "VVMxEDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJDAiBgNV\n" + - "BAoTG1N0YXJmaWVsZCBUZWNobm9sb2dpZXMsIExMQzEvMC0GA1UEAxMmcmV2b2tl\n" + - "ZC5zZmlnMi5jYXRlc3Quc3RhcmZpZWxkdGVjaC5jb20wggEiMA0GCSqGSIb3DQEB\n" + - "AQUAA4IBDwAwggEKAoIBAQCWsAZC9goWW6yzg9HiLjCG4Gv2PCHlUIQGqyhc1y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LmNv\n" + - "bTAdBgNVHQ4EFgQU9hCSl7QoQ8KdsGgwMDwlvSurKNcwggF9BgorBgEEAdZ5AgQC\n" + - "BIIBbQSCAWkBZwB1AFYUBpov18Ls0/XhvUSyPsdGdrm8mRFcwO+UmFXWidDdAAAB\n" + - "XppC0cEAAAQDAEYwRAIgIO8sIG88JlA73P2myZ7EshemxaR8qBgf3wlYZpg5aZEC\n" + - "IGtlcUL7Il1uOLN0LTAzNTQ7pfb7oFYbr0R4LWe2ZvBIAHYA7ku9t3XOYLrhQmkf\n" + - "q+GeZqMPfl+wctiDAMR7iXqo/csAAAFemkLVbwAABAMARzBFAiEAmWkzcotxZSwb\n" + - "xPS3MG13TVXGu2+MiXXjOIf42DR8zJQCIBL4cSOJh+LX5kpPub6KOiEOn7TVE1Zv\n" + - "IQUxuf+vyAD4AHYApLkJkLQYWBSHuxOizGdwCjw1mAT5G9+443fNDsgN3BAAAAFe\n" + - "mkLXRQAABAMARzBFAiBX8foh/KrYr34O2c9cH6uyWW2XjBHNLsYX1mr+8VuNaAIh\n" + - "AObDQwpDYh/bNp6k547gDxnR73LeU3kvl1Y76GjgxLAhMA0GCSqGSIb3DQEBCwUA\n" + - "A4IBAQDJ5vlagzOH8/ORUMgT33muSDFXCe5el/sQzVg8dridw9qjnxOpkGibdCiT\n" + - "b9Il1bdi7UnG8MlA3XpDjGgp6J/mUTijD9WcFx4lp5JnPaIbShHWCyIlRVZJzrZc\n" + - "UYhR56xXOKDYKYOIvM6qTqegXyEynJrIVTArMk7jQf0oNQLLHzXE1fVS1zut0H5l\n" + - "GE+TBgjasMEa1o1e/H/heSytb2zFNsZr8oxojzGBmlKyfCoIIcCv3PxX2ur57zJE\n" + - "9ADWoYK/7gYVba0JmLV4nQltDPp06nOYT9imxBWTrFahgPx1jOQDLgIpitkjyCy4\n" + - "xpmxUk8L6yc3O3aSD9OU/fzk/t/d\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, null, System.out); - } -} - diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/GoogleCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,621 +0,0 @@ -/* - * Copyright (c) 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8307134 - * @summary Interoperability tests with Google's GlobalSign R4 and GTS Root certificates - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath GoogleCA OCSP - * @run main/othervm -Djava.security.debug=certpath GoogleCA CRL - */ - -/* - * Obtain TLS test artifacts for Google CAs from: - * - * https://pki.goog/repository/ - */ -public class GoogleCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - ocspEnabled = true; - } - - new GoogleGSR4().runTest(pathValidator); - new GoogleGTSR1().runTest(pathValidator); - new GoogleGTSR2().runTest(pathValidator); - new GoogleGTSR3().runTest(pathValidator); - new GoogleGTSR4().runTest(pathValidator); - } -} - -class GoogleGSR4 { - - // Owner: CN=GTS CA 2D4, O=Google Trust Services LLC, C=US - // Issuer: CN=GlobalSign, O=GlobalSign, OU=GlobalSign ECC Root CA - R4 - // Serial number: 21668f1cd0a2a8f847d8aad34 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDBDCCAqugAwIBAgINAhZo8c0KKo+EfYqtNDAKBggqhkjOPQQDAjBQMSQwIgYD\n" + - "VQQLExtHbG9iYWxTaWduIEVDQyBSb290IENBIC0gUjQxEzARBgNVBAoTCkdsb2Jh\n" + - "bFNpZ24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMjIxMDA1MDAwMDQyWhcNMjcw\n" + - "OTMwMDAwMDQyWjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0\n" + - "IFNlcnZpY2VzIExMQzETMBEGA1UEAxMKR1RTIENBIDJENDBZMBMGByqGSM49AgEG\n" + - "CCqGSM49AwEHA0IABPQdCdV61990MPueGTVpXAjRmp2JIxt0Yuy59RZYT/XKg1lN\n" + - "gpRc0eh/bHtpehigtqe+llKTiVEkMhSMURoQQsOjggFyMIIBbjAOBgNVHQ8BAf8E\n" + - "BAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQI\n" + - "MAYBAf8CAQAwHQYDVR0OBBYEFKiI2Yo5rGXVgks3qJVsZUPNRAHgMB8GA1UdIwQY\n" + - "MBaAFFSwe61FuOJAf/sKbvu+M8k8o4TVMGYGCCsGAQUFBwEBBFowWDAlBggrBgEF\n" + - "BQcwAYYZaHR0cDovL29jc3AucGtpLmdvb2cvZ3NyNDAvBggrBgEFBQcwAoYjaHR0\n" + - "cDovL3BraS5nb29nL3JlcG8vY2VydHMvZ3NyNC5kZXIwMgYDVR0fBCswKTAnoCWg\n" + - "I4YhaHR0cDovL2NybC5wa2kuZ29vZy9nc3I0L2dzcjQuY3JsME0GA1UdIARGMEQw\n" + - "CAYGZ4EMAQIBMDgGCisGAQQB1nkCBQMwKjAoBggrBgEFBQcCARYcaHR0cHM6Ly9w\n" + - "a2kuZ29vZy9yZXBvc2l0b3J5LzAKBggqhkjOPQQDAgNHADBEAiBi+ikli1YBHQGs\n" + - "b5mnyBo5mydw04o386BPgaPpiBzgagIgbcpwQJCalLIekv8XRMoWFr3nV5XJfWRU\n" + - "5QPpOX0rXbg=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gsr4.demo.pki.goog - // Issuer: CN=GTS CA 2D4, O=Google Trust Services LLC, C=US - // Serial number: 4c435754ee6e013c10efaff908a58cbb - // Valid from: Mon Mar 27 12:41:45 PDT 2023 until: Sun Jun 25 12:41:44 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEsTCCBFegAwIBAgIQTENXVO5uATwQ76/5CKWMuzAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJENDAeFw0yMzAzMjcxOTQxNDVaFw0yMzA2MjUxOTQx\n" + - "NDRaMCIxIDAeBgNVBAMTF2dvb2QuZ3NyNC5kZW1vLnBraS5nb29nMIIBIjANBgkq\n" + - "hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAymtcnnxJ8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ZXF0Xm30\n" + - "Oz+q2tgCIQCgSYqT/6RH+PCOauOVW4uaoshT+HfqurghVCzwGgBFvwB1ALc++yTf\n" + - "nE26dfI5xbpY9Gxd/ELPep81xJ4dCYEl7bSZAAABhyTOttoAAAQDAEYwRAIgBXao\n" + - "3Pry1nCHu3bngW3q3CHSLzmNHmO4cXMSdN2sAOkCIDE5DUyok3TRsOIHu1QTB0R2\n" + - "UxPeFm9KS73TBT8JEZykMAoGCCqGSM49BAMCA0gAMEUCIG1m91VOq3tghyLPA6YR\n" + - "/Pkq+gQylyM8wGJgnRMRE0lhAiEAxBgYXImtVqbfymq2MYwhV9KmG9gPIfqN6qWi\n" + - "lzblUM0=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gsr4.demo.pki.goog - // Issuer: CN=GTS CA 2D4, O=Google Trust Services LLC, C=US - // Serial number: 1f9bd55e26716b3710b2614cec6fff02 - // Valid from: Mon Mar 27 12:48:37 PDT 2023 until: Sun Jun 25 12:48:36 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEtzCCBFygAwIBAgIQH5vVXiZxazcQsmFM7G//AjAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJENDAeFw0yMzAzMjcxOTQ4MzdaFw0yMzA2MjUxOTQ4\n" + - "MzZaMCUxIzAhBgNVBAMTGnJldm9rZWQuZ3NyNC5kZW1vLnBraS5nb29nMIIBIjAN\n" + - "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApVuoZ/bS9c2WSQ8W1FjPEsdGoANj\n" + - "PqKaPwdyUhnko9ayyGGi5hHLYqir2tiNjfO8i5e3ybe6CIaybY37SQebquV+rioH\n" + - "O9BS75GgtYXCaMK/8prya9RiaUjy7kecvpKtJNiaXrLJy8Vzq9g39n9hiXJYMGkc\n" +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z0G4QYPKmS74VQVEgnHqgKSoqv0ghTJXTgIgPyoYubz4MEHYirBu\n" + - "69BLC2jioXr8+wS7MK1IPqjdH44wCgYIKoZIzj0EAwIDSQAwRgIhAI4NdZ5JwTuW\n" + - "P+RH2bsAc5xrb804G9mOc3WMRVxTUKesAiEA/jHMJ2YdPv0WXKjKY7nUyFjUPdin\n" + - "BHRHfBeltynaFzU=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:49:33 PDT 2023", System.out); - } -} - -class GoogleGTSR1 { - - // Owner: CN=GTS CA 1D4, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R1, O=Google Trust Services LLC, C=US - // Serial number: 2008eb2023336658b64cddb9b - // Valid from: Wed Aug 12 17:00:42 PDT 2020 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFjDCCA3SgAwIBAgINAgCOsgIzNmWLZM3bmzANBgkqhkiG9w0BAQsFADBHMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU\n" + - "MBIGA1UEAxMLR1RTIFJvb3QgUjEwHhcNMjAwODEzMDAwMDQyWhcNMjcwOTMwMDAw\n" + - "MDQyWjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp\n" + - "Y2VzIExMQzETMBEGA1UEAxMKR1RTIENBIDFENDCCASIwDQYJKoZIhvcNAQEBBQAD\n" + - "ggEPADCCAQoCggEBAKvAqqPCE27l0w9zC8dTPIE89bA+xTmDaG7y7VfQ4c+mOWhl\n" + - "UebUQpK0yv2r678RJExK0HWDjeq+nLIHN1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6XpF0PpqyCRvp/NCGv2KX2T\n" + - "uPCJvscp1/m2pVTtyBjYPRQ+QuCQGAJKjtN7R5DFrfTqMWvYgVlpCJBkwlu7+7KY\n" + - "3cTIfzE7cmALskMKNLuDz+RzCcsYTsVaU7Vp3xL60OYhqFkuAOOxDZ6pHOj9+OJm\n" + - "YgPmOT4X3+7L51fXJyRH9KfLRP6nT31D5nmsGAOgZ26/8T9hsBW1uo9ju5fZLZXV\n" + - "VS5H0HyIBMEKyGMIPhFWrlt/hFS28N1zaKI0ZBGD3gYgDLbiDT9fGXstpk+Fmc4o\n" + - "lVlWPzXe81vdoEnFbr5M272HdgJWo+WhT9BYM0Ji+wdVmnRffXgloEoluTNcWzc4\n" + - "1dFpgJu8fF3LG0gl2ibSYiCi9a6hvU0TppjJyIWXhkJTcMJlPrWx1VytEUGrX2l0\n" + - "JDwRjW/656r0KVB02xHRKvm2ZKI03TglLIpmVCK3kBKkKNpBNkFt8rhafcCKOb9J\n" + - "x/9tpNFlQTl7B39rJlJWkR17QnZqVptFePFORoZmFzM=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr1.demo.pki.goog - // Issuer: CN=GTS CA 1D4, O=Google Trust Services LLC, C=US - // Serial number: 19c08d5cde41fc84108f54c8d2a1aeca - // Valid from: Mon Mar 27 12:33:43 PDT 2023 until: Sun Jun 25 12:33:42 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFcjCCBFqgAwIBAgIQGcCNXN5B/IQQj1TI0qGuyjANBgkqhkiG9w0BAQsFADBG\n" + - "MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM\n" + - "QzETMBEGA1UEAxMKR1RTIENBIDFENDAeFw0yMzAzMjcxOTMzNDNaFw0yMzA2MjUx\n" + - "OTMzNDJaMCMxITAfBgNVBAMTGGdvb2QuZ3RzcjEuZGVtby5wa2kuZ29vZzCCASIw\n" + - "DQYJKoZIhvc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wBGMEQCICQ4Do1cKFsqmm/swKZkdM/qGluDbctL\n" + - "tIgp0YnoZTlEAiByAeAEaVQiU27AnpUerimnjPnThQq26vqvnWdstb0mwgB1AK33\n" + - "vvp8/xDIi509nB4+GGq0Zyldz7EMJMqFhjTr3IKKAAABhyTHU7UAAAQDAEYwRAIg\n" + - "WAIAOov42kcgOj0rYO3qb4/HTsW3o69x4IKd8ycsaVkCICIQUaeKwNp4aW/civO9\n" + - "No/v5Ner5bmlwheqFAJcR/HCMA0GCSqGSIb3DQEBCwUAA4IBAQBEKKdwuzuAhdir\n" + - "3hbPQIosD6H9vatr8tExWCDmw+PHOoiWIUTBu5fVZPQ27EgehTIA6kNhQj2g7fkF\n" + - "Bd5zAl4k7WdsDZCeOHml6XXQZHvc+p4DYBKTTt3h81lsMLw8aWCOaiSmrQ0hZS/E\n" + - "iuaqvlOFpOTd0x+MN2qcU14hi8SKxBgpraqR/s7OCwUFltxcPq0GAybzDGc9lgB+\n" + - "Jt56QviN641s7hxThyGhFIHSePgWuwbT1grJKQiSW35yI4PJO90HoCpd2MLrC5Ic\n" + - "B89ykY8mQcx+naGPZQdwdpx9GvKwSZdn+cq3kZwD66iXnwhqmiEdq4eBZr8ygSya\n" + - "lnGV2OW+\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr1.demo.pki.goog - // Issuer: CN=GTS CA 1D4, O=Google Trust Services LLC, C=US - // Serial number: c414c34e6c2cc66c102b8d3502be3bb4 - // Valid from: Mon Mar 27 12:42:39 PDT 2023 until: Sun Jun 25 12:42:38 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFfDCCBGSgAwIBAgIRAMQUw05sLMZsECuNNQK+O7QwDQYJKoZIhvcNAQELBQAw\n" + - "RjELMAkGA1UEBhMCVVMxIjAgBgNVBAoTGUdvb2dsZSBUcnVzdCBTZXJ2aWNlcyBM\n" + - "TEMxEzARBgNVBAMTCkdUUyBDQSAxRDQwHhcNMjMwMzI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QVVsR1ku\n" + - "Y3JsMIIBBQYKKwYBBAHWeQIEAgSB9gSB8wDxAHYArfe++nz/EMiLnT2cHj4YarRn\n" + - "KV3PsQwkyoWGNOvcgooAAAGHJM+cawAABAMARzBFAiB568monxGD3NiHsqNmsy+t\n" + - "IL4kCc71UNCCJthgnlL7HgIhAKSYf7P7CFO2wWdAt8LBMrsLoip9lytrinj0JR8R\n" + - "CYK9AHcAtz77JN+cTbp18jnFulj0bF38Qs96nzXEnh0JgSXttJkAAAGHJM+cZAAA\n" + - "BAMASDBGAiEAj8nBf1ihput8Gb8qCqVgvqAxPv9t4xLVhWg3tqv8gGMCIQDPiNbu\n" + - "vsyOi9nE6pDm86nggExXRa13wwCtr2wjAn5IpDANBgkqhkiG9w0BAQsFAAOCAQEA\n" + - "ezldM/NCUH58eXPZnbPaMMKrT5oNBxv+hypDy96+PyAqKtbC2bK+7sobGMZkfpG5\n" + - "8dW0mFmfazzjgbZUj54ZVHG4KaHeit8Nq1s07wh2Jo1c2JQdKxEXAOItax/IOfEd\n" + - "tqSg8AwSmhogQeiA7EXRspw4dYXL5uP/8jPPqByMI3PRmm3y7wyQLKNlNAfSgn7m\n" + - "wkrZxMRAENML4JND5UKxg7zo9e/Wvf4UPtEVVZaEj6ZxOe4JljvErCtayaw03t5p\n" + - "I18IAhXRpqm8JG1UGWjn49O8vkjB0bf/7iVXXI4rg6gGVia+HFuxKVGk5OQzo4Qd\n" + - "wBl6yOc8tpUH3phFPYbiMg==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:43:25 PDT 2023", System.out); - } -} - -class GoogleGTSR2 { - - // Owner: CN=GTS CA 1D8, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R2, O=Google Trust Services LLC, C=US - // Serial number: 219c15ac025a1b0a5c1d9d501 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFjDCCA3SgAwIBAgINAhnBWsAlobClwdnVATANBgkqhkiG9w0BAQsFADBHMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEU\n" + - "MBIGA1UEAxMLR1RTIFJvb3QgUjIwHhcNMjIxMDA1MDAwMDQyWhcNMjcwOTMwMDAw\n" + - "MDQyWjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZp\n" + - "Y2VzIExMQzETMBEGA1UEAxMKR1RTIENBIDFEODCCASIwDQYJKoZIhvcNAQEBBQAD\n" + - "ggEPADCCAQoCggEBAKgpBAgi9bhOp5nCIELI/W+1rMoxNH3isu2LuDI3pPEPYJ0o\n" + - "YDxXB1zKHvUqn1VWDlF+K4vLPzjTRv2MUw8fHH9IAd/Rx+mrUHUxffTPU5O41tPj\n" + - "OdzFRO+FOr5RqZfbtXWbEUNyv7wyyCYr9gaDvDeQgDnHTfHAafdoDracNLm2LS3r\n" + - "8iznvJltsboRm+fBwTH99nHciN/h/hHEWlRriUGZ+Cz+5YVB9Tm4gAOByyYYbAa4\n" + - "ES0PhzkIUHaq+56cTDVhK0DM5ZtnZJqV8amhBFssswPttAXT9pNCzoDLCtxeZ2Lw\n" + - "r7bcaGaDcuDmv4j8zAw3BOR73O0Xk1VcBYPBBUcCAwEAAaOCAXYwggFyMA4GA1Ud\n" + - "DwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwEgYDVR0T\n" + - "AQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUkPhQ+ueQJcnkJ30S3UdY53QPtmowHwYD\n" + - "VR0jBBgwFoAUu//Kji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g4WeGAmTClsXUnMOjCnlVYMLg9v\n" + - "URq0LbylxbGBelBrCNyqBS5UO6+9F4/Yi4vzoIvvbJ0=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr2.demo.pki.goog - // Issuer: CN=GTS CA 1D8, O=Google Trust Services LLC, C=US - // Serial number: 428fe99edb0df46e1008e4452f6cbfd2 - // Valid from: Mon Mar 27 12:52:12 PDT 2023 until: Sun Jun 25 12:52:11 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIFdDCCBFygAwIBAgIQQo/pntsN9G4QCORFL2y/0jANBgkqhkiG9w0BAQsFADBG\n" + - "MQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExM\n" + - "QzETMBEGA1UEAxMKR1RTIENBIDFEODAeFw0yMzAzMjcxOTUyMTJaFw0yMzA2MjUx\n" + - "OTUyMTFaMCMxITAfBgNVBAMTGGdvb2QuZ3RzcjIuZGVtby5wa2kuZ29vZzCCASIw\n" + - "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMaC0h20vohsggOQ0XGL5ca3Gqyf\n" + - "2n44PhYBrhzPpbq9/Mk9BKYYFy9osH0HwTFkYRYnI5fDeK6s/7svufiEwH8LtXK7\n" + - "A3juxf3k65cJ8M5bbBwDDW7Prgp86ueUd6pzqv23rLPc9Kv6vvtNYzgaTd4COU38\n" + - "3zFnuudAh8gvEbIQD+Nqis+kc4kEO3JfZBlAF883YRQZRpm6c4bWxKm1Atco53/6\n" + - "fYOota/XUgdJ8zQWOH1f9iaKX3kiDn76djxT9v/8MrcK2gRkHJJDo72HtCPuhdt8\n" + - "UkVLX4C3KF6eSUrgZ1gxA92ikAWxI4tn5D70yEffH0A7by0/b/C6uPMvXCECAwEA\n" + - "AaOCAn8wggJ7MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAM\n" + - "BgNVHRMBAf8EAjAAMB0GA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zpZLIl+x2EBn3L6CFe5xaKzNaANgbShI\n" + - "cQsyKdaUrSAzNJZWnHwaAyQ1msqqXXoVzKmjAGMgZrXZNxv8Lh9V1v+F9WHDIjeQ\n" + - "TtahntIgq38eGtZAnyjdrUtfQwBlQI3zaE0n7n6Fq8ocglJE5woRlL/eTmSKiZr9\n" + - "rrEY0sJ0fCw=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr2.demo.pki.goog - // Issuer: CN=GTS CA 1D8, O=Google Trust Services LLC, C=US - // Serial number: df9af5c19e9dbdf6107cb03548ffbd06 - // Valid from: Mon Mar 27 12:45:09 PDT 2023 until: Sun Jun 25 12:45:08 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFejCCBGKgAwIBAgIRAN+a9cGenb32EHywNUj/vQYwDQYJKoZIhvcNAQELBQAw\n" + - "RjELMAkGA1UEBhMCVVMxIjAgBgNVBAoTGUdvb2dsZSBUcnVzdCBTZXJ2aWNlcyBM\n" + - "TEMxEzARBgNVBAMTCkdUUyBDQSAxRDgwHhcNMjMwMzI3MTk0NTA5WhcNMjMwNjI1\n" + - "MTk0NTA4WjAmMSQwIgYDVQQDExtyZXZva2VkLmd0c3IyLmRlbW8ucGtpLmdvb2cw\n" + - "ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDFJUSh0aOOjj6BXJqBFDOD\n" + - "GFjnr1VKDfWYdGWfB3QNhcbjz7qJRLeZDSYQZ3H2D5pkOQhl6xYLOZ1L0v+0TWW9\n" + - "5lCXQ476jdZXzPlOC29gYFX4VzS9w92ochg0dUhHdzKcWsqBjqChZdudGydYfwNS\n" + - "edZIhd4AcamVsXbCqAhS01Evo2hiBRlmMgryR9Ok2xRqbJiyvd8awhBIB4L0vMN+\n" + - "CgMpWMgaV1nn+LjEa3bHisyNVsRLdDZXY6Bgq3hUQ9jQWJdK/vGxHqunqC5ByrqG\n" + - "iN+4/+kK/PS8okkpAEAOXF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JKArvpkczxnCBxCPE\n" + - "imW2MHWCayT9JXKuO4ppU0oTh6GYvRV6DV1OkuWXsna7+dGf3+tkm9k0wauI6J8X\n" + - "H1T8Dq3W0+S+8UNSftduYSR1wTcN15OxIzlZ/FrV3LLRDxH2RKSsXfXBLgP1befh\n" + - "m+8SPQTpZ5NdMl7my0gmVgNF5ZIbFiHYzJkF2vS4iXJCI6fTWyoA1u/7jQyHdLOy\n" + - "pY0s6gKWEwwtpYC1lWI6ek/wLfuNrJbiRRiRs8e3HHQymn8K3T1PM+7n8huDy95b\n" + - "f1EgLMjvEtx6xpIqrqg=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:45:40 PDT 2023", System.out); - } -} - -class GoogleGTSR3 { - - // Owner: CN=GTS CA 2D3, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R3, O=Google Trust Services LLC, C=US - // Serial number: 21668d8d65bc4320e5b8e5e76 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDIDCCAqagAwIBAgINAhZo2NZbxDIOW45edjAKBggqhkjOPQQDAzBHMQswCQYD\n" + - "VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIG\n" + - "A1UEAxMLR1RTIFJvb3QgUjMwHhcNMjIxMDA1MDAwMDQyWhcNMjcwOTMwMDAwMDQy\n" + - "WjBGMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2Vz\n" + - "IExMQzETMBEGA1UEAxMKR1RTIENBIDJEMzBZMBMGByqGSM49AgEGCCqGSM49AwEH\n" + - "A0IABGQQXn8LoR0OtyBn+KkEav3utA7WFBgWEb/8bXVlW6xJLTZJIC04lsNmNKWJ\n" + - "P/fwHYfrZcx1o4vvOUTO9OD/7pijggF2MIIBcjAOBgNVHQ8BAf8EBAMCAYYwHQYD\n" + - "VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMBIGA1UdEwEB/wQIMAYBAf8CAQAw\n" + - "HQYDVR0OBBYEFL+pU78badiFKTSaaUPL1nrUmf9tMB8GA1UdIwQYMBaAFMHxJrqg\n" + - "La6Fgc/T8SoSvbgKZ/28MGgGCCsGAQUFBwEBBFwwWjAmBggrBgEFBQcwAYYaaHR0\n" + - "cDovL29jc3AucGtpLmdvb2cvZ3RzcjMwMAYIKwYBBQUHMAKGJGh0dHA6Ly9wa2ku\n" + - "Z29vZy9yZXBvL2NlcnRzL2d0c3IzLmRlcjA0BgNVHR8ELTArMCmgJ6AlhiNodHRw\n" + - "Oi8vY3JsLnBraS5nb29nL2d0c3IzL2d0c3IzLmNybDBNBgNVHSAERjBEMAgGBmeB\n" + - "DAECATA4BgorBgEEAdZ5AgUDMCowKAYIKwYBBQUHAgEWHGh0dHBzOi8vcGtpLmdv\n" + - "b2cvcmVwb3NpdG9yeS8wCgYIKoZIzj0EAwMDaAAwZQIxAO3wG4U11INX3hl2UyCn\n" + - "0A/upBaO+BBzX1OiQx7UfmMXc65kqkdIcNzZc6G6EWnNVAIwBG0LuIKWXfYc+Wbk\n" + - "STfMvwatUvd6QjdIKsYF0e8Hiaav+hLI0DzOuJcDPFtfYIyY\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=good.gtsr3.demo.pki.goog - // Issuer: CN=GTS CA 2D3, O=Google Trust Services LLC, C=US - // Serial number: 7d08ad6716e51d1210bfc149e3d0af19 - // Valid from: Mon Mar 27 12:37:41 PDT 2023 until: Sun Jun 25 12:37:40 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEszCCBFmgAwIB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dvb2QuZ3RzcjMuZGVtby5wa2kuZ29vZzAhBgNVHSAE\n" + - "GjAYMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAvoC2GK2h0\n" + - "dHA6Ly9jcmxzLnBraS5nb29nL2d0czJkMy9WREItNVdJSTVRSS5jcmwwggEEBgor\n" + - "BgEEAdZ5AgQCBIH1BIHyAPAAdgDoPtDaPvUGNTLnVyi8iWvJA9PL0RFr7Otp4Xd9\n" + - "bQa9bgAAAYckzOfmAAAEAwBHMEUCIF0wxIlFnHLMan20Gtbnia+mzuA1Re0dhoIS\n" + - "wOAO7aC4AiEA7cYfSflOAA0DLxHsHAXpVs2LuLYlq34bSxbyUa85UyYAdgCzc3cH\n" + - "4YRQ+GOG1gWp3BEJSnktsWcMC4fc8AMOeTalmgAAAYckzOf5AAAEAwBHMEUCICza\n" + - "2nef9GWr9tF/ZXxhMYP15JQsdWPWmpQkdS/xUBWyAiEAs9AaeMarT7EaBVoSatAT\n" + - "Poj6cOhdvF/uDOHigyQdVd8wCgYIKoZIzj0EAwIDSAAwRQIhALv6jaEFgAIe3NbX\n" + - "87YEjhMMymK7wl435DQD9syoOEx2AiBbcYXr6nLNWA1pPoRiA1WvHgTVJFWftpYt\n" + - "e8CkUXnIxA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr3.demo.pki.goog - // Issuer: CN=GTS CA 2D3, O=Google Trust Services LLC, C=US - // Serial number: 7ffa6a827df64c6010ebc47b5ca3eda7 - // Valid from: Mon Mar 27 12:45:58 PDT 2023 until: Sun Jun 25 12:45:57 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIEuTCCBF+gAwIBAgIQf/pqgn32TGAQ68R7XKPtpzAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBID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WREItNVdJSTVRSS5jcmww\n" + - "ggEEBgorBgEEAdZ5AgQCBIH1BIHyAPAAdQDoPtDaPvUGNTLnVyi8iWvJA9PL0RFr\n" + - "7Otp4Xd9bQa9bgAAAYck00MJAAAEAwBGMEQCIALwbMReWy/zrvUwV1G5XOxN8koN\n" + - "VJ1pp7s1d7ClE9ebAiBYWwJeccnfHLIh9AJTdeuN+R/pDzEudVBSC2rIdo3HhgB3\n" + - "ALc++yTfnE26dfI5xbpY9Gxd/ELPep81xJ4dCYEl7bSZAAABhyTTQzMAAAQDAEgw\n" + - "RgIhAOEO0oyiRgMNDdWvRTobr7sex2SUFsjpKmwenYAULrRiAiEA6uKFK1sbnJ1J\n" + - "lW8Tw2G4jGpEFIc4C9duRbU6DIbGnckwCgYIKoZIzj0EAwIDSAAwRQIgN3byD4lu\n" + - "a8A0hzUR1OnPoXSyfus6HOhmBozH6coY9MICIQDsT5jj5GKVtxtlcki5iE08K70Z\n" + - "gt/tkcE1Fkk4RsZORA==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:47:24 PDT 2023", System.out); - } -} - -class GoogleGTSR4 { - - // Owner: CN=GTS CA 2P2, O=Google Trust Services LLC, C=US - // Issuer: CN=GTS Root R4, O=Google Trust Services LLC, C=US - // Serial number: 2166825e1700440612491f540 - // Valid from: Tue Oct 04 17:00:42 PDT 2022 until: Wed Sep 29 17:00:42 PDT 2027 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDITCCAqagAwIBAgINAhZoJeFwBEBhJJH1QDAKBggqhkjOPQQDAzBHMQswCQYD\n" + - "VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIG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-----"; - - // Owner: CN=good.gtsr4.demo.pki.goog - // Issuer: CN=GTS CA 2P2, O=Google Trust Services LLC, C=US - // Serial number: 743c4f78750e30f0d407a19254ba96a - // Valid from: Mon Mar 27 12:40:42 PDT 2023 until: Sun Jun 25 12:40:41 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIEsTCCBFegAwIBAgIQB0PE94dQ4w8NQHoZJUupajAKBggqhkjOPQQDAjBGMQsw\n" + - "CQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzET\n" + - "MBEGA1UEAxMKR1RTIENBIDJQMjAeFw0yMzAzMjcxOTQwNDJaFw0yMzA2MjUxOTQw\n" + - "NDFaMCMxITAfBgNVBAMTGGdvb2QuZ3RzcjQuZGVtby5wa2kuZ29vZzCCASIwDQYJ\n" + - "KoZIhvcNAQEBBQADggEPADCCAQoCggEBAOdkWBg3i5CxzH1dvlBoWHtIUyk78OAA\n" + - "bZdq7pKWB8i8C9Rf089uQ+7jQWOmqCNxU+OXdjumPfk/4MQvvtkmaqKi7HCN1bvQ\n" + - "0CrW7Zhi5jx11QuzEEZVdvXcchzmodp9GSl9t6zK/ItNiIYVisH9dqRWrZ/KZnO+\n" + - "y13dlr5UXAXVvNKx1L4TjhGlam7IEJdrAjkLJk4wXAFhv9HaPNJnjj0306xNm2h+\n" + - "VzldpMPlaXGN9JcGQdMVFpa9f0AI/r7SF7I2EDXaIKFToJ4jQurEGc3oxayiv9wB\n" + - "QapXqSTbPztb5SPGdX1yawDeigNHf10tDqFzCpfI/AwLxagpA2YyyXMCAwEAAaOC\n" + - "An0wggJ5MA4GA1UdDwEB/wQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAMBgNV\n" + - "HRMBAf8EAjAAMB0GA1UdDgQWBBTZs4UFHCFLlXnJswubCMxEhtgPmjAfBgNVHSME\n" + - "GDAWgBSHI6lQSA4HiVQKcTD2M9IKR/adrDB4BggrBgEFBQcBAQRsMGowNQYIKwYB\n" + - "BQUHMAGGKWh0dHA6Ly9vY3NwLnBraS5nb29nL3MvZ3RzMnAyL3dKWTY1eFNLQUNB\n" + - "MDEGCCsGAQUFBzAChiVodHRwOi8vcGtpLmdvb2cvcmVwby9jZXJ0cy9ndHMycDIu\n" + - "ZGVyMCMGA1UdEQQcMBqCGGdvb2QuZ3RzcjQuZGVtby5wa2kuZ29vZzAhBgNVHSAE\n" + - "GjAYMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAvoC2GK2h0\n" + - "dHA6Ly9jcmxzLnBraS5nb29nL2d0czJwMi94NWswT2ZlZ0o4OC5jcmwwggECBgor\n" + - "BgEEAdZ5AgQCBIHzBIHwAO4AdQDoPtDaPvUGNTLnVyi8iWvJA9PL0RFr7Otp4Xd9\n" + - "bQa9bgAAAYckzdBSAAAEAwBGMEQCICpm7XEQds5Pzk59Qhhlx3PjipAEVzxVJB3H\n" + - "UmmGlHYKAiBG39UauHNNQDMYK2PEnILbFI0AvVWpCBUck4CHbs+9xAB1AHoyjFTY\n" + - "ty22IOo44FIe6YQWcDIThU070ivBOlejUutSAAABhyTN0JoAAAQDAEYwRAIgekoP\n" + - "yJFspEfqvzW/pzVtRn8oz1L/PBzw2NYRPFdDkRUCIG1uIaGUA7uqiILD6vvp/1VD\n" + - "XriEIH8/qz/3qWqxsZanMAoGCCqGSM49BAMCA0gAMEUCIQCnpyh5H9Hn+f8nOFZp\n" + - "wz7p+x5pmMVvPzah1g+EmoFO/wIgStidgVhudT/vpM2OH/oN30Na+EJJDqWxousN\n" + - "6t9L8FQ=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked.gtsr4.demo.pki.goog - // Issuer: CN=GTS CA 2P2, O=Google Trust Services LLC, C=US - // Serial number: 6b2d650d4bc3bd3f11a595bf05187915 - // Valid from: Mon Mar 27 12:47:43 PDT 2023 until: Sun Jun 25 12:47:42 PDT 2023 - private static final String REVOKED = "-----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mVwby9jZXJ0cy9ndHMy\n" + - "cDIuZGVyMCYGA1UdEQQfMB2CG3Jldm9rZWQuZ3RzcjQuZGVtby5wa2kuZ29vZzAh\n" + - "BgNVHSAEGjAYMAgGBmeBDAECATAMBgorBgEEAdZ5AgUDMDwGA1UdHwQ1MDMwMaAv\n" + - "oC2GK2h0dHA6Ly9jcmxzLnBraS5nb29nL2d0czJwMi9sU1htaTNxZWRoYy5jcmww\n" + - "ggEDBgorBgEEAdZ5AgQCBIH0BIHxAO8AdgCt9776fP8QyIudPZwePhhqtGcpXc+x\n" + - "DCTKhYY069yCigAAAYck1BYGAAAEAwBHMEUCIGM5ykDTU3mqgLIk+fPmVn6JGUXB\n" + - "W4xouGUA1iiNs7G0AiEAtuWnV/J5llcxB7ZTwkCb6cviyv4Z6O396ZGW8GsrqAQA\n" + - "dQC3Pvsk35xNunXyOcW6WPRsXfxCz3qfNcSeHQmBJe20mQAAAYck1BYIAAAEAwBG\n" + - "MEQCIHcK1H025GIv8klzQGSZAL9NnuH5EzeGra0jRRg5RM4UAiAQaJyJDBkJRL/C\n" + - "F9WCg9Lmp8bdsXkG5WPreI24ansAPTAKBggqhkjOPQQDAgNIADBFAiBehPLU7raP\n" + - "509khaP9yiKiL3mbygtfQo4MDpBnd2RI6wIhAOdlQythGgU+nOENodsB+wUOQXOb\n" + - "akcBOxrDWfyhxmpk\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Mar 27 13:48:18 PDT 2023", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/LetsEncryptCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2017, 2021, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - /* - * @test - * @bug 8189131 - * @summary Interoperability tests with Let's Encrypt CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath LetsEncryptCA OCSP - * @run main/othervm -Djava.security.debug=certpath LetsEncryptCA CRL - */ - - /* - * Obtain TLS test artifacts for Let's Encrypt CA from: - * - * Valid TLS Certificates: - * https://valid-isrgrootx1.letsencrypt.org/ - * - * Revoked TLS Certificates: - * https://revoked-isrgrootx1.letsencrypt.org/ - * - * Test artifacts don't have CRLs listed and intermediate cert doesn't have OCSP. - */ -public class LetsEncryptCA { - - // Owner: CN=R3, O=Let's Encrypt, C=US - // Issuer: CN=ISRG Root X1, O=Internet Security Research Group, C=US - // Serial number: 912b084acf0c18a753f6d62e25a75f5a - // Valid from: Thu Sep 03 17:00:00 PDT 2020 until: Mon Sep 15 09:00:00 PDT 2025 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw\n" + - "TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh\n" + - "cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw\n" + - "WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg\n" + - "RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP\n" + - "R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx\n" + - "sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm\n" + - "NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg\n" + - "Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG\n" + - "/kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC\n" + - "AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB\n" + - "Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA\n" + - "FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw\n" + - "AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw\n" + - "Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB\n" + - "gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W\n" + - "PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl\n" + - "ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz\n" + - "CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm\n" + - "lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4\n" + - "avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2\n" + - "yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O\n" + - "yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids\n" + - "hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+\n" + - "HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv\n" + - "MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX\n" + - "nLRbwHOoq7hHwg==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=valid-isrgrootx1.letsencrypt.org - // Issuer: CN=R3, O=Let's Encrypt, C=US - // Serial number: 46326744d1c2f3feeca7148ed59353144a6 - // Valid from: Wed Jun 02 08:00:18 PDT 2021 until: Tue Aug 31 08:00:18 PDT 2021 - private static final String VALID = "-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dHgx\n" + - "LmxldHNlbmNyeXB0Lm9yZzBMBgNVHSAERTBDMAgGBmeBDAECATA3BgsrBgEEAYLf\n" + - "EwEBATAoMCYGCCsGAQUFBwIBFhpodHRwOi8vY3BzLmxldHNlbmNyeXB0Lm9yZzCC\n" + - "AQYGCisGAQQB1nkCBAIEgfcEgfQA8gB3APZclC/RdzAiFFQYCDCUVo7jTRMZM7/f\n" + - "DC8gC8xO8WTjAAABec10PpUAAAQDAEgwRgIhAPDWvnP5mA0RhPa9oiTlE21Ppcez\n" + - "eF1+wU0MeoQcjq/7AiEAsox8kMGpWXq0ZVPweTpw1So/sNOZTsSPyBUdbLwjf+MA\n" + - "dwBvU3asMfAxGdiZAKRRFf93FRwR2QLBACkGjbIImjfZEwAAAXnNdD7rAAAEAwBI\n" + - "MEYCIQCYBSmmb5P+DZGANyYTPHlEbmqOBkEOblkEHq5Lf+wtkQIhAO2HhwOm3wns\n" + - "ZTsXjUCcfQA0lKBI2TKkg9tJKFs3uuKDMA0GCSqGSIb3DQEBCwUAA4IBAQBJJ47x\n" + - "ZhKN3QRBYVROpoYDSh0a/JW7zPGRCxK5fnDY9UT8m4gEh3yhDTkycX+vo8TReK6W\n" + - "fEYareTSTq71MYgtKDYEARm10DuL7Vdig9Tf5DpjXLHaba+wqPz24lwhiJgoKRRr\n" + - "8by3wXPFCGSuQyDo1ZUNrAJVYKO4hPMob1ZE8z9IYW63GvzBjEla/HxoVa9iTkv+\n" + - "31rsKzpSbMJpnQ7WcgkUPdpoDo4JElGCyf7VZHNicumipAiCmKu0Q6TRCPOXxlKE\n" + - "/BIyDey3rXVw3wzOlxmVF6t/V3vGtbgVvN/feUe/ytyv4vLfRR4udi2XxWt3x1la\n" + - "7R3zuWdRQhh21p1H\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked-isrgrootx1.letsencrypt.org - // Issuer: CN=R3, O=Let's Encrypt, C=US - // Serial number: 4f1333011635d76d6356c5f1fb8a7273617 - // Valid from: Fri Jun 25 08:18:10 PDT 2021 until: Thu Sep 23 08:18:09 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIFSTCCBDGgAwIBAgISBPEzMBFjXXbWNWxfH7inJzYXMA0GCSqGSIb3DQEBCwUA\n" + - "MDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MQswCQYDVQQD\n" + - "EwJSMzAeFw0yMTA2MjUxNTE4MTBaFw0yMTA5MjMxNTE4MDlaMC0xKzApBgNVBAMT\n" + - "InJldm9rZWQtaXNyZ3Jvb3R4MS5sZXRzZW5jcnlwdC5vcmcwggEiMA0GCSqGSIb3\n" + - "DQEBAQUAA4IBDwAwggEKAoIBAQCkCp4fq7FnN5lfAWX0vhCcyC5WO9TuU6ckuYYj\n" + - "8/wQ8GQ/FIl+vXCAmHIfIX14irQN8TISeVdMOP0C7sa73d3GSawX7qMaRhddXn7V\n" + - "EL+4CbHQ6qit5YkakwhHz9tKbYX16wPj+inn22kJVwi8iLbhYB9WWSvv7OyiNSHv\n" + - "nmlYUkMv8+9UhgPT4yCKF1OEI5ajUOuecjOKc+EzsT/JqPRErvBOIKn3PRn4h8UM\n" + - "0BJDrDtZMpkvD4/lyRs3g/BLsf3DQjlEgKit0hvc72yyhiDbKd41EmBoQC5rNF7o\n" + - "B0CnBXhDLHbC/YRunVrYGsF0h2J9hw4055BdaXbS2BJnPEFnAgMBAAGjggJcMIIC\n" + - "WDAOBgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMC\n" + - "MAwGA1UdEwEB/wQCMAAwHQYDVR0OBBYEFJBkf3Z/ICoCTUx3JCgrBeoMyedQMB8G\n" + - "A1UdIwQYMBaAFBQusxe3WFbLrlAJQOYfr52LFMLGMFUGCCsGAQUFBwEBBEkwRzAh\n" + - "BggrBgEFBQcwAYYVaHR0cDovL3IzLm8ubGVuY3Iub3JnMCIGCCsGAQUFBzAChhZo\n" + - "dHRwOi8vcjMuaS5sZW5jci5vcmcvMC0GA1UdEQQmMCSCInJldm9rZWQtaXNyZ3Jv\n" + - "b3R4MS5sZXRzZW5jcnlwdC5vcmcwTAYDVR0gBEUwQzAIBgZngQwBAgEwNwYLKwYB\n" + - "BAGC3xMBAQEwKDAmBggrBgEFBQcCARYaaHR0cDovL2Nwcy5sZXRzZW5jcnlwdC5v\n" + - "cmcwggEDBgorBgEEAdZ5AgQCBIH0BIHxAO8AdQCUILwejtWNbIhzH4KLIiwN0dpN\n" + - "XmxPlD1h204vWE2iwgAAAXpD9t6nAAAEAwBGMEQCIHwF9NcPqsovYp56lhqFkWYj\n" + - "QCATATrLzzxgUoLDYRwgAiBBecqe5Ub32I+q9oqH1nbK/s8QadcafIL3bkrRVbFB\n" + - "TAB2AH0+8viP/4hVaCTCwMqeUol5K8UOeAl/LmqXaJl+IvDXAAABekP23sYAAAQD\n" + - "AEcwRQIgGli/1mmKKnZ0uxDIX7ySqAyD2C7FTf+y3py2S0Xcv4YCIQCZve3cqKZ2\n" + - "lrEyyaMeLZA+PIxUMniHx3gDkro0sKLzOzANBgkqhkiG9w0BAQsFAAOCAQEAle42\n" + - "p58OTusm7DAOcdK4ld+pJu2bz9F940Wrnql08rciRjGIVpp5PhMNFm9AOaptKPNY\n" + - "h62V2GEOVaLxmvr9/8EDFcCCPAGV1DNYrG9aTKaiXk7IzO4UxKbzox4iUcuop/zB\n" + - "uofxT8uBLmT4XYZrQXXKj1KdfJGzgeoXqBv5PPCiP3hmBQixoJnSKImnUIXWh4O8\n" + - "kBtmgII5ug0q+jI3LvpJuv7xQsaNYFBcmFiQQ7YRt4W99GMdbYGjhzT8iBDEH7nG\n" + - "MsqWuwB5TN5vIuw2aWxcfaqKayq7UPA4rJePWdD/5RzKlQKLQx0BA3AL+3Nnj1fT\n" + - "NEKwCWWylIND6z/9Xw==\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - pathValidator.enableCRLCheck(); - - // Validate int, EE certs don't have CRLs - pathValidator.validate(new String[]{INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - return; - } - - // OCSP check by default - // intermediate cert R3 doesn't specify OCSP responder - ValidatePathWithParams pathValidator = new ValidatePathWithParams(new String[]{INT}); - pathValidator.enableOCSPCheck(); - - // Validate valid - pathValidator.validate(new String[]{VALID}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED}, - ValidatePathWithParams.Status.REVOKED, - "Fri Jun 25 09:18:12 PDT 2021", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/MicrosoftTLS.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,348 +0,0 @@ -/* - * Copyright (c) 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8304760 - * @summary Interoperability tests with Microsoft TLS root CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath MicrosoftTLS OCSP - * @run main/othervm -Djava.security.debug=certpath MicrosoftTLS CRL - */ - -/* - * Microsoft ECC Root Certificate Authority 2017: - * Valid: http://acteccroot2017.pki.microsoft.com/ - * Revoked: http://rvkeccroot2017.pki.microsoft.com/ - * Expired: http://expeccroot2017.pki.microsoft.com/ - * - * Microsoft RSA Root Certificate Authority 2017: - * Valid: http://actrsaroot2017.pki.microsoft.com/ - * Revoked: http://rvkrsaroot2017.pki.microsoft.com/ - * Expired: http://exprsaroot2017.pki.microsoft.com/ - */ -public class MicrosoftTLS { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new MicrosoftECCTLS().runTest(pathValidator); - new MicrosoftRSATLS().runTest(pathValidator); - } -} - -class MicrosoftECCTLS { - - // Owner: CN=Microsoft ECC TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Issuer: CN=Microsoft ECC Root Certificate Authority 2017, O=Microsoft - // Corporation, C=US - // Serial number: 33000000282bfd23e7d1add707000000000028 - // Valid from: Thu Jun 24 12:58:36 PDT 2021 until: Wed Jun 24 12:58:36 PDT 2026 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIESTCCA8+gAwIBAgITMwAAACgr/SPn0a3XBwAAAAAAKDAKBggqhkjOPQQDAzBl\n" + - "MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw\n" + - "NAYDVQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5\n" + - "I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L29jc3AwcAYDVR0gBGkwZzAIBgZngQwBAgEwCAYGZ4EMAQICMFEGDCsGAQQBgjdM\n" + - "g30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtp\n" + - "b3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wCgYIKoZIzj0EAwMDaAAwZQIxANmPydUj\n" + - "lgj/2K77UnMeMkSGIgXzOhcTsixzZL+NmTR1Bq2hSPeA6Y3mn3lMlwxZmAIwIio6\n" + - "KrgItH4YmLWKd8QClIrE9QjbDlR7oFqaU3J34bWbMlAEjRARdZhhQlNwdORe\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft ECC TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 3300000154e1c6007ee3d5c903000000000154 - // Valid from: Fri Oct 14 13:44:52 PDT 2022 until: Mon Oct 09 13:44:52 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIF3zCCBWSgAwIBAgITMwAAAVThxgB+49XJAwAAAAABVDAKBggqhkjOPQQDAzBb\n" + - "MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSww\n" + - "KgYDVQQDEyNNaWNyb3NvZnQgRUNDIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAeFw0y\n" + - "MjEwMTQyMDQ0NTJaFw0yMzEwMDkyMDQ0NTJaMFQxCzAJBgNVBAYTAlVTMRMwEQYD\n" + - "VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy\n" + - "b3NvZnQgQ29ycG9yYXRpb24wdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARk86yqvyiv\n" + - "jH2Frg2l6bmh1f0CqiKAEHdA2S2vTQhR4CtvFArkrPdqcKrhAAfQSgnC8KJQ08gl\n" + - "Q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KwYDVR0RBCQwIoIgYWN0ZWNjcm9vdDIw\n" + - "MTcucGtpLm1pY3Jvc29mdC5jb20waAYDVR0fBGEwXzBdoFugWYZXaHR0cDovL3d3\n" + - "dy5taWNyb3NvZnQuY29tL3BraW9wcy9jcmwvTWljcm9zb2Z0JTIwRUNDJTIwVExT\n" + - "JTIwSXNzdWluZyUyMEFPQyUyMENBJTIwMDEuY3JsMGYGA1UdIARfMF0wUQYMKwYB\n" + - "BAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93d3cubWljcm9zb2Z0LmNv\n" + - "bS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTAIBgZngQwBAgIwHwYDVR0jBBgw\n" + - "FoAUMVu5zlEbfNGqA8Dr7TZdwp3TieEwEwYDVR0lBAwwCgYIKwYBBQUHAwEwCgYI\n" + - "KoZIzj0EAwMDaQAwZgIxAOKV8s3SpXVd6zho8zQa4uGXkxPVocYo410FdTwu0lw7\n" + - "G/MQPhLmj4DNsQJ/nYzDcwIxAMw7iZExsY9Is66/EaAty4rA+yuliwCag88VnDRH\n" + - "9cjiongZgpddIYS8xf76B2pi/Q==\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft ECC TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 3300000155ea28117be8708034000000000155 - // Valid from: Fri Oct 14 13:50:39 PDT 2022 until: Mon Oct 09 13:50:39 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIF3TCCBWOgAwIBAgITMwAAAVXqKBF76HCANAAAAAABVTAKBggqhkjOPQQDAzBb\n" + - "MQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSww\n" + - "KgYDVQQDEyNNaWNyb3NvZnQgRUNDIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAeFw0y\n" + - "MjEw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gZYwZQYIKwYBBQUHMAKGWWh0dHA6Ly93d3cubWljcm9z\n" + - "b2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwRUNDJTIwVExTJTIwSXNz\n" + - "dWluZyUyMEFPQyUyMENBJTIwMDEuY3J0MC0GCCsGAQUFBzABhiFodHRwOi8vb25l\n" + - "b2NzcC5taWNyb3NvZnQuY29tL29jc3AwHQYDVR0OBBYEFN3cgtHESQ8o7thvaL42\n" + - "bD7mpfktMA4GA1UdDwEB/wQEAwIHgDArBgNVHREEJDAigiBydmtlY2Nyb290MjAx\n" + - "Ny5wa2kubWljcm9zb2Z0LmNvbTBoBgNVHR8EYTBfMF2gW6BZhldodHRwOi8vd3d3\n" + - "Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBFQ0MlMjBUTFMl\n" + - "MjBJc3N1aW5nJTIwQU9DJTIwQ0ElMjAwMS5jcmwwZgYDVR0gBF8wXTBRBgwrBgEE\n" + - "AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t\n" + - "L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMAgGBmeBDAECAjAfBgNVHSMEGDAW\n" + - "gBQxW7nOURt80aoDwOvtNl3CndOJ4TATBgNVHSUEDDAKBggrBgEFBQcDATAKBggq\n" + - "hkjOPQQDAwNoADBlAjBBhbuh/iukcibeEh/Op3RfNf6jUSyza4lZvsJsRiEVwySa\n" + - "ofmg8OvBO2l2+9MjoCUCMQCoiyS1tDgtjW9gguKDgPXypURpL27KfnCzwx6ar2LN\n" + - "gCZ/soGnLsgPIscuNH/BK20=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Oct 14 15:46:18 PDT 2022", System.out); - } -} - -class MicrosoftRSATLS { - - // Owner: CN=Microsoft RSA TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Issuer: CN=Microsoft RSA Root Certificate Authority 2017, O=Microsoft - // Corporation, C=US - // Serial number: 330000002ffaf06f6697e2469c00000000002f - // Valid from: Thu Jun 24 13:57:35 PDT 2021 until: Wed Jun 24 13:57:35 PDT 2026 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIHmDCCBYCgAwIBAgITMwAAAC/68G9ml+JGnAAAAAAALzANBgkqhkiG9w0BAQwF\n" + - "ADBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n" + - "MTYwNAYDVQQDEy1NaWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y\n" + - "aXR5IDIwMTcwHhcNMjEwNjI0MjA1NzM1WhcNMjYwNjI0MjA1NzM1WjBbMQswCQYD\n" + - "VQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSwwKgYDVQQD\n" + - "EyNNaWNyb3NvZnQgUlNBIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTCCAiIwDQYJKoZI\n" + - "hvcNAQEBBQADggIPADCCAgoCggIBAKAYz8zB6I+LeiWYURf1QUaISydvRgxWfcc6\n" + - "UvEiwvryj2UsRfFuREo2ErLTvP9qQ9E0YBTyWEqI2TXn4jo2uZ2cpGODiQQWlixe\n" + - "aAFcYgSqLzidFXj401vzQsz4E0zylD/ZeY+xkQ6xrdg5312x2u2Ap7AWLzqolZHZ\n" + - "gR0aicn9gcO6M4qn6Uuge8mOve1N7U6j8ebhSiw0KlkzY9ha1Kvrez+NXQdeLC+V\n" + - "PDWPPPlBWeysTnIM6dusbV1v2/C7Ooz9TuGb8wiXRriPpI7+igSIPqBebF00rHGJ\n" + - "Dmx9eN3g78VF9JpT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YhaHR0cDovL29uZW9jc3AubWljcm9zb2Z0LmNv\n" + - "bS9vY3NwMHAGA1UdIARpMGcwCAYGZ4EMAQIBMAgGBmeBDAECAjBRBgwrBgEEAYI3\n" + - "TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3Br\n" + - "aW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMA0GCSqGSIb3DQEBDAUAA4ICAQAkucWk\n" + - "Mrgs2ahYrG7y4sY2yZno4f9TGyk7p+Srg4Yz/g7LmVeyOob9o579Omw9AiyeDK8Y\n" + - "/dXnTTof+sKJrlNTpIzyEBkzCiGGkWtp7x2yxLCm12L65wtmD/6OAV9Bm1kOhf3p\n" + - "7v+d3gtFt7cw46W35lr+fguy62s7uuytTV9hfhQ0pp2E2E9F6B7U71jR4bC+6zGq\n" + - "+34AmqTirjKHwXOhWDRDpEJIkaFAh+qdz/nqJktZj3n5GdC94jfWrMUJjClGjlc4\n" + - "+Ws3AxN46oFpx8oIXDG9wIPfFhUf0SdnCYJL8TD5+qBNp0H5q/V2R31Wi8rijHGQ\n" + - "4CxHqzP5VJbjgvRQgxAp39BrmLQ+JSvf9e5VqQqaH4NYgpB1WObq12B73BJHjBOv\n" + - "pRrULFjPqDW8sPRBzBTRXkXOPEdZbzQj6O/CWEFsg6ilO4thk3n3drb9FEJjVh9u\n" + - "GtRXV6Ea5bNaPvJppZNXb7M9mORk3mddx/K1FgOETQE3quh+mU4ojbSRUWMVmjcb\n" + - "6bKF5oQd+Q0do4yaEIfH1oVnIas/FIE/xu3Z4fvBs0qdiNLCeNT6uS26vqD2PEvV\n" + - "lFWb683Do3Ls59MMCxhy6Erb7kFQgu1oUWXGFhbMQkeLN4TXGi6X3loXYfING9om\n" + - "nWa/udxvPRwAZmcHU2l2W8cwVXiy6uucsh3kPQ==\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft RSA TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 330000014a3b44c12636e54b9f00000000014a - // Valid from: Fri Oct 14 13:55:34 PDT 2022 until: Mon Oct 09 13:55:34 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIILDCCBhSgAwIBAgITMwAAAUo7RMEmNuVLnwAAAAABSjANBgkqhkiG9w0BAQwF\n" + - "ADBbMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n" + - "MSwwKgYDVQQDEyNNaWNyb3NvZnQgUlNBIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAe\n" + - "Fw0yMjEwMTQyMDU1MzRaFw0yMzEwMDkyMDU1MzRaMFQxCzAJBgNVBAYTAlVTMRMw\n" + - "EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN\n" + - "aWNyb3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQDTo/3ysrrKP2eOLQ8JUFhQT09HJM1lUr0nH7RiP4VAKFrGFMIQSCsq17y7\n" + - "PuTHxW53Fvxb5s/EKZobzhlgv4rHQxvoMuGWRBgJN6KfspQAuFnUVG+3y70fHy/O\n" + - "PiVUJdfTupsys/fjzERqzx6FZoU1RzQ08na36SicSOQmj5svtHHxL8ZibDD48Xzp\n" + - "oIEBh2uUDhevkZedBmqlIdAhNgKXqf2lieLjWXZQLzUyXHikQJxNFOHFVjBqH3pu\n" + - "pYt2XD78bS/xeKRbGLw52+o3/u4eaPyiJoG0GaVSG2HRGcplu7Auk6ycD3htispr\n" + - "dviXfHa3tW1hO52PrQBOWvpsP3jdAgMBAAGjggPuMIID6jCCAX4GCisGAQQB1nkC\n" + - "BAIEggFuBIIBagFoAHUA6D7Q2j71BjUy51covIlryQPTy9ERa+zraeF3fW0GvW4A\n" + - "AAGD2FEl4w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ERcJHxYy41U=\n" + - "-----END CERTIFICATE-----"; - - // Owner: O=Microsoft Corporation, L=Redmond, ST=Washington, C=US - // Issuer: CN=Microsoft RSA TLS Issuing AOC CA 01, O=Microsoft Corporation, C=US - // Serial number: 330000014b4c2b0b9955688feb00000000014b - // Valid from: Fri Oct 14 13:56:58 PDT 2022 until: Mon Oct 09 13:56:58 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIKjCCBhKgAwIBAgITMwAAAUtMKwuZVWiP6wAAAAABSzANBgkqhkiG9w0BAQwF\n" + - "ADBbMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u\n" + - "MSwwKgYDVQQDEyNNaWNyb3NvZnQgUlNBIFRMUyBJc3N1aW5nIEFPQyBDQSAwMTAe\n" + - "Fw0yMjEwMTQyMDU2NThaFw0yMzEwMDkyMDU2NThaMFQxCzAJBgNVBAYTAlVTMRMw\n" + - "EQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVN\n" + - "aWNyb3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + - "AoIBAQD2UxPzrv61IqG8jCFPWM3KeQpBeBlxh3mzvWVFmo340r0J1C3uLaUTPYLo\n" + - "P+Xndq2GqYLlm/5FEY7ynU1as57SH0tHbKCIYYJezn/ZJHUYcOY80uGKpP3bdbRq\n" + - "W51Xo7/gzTrXFJ2Nrn05d9mKBq+Oxs71+Nj7QuzjHYAF0n8OWNwZCBOBdAX3EDVQ\n" + - "4HBMSkIzriodM0FD2zkT8RIvZ7WbpLxvZXqWbynAeLirTRYE2lY9UalxrP+wCef9\n" + - "DARxcpEgF30nwRnALfOhnuOhdrtdLYhArfQMyDcvJnDyzCWEZCaPNtBhdsziJjf9\n" + - "A8R4/qdnlQE4/24O9MXQja5dwyyRAgMBAAGjggPsMIID6DCCAXwG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4GjuenPYsCmabzydiAeMIQirCCLSTqXrSw1YL\n" + - "2+608l1nqYy1JOrSq/zFp3c5buSFbjj7jVJB5LEh\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Oct 14 15:46:18 PDT 2022", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/QuoVadisCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,495 +0,0 @@ -/* - * Copyright (c) 2017, 2022, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8189131 8207059 - * @key intermittent - * @summary Interoperability tests with QuoVadis Root CA1, CA2, and CA3 G3 CAs - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath QuoVadisCA OCSP - * @run main/othervm -Djava.security.debug=certpath QuoVadisCA CRL - */ - -/* - * Obtain TLS test artifacts for QuoVadis CAs from: - * - * https://www.quovadisglobal.com/download-roots-crl/ - * - */ -public class QuoVadisCA { - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - new RootCA1G3().runTest(pathValidator); - new RootCA2G3().runTest(pathValidator); - new RootCA3G3().runTest(pathValidator); - } -} - -class RootCA1G3 { - - // Owner: CN=DigiCert QuoVadis TLS ICA QV Root CA 1 G3, O="DigiCert, Inc", C=US - // Issuer: CN=QuoVadis Root CA 1 G3, O=QuoVadis Limited, C=BM - // Serial number: 2837d5c3c2b57294becf99afe8bbdcd1bb0b20f1 - // Valid from: Wed Jan 06 12:50:51 PST 2021 until: Sat Jan 04 12:50:51 PST 2031 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFgDCCA2igAwIBAgIUKDfVw8K1cpS+z5mv6Lvc0bsLIPEwDQYJKoZIhvcNAQEL\n" + - "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + - "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0yMTAxMDYyMDUwNTFaFw0z\n" + - "MTAxMDQyMDUwNTFaMFkxCzAJBgNVBAYTAlVTMRYwFAYDVQQKDA1EaWdpQ2VydCwg\n" + - "SW5jMTIwMAYDVQQDDClEaWdpQ2VydCBRdW9WYWRpcyBUTFMgSUNBIFFWIFJvb3Qg\n" + - "Q0EgMSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALMrbkb9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rGZ2/Q+n5jrnRqM5IS8TXYcnzLD3azH1+aZjkwQt9HP4IuvAe/Bg9aWE\n" + - "XeDmksbg0SqQInrWn+BVYtD+hCZNz8K0GnKKpx3Q9VxzRv+BMbO5e9iqK1Hcj5Wv\n" + - "ZXvU45j2r5y9WML4fc8CvphzbF6ezr1e51i+yabNmfld33gRX48V5oNk16wX32ed\n" + - "kQ83sKNomQm1dXURWK8aSDcZFAvJQ8vKTLIE9wiQmtjfSGoJzQhKLaN+egrp4L9y\n" + - "fjpFIeK4zgAH39P4s4kaPWTdfXe2n6P5o7Xolp4R22SVkI76d8d+5Iv7Rtqd+mqI\n" + - "y1hkwyTBbOBLtyF7yMtJQewkkZ0MWxkPvWg193RbYVRx8w1EycnxMgNwy2sJw7MR\n" + - "XM6Mihkw910BkvlbsFUXw4uSvRkkRWSBWVrkM5hvZGtbIJkqrdnj55RSk4DLOOT/\n" + - "LUyji/KpgD7YCi7emFA4tH6OpkNrjUJ3gdRnD4GwQj/87tYeoQWZ6uCl0MHDUCmw\n" + - "73bpxSkjPrYbmKo9mGEAMhW1ZxY=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-1-g3.chain-demos.digicert.com, O="DigiCert, Inc.", - // L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 1 G3, O="DigiCert, Inc", C=US - // Serial number: a94cc08600f5fe5d3f0659bfcfec6f0 - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIG/DCCBeSgAwIBAgIQCpTMCGAPX+XT8GWb/P7G8DANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDEgRzMwHhcNMjIw\n" + -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E1Y1ZgtX24rSVfTCkU/3dnTZaIhaZgFHyftAum7xSI\n" + - "Qzu7pwih+PXrGNXupsnZ+VUE7a7zHyRDajixhSp7dZS4zLoDTxeyKX0MDmo4e8Mi\n" + - "HNYVASYcrdld90jVJaeI/V3EkJAX7/Eyo9JqzivEwGM0e0JhCLekcVSzhjGoAlbQ\n" + - "tIzCIaeVUlWKKiNXSKr1WD4oCD3ky4Y5VekTGzyUf/0LYzV+Y7p8epc5vTWKwYx/\n" + - "vQwJ4RsgFit+c84mSg4qug==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-1-g3-revoked.chain-demos.digicert.com, - // O="DigiCert, Inc.", L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 1 G3, O="DigiCert, Inc", C=US - // Serial number: e7eff4cdd14ebed1daa7bb7e07300ed - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHDjCCBfagAwIBAgIQDn7/TN0U6+0dqnu34HMA7TANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDEgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjCBhTELMAkGA1UEBhMCVVMxDTALBgNV\n" + - "BAgTBFV0YWgxDTALBgNVBAcTBExlaGkxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMu\n" + - "MT8wPQYDVQQDEzZxdW92YWRpcy1yb290LWNhLTEtZzMtcmV2b2tlZC5jaGFpbi1k\n" + - "ZW1vcy5kaWdpY2VydC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n" + - "AQDCQQ2S25TEDD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MoeSeutAS2e7oIvA//7C37LrQccQ==\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) - throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 08 11:22:28 PST 2022", System.out); - } -} - -class RootCA2G3 { - - // Owner: CN=DigiCert QV EV TLS ICA G1, O="DigiCert, Inc.", C=US - // Issuer: CN=QuoVadis Root CA 2 G3, O=QuoVadis Limited, C=BM - // Serial number: 65e9bcd53e791df22dffeb5ecc2bc7a5588d0883 - // Valid from: Mon Mar 16 12:39:42 PDT 2020 until: Thu Mar 14 12:39:42 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFbzCCA1egAwIBAgIUZem81T55HfIt/+tezCvHpViNCIMwDQYJKoZIhvcNAQEL\n" + - "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + - "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0yMDAzMTYxOTM5NDJaFw0z\n" + - "MDAzMTQxOTM5NDJaMEoxCzAJBgNVBAYTAlVTMRcwFQYDVQQKDA5EaWdpQ2VydCwg\n" + - "SW5jLjEiMCAGA1UEAwwZRGlnaUNlcnQgUVYgRVYgVExTIElDQSBHMTCCASIwDQYJ\n" + - "KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMhwn6I+pGrJsnisnzP7EU5cFN9UT5XF\n" + - "auA13F3jHeUUZmBOcMSOJEhx/e7oeVScTnmKpe7t7uey7lIIC9DWFmP8klbtLBgL\n" + - "0jY4MPlCkVyxUIhZ73EHCPqDCX9bo+rMB6C758/tKZOPcoWRixQypPwoC4cXNOOk\n" + - "ntqFPRxFSZoBdTDNlAmkAQJCRsXGCEC5pZ0JqzGcA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/1\n" + - "+LnH/Dv88VcZhODYq+VGbyM8bpNr0v95PY3yaH4kzpWGqWAN5i9LosfcaqRPmyL4\n" + - "PcKTQwcA9AVTjITExFua/QtGrXLPvMVxR248G9IQpJMxP3JEGkjlKCenmc29r2u1\n" + - "KE4TeCs2xxjR1PusTfX91bBW3YAoAPDTRQKZjolegLUY44j3uKSzAdhMEbZQhovH\n" + - "Lraqx1WjTayTuq1Vuakcia5shmgFVSNcE+NVgLEIe32oTOm/G6Kd1lcm9C4Ph1Cg\n" + - "nfDuqohZrk76kJTk8poAY5aFCQHhVzbpSw3zooMGjjvWnkG+/DC6SZM8rKoOdKiB\n" + - "cy+N\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-2-g3.chain-demos.digicert.com, O="DigiCert, - // Inc.", L=Lehi, ST=Utah, C=US, SERIALNUMBER=5299537-0142, OID.1.3.6.1.4 - // 1.311.60.2.1.2=Utah, OID.1.3.6.1.4.1.311.60.2.1.3=US, - // OID.2.5.4 .15=Private Organization - // Issuer: CN=DigiCert QV EV TLS ICA G1, O="DigiCert, Inc.", C=US - // Serial number: 9c5e9d5f169d3a59e64db208d3e849d - // Valid from: Wed Feb 02 16:00:00 PST 2022 until: Mon Mar 06 15:59:59 PST 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHNDCCBhygAwIBAgIQCcXp1fFp06WeZNsgjT6EnTANBgkqhkiG9w0BAQsFADBK\n" + - "MQswCQYDVQQGEwJVUzEXMBUGA1UECgwORGlnaUNlcnQsIEluYy4xIjAgBgNVBAMM\n" + - "GURpZ2lDZXJ0IFFWIEVWIFRMUyBJQ0EgRzEwHhcNMjIwMjAzMDAwMDAwWhcNMjMw\n" + - "MzA2MjM1OTU5WjCB3zEdMBsGA1UEDwwUUHJpdmF0ZSBPcmdhbml6YXRpb24xEzAR\n" + - "BgsrBgEEAYI3PAIBAxMCVVMxFTATBgsrBgEEAYI3PAIBAhMEVXRhaDEVMBMGA1UE\n"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YSlRrDUvy94S3PE7N8D3wyKq18IhXOI1WUeR0bKHLlXtl+ZjKMIMkd/l\n" + - "YtLnnskRCQa0P/HLwQYLUpgiNGVZJQbjrWsVzcw12mR/gza1KjR02STJRGZad7L0\n" + - "Oz48CRhm94iaEjFcVKT3vcDUrtCKpkmhBACcdA3NNqDq10i/SLspOeDLSESkkJKF\n" + - "w8w3YCqXjZn5JyV3sVHYNezNKtLdCxn4\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-2-g3-revoked.chain-demos.digicert.com, - // O="DigiCert, Inc.", L=Lehi, ST=Utah, C=US, SERIALNUMBER=5299537-0142, - // OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Utah, - // OID.1.3.6.1.4.1.311.60.2.1.3=US - // Issuer: CN=DigiCert QV EV TLS ICA G1, O="DigiCert, Inc.", C=US - // Serial number: 3f84605850df3ac98fcc15adec269f8 - // Valid from: Sun Apr 17 17:00:00 PDT 2022 until: Fri May 19 16:59:59 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHQDCCBiigAwIBAgIQA/hGBYUN86yY/MFa3sJp+DANBgkqhkiG9w0BAQsFADBK\n" + - "MQswCQYDVQQGEwJVUzEXMBUGA1UECgwORGlnaUNlcnQsIEluYy4xIjAgBgNVBAMM\n" + - "GURpZ2lDZXJ0IFFWIEVWIFRMUyBJQ0EgRzEwHhcNMjIwNDE4MDAwMDAwWhcNMjMw\n" + - "NTE5MjM1OTU5WjCB5zETMBEGCysGAQQBgjc8AgEDEwJVUzEVMBMGCysGAQQBgjc8\n" + - "AgECEwRVdGFoMR0wGwYDVQQPDBRQcml2YXRlIE9yZ2FuaXphdGlvbjEVMBMGA1UE\n" + - "BRMMNTI5OTUzNy0wMTQyMQswCQYDVQQGEwJVUzENMAsGA1UECBMEVXRhaDENMAsG\n" + - "A1UEBxMETGVoaTEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xPzA9BgNV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qET0x6/EJa6YI3Xa7Aumb8Pp2r2UZ5Tr\n" + - "7BUhmiRLkvw/9SI8ceXNSwuTTGK2fKHm2/CWqI0cS3zWk3dC\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) - throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Apr 18 14:07:46 PDT 2022", System.out); - } -} - -class RootCA3G3 { - - // Owner: CN=DigiCert QuoVadis TLS ICA QV Root CA 3 G3, O="DigiCert, Inc", C=US - // Issuer: CN=QuoVadis Root CA 3 G3, O=QuoVadis Limited, C=BM - // Serial number: 427dd33a8ff51d8152e813c7dec93ba76312a7d8 - // Valid from: Wed Jan 06 12:55:40 PST 2021 until: Sat Jan 04 12:55:40 PST 2031 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFgDCCA2igAwIBAgIUQn3TOo/1HYFS6BPH3sk7p2MSp9gwDQYJKoZIhvcNAQEL\n" + - "BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc\n" + - "BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0yMTAxMDYyMDU1NDBaFw0z\n" + - "MTAxMDQyMDU1NDBaMFkxCzAJBgNVBAYTAlVTMRYwFAYDVQQKDA1EaWdpQ2VydCwg\n" + - "SW5jMTIwMAYDVQQDDClEaWdpQ2VydCBRdW9WYWRpcyBUTFMgSUNBIFFWIFJvb3Qg\n" + - "Q0EgMyBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALxNTdqnFD+A\n" + - "MhketYfVfVUWQKPkVEuyYj7Y2uwXBMRP4RStO4CoQih+hX/h94vRlObOIsqcNnyC\n" + - "ElwBnLbmusaWYLYnDEWoROL8uN0pkWk0as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OOaSd5hbCQY/fCZwohtest+ZU\n" + - "Ajyd+FVzSNvEFrwPzZwKfcdemvD4kew8lx5sG6BUL4GkFWnotxSr+F9Huwgj4pC+\n" + - "cxE2841a/9r/gliuwDM/8jkt16epFAdw0fXemyM8FdHJDnB++3d8SyjOOQ8j+VHW\n" + - "31NWx27sORa5CgRchlldXWDzIIEwbc82a1OAfGUmNAsdEHjMl1HMcZHbjCmdSdsw\n" + - "fmyldZrj2YmvOI5ZlE9z4vzi35KyqlxWCtu9O/SJq/rBvYS0TPmm8HbhJQbeMe6p\n" + - "vJGrxcb1muSBANn9T9wvukjiNNw32ciSDCjZ0h4N+CGxbzoZtgIAQ29IunYdnJix\n" + - "ZiP+ED6xvwgVRBkDSgWD2W/hex/+z4fNmGQJDcri51/tZCqHHv2Y7XReuf4Fk+nP\n" + - "l8Sd/Kpqwde/sJkoqwDcBSJygh0=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-3-g3.chain-demos.digicert.com, O="DigiCert, Inc.", - // L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 3 G3, O="DigiCert, Inc", C=US - // Serial number: f27ee3fad1d754ae78d7866da0a4f6f - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIG/jCCBeagAwIBAgIQDyfuP60ddUrnjXhm2gpPbzANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDMgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjB9MQswCQYDVQQGEwJVUzENMAsGA1UE\n" + - "CBMEVXRhaDENMAsGA1UEBxMETGVoaTEXMBUGA1UEChMORGl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Tqpa0nvWUT7q9POT7xwQNui7P0j5t7prVX/fBKm5EfK1Jdi1Toj9+VxTIWYk\n" + - "splUCXw7zxaA3nlrncAmnHxZEY8sQjpGY1OGY0udd+m5bldJNbRTA1Q+VoPVMiU6\n" + - "osdBQGUbbWrqm1fnoFW1VvUt\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=quovadis-root-ca-3-g3-revoked.chain-demos.digicert.com, - // O="DigiCert, Inc.", L=Lehi, ST=Utah, C=US - // Issuer: CN=DigiCert QuoVadis TLS ICA QV Root CA 3 G3, O="DigiCert, Inc", C=US - // Serial number: aafa7cafda91796626f5fc8bcb38702 - // Valid from: Fri Mar 04 16:00:00 PST 2022 until: Wed Apr 05 16:59:59 PDT 2023 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHDTCCBfWgAwIBAgIQCq+nyv2pF5Zib1/IvLOHAjANBgkqhkiG9w0BAQsFADBZ\n" + - "MQswCQYDVQQGEwJVUzEWMBQGA1UECgwNRGlnaUNlcnQsIEluYzEyMDAGA1UEAwwp\n" + - "RGlnaUNlcnQgUXVvVmFkaXMgVExTIElDQSBRViBSb290IENBIDMgRzMwHhcNMjIw\n" + - "MzA1MDAwMDAwWhcNMjMwNDA1MjM1OTU5WjCBhTELMAkGA1UEBhMCVVMxDTALBgNV\n" + - "BAgTBFV0YWgxDTALBgNVBAcTBExlaGkxFzAVBgNVBAoTDkRpZ2lDZXJ0LCBJbmMu\n" + - "MT8wPQYDVQQDEzZxdW92YWRpcy1yb290LWNhLTMtZzMtcmV2b2tlZC5jaGFpbi1k\n" + - "ZW1vcy5kaWdpY2VydC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB\n" + - "AQDofDJ1xHHWMhbWwU7e4cY3u2NjvE4ur/A0Y13UK53zoH8qDunV6ORAXQ+zSpev\n" + - "kPlnIbdjYOK1v5RJn2ZRgCafj8Bc/9GnfQ1uE7P9dRkC9ZQwvb6Eh6f4RT7gaOPX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F9\n" + - "BgorBgEEAdZ5AgQCBIIBbQSCAWkBZwB1AOg+0No+9QY1MudXKLyJa8kD08vREWvs\n" + - "62nhd31tBr1uAAABf1wc0LIAAAQDAEYwRAIgdmF6UFe2jgbM3FjYRMmcNaXfpleT\n" + - "E8hmYfmAVy5lSoUCIDPCV27IP9wpdGoxnnCMBwuekg6E4SB0lj49+o9OHHjDAHUA\n" + - "Nc8ZG7+xbFe/D61MbULLu7YnICZR6j/hKu+oA8M71kwAAAF/XBzQ0QAABAMARjBE\n" + - "AiBO6vYHFci7OWvqDHRlgTn+Q6zNG/LysZEOlrO4W8ZZ2gIgDY5+qjlar3esPN0b\n" + - "JUR5vfITl7UiZoqINJSm1gZ4Nm4AdwCzc3cH4YRQ+GOG1gWp3BEJSnktsWcMC4fc\n" + - "8AMOeTalmgAAAX9cHNDdAAAEAwBIMEYCIQCB52OPhdnYybsWzmkdSGSbgQVmS0V7\n" + - "ZumbThJSJwpuiwIhAP+JRx+Eu3MYRp5iyLb+xlWqghMnDnF9aCfm1VuW4aDuMA0G\n" + - "CSqGSIb3DQEBCwUAA4IBAQBO/4LljBpMGYYxBang12UIQ+FIjxAfKqqIklSa+du2\n" + - "ea0VHqaRrdfh/aTxzb0WaU++bgQN+MeHmQdvwYSgAyU/lY7mIvDTNxFOO6IG2vfR\n" + - "+JAUnS9iVUQ1rXHU72cxUsne5aRyLQ0W/2Zayx85O6/C9gIUJgJVRuk0dTPZ6tnq\n" + - "FoW1S4GwqEpzTuJU8rP5IvMYoYo8jItpjzS0W90gtDvev/XBRs1ig28Ky7ZS5AtQ\n" + - "S2Q6Ikg9YzegE9YNj2wqdZnEneoce0G1InysM/geY1BZ57G9RAUZkzWVTJRLJgbg\n" + - "2nWSqpQJ765gg9JdsRo+zqj1kUBbUYoTSlaAJG6ucrlB\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator) - throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Tue Mar 08 11:23:06 PST 2022", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/SSLCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,490 +0,0 @@ -/* - * Copyright (c) 2020, 2021, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8243320 8256895 - * @summary Interoperability tests with SSL.com's RSA, EV RSA, and ECC CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath SSLCA OCSP - * @run main/othervm -Djava.security.debug=certpath SSLCA CRL - */ - -/* - * Obtain TLS test artifacts for SSL.com CAs from: - * - * SSL.com RSA CA - * Valid - https://test-dv-rsa.ssl.com - * Revoked - https://revoked-rsa-dv.ssl.com/ - * SSL.com EV RSA CA - * Valid - https://test-ev-rsa.ssl.com - * Revoked - https://revoked-rsa-ev.ssl.com/ - * SSL.com ECC CA - * Valid - https://test-dv-ecc.ssl.com - * Revoked - https://revoked-ecc-dv.ssl.com/ - */ -public class SSLCA { - - public static void main(String[] args) throws Exception { - - System.setProperty("jdk.security.certpath.ocspNonce", "true"); - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - boolean ocspEnabled = false; - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - ocspEnabled = true; - } - - new SSLCA_RSA().runTest(pathValidator, ocspEnabled); - new SSLCA_EV_RSA().runTest(pathValidator, ocspEnabled); - new SSLCA_ECC().runTest(pathValidator, ocspEnabled); - } -} - -class SSLCA_RSA { - - // Owner: CN=SSL.com RSA SSL subCA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com Root Certification Authority RSA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 997ed109d1f07fc - // Valid from: Fri Feb 12 10:48:52 PST 2016 until: Wed Feb 12 10:48:52 PST 2031 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIGbzCCBFegAwIBAgIICZftEJ0fB/wwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UE\n" + - "BhMCVVMxDjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQK\n" + - "DA9TU0wgQ29ycG9yYXRpb24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZp\n" + - "Y2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYwMjEyMTg0ODUyWhcNMzEwMjEyMTg0\n" + - "ODUyWjBpMQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hv\n" + - "dXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3Jh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VR0gBAowCDAGBgRV\n" + - "HSAAMDsGA1UdHwQ0MDIwMKAuoCyGKmh0dHA6Ly9jcmxzLnNzbC5jb20vc3NsLmNv\n" + - "bS1yc2EtUm9vdENBLmNybDAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYB\n" + - "BQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4ICAQAi6e/iSV5DEqDO6XjQ\n" + - "SIIzXgc255yv6Oc2sqZnvRyVBHtHvo62jMoHY3Xunc/EofbeS4aHdYBvgkn6CNTj\n" + - "VkCU+psWwcT3Pg83uP4k4Thu7bXvrClfS+XBlbJiCF/PSJxLrKnxRn+XIGiYl62H\n" + - "glBhq9K8/fZrI2Qh1mZJmWE0FlxEDCb4i8SBNi8lmDogaFi8/yl32Z9ahmhxcLit\n" + - "DU/XyKA0yOqvIrOGKH95v+/l8fQkzE1VEFvj+iyv4TXd7mRZDOsfqfIDZhrpou02\n" + - "kXH/hcXlrR++t8kjj9wt8HHQ+FkryWI6bU3KPRJR6N8EH2EHi23Rp8/kyMs+gwaz\n" + - "zMqnkNPbMME723rXk6/85sjOUaZCmhmRIx9rgqIWQesU962J0FruGOOasLT7WbZi\n" + - "FsmSblmpjUAo49sIRi7X493qegyCEAa412ynybhQ7LVsTLEPxVbdmGVih3jVTif/\n" + - "Nztr2Isaaz4LpMEo4mGCiGxec5mKr1w8AE9n6D91CvxR5/zL1VU1JCVC7sAtkdki\n" + - "vnN1/6jEKFJvlUr5/FX04JXeomIjXTI8ciruZ6HIkbtJup1n9Zxvmr9JQcFTsP2c\n" + - "bRbjaT7JD6MBidAWRCJWClR/5etTZwWwWrRCrzvIHC7WO6rCzwu69a+l7ofCKlWs\n" + - "y702dmPTKEdEfwhgLx0LxJr/Aw==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=test-dv-rsa.ssl.com - // Issuer: CN=SSL.com RSA SSL subCA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 4ceada4ade82a6ccd0b2ae32c0dbfd62 - // Valid from: Fri Jun 28 07:06:50 PDT 2019 until: Sun Jun 27 07:06:50 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHTjCCBTagAwIBAgIQTOraSt6CpszQsq4ywNv9YjANBgkqhkiG9w0BAQsFADBp\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x\n" + - "GDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjEeMBwGA1UEAwwVU1NMLmNvbSBSU0Eg\n" + - "U1NMIHN1YkNBMB4XDTE5MDYyODE0MDY1MFoXDTIxMDYyNzE0MDY1MFowHjEcMBoG\n" + - "A1UEAwwTdGVzdC1kdi1yc2Euc3NsLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEP\n" + - "ADCCAQoCggEBAKlOrYr8fnHN8REfJDwgsBhJvnsU4beQIYYaOAzR8pmo8eq1U/K0\n" + - "uwRrgJ5K61V78zBO5qmZNiivBobViftObWrq2H6QhQsYdMYXld3SEnEotIIriRHY\n" + - "2PcqlgnFYXkqI0ZKs4kNs+j3GS0IwncJJwKtypmtLTCLK5J/kG7qB2MNfXZTIzKI\n" + - "iZza4RUM1j67Hv3fPJzNEJ9urfjaI4xcRh5airlzBWOBU9pW87P7BgQN7cNzJQji\n" + - "4DSvb1pSXv8sBbZk5fmG+81PyUxcfqj7Dbih0J1Aoq0YysHugsrK/kLz+CvqL9B2\n" + - "a1JMZfob9jzcA7XPjpggLc3az2Wvv3XKqokCAwEAAaOCAzswggM3MB8GA1UdIwQY\n" + - "MBaAFCYUfuDc16b34tQEJ99h8cLs5zLKMHwGCCsGAQUFBwEBBHAwbjBKBggrBgEF\n" + - "BQcwAoY+aHR0cDovL3d3dy5zc2wuY29tL3JlcG9zaXRvcnkvU1NMY29tLVN1YkNB\n" + - "LVNTTC1SU0EtNDA5Ni1SMS5jcnQwIAYIKwYBBQUHMAG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U2kpCS/FBIsLSTWNEf\n" + - "dREv1nh93qQ2CPIxj5kP/0EOUfq7tmQCJHMODVgz3iHrdxRB1E58nXHlZ6vUdrCo\n" + - "pD9d6Cp+AwvrOdv6MndVJgel9tVOAqAUblwdLzPNQHEcXoKnFEVv2SVQCmAYLlkP\n" + - "xX2RS73gseiit4QnVZOWi/wDhqMm7/iq8n7rL/f7+ly2+7e3LVjxd24HZkgxNgbn\n" + - "JDjYvIla+EvyrY8514Ru3Pf1UICY03VpYjE8R7SxrqcvOLtwvOVew6TuCUl6RNpl\n" + - "xeC9Oa1dgf+QRXN7LvmBXUP2nOCnwJE1ENvThPLw9BXLatVJgkA/v/mYWE5VjzIL\n" + - "hboPH2fNWemUv5QMzxUkqhgHgrhr8wnhI6xYIYciGDbmmfnItHex7bxktT7axoCD\n" + - "3dTQQe01YfK/LlkHtnBmJf/t0F33m8KXcQ51fic/TR2U5Tampxp2kdFdTyvRRqMl\n" + - "igqo3EhiPmB9bKsnXDA2AnvdjZT9uFwbUu5lNxjiMQcSZikjQAjJPgjCZ9BQOGbL\n" + - "eqgZcw2CxWMxFSTLL3TIBlNL/0GpRlTvr3IGyvHEr7EESXKD+Ar8XW+4VlMc1s8F\n" + - "cdtnus71s7wm+JUSXcM0WJUkRUvWqHlPi3Ucfe7k6x6BG9Mb42ECjorefPXvFu7v\n" + - "OT4=\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked-rsa-dv.ssl.com - // Issuer: CN=SSL.com RSA SSL subCA, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 3f527e677d00558272ac90d1620b67f4 - // Valid from: Fri Jun 28 07:13:48 PDT 2019 until: Sun Jun 27 07:13:48 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHVzCCBT+gAwIBAgIQP1J+Z30AVYJyrJDRYgtn9DANBgkqhkiG9w0BAQsFADBp\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAO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EPrJrrtcEM0zG48yI\n" + - "P3b57Nl2ZbshRvY9bVi3of2SaPFQgu99/zAlerPUThz4O2CskOgKt77y6KOgCbBp\n" + - "7fQF6vh/aOm0Xba2Z0CtB+uVN2g4+LwyuovOy+JyjGKv7GxRKEQmGZsRLDVpxOs5\n" + - "W47K+iuOEhTRWRkStfuk2LcCLwTrgxHv2/Wo+80ME/7wxGKs1IzlkcFtFLhaeN4p\n" + - "QsmADpcyBfeWmvTdKgaVBOE2F/nenIiKpo+0jcoMAW6JgMD+otn8gofBq+Za1N4X\n" + - "xckvLWbMDAj4lELBHXu7gLHHLJCL9GGPD5HKjH/RyLtKKaRgT/AV6jl/woKTAzGF\n" + - "SPqgNQsu+sCdUbO0nDONkXDxhfan8XNrd32KMPGucJySiyjpHkurobMuGbs/LQzd\n" + - "JLTSTIIIPpEHBk7PHRGPSFewIhi0aDhupgZLU9UGrLRw/xV/KlGqTcGFWBvvOC+I\n" + - "CSZFRr0hWBv/dfw=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Jun 28 07:25:02 PDT 2019", System.out); - } -} - -class SSLCA_EV_RSA { - - // Owner: CN=SSL.com EV SSL Intermediate CA RSA R3, O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com EV Root Certification Authority RSA R2, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 56b629cd34bc78f6 - // Valid from: Wed May 31 11:14:37 PDT 2017 until: Fri May 30 11:14:37 PDT 2042 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIG4DCCBMigAwIBAgIQA6P00GAwUqM3zjgKiDAxjDANBgkqhkiG9w0BAQsFADCB\n" + - "gjELMAkGA1UEBhMCV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BiyDCE3ZeBeUtKmcdFUFrHwHl3gV\n" + - "aRipD+xMa1hGOTh33eMzwWoRxvk6o7y73Sy6XBfycN+8LhXUZT0X8STmWtBtLSMp\n" + - "blWMjuuFyUVQvIj05N7hORY/LhdQhEx8kVwS5RkLVSpRnohdk+nI69yIA7EwZKlw\n" + - "kKEsDqlVOeDYWVWQANDC55kJ7nOyJbqtGJqImwWXdQcf37fi80cf+mKOYs5vNmkx\n" + - "D9bwFWsKnP71x0liSlv8z79vRAo8FJwTgXRNO1c0ACf0rXEJy3GRAXRWiTvuGahR\n" + - "JVM3Jnn0G6o3+vTfwa7CKR/9Jc4t25iRU3xmSgiusg4u8i5x\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.1.3.6.1.4.1.311.60.2.1.3=US, OID.1.3.6.1.4.1.311.60.2.1.2=Nevada, STREET=3100 Richmond Ave, - // OID.2.5.4.15=Private Organization, OID.2.5.4.17=77098, CN=test-ev-rsa.ssl.com, SERIALNUMBER=NV20081614243, - // O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com EV SSL Intermediate CA RSA R3, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 558089b221d7cd9c7a4bc4a7fd7e2969 - // Valid from: Mon Jul 01 13:28:01 PDT 2019 until: Wed Jun 30 13:28:01 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIISTCCBjGgAwIBAgIQVYCJsiHXzZx6S8Sn/X4paTANBgkqhkiG9w0BAQsFADBy\n" + - "MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24x\n" + - "ETAPBgNVBAoMCFNTTCBDb3JwMS4wLAYDVQQDDCVTU0wuY29tIEVWIFNTTCBJbnRl\n" + - "cm1lZGlhdGUgQ0EgUlNBIFIzMB4XDTE5MDcwMTIwMjgwMVoXDTIxMDYzMDIwMjgw\n" + - "MVowgfExCzAJBgNVBAYTAlVTMQ4wDAYDV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m0\n" + - "17v+yeEzAVK51eQeinHoCYc9TIwmyrwt36JE/zIwnDB623Y4ccxYN5LZxjVx668/\n" + - "xj3JffaY5185qPjAqkjLUzj9TeeAJk/ws1YXbQJvO4CZV2QXrishC+dEoqvfOe/u\n" + - "sMHcMJy+cFrPhe4cC7s9fHeYTpF36yvfWrgjGwDki/9zgRhOvDuM72dIMkrcHkZi\n" + - "OvZMgyoXz/Nw3D514K9BSt6xRB2qGzI8fx0EOGzEEjX1Zdie2uVDy9aC8k8TjQAM\n" + - "v/YT7Bggpv300hWvBGw0QT8l7Nk1PZFBagAhqRCKRsR1pUZ8CyZzwNkNyUSYV4Or\n" + - "n0vYwVEgpMeSMu/ObWwWPM7QKSNcSSIV5lxmsZX+wS76OpDMHm27P94RTEePF4sG\n" + - "QmvY6hgHSlREJUL0vyGGY2Rbm3cL3zaM4qTquN18v61uUVKakELYIcRZwVTyBj5M\n" + - "KxOkjGXnLYpDOLFHD4WB1q7J+SorG43V+nbmTEN5fshGUjjWoz5ykfErnyJa1+Py\n" + - "FXWoPFb425DelhuDe94btROuJELRfzhqDXoKrhDgSQGV2qM3sk6uIPOaoH4N31ko\n" + - "C41bezSdJ5r4mif8iA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.1.3.6.1.4.1.311.60.2.1.3=US, OID.1.3.6.1.4.1.311.60.2.1.2=Nevada, STREET=3100 Richmond Ave, - // OID.2.5.4.15=Private Organization, OID.2.5.4.17=77098, CN=revoked-rsa-ev.ssl.com, SERIALNUMBER=NV20081614243, - // O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com EV SSL Intermediate CA RSA R3, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 1ea7f53492bded2d425135bdf525889f - // Valid from: Mon Jul 01 13:29:02 PDT 2019 until: Wed Jun 30 13:29:02 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIIUzCCBjugAwIBAgIQHqf1NJK97S1CUTW99SWIn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Geb0paiIIAdQC7\n" + - "2d+8H4pxtZOUI5eqkntHOFeVCqtS6BqQlmQ2jh7RhQAAAWuvQy4MAAAEAwBGMEQC\n" + - "IGFiEQ8fMrjm1bV/mbT35bvJWf4mUbb92/NkHkQvHcaQAiBcS4CclZmzQLj4w6CV\n" + - "JsLf1P6+OhCDtvxWZdndGwJRczANBgkqhkiG9w0BAQsFAAOCAgEAFwE/RMAk871D\n" + - "acLlB0Jb29+WBmCgIu1pA+bh5/lMxn5KoPxkbHPFVHlfenDgZHUNU6DKH4HdCUG7\n" + - "GSAyajLiYRkcrDtBfp5MtNUAqnOJbh2NWiJ3FgSdAjfeSXPhhGfQ3U+0YCWarBfO\n" + - "xZ49eyhTzhHMoW+caJV3jC442Ebzh2X243MwcxqIkjgzWs6duiHnpHfT9gZBl3ou\n" + - "eu85LVFwzxNdrrAx1yG9PA05wCsYYlzwx7fC8ycfbvs+2ORIztiEScyr9VCg5sho\n" + - "YGuBFuP38sWRwiV5K7+EqpGjY+4R3BLWol7lzWsqWJC1J4zkd6Df5reSGBt0wlbx\n" + - "7MdUTXzHMtP8NDIYpdMBrPbkzOKIDzO6bDMsBWWFz7rWCmxUI6sSf0yknPtmBgCd\n" + - "rJAq25V/DqSRGrkaY4Dx1CPGtwYN34fCDLxKeN69rG5mkR2w7HRR5eMXek6oi3Pr\n" + - "hQrKt5NgrYjO6HJ6ABI5xoDM9doXy9BYbz5RX43RTU399aIqyXZh0d3W0rr7wggt\n" + - "+PFRU1OJqhpPQgKsB5zFT3G2HgVBD0hawHS+0Hu+CHpngiDziH+eyvTk3tdhIq2x\n" + - "oDZXs7SSZK6hf/im+7OFSkROy6CwhAn3nxRI9lpag1tTgF4kVSctBv+301ev0twX\n" + - "0w6RymKcvEbcuSDHkzOYWxc1cqwOxjA=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Mon Jul 01 20:53:13 PDT 2019", System.out); - } -} - -class SSLCA_ECC { - - // Owner: CN=SSL.com SSL Intermediate CA ECC R2, O=SSL Corp, L=Houston, ST=Texas, C=US - // Issuer: CN=SSL.com Root Certification Authority ECC, O=SSL Corporation, L=Houston, ST=Texas, C=US - // Serial number: 75e6dfcbc1685ba8 - // Valid from: Fri Feb 12 10:14:03 PST 2016 until: Tue Feb 12 10:14:03 PST 2041 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIDejCCAv+gAwIBAgIQHNcSEt4VENkSgtozEEoQLzAKBggqhkjOPQQDAzB8MQsw\n" + - "CQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xGDAW\n" + - "BgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNvbSBSb290IENl\n" + - "cnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzAeFw0xOTAzMDcxOTQyNDJaFw0zNDAz\n" + - "MDMxOTQyNDJaMG8xCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UE\n" + - "BwwHSG91c3RvbjERMA8GA1UECgwIU1NMIENvcnAxKzApBgNVBAMMIlNTTC5jb20g\n" + - "U1NMIEludGVybWVkaWF0ZSBDQSBFQ0MgUjIwdjAQBgcqhkjOPQIBBgUrgQQAIgNi\n" + - "AASEOWn30uEYKDLFu4sCjFQ1VupFaeMtQjqVWyWSA7+KFljnsVaFQ2hgs4cQk1f/\n" + - "RQ2INSwdVCYU0i5qsbom20rigUhDh9dM/r6bEZ75eFE899kSCI14xqThYVLPdLEl\n" + - "+dyjggFRMIIBTTASBgNVHRMBAf8ECDAGAQH/AgEAMB8GA1UdIwQYMBaAFILRhXMw\n" + - "5zUE044CkvvlpNHEIejNMHgGCCsGAQUFBwEBBGwwajBGBggrBgEFBQcwAoY6aHR0\n" + - "cDovL3d3dy5zc2wuY29tL3JlcG9zaXRvcnkvU1NMY29tLVJvb3RDQS1FQ0MtMzg0\n" + - "LVIxLmNydDAgBggrBgEFBQcwAYYUaHR0cDovL29jc3BzLnNzbC5jb20wEQYDVR0g\n" + - "BAowCDAGBgRVHSAAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATA7BgNV\n" + - "HR8ENDAyMDCgLqAshipodHRwOi8vY3Jscy5zc2wuY29tL3NzbC5jb20tZWNjLVJv\n" + - "b3RDQS5jcmwwHQYDVR0OBBYEFA10Zgpen+Is7NXCXSUEf3Uyuv99MA4GA1UdDwEB\n" + - "/wQEAwIBhjAKBggqhkjOPQQDAwNpADBmAjEAxYt6Ylk/N8Fch/3fgKYKwI5A011Q\n" + - "MKW0h3F9JW/NX/F7oYtWrxljheH8n2BrkDybAjEAlCxkLE0vQTYcFzrR24oogyw6\n" + - "VkgTm92+jiqJTO5SSA9QUa092S5cTKiHkH2cOM6m\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=test-dv-ecc.ssl.com - // Issuer: CN=SSL.com SSL Intermediate CA ECC R2, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 1bfbd8e4bea894f3d1887c50e7d366d7 - // Valid from: Fri Jun 28 06:58:27 PDT 2019 until: Sun Jun 27 06:58:27 PDT 2021 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIE9TCCBHqgAwIBAgIQG/vY5L6olPPRiHxQ59Nm1zAKBggqhkjOPQQDAzBvMQsw\n" + - "CQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xETAP\n" + - "BgNVBAoMCFNTTCBDb3JwMSswKQYDVQQDDCJTU0wuY29tIFNTTCBJbnRlcm1lZGlh\n" + - "dGUgQ0EgRUNDIFIyMB4XDTE5MDYyODEzNTgyN1oXDTIxMDYyNzEzNT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sjRIN9gH7a\n" + - "AHcAu9nfvB+KcbWTlCOXqpJ7RzhXlQqrUugakJZkNo4e0YUAAAFrnmqArQAABAMA\n" + - "SDBGAiEAs2yfi9e1h6dTQbe4WPd7+5qf7kvP7Vr2k0nAtBS1IgECIQCQYL9he9J4\n" + - "Bh5cpQezTVPgLAOGcf5xIcCrBs1QJe66/AB3AFWB1MIWkDYBSuoLm1c8U/DA5Dh4\n" + - "cCUIFy+jqh0HE9MMAAABa55qgaEAAAQDAEgwRgIhAI/27txsvzpbBXkMICi/UOzE\n" + - "t8uZidbF9KSwmGRPT/6gAiEAhm/VeWHDeWK8gFMU+f0/x4jK7UbzySGBvPzbPpNd\n" + - "EDwwCgYIKoZIzj0EAwMDaQAwZgIxAJKn8Hr68Z/2rA+VHfZo8eeIFaZ3nvSvQO92\n" + - "1Byl6cPAm8DsdCnYT16uNSL8Zb5IQAIxAOFLsqPDCSAYkpgutAnVgwI+c549SIRU\n" + - "k8ol+wUx6zgMmt8VHYagyj6IO0GRDjm/eA==\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=revoked-ecc-dv.ssl.com - // Issuer: CN=SSL.com SSL Intermediate CA ECC R2, O=SSL Corp, L=Houston, ST=Texas, C=US - // Serial number: 423c2b57dfa379d0c45ffceb6284ed99 - // Valid from: Fri Jun 28 07:09:30 PDT 2019 until: Sun Jun 27 07:09:30 PDT 2021 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIE+TCCBH+gAwIBAgIQQjwrV9+jedDEX/zrYoTtmTAKBggqhkjOPQQDAzBvMQsw\n" + - "CQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xETAP\n" + - "BgNVBAoMCFNTTCBDb3JwMSswKQYDVQQDDCJTU0wuY29tIFNTTCBJbnRlcm1lZGlh\n" + - "dGUgQ0EgRUNDIFIyMB4XDTE5MDYyODE0MDkzMFoXDTIxMDYyNzE0MDkzMFowITEf\n" + - "MB0G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hWNIST4W8wB2AG9Tdqwx8DEZ2JkApFEV/3cVHBHZAsEAKQaNsgiaN9kTAAABa550\n" + - "oQEAAAQDAEcwRQIhAJ3nwLI7kLP2SKicFKuJoqRYKE/FR2Ff65WL+iWxm/6nAiAJ\n" + - "cd9EKnBETwM9qQfKoSSs2oTQL4QjSKJZi/sPfKQaagB2ALvZ37wfinG1k5Qjl6qS\n" + - "e0c4V5UKq1LoGpCWZDaOHtGFAAABa550oH4AAAQDAEcwRQIhAIo6k5BMSFN3FnD4\n" + - "UFbyJJG/Bujh+OFTYzVM8vuIBoU0AiAhBe+air4wHvd68ykK6xOPv9Qshje9F6LC\n" + - "gxTqbMOEkDAKBggqhkjOPQQDAwNoADBlAjEAyayBtbcCQB0fE+cCc7OHLuNvb9tl\n" + - "uiHWy/Ika6IA72WJLLmED971ik08OMa2mGt4AjAklxdElQ5Z/nSeJ2CNEwD7pcYz\n" + - "468kkrMoGU2lk3QmwcXZscPIoh4Pwew6QteY4J0=\n" + - "-----END CERTIFICATE-----"; - - public void runTest(ValidatePathWithParams pathValidator, boolean ocspEnabled) throws Exception { - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Fri Jun 28 07:59:20 PDT 2019", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TWCAGlobalCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ -/* - * Copyright (c) 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8305975 - * @summary Interoperability tests with TWCA Global Root CA from TAIWAN-CA - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath TWCAGlobalCA OCSP - * @run main/othervm -Djava.security.debug=certpath TWCAGlobalCA CRL - */ - -/* - * Obtain TLS test artifacts for TWCA Global Root CA from: - * - * Valid TLS Certificates: - * https://evssldemo6.twca.com.tw - * - * Revoked TLS Certificates: - * https://evssldemo7.twca.com.tw - */ -public class TWCAGlobalCA { - - // Owner: CN=TWCA Global EVSSL Certification Authority, OU=Global EVSSL Sub-CA, O=TAIWAN-CA, C=TW - // Issuer: CN=TWCA Global Root CA, OU=Root CA, O=TAIWAN-CA, C=TW - // Serial number: 40013304f70000000000000cc042cd6d - // Valid from: Thu Aug 23 02:53:30 PDT 2012 until: Fri Aug 23 08:59:59 PDT 2030 - private static final String INT = "-----BEGIN CERTIFICATE-----\n" + - "MIIFdzCCA1+gAwIBAgIQQAEzBPcAAAAAAAAMwELNbTANBgkqhkiG9w0BAQsFADBR\n" + - "MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRAwDgYDVQQLEwdSb290\n" + - "IENBMRwwGgYDVQQDExN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BgEFBQcwAYYcaHR0cDovL1Jvb3RPY3NwLnR3Y2Eu\n" + - "Y29tLnR3LzANBgkqhkiG9w0BAQsFAAOCAgEAaOmLaZ2+WN2EtB6feuSV5KnL88ck\n" + - "I9jsUTB4YtKsv0ViORkeBMCQur5OoAgRE9VYdRVlWHN0zJAX232fdoZmnajl8gtj\n" + - "u0AOOyDDJ7Vlh38rDMRlX/u+MS2DFcsq5Vd3EMwJsWWFR9D3Dcey+Tu9uEmEdqeB\n" + - "+Erd4YjCeV9PyOW3SzPQ47RdW6XYmHArPh65/LcmSxTn/lxQy/NEBGGWqhm6s6n1\n" + - "49mPq4MtQcMLo/NBI+8jv7BVjnThbbEh2edHHxMNiAd5kLZFDCyJuFkoezjWL4AH\n" + - "ratXdoHtqvqtPoy97LyGrLrJeh+0hkO9u8QOt2gF7BEhNfid7o5dnsPRk+8l77Hn\n" + - "T1dvBs++M0r0QG4AWMSMj9uUn6rhl4FGTvAsyB1fA8p/xCLoIEetIpKRP3BD+ve2\n" + - "eYjWPorR/0W77iMTeoQEeuxDIxi2J/U9QLKKvzzqBy1TYrqqPe5YxqHLNAcfHZvo\n" + - "BTPPbtP0WAiXrJiELTYcqFXETvQcGw0XjoUZNvJE8RD7vssSNT17RKU8iBRX7CbL\n" + - "AB3T8gYykPMJTUqQSmdgEdVRBcqRMMdU+XRAEoU/Mz5oHAkm3ZNTDNwsEp2Dg1/b\n" + - "qzfPMhg4/3/YyWzGrzNeCSWZkjYImAzLCvN0D5rbdVHEmFIrEJt+igocGozroq5x\n" + - "DT5KhixlrqexzWE=\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.2.5.4.17=100, STREET="10F.,NO.85,Yanping S. Rd.,Taipei City 100,Taiwan (R.O.C)", - // SERIALNUMBER=70759028, OID.1.3.6.1.4.1.311.60.2.1.3=TW, OID.1.3.6.1.4.1.311.60.2.1.2=Taiwan, - // OID.1.3.6.1.4.1.311.60.2.1.1=Taipei, OID.2.5.4.15=Private Organization, - // CN=evssldemo6.twca.com.tw, O=TAIWAN-CA INC., L=Taipei, ST=Taiwan, C=TW - // Issuer: CN=TWCA Global EVSSL Certification Authority, OU=Global EVSSL Sub-CA, - // O=TAIWAN-CA, C=TW - // Serial number: 47e70000001258ff71d89af7f0353fef - // Valid from: Thu Mar 02 00:49:56 PST 2023 until: Sun Mar 31 08:59:59 PDT 2024 - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIH7zCCBtegAwIBAgIQR+cAAAASWP9x2Jr38DU/7zANBgkqhkiG9w0BAQsFADBz\n" + - "MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRwwGgYDVQQLExNHbG9i\n" + - "YWwgRVZTU0wgU3ViLUNBMTIwMAYDVQQDEylUV0NBIEdsb2JhbCBFVlNTTCBDZXJ0\n" + - "aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0yMzAzMDIwODQ5NTZaFw0yNDAzMzExNTU5\n" + - "NTlaMIIBMzELMAkGA1UEBhMCVFcxDzANBgNVBAgTBlRhaXdhbjEPMA0GA1UEBxMG\n" + - "VGFpcGVpMRcwFQYDVQQKEw5UQUlXQU4tQ0EgSU5DLjEfMB0GA1UEAxMWZXZzc2xk\n" + - "ZW1vNi50d2NhLmNvbS50dzEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24x\n" + - "FzAVBgsrBgEEAYI3PAIBARMGVGFpcGVpMRcwFQYLKwYBBAGCNzwCAQITBlRhaXdh\n" + - "bjETMBEGCysGAQQBgjc8AgEDEwJUVzERMA8GA1UEBRMINzA3NTkwMjgxQTA/BgNV\n" + - "BAkTODEwRi4sTk8uODUsWWFucGluZyBTLiBSZC4sVGFpcGVpIENpdHkgMTAwLFRh\n" + - "aXdhbiAoUi5PLkMpMQwwCgYDVQQREwMxMDAwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + - "DwAwggEKAoIBAQDEgj/jtcAtGPkiBilLajzHIqfiAxpwwnKhdHwyOnqfcqur1p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g==\n" + - "-----END CERTIFICATE-----"; - - // Owner: OID.2.5.4.17=100, STREET="10F.,NO.85,Yanping S. Rd.,Taipei City 100,Taiwan (R.O.C)", - // SERIALNUMBER=70759028, OID.1.3.6.1.4.1.311.60.2.1.3=TW, OID.1.3.6.1.4.1.311.60.2.1.2=Taiwan, - // OID.1.3.6.1.4.1.311.60.2.1.1=Taipei, OID.2.5.4.15=Private Organization, - // CN=evssldemo7.twca.com.tw, O=TAIWAN-CA INC., L=Taipei, ST=Taiwan, C=TW - // Issuer: CN=TWCA Global EVSSL Certification Authority, OU=Global EVSSL Sub-CA, - // O=TAIWAN-CA, C=TW - // Serial number: 47e70000001258f036a5b513091ccb2e - // Valid from: Tue Feb 07 02:03:08 PST 2023 until: Thu Mar 07 07:59:59 PST 2024 - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIHdjCCBl6gAwIBAgIQR+cAAAASWPA2pbUTCRzLLjANBgkqhkiG9w0BAQsFADBz\n" + - "MQswCQYDVQQGEwJUVzESMBAGA1UEChMJVEFJV0FOLUNBMRwwGgYDVQQLExNHbG9i\n" + - "YWwgRVZTU0wgU3ViLUNBMTIwMAYDVQQDEylUV0NBIEdsb2JhbCBFVlNTTCBDZXJ0\n" + - "aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0yMzAyMDcxMDAzMDhaFw0yNDAzMDcxNTU5\n" + - "NTlaMIIBMzELMAkGA1UEBhMCVFcxDzANBgNVBAgTBlRhaXdhbjEPMA0GA1UEBxMG\n" + - "VGFpcGVpMRcwFQYDVQQKEw5UQUlXQU4tQ0EgSU5DLjEfMB0GA1UEAxMWZXZzc2xk\n" + - "ZW1vNy50d2NhLmNvbS50dzEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24x\n" + - "FzAVBgsrBgEEAYI3PAIBARMGVGFpcGVpMRcwFQYLKwYBBAGCNzwCAQITBlRhaXdh\n" + - "bjETMBEGCysGAQQBgjc8AgEDEwJUVzERMA8GA1U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- "xDPMMsMMh7L/f+uMWDYZ+wH17LYQxOLi7VXT3fv8nl2X2iD3d4CCh0Tu\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Thu Mar 23 17:30:19 PDT 2023", System.out); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/TeliaSoneraCA.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2018, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8210432 - * @summary Interoperability tests with TeliaSonera Root CA v1 - * @build ValidatePathWithParams - * @run main/othervm -Djava.security.debug=certpath TeliaSoneraCA OCSP - * @run main/othervm -Djava.security.debug=certpath TeliaSoneraCA CRL - */ - -/* - * Obtain TLS test artifacts for TeliaSonera Root CA v1 from: - * - * Valid TLS Certificates: - * https://juolukka.cover.sonera.net:10443/ - * - * Revoked TLS Certificates: - * https://juolukka.cover.sonera.net:10444/ - */ -public class TeliaSoneraCA { - - // Owner: CN=TeliaSonera Server CA v2, O=TeliaSonera, C=FI - // Issuer: CN=TeliaSonera Root CA v1, O=TeliaSonera - private static final String INT = "-----BEGIN CERTIFICATE-----\n" - + "MIIHHjCCBQagAwIBAgIQTEYq9tv794BPhMF8/qlytjANBgkqhkiG9w0BAQsFADA3\n" - + "MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9v\n" - + "dCBDQSB2MTAeFw0xNDEwMTYwODA5NTdaFw0zMjEwMTYwNTA0MDBaMEYxCzAJBgNV\n" - + "BAYTAkZJMRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEhMB8GA1UEAwwYVGVsaWFTb25l\n" - + "cmEgU2VydmVyIENBIHYyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA\n" - + "rwQN5rfRLbVAiYWLJF9SI4YLm8oqrtf8OjGybgoLyiMIo8nhY/atuGRFWCQNOnUK\n" - + "caZn29C360PlC5yYrsrSHuouROisqHSJcgA7HvV+37Rcry7daeDj6rfyx4yI5dmj\n" - + "LwHkK0j1NzhX1JxFDgPeLNuebgzv/j8OfRhYK/BttpystC4Zgm3gZheKDjYsDS5D\n" - + "gjffuOysP3vewrcuw0EIZFx+HawuwNBLq4tMf4VSitYDHJSLIM2TeXZGGY5slTbT\n" - + "yLnrU5mIzG9WKq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BSb290JTIwQ0ElMjB2MSxvPVRlbGlhU29uZXJhP2Nl\n" - + "cnRpZmljYXRlcmV2b2NhdGlvbmxpc3Q7YmluYXJ5MB0GA1UdDgQWBBQvSTwpT9cH\n" - + "JfnGjNVk9WY9EoMilTAfBgNVHSMEGDAWgBTwj1k4ALP1j5qWDNXr+nuqF+gTEjAN\n" - + "BgkqhkiG9w0BAQsFAAOCAgEAg9EVFW6ioZ2ctrX8KqvW9XPYZR01yNgqlO7pwBWf\n" - + "HzuBCbUdyVzumfQnU24Sce92oMtEfyuxIOmhvoXU7LpnYlH3Q29UGP5dL0D3edGz\n" - + "HeU6Tf8bkcOEHtnTrkd+y+rfFSDWYl9r1y993NAcrBHhroQCE53mlrO7TjXa3zDq\n" - + "6LGR8T8VgvGw0IBz6mzAks0wMYB0b4uREPmWXi+m+RqG3lnpl+eBzz6YVLkxIYMq\n" - + "QIXJIBsu4/ybmadsfdql6E8Lo3dKVD4UG10mtd+iPbJiBiW/a9VbEe3NVKIv4H2y\n" - + "HqYcxDXAeUI66E3K2cjCmKoQaa0Ywt02ikZFd0v1OWNPS7YWbEJWkVR1PcPMESK9\n" - + "6HKI4xhG2tJesmXjQ8q8aSx2u79Zts3ewjKqTmurf6FXW3u9TpSCUe6Drr/3X7Ve\n" - + "nBy4M0sLwCecD/L9gjTa+EItQTYzCkpxiMO49tQdX/BpwgWju4Kg3qkaBNTzvSlk\n" - + "gdnRJqCUkVuzwK4yBqUoyRz3prlhvvRGdZJKf6IXRDhncpey5pm0PQYQ4cArx7Go\n" - + "AaAKz0ZTHOKjnM2KIdUhBJQybL7oPklSfkeMWoUoYED6R4YMTt/JXX4ixEb5DgDJ\n" - + "0F+bNcF7qGrJTkTx0Ccy4BuuY05hJckd72E7WdmjN7DDeosghgWZNV/6D7N5tfxo\n" - + "nlU=\n" - + "-----END CERTIFICATE-----"; - - // Owner: CN=juolukka.cover.sonera.net, OU=security, O=Telia Finland Oyj, L=helsinki, C=FI - // Issuer: CN=TeliaSonera Server CA v2, O=TeliaSonera, C=FI - private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + - "MIIHiDCCBXCgAwIBAgIPAWOq14hk136UDQY3WSjLMA0GCSqGSIb3DQEBCwUAMEYx\n" + - "CzAJBgNVBAYTAkZJMRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEhMB8GA1UEAwwYVGVs\n" + - "aWFTb25lcmEgU2VydmVyIENBIHYyMB4XDTE4MDUyOTA3NDA0MVoXDTE5MDUyOTA3\n" + - "NDA0MVowczELMAkGA1UEBhMCRkkxETAPBgNVBAcMCGhlbHNpbmtpMRowGAYDVQQK\n" + - "DBFUZWxpYSBGaW5sYW5kIE95ajERMA8GA1UECwwIc2VjdXJpdHkxIjAgBgNVBAMM\n" + - "GWp1b2x1a2thLmNvdmVyLnNvbmVyYS5uZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + - "DwAwggEKAoIBAQDLks9F8ZUqV9G4jn3fY234OX09Dmqqtuk0qAmjWpF0JAn2o64t\n" + - "whVxFLx9e2IwUPTQgyo6FwRsiT19m99BhgxYnJOxVRwURxSL3mqlV9gX4oFMmT4O\n" + - "EOYEjaJXi8ne1pJX80y2hVQ48XqgODnKdKZVwa5YoeWZQJiaq+C5JkMDN8qzpiyQ\n" + - "X3EfJspLkKy2E+UVxWmfnyf0v70ES9TQ8qgxwvsf7LRZ8Jixq7TTO5VbqWsdBvJC\n" + - "9Zm2aBOYJ7ptSZQ5YDfeUJG2c9S/zFmngoPnTrvAZwUeU3YTrbdZQy899ZOatWac\n" + - "6lHUYU2EagEmbj/jtIvJ6wMbzhleIXRQFWibAgMBAAGjggNEMIIDQDAfBgNVHSME\n" + - "GDAWgBQvSTwpT9cHJfnGjNVk9WY9EoMilTAdBgNVHQ4EFgQUbMozh4osL4gFJvb5\n" + - "baELpQSKEhIwDgYDVR0PAQH/BAQDAgSwME4GA1UdIARHMEUwQwYGZ4EMAQICMDkw\n" + - "NwYIKwYBBQUHAgEWK2h0dHA6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IBAIl5UWSwCXF85+2lU6t89K7I4TvZ\n" + - "Ggof0NLngea9qxBq00opfnl9i2LPRnsjh9s3iA29i2daTEuJn3qt3Ygcm27Jd7WM\n" + - "5StcxQ483GAaL5s5m2QqkZB8eLfez3tIyCMGCAyixBDNRNPVI4xZr6sSOenWtipo\n" + - "gMt+/gvRIMdMT79IXPFz4W9RWCwnfJNOlfH2OkS3KZYaPSaEvs6sfMW1DDZosrBy\n" + - "6F+DITPLllOVSE4+PTxvXLKVy+srFwF1VocQXKkWMHQ7AfWNnOGzb7B1qg7gsw0n\n" + - "axqinyCjkhMpHpcVtmD9Pi15HLFDIy9yI2S+FHJQfhUSmM/LdCWzQpnee6/Wo+uw\n" + - "p0Jg2v6v9GGaqfpuiVJPFN9dOv3OjMU7DL5lgMRWFRo2T8+wBHXDyBhT0W0y5kRJ\n" + - "eWA7t6CnkziHuaOihZAHUH3nn5exjqUFVS0ThbF6hxN7HAlq/xIbTKlZjkLlc14W\n" + - "fB8vkxJyy/tgBZ4dCj9Y1Y32d4eFT5JZJgqgkN59SmX56BswNXncGrk/vWZFFx+g\n" + - "9dgb8QSe8KseD1iSLc7SsqVDv8NPYdaI3eZ90W8Wv0/CDls321O6UbAmURzQwFGB\n" + - "w8WnteoVBi6Wf6M1TxIfJsXBYeIN0BB6AYc8cmZIOtx2C8aH4JJT45MyFnBv3ac5\n" + - "Ahs9pGn/+K+5yb2e\n" + - "-----END CERTIFICATE-----"; - - // Owner: CN=juolukka.cover.sonera.net, OU=Security, O=TeliaSonera Finland, L=Helsinki, C=FI - // Issuer: CN=TeliaSonera Server CA v2, O=TeliaSonera, C=FI - private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + - "MIIGEDCCA/igAwIBAgIRAKWJTjs6v04ZTyb2wJxfnJswDQYJKoZIhvcNAQELBQAw\n" + - "RjELMAkGA1UEBhMCRkkxFDASBgNVBAoMC1RlbGlhU29uZXJhMSEwHwYDVQQDDBhU\n" + - "ZWxpYVNvbmVyYSB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EMEKgQKA+hjxodHRwOi8vY3JsLTMudHJ1\n" + - "c3QudGVsaWFzb25lcmEuY29tL3RlbGlhc29uZXJhc2VydmVyY2F2Mi5jcmwwHQYD\n" + - "VR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA4GA1UdDwEB/wQEAwIEsDAkBgNV\n" + - "HREEHTAbghlqdW9sdWtrYS5jb3Zlci5zb25lcmEubmV0MB0GA1UdDgQWBBSa+vJH\n" + - "I6Lt9Aqw5ondhoZu4/IJezANBgkqhkiG9w0BAQsFAAOCAgEASRK1l1MZb/IRlyi+\n" + - "XjfZcxJdFuNzW2kpZstW6Ni2XiD3p7aROBfDFtu7GajzZHb6p76auDb4NwJgeE/3\n" + - "6gnXoIK00HwpF2RAhxDpkF8r3q0jSqGhSv/xz9Nx7JBzgqfSw3Ha4ohioIed3uc+\n" + - "nMDyvVenio4GYgtxIIubSybCxMv/lBA/S4daIVCYK3VOoBbM2F36ecAKvRU5vIWM\n" + - "urXsfANL3u4qgJpaM0DclzFsOkVsRPffzToko/Nr6pGXYjt47IzTRlwLMnLehoZW\n" + - "ZZMGMVVOlR7XGf81UjWB6OsKeoQ4FWgcb/rIJcZusm+LqvnsCHuC3gtuC2nGA7lr\n" + - "fseUlG7QZN9/QfUIyvL69wAzeVj1cUcd7GHcAH9DyZJfI8orv4PyUvitDdgISkFu\n" + - "GZ562O7cGmCv00/6I4t0z9wZal8a5lRDoKXAYy+u/adrO1JjLwi11y/DTw9LQ7sJ\n" + - "gVP/v2GsI0ajF9A6z33UHN9uxXZVmQNvOiMkcJiGLovFgu5zxoAg2W3pHjbBbeL8\n" + - "v5MPqgsKafgzaSRtXBBvaISHi9hhRR8v/qSwO3NyLm8uAhQD4x+OPHrmQ/s16j45\n" + - "Ib53UHj1k6byXGUqDgzFBsmEPV6Shf2C4/HcRHpAX8wQx3xVwDtRzDpNUR6vnNfi\n" + - "PwzRU1xsQKd8llmgl4l+fYV0tBA=\n" + - "-----END CERTIFICATE-----"; - - public static void main(String[] args) throws Exception { - - ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); - - if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { - pathValidator.enableCRLCheck(); - } else { - // OCSP check by default - pathValidator.enableOCSPCheck(); - } - - // Validate valid - pathValidator.validate(new String[]{VALID, INT}, - ValidatePathWithParams.Status.GOOD, null, System.out); - - // Validate Revoked - pathValidator.validate(new String[]{REVOKED, INT}, - ValidatePathWithParams.Status.REVOKED, - "Thu Dec 22 23:14:55 PST 2016", System.out); - - // reset validation date back to current date - pathValidator.resetValidationDate(); - } -} diff -Nru openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java --- openjdk-17-17.0.9+9/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/ValidatePathWithURL.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,229 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jtreg.SkippedException; + +import javax.net.ssl.*; +import javax.security.auth.x500.X500Principal; +import java.io.FileInputStream; +import java.io.IOException; +import java.net.URL; +import java.security.*; +import java.security.cert.*; +import java.security.cert.Certificate; + +public class ValidatePathWithURL { + + private final X509Certificate rootCertificate; + private final X500Principal rootPrincipal; + + /** + * Enables the certificate revocation checking and loads the certificate from + * cacerts file for give caAlias + * + * @param caAlias CA alias for CA certificate in cacerts file + * @throws Exception when fails to get CA certificate from cacerts file + */ + public ValidatePathWithURL(String caAlias) throws Exception { + System.setProperty("com.sun.net.ssl.checkRevocation", "true"); + Security.setProperty("ssl.TrustManagerFactory.algorithm", "SunPKIX"); + + // some test sites don't have correct hostname specified in test certificate + HttpsURLConnection.setDefaultHostnameVerifier(new CustomHostnameVerifier()); + + String FS = System.getProperty("file.separator"); + String CACERTS_STORE = + System.getProperty("test.jdk") + FS + "lib" + FS + "security" + FS + "cacerts"; + + KeyStore cacerts = KeyStore.getInstance("PKCS12"); + try (FileInputStream fis = new FileInputStream(CACERTS_STORE)) { + cacerts.load(fis, null); + } + + rootCertificate = (X509Certificate) cacerts.getCertificate(caAlias); + rootPrincipal = rootCertificate.getSubjectX500Principal(); + } + + /** + * Enable revocation checking using OCSP and disables CRL check + */ + public static void enableOCSPOnly() { + System.setProperty("com.sun.security.enableCRLDP", "false"); + Security.setProperty("ocsp.enable", "true"); + } + + /** + * Enable revocation checking using CRL + */ + public static void enableCRLOnly() { + System.setProperty("com.sun.security.enableCRLDP", "true"); + Security.setProperty("ocsp.enable", "false"); + } + + /** + * Enable revocation checking using OCSP or CRL + */ + public static void enableOCSPAndCRL() { + System.setProperty("com.sun.security.enableCRLDP", "true"); + Security.setProperty("ocsp.enable", "true"); + } + + /** + * Logs revocation settings + */ + public static void logRevocationSettings() { + System.out.println("====================================================="); + System.out.println("CONFIGURATION"); + System.out.println("====================================================="); + System.out.println("http.proxyHost :" + System.getProperty("http.proxyHost")); + System.out.println("http.proxyPort :" + System.getProperty("http.proxyPort")); + System.out.println("https.proxyHost :" + System.getProperty("https.proxyHost")); + System.out.println("https.proxyPort :" + System.getProperty("https.proxyPort")); + System.out.println("https.socksProxyHost :" + + System.getProperty("https.socksProxyHost")); + System.out.println("https.socksProxyPort :" + + System.getProperty("https.socksProxyPort")); + System.out.println("jdk.certpath.disabledAlgorithms :" + + Security.getProperty("jdk.certpath.disabledAlgorithms")); + System.out.println("com.sun.security.enableCRLDP :" + + System.getProperty("com.sun.security.enableCRLDP")); + System.out.println("ocsp.enable :" + Security.getProperty("ocsp.enable")); + System.out.println("====================================================="); + } + + /** + * Validates end entity certificate used in provided test URL using + * HttpsURLConnection. Validation is skipped on network error or if + * the certificate is expired. + * + * @param testURL URL to validate + * @param revokedCert if true then validate is REVOKED certificate + * @throws Exception on failure to validate certificate + */ + public void validateDomain(final String testURL, + final boolean revokedCert) + throws Exception { + System.out.println(); + System.out.println("===== Validate " + testURL + "====="); + if (!validateDomainCertChain(testURL, revokedCert)) { + throw new RuntimeException("Failed to validate " + testURL); + } + System.out.println("======> SUCCESS"); + } + + private boolean validateDomainCertChain(final String testURL, + final boolean revokedCert) + throws Exception { + HttpsURLConnection httpsURLConnection = null; + try { + URL url = new URL(testURL); + httpsURLConnection = (HttpsURLConnection) url.openConnection(); + httpsURLConnection.setInstanceFollowRedirects(false); + httpsURLConnection.connect(); + + // certain that test certificate anchors to trusted CA for VALID certificate + // if the connection is successful + Certificate[] chain = httpsURLConnection.getServerCertificates(); + httpsURLConnection.disconnect(); + validateAnchor(chain); + } catch (SSLHandshakeException e) { + System.out.println("SSLHandshakeException: " + e.getMessage()); + Throwable cause = e.getCause(); + + while (cause != null) { + if (cause instanceof CertPathValidatorException cpve) { + if (cpve.getReason() == CertPathValidatorException.BasicReason.REVOKED + || cpve.getCause() instanceof CertificateRevokedException) { + System.out.println("Certificate is revoked"); + + // We can validate anchor for revoked certificates as well + Certificate[] chain = cpve.getCertPath().getCertificates().toArray(new Certificate[0]); + validateAnchor(chain); + + if (revokedCert) { + return true; + } + } else if (cpve.getReason() == CertPathValidatorException.BasicReason.EXPIRED + || cpve.getCause() instanceof CertificateExpiredException) { + System.out.println("Certificate is expired"); + throw new SkippedException("Certificate is expired, skip the test"); + } + break; + } + cause = cause.getCause(); + } + + throw new RuntimeException("Unhandled exception", e); + } catch (SSLException e) { + // thrown if root CA is not included in cacerts + throw new RuntimeException(e); + } catch (IOException e) { + throw new SkippedException("Network setup issue, skip this test", e); + } finally { + if (httpsURLConnection != null) { + httpsURLConnection.disconnect(); + } + } + + return !revokedCert; + } + + private void validateAnchor(Certificate[] chain) throws Exception { + X509Certificate interCert = null; + + // fail if there is no intermediate CA or self-signed + if (chain.length < 2) { + throw new RuntimeException("Cert chain too short " + chain.length); + } else { + System.out.println("Finding intermediate certificate issued by CA"); + for (Certificate cert : chain) { + if (cert instanceof X509Certificate certificate) { + System.out.println("Checking: " + certificate.getSubjectX500Principal()); + System.out.println("Issuer: " + certificate.getIssuerX500Principal()); + if (certificate.getIssuerX500Principal().equals(rootPrincipal)) { + interCert = certificate; + break; + } + } + } + } + + if (interCert == null) { + throw new RuntimeException("Intermediate Root CA not found in the chain"); + } + + // validate intermediate CA signed by root CA under test + System.out.println("Found intermediate root CA: " + interCert.getSubjectX500Principal()); + System.out.println("intermediate CA Issuer: " + interCert.getIssuerX500Principal()); + interCert.verify(rootCertificate.getPublicKey()); + System.out.println("Verified: Intermediate CA signed by test root CA"); + } + + private static class CustomHostnameVerifier implements HostnameVerifier { + @Override + public boolean verify(String hostname, SSLSession session) { + // Allow any hostname + return true; + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/RunTest.sh openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/RunTest.sh --- openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/RunTest.sh 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/RunTest.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -# -# Copyright (c) 2003, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# 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, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# Execute the test. -# No need to compile (now done by JTReg tags in calling file) -# -echo ${TESTJAVA}/bin/java ${TESTVMOPTS} -Dtest.src=${TESTCLASSES} \ - -classpath ${TESTCLASSPATH} $* || exit 20 - -${TESTJAVA}/bin/java ${TESTVMOPTS} -Dtest.src=${TESTCLASSES} \ - -classpath ${TESTCLASSPATH} $* || exit 20 - -exit 0 diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh --- openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -# -# Copyright (c) 2003, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# 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, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -# -# Utility Shell Script for generating .properties files or .password files -# or .access files from a list of input .in files. -# -# Source in this GeneratePropertyPassword.sh and call the function -# generatePropertyPasswordFiles. -# Call restoreFilePermissions to restore file permissions after the test completes -# - - -OS=`uname -s` -UMASK=`umask` - -case $OS in -CYGWIN_NT*) - OS="Windows_NT" - if [ -z "$SystemRoot" ] ; then - SystemRoot=`cygpath $SYSTEMROOT` - fi -esac - -case $OS in -Linux | Darwin | AIX ) - PATHSEP=":" - FILESEP="/" - DFILESEP=$FILESEP - TMP_FILE=${TESTCLASSES}${FILESEP}${TESTCLASS}.sed.tmpfile - -cat < ${TMP_FILE} -s^@TEST-SRC@/^${TESTCLASSES}${DFILESEP}^g -EOF - ;; -Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN*) - PATHSEP=";" - FILESEP="\\" - DFILESEP=$FILESEP$FILESEP - TMP_FILE=${TESTCLASSES}${FILESEP}${TESTCLASS}.sed.tmpfile - -cat < ${TMP_FILE}0 -s^@TEST-SRC@/^${TESTCLASSES}${DFILESEP}^g -EOF - # Need to put double backslash in the .properties files - cat ${TMP_FILE}0 | sed -e 's^\\\\^ZZZZ^g' | \ - sed -e 's^\\^ZZZZ^g' | \ - sed -e 's^ZZZZ^\\\\\\\\^g' > ${TMP_FILE} - - if [ "$OS" = "Windows_NT" ]; then - USER=`id -u -n` - CACLS="$SystemRoot/system32/cacls.exe" - REVOKEALL="$TESTNATIVEPATH/revokeall.exe" - if [ ! -x "$REVOKEALL" ] ; then - echo "$REVOKEALL doesn't exist or is not executable" - exit 1 - fi - fi - ;; -*) - echo "Unrecognized system! $OS" - exit 1 - ;; -esac - -generatePropertyPasswordFiles() -{ - for f in $@ - do - echo processing $f - suffix=`basename $f .in` - f2="${TESTCLASSES}${FILESEP}${suffix}" - - if [ -f "$f2" ] ; then - rm -f $f2 || echo WARNING: $f2 already exits - unable to remove old copy - fi - - echo creating $f2 - sed -f $TMP_FILE $f > $f2 - - if [ "$OS" = "Windows_NT" ]; then - chown $USER $f2 - # Grant this user full access - echo Y|$CACLS $f2 \/E \/G $USER:F - # Revoke everyone else - $REVOKEALL $f2 - # Display ACLs - $CACLS $f2 - else - chmod 600 $f2 - fi - done -} - -restoreFilePermissions() -{ - for f in $@ - do - suffix=`basename $f .in` - f2="${TESTCLASSES}${FILESEP}${suffix}" - - if [ "$OS" = "Windows_NT" ]; then - # Grant everyone full control - $CACLS $f2 \/E \/G Everyone:F - else - chmod 777 $f2 - fi - - done -} - diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java --- openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/RmiBootstrapTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2022, 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 @@ -20,29 +20,57 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + import sun.management.jmxremote.ConnectorBootstrap; import java.io.File; import java.io.FileInputStream; -import java.io.FilenameFilter; import java.io.IOException; import java.net.BindException; +import java.nio.file.Path; import java.rmi.server.ExportException; -import java.util.Properties; -import java.util.Iterator; -import java.util.Set; +import jdk.internal.agent.AgentConfigurationError; + +import javax.management.MBeanAttributeInfo; +import javax.management.MBeanInfo; +import javax.management.MBeanServerConnection; +import javax.management.ObjectName; +import javax.management.QueryExp; +import javax.management.remote.JMXConnector; +import javax.management.remote.JMXConnectorFactory; +import javax.management.remote.JMXConnectorServer; +import javax.management.remote.JMXServiceURL; +import java.security.Security; import java.util.ArrayList; +import java.util.Enumeration; import java.util.HashMap; +import java.util.List; import java.util.Map; -import java.util.Enumeration; - -import javax.management.remote.*; -import javax.management.*; +import java.util.Properties; +import java.util.Set; -import jdk.internal.agent.AgentConfigurationError; +/* + * @test + * @bug 6528083 + * @key intermittent + * @summary Test RMI Bootstrap + * + * @library /test/lib + * + * @run main/othervm/timeout=300 RmiBootstrapTest .*_test.*.in + * */ -import java.security.Security; +/* + * @test + * @bug 6528083 + * @key intermittent + * @summary Test RMI Bootstrap + * + * @library /test/lib + * + * @run main/othervm/timeout=300 RmiBootstrapTest .*_ssltest.*.in + * */ /** *

This class implements unit test for RMI Bootstrap. @@ -56,7 +84,7 @@ *

The rmi port number can be specified with the "rmi.port" system property. * If not, this test will use the first available port

* - *

When called with some argument, the main() will interprete its args to + *

When called with some argument, the main() will interpret its args to * be Java M&M configuration file names. The filenames are expected to end * with ok.properties or ko.properties - and are interpreted as above.

* @@ -68,160 +96,57 @@ * *

Debug traces are logged in "sun.management.test"

**/ -public class RmiBootstrapTest { +public class RmiBootstrapTest extends RmiTestBase { + static TestLogger log = new TestLogger("RmiBootstrapTest"); // the number of consecutive ports to test for availability private static int MAX_GET_FREE_PORT_TRIES = 10; - static TestLogger log = - new TestLogger("RmiBootstrapTest"); - - /** - * Default values for RMI configuration properties. - **/ - public static interface DefaultValues { - public static final String PORT="0"; - public static final String CONFIG_FILE_NAME="management.properties"; - public static final String USE_SSL="true"; - public static final String USE_AUTHENTICATION="true"; - public static final String PASSWORD_FILE_NAME="jmxremote.password"; - public static final String ACCESS_FILE_NAME="jmxremote.access"; - public static final String KEYSTORE="keystore"; - public static final String KEYSTORE_PASSWD="password"; - public static final String TRUSTSTORE="truststore"; - public static final String TRUSTSTORE_PASSWD="trustword"; - public static final String SSL_NEED_CLIENT_AUTH="false"; - } - - /** - * Names of RMI configuration properties. - **/ - public static interface PropertyNames { - public static final String PORT= - "com.sun.management.jmxremote.port"; - public static final String CONFIG_FILE_NAME= - "com.sun.management.config.file"; - public static final String USE_SSL= - "com.sun.management.jmxremote.ssl"; - public static final String USE_AUTHENTICATION= - "com.sun.management.jmxremote.authenticate"; - public static final String PASSWORD_FILE_NAME= - "com.sun.management.jmxremote.password.file"; - public static final String ACCESS_FILE_NAME= - "com.sun.management.jmxremote.access.file"; - public static final String INSTRUMENT_ALL= - "com.sun.management.instrumentall"; - public static final String CREDENTIALS = - "jmx.remote.credentials"; - public static final String KEYSTORE= - "javax.net.ssl.keyStore"; - public static final String KEYSTORE_PASSWD= - "javax.net.ssl.keyStorePassword"; - public static final String TRUSTSTORE= - "javax.net.ssl.trustStore"; - public static final String TRUSTSTORE_PASSWD= - "javax.net.ssl.trustStorePassword"; - public static final String SSL_ENABLED_CIPHER_SUITES = - "com.sun.management.jmxremote.ssl.enabled.cipher.suites"; - public static final String SSL_ENABLED_PROTOCOLS = - "com.sun.management.jmxremote.ssl.enabled.protocols"; - public static final String SSL_NEED_CLIENT_AUTH = - "com.sun.management.jmxremote.ssl.need.client.auth"; - public static final String SSL_CLIENT_ENABLED_CIPHER_SUITES = - "javax.rmi.ssl.client.enabledCipherSuites"; - } - - /** - * A filter to find all filenames who match *. - * Note that and can overlap. - **/ - private static class ConfigFilenameFilter implements FilenameFilter { - final String suffix; - final String prefix; - ConfigFilenameFilter(String prefix, String suffix) { - this.suffix=suffix; - this.prefix=prefix; - } - public boolean accept(File dir, String name) { - return (name.startsWith(prefix) && name.endsWith(suffix)); - } - } - - /** - * Get all "management*ok.properties" files in the directory - * indicated by the "test.src" management property. - **/ - private static File[] findConfigurationFilesOk() { - final String testSrc = System.getProperty("test.src"); - final File dir = new File(testSrc); - final FilenameFilter filter = - new ConfigFilenameFilter("management_test","ok.properties"); - return dir.listFiles(filter); - } - - /** - * Get all "management*ko.properties" files in the directory - * indicated by the "test.src" management property. - **/ - private static File[] findConfigurationFilesKo() { - final String testSrc = System.getProperty("test.src"); - final File dir = new File(testSrc); - final FilenameFilter filter = - new ConfigFilenameFilter("management_test","ko.properties"); - return dir.listFiles(filter); - } /** * List all MBeans and their attributes. Used to test communication * with the Java M&M MBean Server. + * * @return the number of queried MBeans. */ - public static int listMBeans(MBeanServerConnection server) - throws IOException { - return listMBeans(server,null,null); + public static int listMBeans(MBeanServerConnection server) throws IOException { + return listMBeans(server, null, null); } /** * List all matching MBeans and their attributes. * Used to test communication with the Java M&M MBean Server. + * * @return the number of matching MBeans. */ - public static int listMBeans(MBeanServerConnection server, - ObjectName pattern, QueryExp query) - throws IOException { - - final Set names = server.queryNames(pattern,query); - for (final Iterator i=names.iterator(); i.hasNext(); ) { - ObjectName name = (ObjectName)i.next(); - log.trace("listMBeans","Got MBean: "+name); + public static int listMBeans(MBeanServerConnection server, ObjectName pattern, QueryExp query) + throws IOException { + + final Set names = server.queryNames(pattern, query); + for (ObjectName name : names) { + log.trace("listMBeans", "Got MBean: " + name); try { - MBeanInfo info = - server.getMBeanInfo((ObjectName)name); + MBeanInfo info = server.getMBeanInfo(name); MBeanAttributeInfo[] attrs = info.getAttributes(); - if (attrs == null) continue; - for (int j=0; j credentialFiles = prepareTestFiles(args[0]); + + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + + try { + MAX_GET_FREE_PORT_TRIES = Integer.parseInt(System.getProperty("test.getfreeport.max.tries", "10")); + } catch (NumberFormatException ex) { + } + + RmiBootstrapTest manager = new RmiBootstrapTest(); + try { + manager.run(args); + } catch (RuntimeException r) { + System.out.println("Test Failed: " + r.getMessage()); + System.exit(1); + } catch (Throwable t) { + System.out.println("Test Failed: " + t); + t.printStackTrace(); + System.exit(2); + } + System.out.println("**** Test RmiBootstrap Passed ****"); + grantFilesAccess(credentialFiles, AccessControl.EVERYONE); + } /** * Parses the password file to read the credentials. @@ -266,158 +195,151 @@ * If the password file does not exists, return an empty list. * (File not found = empty file). **/ - private ArrayList readCredentials(String passwordFileName) - throws IOException { + private ArrayList readCredentials(String passwordFileName) throws IOException { final Properties pws = new Properties(); - final ArrayList result = new ArrayList(); + final ArrayList result = new ArrayList(); final File f = new File(passwordFileName); - if (!f.exists()) return result; - FileInputStream fin = new FileInputStream(passwordFileName); - try {pws.load(fin);}finally{fin.close();} - for (Enumeration en=pws.propertyNames();en.hasMoreElements();) { + if (!f.exists()) { + return result; + } + try (FileInputStream fin = new FileInputStream(passwordFileName)){ + pws.load(fin); + } catch (IOException e) { + } + for (Enumeration en = pws.propertyNames(); en.hasMoreElements(); ) { final String[] cred = new String[2]; - cred[0]=(String)en.nextElement(); - cred[1]=pws.getProperty(cred[0]); + cred[0] = (String) en.nextElement(); + cred[1] = pws.getProperty(cred[0]); result.add(cred); } return result; } - /** * Connect with the given url, using all given credentials in turn. * A null entry in the useCredentials arrays indicate a connection * where no credentials are used. - * @param url JMXServiceURL of the server. - * @param useCredentials An array of credentials (a credential - * is a two String array, so this is an array of arrays - * of strings: - * useCredentials[i][0]=subject - * useCredentials[i][1]=password - * if useCredentials[i] == null means no credentials. + * + * @param url JMXServiceURL of the server. + * @param useCredentials An array of credentials (a credential + * is a two String array, so this is an array of + * arrays + * of strings: + * useCredentials[i][0]=subject + * useCredentials[i][1]=password + * if useCredentials[i] == null means no credentials. * @param expectConnectOk true if connection is expected to succeed - * Note: if expectConnectOk=false and the test fails to connect - * the number of failure is not incremented. Conversely, - * if expectConnectOk=false and the test does not fail to - * connect the number of failure is incremented. - * @param expectReadOk true if communication (listMBeans) is expected - * to succeed. - * Note: if expectReadOk=false and the test fails to read MBeans - * the number of failure is not incremented. Conversely, - * if expectReadOk=false and the test does not fail to - * read MBeans the number of failure is incremented. + * Note: if expectConnectOk=false and the test + * fails to connect + * the number of failure is not incremented. + * Conversely, + * if expectConnectOk=false and the test does not + * fail to + * connect the number of failure is incremented. + * @param expectReadOk true if communication (listMBeans) is expected + * to succeed. + * Note: if expectReadOk=false and the test fails + * to read MBeans + * the number of failure is not incremented. + * Conversely, + * if expectReadOk=false and the test does not + * fail to + * read MBeans the number of failure is incremented. * @return number of failure. **/ - public int connectAndRead(JMXServiceURL url, - Object[] useCredentials, - boolean expectConnectOk, - boolean expectReadOk) - throws IOException { + public int connectAndRead(JMXServiceURL url, Object[] useCredentials, + boolean expectConnectOk, boolean expectReadOk) + throws IOException { int errorCount = 0; - for (int i=0 ; i * This method calls connectAndRead(). **/ - public void testCommunication(JMXServiceURL url) - throws IOException { + public void testCommunication(JMXServiceURL url) throws IOException { - final String defaultConf = - getDefaultFileName(DefaultValues.CONFIG_FILE_NAME); - final String confname = - System.getProperty(PropertyNames.CONFIG_FILE_NAME,defaultConf); + final String defaultConf = defaultFileNamePrefix + DefaultValues.CONFIG_FILE_NAME; + final String confname = System.getProperty(PropertyNames.CONFIG_FILE_NAME, defaultConf); final Properties props = new Properties(); final File conf = new File(confname); if (conf.exists()) { FileInputStream fin = new FileInputStream(conf); - try {props.load(fin);} finally {fin.close();} + try { + props.load(fin); + } finally { + fin.close(); + } } // Do we use authentication? - final String useAuthenticationStr = - props.getProperty(PropertyNames.USE_AUTHENTICATION, - DefaultValues.USE_AUTHENTICATION); - final boolean useAuthentication = - Boolean.valueOf(useAuthenticationStr).booleanValue(); + final String useAuthenticationStr = + props.getProperty(PropertyNames.USE_AUTHENTICATION, DefaultValues.USE_AUTHENTICATION); + final boolean useAuthentication = Boolean.valueOf(useAuthenticationStr).booleanValue(); // Get Password File - final String defaultPasswordFileName = Utils.convertPath( - getDefaultFileName(DefaultValues.PASSWORD_FILE_NAME)); - final String passwordFileName = Utils.convertPath( - props.getProperty(PropertyNames.PASSWORD_FILE_NAME, - defaultPasswordFileName)); + final String defaultPasswordFileName = + Utils.convertPath(defaultFileNamePrefix + DefaultValues.PASSWORD_FILE_NAME); + final String passwordFileName = + Utils.convertPath(props.getProperty(PropertyNames.PASSWORD_FILE_NAME, defaultPasswordFileName)); // Get Access File - final String defaultAccessFileName = Utils.convertPath( - getDefaultFileName(DefaultValues.ACCESS_FILE_NAME)); - final String accessFileName = Utils.convertPath( - props.getProperty(PropertyNames.ACCESS_FILE_NAME, - defaultAccessFileName)); + final String defaultAccessFileName = Utils.convertPath(defaultFileNamePrefix + DefaultValues.ACCESS_FILE_NAME); + final String accessFileName = + Utils.convertPath(props.getProperty(PropertyNames.ACCESS_FILE_NAME, defaultAccessFileName)); if (useAuthentication) { System.out.println("PasswordFileName: " + passwordFileName); @@ -580,55 +471,52 @@ } final Object[] allCredentials; - final Object[] noCredentials = { null }; + final Object[] noCredentials = {null}; if (useAuthentication) { final ArrayList l = readCredentials(passwordFileName); - if (l.size() == 0) allCredentials = null; - else allCredentials = l.toArray(); - } else allCredentials = noCredentials; + if (l.size() == 0) { + allCredentials = null; + } else { + allCredentials = l.toArray(); + } + } else { + allCredentials = noCredentials; + } int errorCount = 0; - if (allCredentials!=null) { + if (allCredentials != null) { // Tests that the registered user/passwords are allowed to // connect & read // - errorCount += connectAndRead(url,allCredentials,true,true); + errorCount += connectAndRead(url, allCredentials, true, true); } else { // Tests that no one is allowed // connect & read // - final String[][] someCredentials = { - null, - { "modify", "R&D" }, - { "measure", "QED" } - }; - errorCount += connectAndRead(url,someCredentials,false,false); + final String[][] someCredentials = {null, {"modify", "R&D"}, {"measure", "QED"}}; + errorCount += connectAndRead(url, someCredentials, false, false); } if (useAuthentication && allCredentials != noCredentials) { // Tests that the registered user/passwords are not allowed to // connect & read // - final String[][] badCredentials = { - { "bad.user", "R&D" }, - { "measure", "bad.password" } - }; - errorCount += connectAndRead(url,badCredentials,false,false); + final String[][] badCredentials = {{"bad.user", "R&D"}, {"measure", "bad.password"}}; + errorCount += connectAndRead(url, badCredentials, false, false); } if (errorCount > 0) { - final String err = "Test " + confname + " failed with " + - errorCount + " error(s)"; - log.debug("testCommunication",err); + final String err = "Test " + confname + " failed with " + errorCount + " error(s)"; + log.debug("testCommunication", err); throw new RuntimeException(err); } } - /** * Test the configuration indicated by `file'. * Sets the appropriate System properties for config file and * port and then calls ConnectorBootstrap.initialize(). * eventually cleans up by calling ConnectorBootstrap.terminate(). + * * @return null if the test succeeds, an error message otherwise. **/ private String testConfiguration(File file) throws IOException, InterruptedException { @@ -638,32 +526,30 @@ int port = jdk.test.lib.Utils.getFreePort(); final String path; try { - path=(file==null)?null:file.getCanonicalPath(); - } catch(IOException x) { - final String err = "Failed to test configuration " + file + - ": " + x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + path = (file == null) ? null : file.getCanonicalPath(); + } catch (IOException x) { + final String err = "Failed to test configuration " + file + ": " + x; + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); return err; } - final String config = (path==null)?"Default config file":path; + final String config = (path == null) ? "Default config file" : path; System.out.println("***"); - System.out.println("*** Testing configuration (port=" + port + "): " - + path); + System.out.println("*** Testing configuration (port=" + port + "): " + path); System.out.println("***"); - System.setProperty("com.sun.management.jmxremote.port", - Integer.toString(port)); - if (path != null) + System.setProperty("com.sun.management.jmxremote.port", Integer.toString(port)); + if (path != null) { System.setProperty("com.sun.management.config.file", path); - else + } else { System.getProperties().remove("com.sun.management.config.file"); + } - log.trace("testConfiguration","com.sun.management.jmxremote.port="+port); - if (path != null && log.isDebugOn()) - log.trace("testConfiguration", - "com.sun.management.config.file="+path); + log.trace("testConfiguration", "com.sun.management.jmxremote.port=" + port); + if (path != null && log.isDebugOn()) { + log.trace("testConfiguration", "com.sun.management.config.file=" + path); + } checkSslConfiguration(); @@ -673,54 +559,49 @@ } catch (AgentConfigurationError x) { if (x.getCause() instanceof ExportException) { if (x.getCause().getCause() instanceof BindException) { - throw (BindException)x.getCause().getCause(); + throw (BindException) x.getCause().getCause(); } } - final String err = "Failed to initialize connector:" + - "\n\tcom.sun.management.jmxremote.port=" + port + - ((path!=null)?"\n\tcom.sun.management.config.file="+path: - "\n\t"+config) + - "\n\tError is: " + x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + final String err = + "Failed to initialize connector:" + "\n\tcom.sun.management.jmxremote.port=" + port + + ((path != null) ? "\n\tcom.sun.management.config.file=" + path : "\n\t" + config) + + "\n\tError is: " + x; + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); return err; } catch (Exception x) { - log.debug("testConfiguration",x); + log.debug("testConfiguration", x); return x.toString(); } try { - JMXServiceURL url = - new JMXServiceURL("rmi",null,0,"/jndi/rmi://localhost:"+ - port+"/jmxrmi"); + JMXServiceURL url = new JMXServiceURL("rmi", null, 0, "/jndi/rmi://localhost:" + port + "/jmxrmi"); try { testCommunication(url); } catch (Exception x) { - final String err = "Failed to connect to agent {url="+url+ - "}: " + x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + final String err = "Failed to connect to agent {url=" + url + "}: " + x; + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); return err; } } catch (Exception x) { - final String err = "Failed to test configuration "+config+ - ": "+x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + final String err = "Failed to test configuration " + config + ": " + x; + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); return err; } finally { try { cs.stop(); } catch (Exception x) { - final String err = "Failed to terminate: "+x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + final String err = "Failed to terminate: " + x; + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); } } System.out.println("Configuration " + config + " successfully tested"); return null; - } catch(BindException ex) { + } catch (BindException ex) { } } System.err.println("Cannot find a free port after " + MAX_GET_FREE_PORT_TRIES + " tries"); @@ -730,17 +611,15 @@ /** * Test a configuration file which should make the bootstrap fail. * The test is assumed to have succeeded if the bootstrap fails. + * * @return null if the test succeeds, an error message otherwise. **/ private String testConfigurationKo(File conf) throws InterruptedException, IOException { - String errStr = null; - errStr = testConfiguration(conf); + String errStr = testConfiguration(conf); if (errStr == null) { - return "Configuration " + - conf + " should have failed!"; + return "Configuration " + conf + " should have failed!"; } - System.out.println("Configuration " + - conf + " failed as expected"); + System.out.println("Configuration " + conf + " failed as expected"); log.debug("runko", "Error was: " + errStr); return null; } @@ -748,8 +627,9 @@ /** * Test a configuration file. Determines whether the bootstrap * should succeed or fail depending on the file name: - * *ok.properties: bootstrap should succeed. - * *ko.properties: bootstrap or connection should fail. + * *ok.properties: bootstrap should succeed. + * *ko.properties: bootstrap or connection should fail. + * * @return null if the test succeeds, an error message otherwise. **/ private String testConfigurationFile(String fileName) throws InterruptedException, IOException { @@ -763,22 +643,23 @@ if (fileName.endsWith("ko.properties")) { return testConfigurationKo(file); } - return fileName + - ": test file suffix must be one of [ko|ok].properties"; + return fileName + ": test file suffix must be one of [ko|ok].properties"; } /** * Find all *ko.property files and test them. * (see findConfigurationFilesKo() and testConfigurationKo()) + * * @throws RuntimeException if the test fails. **/ - public void runko() throws InterruptedException, IOException { - final File[] conf = findConfigurationFilesKo(); - if ((conf == null)||(conf.length == 0)) + public void runko(boolean useSsl) throws InterruptedException, IOException { + final File[] conf = RmiTestBase.findConfigurationFilesKo(useSsl); + if ((conf == null) || (conf.length == 0)) { throw new RuntimeException("No configuration found"); + } String errStr; - for (int i=0;iThis class implements unit test for RMI Bootstrap. * When called with no arguments main() looks in the directory indicated @@ -69,163 +75,113 @@ * *

Debug traces are logged in "sun.management.test"

**/ -public class RmiSslNoKeyStoreTest { - - static TestLogger log = - new TestLogger("RmiSslNoKeyStoreTest"); +public class RmiSslNoKeyStoreTest extends RmiTestBase { + static TestLogger log = new TestLogger("RmiSslNoKeyStoreTest"); /** * When launching several registries, we increment the port number * to avoid falling into "port number already in use" problems. **/ static int testPort = 0; - - /** - * Default values for RMI configuration properties. - **/ - public static interface DefaultValues { - public static final String PORT="0"; - public static final String CONFIG_FILE_NAME="management.properties"; - public static final String USE_SSL="true"; - public static final String USE_AUTHENTICATION="true"; - public static final String PASSWORD_FILE_NAME="jmxremote.password"; - public static final String ACCESS_FILE_NAME="jmxremote.access"; - public static final String KEYSTORE="keystore"; - public static final String KEYSTORE_PASSWD="password"; - public static final String TRUSTSTORE="truststore"; - public static final String TRUSTSTORE_PASSWD="trustword"; - } - - /** - * Names of RMI configuration properties. - **/ - public static interface PropertyNames { - public static final String PORT="com.sun.management.jmxremote.port"; - public static final String CONFIG_FILE_NAME= - "com.sun.management.config.file"; - public static final String USE_SSL="com.sun.management.jmxremote.ssl"; - public static final String USE_AUTHENTICATION= - "com.sun.management.jmxremote.authenticate"; - public static final String PASSWORD_FILE_NAME= - "com.sun.management.jmxremote.password.file"; - public static final String ACCESS_FILE_NAME= - "com.sun.management.jmxremote.access.file"; - public static final String INSTRUMENT_ALL= - "com.sun.management.instrumentall"; - public static final String CREDENTIALS = - "jmx.remote.credentials"; - public static final String KEYSTORE="javax.net.ssl.keyStore"; - public static final String KEYSTORE_PASSWD= - "javax.net.ssl.keyStorePassword"; - public static final String KEYSTORE_TYPE="javax.net.ssl.keyStoreType"; - public static final String TRUSTSTORE="javax.net.ssl.trustStore"; - public static final String TRUSTSTORE_PASSWD= - "javax.net.ssl.trustStorePassword"; - } - - /** - * Compute the full path name for a default file. - * @param basename basename (with extension) of the default file. - * @return ${JRE}/conf/management/${basename} - **/ - private static String getDefaultFileName(String basename) { - final String fileSeparator = File.separator; - final StringBuffer defaultFileName = - new StringBuffer(System.getProperty("java.home")). - append(fileSeparator).append("conf").append(fileSeparator). - append("management").append(fileSeparator). - append(basename); - return defaultFileName.toString(); - } - - /** - * Compute the full path name for a default file. - * @param basename basename (with extension) of the default file. - * @return ${JRE}/conf/management/${basename} - **/ - private static String getDefaultStoreName(String basename) { - final String fileSeparator = File.separator; - final StringBuffer defaultFileName = - new StringBuffer(System.getProperty("test.src")). - append(fileSeparator).append("ssl").append(fileSeparator). - append(basename); - return defaultFileName.toString(); - } + final String DEFAULT_KEY_STORE = defaultStoreNamePrefix + DefaultValues.KEYSTORE; + final String KEY_STORE = System.getProperty(PropertyNames.KEYSTORE, DEFAULT_KEY_STORE); private static void checkKeystore(Properties props) - throws IOException, GeneralSecurityException { - if (log.isDebugOn()) - log.debug("checkKeystore","Checking Keystore configuration"); - - final String keyStore = - System.getProperty(PropertyNames.KEYSTORE); - if (keyStore == null) - throw new IllegalArgumentException("System property " + - PropertyNames.KEYSTORE + - " not specified"); + throws IOException, GeneralSecurityException { + if (log.isDebugOn()) { + log.debug("checkKeystore", "Checking Keystore configuration"); + } - final String keyStorePass = - System.getProperty(PropertyNames.KEYSTORE_PASSWD); + final String keyStore = System.getProperty(PropertyNames.KEYSTORE); + if (keyStore == null) { + throw new IllegalArgumentException("System property " + PropertyNames.KEYSTORE + " not specified"); + } + + final String keyStorePass = System.getProperty(PropertyNames.KEYSTORE_PASSWD); if (keyStorePass == null) { // We don't have the password, we can only check whether the // file exists... // final File ksf = new File(keyStore); - if (! ksf.canRead()) + if (!ksf.canRead()) { throw new IOException(keyStore + ": not readable"); + } - if (log.isDebugOn()) + if (log.isDebugOn()) { log.debug("checkSSL", "No password."); - throw new IllegalArgumentException("System property " + - PropertyNames.KEYSTORE_PASSWD + - " not specified"); + } + throw new IllegalArgumentException("System property " + PropertyNames.KEYSTORE_PASSWD + " not specified"); } // Now we're going to load the keyStore - just to check it's // correct. // - final String keyStoreType = - System.getProperty(PropertyNames.KEYSTORE_TYPE, - KeyStore.getDefaultType()); - final KeyStore ks = KeyStore.getInstance(keyStoreType); + final String keyStoreType = System.getProperty(PropertyNames.KEYSTORE_TYPE, KeyStore.getDefaultType()); + final KeyStore ks = KeyStore.getInstance(keyStoreType); final FileInputStream fin = new FileInputStream(keyStore); - final char keypassword[] = keyStorePass.toCharArray(); + final char keypassword[] = keyStorePass.toCharArray(); try { - ks.load(fin,keypassword); + ks.load(fin, keypassword); } finally { - Arrays.fill(keypassword,' '); + Arrays.fill(keypassword, ' '); fin.close(); } - if (log.isDebugOn()) - log.debug("checkSSL","SSL configuration successfully checked"); + if (log.isDebugOn()) { + log.debug("checkSSL", "SSL configuration successfully checked"); + } + } + + /** + * Calls run(args[]). + * exit(1) if the test fails. + **/ + public static void main(String args[]) throws Exception { + if (args.length == 0) { + throw new IllegalArgumentException("Argument is required for this" + " test"); + } + + final List credentialFiles = prepareTestFiles(args[0]); + + RmiSslNoKeyStoreTest manager = new RmiSslNoKeyStoreTest(); + try { + manager.run(args); + } catch (RuntimeException r) { + System.err.println("Test Failed: " + r.getMessage()); + System.exit(1); + } catch (Throwable t) { + System.err.println("Test Failed: " + t); + t.printStackTrace(); + System.exit(2); + } + System.out.println("**** Test RmiSslNoKeyStoreTest Passed ****"); + + grantFilesAccess(credentialFiles, AccessControl.EVERYONE); } private void checkSslConfiguration() throws Exception { - final String defaultConf = - getDefaultFileName(DefaultValues.CONFIG_FILE_NAME); - final String confname = - System.getProperty(PropertyNames.CONFIG_FILE_NAME,defaultConf); + final String defaultConf = defaultFileNamePrefix + DefaultValues.CONFIG_FILE_NAME; + final String confname = System.getProperty(PropertyNames.CONFIG_FILE_NAME, defaultConf); final Properties props = new Properties(); final File conf = new File(confname); if (conf.exists()) { FileInputStream fin = new FileInputStream(conf); - try {props.load(fin);} finally {fin.close();} + try { + props.load(fin); + } finally { + fin.close(); + } } // Do we use SSL? - final String useSslStr = - props.getProperty(PropertyNames.USE_SSL, - DefaultValues.USE_SSL); - final boolean useSsl = - Boolean.valueOf(useSslStr).booleanValue(); + final String useSslStr = props.getProperty(PropertyNames.USE_SSL, DefaultValues.USE_SSL); + final boolean useSsl = Boolean.valueOf(useSslStr).booleanValue(); - log.debug("checkSslConfiguration",PropertyNames.USE_SSL+"="+useSsl); + log.debug("checkSslConfiguration", PropertyNames.USE_SSL + "=" + useSsl); if (useSsl == false) { - final String msg = - PropertyNames.USE_SSL+"="+useSsl+", can't run test"; + final String msg = PropertyNames.USE_SSL + "=" + useSsl + ", can't run test"; throw new IllegalArgumentException(msg); } @@ -233,7 +189,7 @@ checkKeystore(props); } catch (Exception x) { // Ok! - log.debug("checkSslConfiguration","Test configuration OK: " + x); + log.debug("checkSslConfiguration", "Test configuration OK: " + x); return; } @@ -246,31 +202,30 @@ * Sets the appropriate System properties for config file and * port and then calls ConnectorBootstrap.initialize(). * eventually cleans up by calling ConnectorBootstrap.terminate(). + * * @return null if the test succeeds, an error message otherwise. **/ - private String testConfiguration(File file,int port) { + private String testConfiguration(File file, int port) { - final String path = (file==null)?null:file.getAbsolutePath(); - final String config = (path==null)?"Default config file":path; + final String path = (file == null) ? null : file.getAbsolutePath(); + final String config = (path == null) ? "Default config file" : path; try { System.out.println("***"); - System.out.println("*** Testing configuration (port="+ - port + "): "+ path); + System.out.println("*** Testing configuration (port=" + port + "): " + path); System.out.println("***"); - System.setProperty("com.sun.management.jmxremote.port", - Integer.toString(port)); - if (path != null) + System.setProperty("com.sun.management.jmxremote.port", Integer.toString(port)); + if (path != null) { System.setProperty("com.sun.management.config.file", path); - else - System.getProperties(). - remove("com.sun.management.config.file"); - - log.trace("testConfiguration","com.sun.management.jmxremote.port="+port); - if (path != null && log.isDebugOn()) - log.trace("testConfiguration", - "com.sun.management.config.file="+path); + } else { + System.getProperties().remove("com.sun.management.config.file"); + } + + log.trace("testConfiguration", "com.sun.management.jmxremote.port=" + port); + if (path != null && log.isDebugOn()) { + log.trace("testConfiguration", "com.sun.management.config.file=" + path); + } checkSslConfiguration(); @@ -278,61 +233,52 @@ try { cs = ConnectorBootstrap.initialize(); } catch (AgentConfigurationError x) { - final String err = "Failed to initialize connector:" + - "\n\tcom.sun.management.jmxremote.port=" + port + - ((path!=null)?"\n\tcom.sun.management.config.file="+path: - "\n\t"+config) + - "\n\tError is: " + x; + final String err = "Failed to initialize connector:" + "\n\tcom.sun.management.jmxremote.port=" + port + + ((path != null) ? "\n\tcom.sun.management.config.file=" + path : "\n\t" + config) + + "\n\tError is: " + x; - log.trace("testConfiguration","Expected failure: " + err); - log.debug("testConfiguration",x); + log.trace("testConfiguration", "Expected failure: " + err); + log.debug("testConfiguration", x); System.out.println("Got expected failure: " + x); return null; } catch (Exception x) { - log.debug("testConfiguration",x); + log.debug("testConfiguration", x); return x.toString(); } try { - JMXConnector cc = - JMXConnectorFactory.connect(cs.getAddress(), null); + JMXConnector cc = JMXConnectorFactory.connect(cs.getAddress(), null); cc.close(); } catch (IOException x) { - final String err = "Failed to initialize connector:" + - "\n\tcom.sun.management.jmxremote.port=" + port + - ((path!=null)?"\n\tcom.sun.management.config.file="+path: - "\n\t"+config) + - "\n\tError is: " + x; + final String err = "Failed to initialize connector:" + "\n\tcom.sun.management.jmxremote.port=" + port + + ((path != null) ? "\n\tcom.sun.management.config.file=" + path : "\n\t" + config) + + "\n\tError is: " + x; - log.trace("testConfiguration","Expected failure: " + err); - log.debug("testConfiguration",x); + log.trace("testConfiguration", "Expected failure: " + err); + log.debug("testConfiguration", x); System.out.println("Got expected failure: " + x); return null; } catch (Exception x) { - log.debug("testConfiguration",x); + log.debug("testConfiguration", x); return x.toString(); } try { cs.stop(); } catch (Exception x) { - final String err = "Failed to terminate: "+x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + final String err = "Failed to terminate: " + x; + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); } - final String err = "Bootstrap should have failed:" + - "\n\tcom.sun.management.jmxremote.port=" + port + - ((path!=null)?"\n\tcom.sun.management.config.file="+path: - "\n\t"+config); - log.trace("testConfiguration",err); + final String err = "Bootstrap should have failed:" + "\n\tcom.sun.management.jmxremote.port=" + port + + ((path != null) ? "\n\tcom.sun.management.config.file=" + path : "\n\t" + config); + log.trace("testConfiguration", err); return err; } catch (Exception x) { - final String err = "Failed to test bootstrap for:" + - "\n\tcom.sun.management.jmxremote.port=" + port + - ((path!=null)?"\n\tcom.sun.management.config.file="+path: - "\n\t"+config)+ - "\n\tError is: " + x; + final String err = "Failed to test bootstrap for:" + "\n\tcom.sun.management.jmxremote.port=" + port + + ((path != null) ? "\n\tcom.sun.management.config.file=" + path : "\n\t" + config) + + "\n\tError is: " + x; - log.trace("testConfiguration",err); - log.debug("testConfiguration",x); + log.trace("testConfiguration", err); + log.debug("testConfiguration", x); return err; } } @@ -340,79 +286,82 @@ /** * Test a configuration file. Determines whether the bootstrap * should succeed or fail depending on the file name: - * *ok.properties: bootstrap should succeed. - * *ko.properties: bootstrap or connection should fail. + * *ok.properties: bootstrap should succeed. + * *ko.properties: bootstrap or connection should fail. + * * @return null if the test succeeds, an error message otherwise. **/ private String testConfigurationFile(String fileName) { File file = new File(fileName); - final String portStr = System.getProperty("rmi.port","12424"); - final int port = Integer.parseInt(portStr); + final String portStr = System.getProperty("rmi.port", "12424"); + final int port = Integer.parseInt(portStr); - return testConfiguration(file,port+testPort++); + return testConfiguration(file, port + testPort++); } - /** - * Tests the specified configuration files. - * If args[] is not empty, each element in args[] is expected to be - * a filename ending either by ok.properties or ko.properties. - * Otherwise, the configuration files will be automatically determined - * by looking at all *.properties files located in the directory - * indicated by the System property "test.src". - * @throws RuntimeException if the test fails. + * Test a configuration file. **/ - public void run(String args[]) { - final String defaultKeyStore = - getDefaultStoreName(DefaultValues.KEYSTORE); - final String keyStore = - System.getProperty(PropertyNames.KEYSTORE, defaultKeyStore); - - for (int i=0; i*. + * Note that and can overlap. + **/ + static class FilenameFilterFactory { + static FilenameFilter prefixSuffix(final String p, final String s) { + return (dir, name) -> name.startsWith(p) && name.endsWith(s); + } + } + + enum AccessControl { + OWNER, + EVERYONE, + } + + /** + * Default values for RMI configuration properties. + **/ + public interface DefaultValues { + String PORT = "0"; + String CONFIG_FILE_NAME = "management.properties"; + String USE_SSL = "true"; + String USE_AUTHENTICATION = "true"; + String PASSWORD_FILE_NAME = "jmxremote.password"; + String ACCESS_FILE_NAME = "jmxremote.access"; + String KEYSTORE = "keystore"; + String KEYSTORE_PASSWD = "password"; + String TRUSTSTORE = "truststore"; + String TRUSTSTORE_PASSWD = "trustword"; + String SSL_NEED_CLIENT_AUTH = "false"; + } + + /** + * Names of RMI configuration properties. + **/ + public interface PropertyNames { + String PORT = "com.sun.management.jmxremote.port"; + String CONFIG_FILE_NAME = "com.sun.management.config.file"; + String USE_SSL = "com.sun.management.jmxremote.ssl"; + String USE_AUTHENTICATION = "com.sun.management.jmxremote.authenticate"; + String PASSWORD_FILE_NAME = "com.sun.management.jmxremote.password.file"; + String ACCESS_FILE_NAME = "com.sun.management.jmxremote.access.file"; + String INSTRUMENT_ALL = "com.sun.management.instrumentall"; + String CREDENTIALS = "jmx.remote.credentials"; + String KEYSTORE = "javax.net.ssl.keyStore"; + String KEYSTORE_PASSWD = "javax.net.ssl.keyStorePassword"; + String KEYSTORE_TYPE = "javax.net.ssl.keyStoreType"; + String TRUSTSTORE = "javax.net.ssl.trustStore"; + String TRUSTSTORE_PASSWD = "javax.net.ssl.trustStorePassword"; + String SSL_ENABLED_CIPHER_SUITES = "com.sun.management.jmxremote.ssl.enabled.cipher.suites"; + String SSL_ENABLED_PROTOCOLS = "com.sun.management.jmxremote.ssl.enabled.protocols"; + String SSL_NEED_CLIENT_AUTH = "com.sun.management.jmxremote.ssl.need.client.auth"; + String SSL_CLIENT_ENABLED_CIPHER_SUITES = "javax.rmi.ssl.client.enabledCipherSuites"; + } + + /** + * Copy test artifacts to test folder. + * + * @param filenamePattern the filename pattern to look for + * @return files who match the filename pattern + * @throws IOException if error occurs + */ + static List prepareTestFiles(String filenamePattern) throws IOException { + copySsl(); + List files = Utils.findFiles(Paths.get(SRC), (dir, name) -> name.matches(filenamePattern)); + + final Function removeSuffix = (s) -> s.substring(0, s.lastIndexOf(".")); + + List propertyFiles = + Utils.copyFiles(files, Paths.get(DEST), removeSuffix, StandardCopyOption.REPLACE_EXISTING); + + // replace @TEST-SRC@ with the path of the current test folder + if (Platform.isWindows()) { + // On Windows, also replace forward slash or single backslash to double backslashes + Utils.replaceFilesString(propertyFiles, + (s) -> s.replace(TEST_SRC, DEST).replaceAll("[/\\\\]", "\\\\\\\\")); + } else { + Utils.replaceFilesString(propertyFiles, (s) -> s.replace(TEST_SRC, DEST)); + } + + grantFilesAccess(propertyFiles, AccessControl.OWNER); + + return Collections.unmodifiableList(propertyFiles); + } + + /** + * Grant file access. + * + * @param file file to grant access + * @param access user access or full access + * @throws IOException if error occurs + */ + static void grantAccess(Path file, AccessControl access) throws IOException { + Set attr = file.getFileSystem().supportedFileAttributeViews(); + if (attr.contains("posix")) { + String perms = access == AccessControl.OWNER ? "rw-------" : "rwxrwxrwx"; + Files.setPosixFilePermissions(file, PosixFilePermissions.fromString(perms)); + } else if (attr.contains("acl")) { + AclFileAttributeView view = Files.getFileAttributeView(file, AclFileAttributeView.class); + List acl = new ArrayList<>(); + for (AclEntry thisEntry : view.getAcl()) { + if (access == AccessControl.OWNER) { + if (thisEntry.principal().getName().equals(view.getOwner().getName())) { + acl.add(Utils.allowAccess(thisEntry)); + } else if (thisEntry.type() == AclEntryType.ALLOW) { + acl.add(Utils.revokeAccess(thisEntry)); + } else { + acl.add(thisEntry); + } + } else { + if (!thisEntry.principal().getName().contains("NULL SID") + && thisEntry.type() != AclEntryType.ALLOW) { + acl.add(Utils.allowAccess(thisEntry)); + } else { + acl.add(thisEntry); + } + } + } + view.setAcl(acl); + } else { + throw new RuntimeException("Unsupported file attributes: " + attr); + } + } + + /** + * Grant files' access. + * + * @param files files to grant access + * @param access user access or full access + * @throws IOException if error occurs + */ + static void grantFilesAccess(List files, AccessControl access) throws IOException { + for (Path thisFile : files) { + grantAccess(thisFile, access); + } + } + + /** + * Copy SSL files to test folder. + * + * @throws IOException + */ + static void copySsl() throws IOException { + Path sslSource = Paths.get(SRC_SSL); + Path sslTarget = Paths.get(DEST_SSL); + + List files = Arrays.stream(sslSource.toFile().listFiles()).map(File::toPath).collect(Collectors.toList()); + Utils.copyFiles(files, sslTarget, StandardCopyOption.REPLACE_EXISTING); + + for (Path file : files) { + grantAccess(sslTarget.resolve(file.getFileName()), AccessControl.EVERYONE); + } + } + + /** + * Get all "management*ok.properties" files in the directory + * indicated by the "test.src" management property. + * + * @param useSsl boolean that indicates if test uses SSL + * @return configuration files + **/ + static File[] findConfigurationFilesOk(boolean useSsl) { + String prefix = useSsl ? "management_ssltest" : "management_test"; + return findAllConfigurationFiles(prefix, "ok.properties"); + } + + /** + * Get all "management*ko.properties" files in the directory + * indicated by the "test.src" management property. + * + * @param useSsl boolean that indicates if test uses SSL + * @return configuration files + **/ + static File[] findConfigurationFilesKo(boolean useSsl) { + String prefix = useSsl ? "management_ssltest" : "management_test"; + return findAllConfigurationFiles(prefix, "ko.properties"); + } + + /** + * Get all "management*.properties" files in the directory + * indicated by the "test.src" management property. + * + * @param useSsl boolean that indicates if test uses SSL + * @return configuration files + **/ + static File[] findAllConfigurationFiles(boolean useSsl) { + String prefix = useSsl ? "management_ssltest" : "management_test"; + return findAllConfigurationFiles(prefix, "properties"); + } + + /** + * Get all "management*.properties" files in the directory + * indicated by the "test.src" management property. + * + * @param prefix filename prefix + * @param suffix filename suffix + * @return configuration files + **/ + static File[] findAllConfigurationFiles(String prefix, String suffix) { + final File dir = new File(DEST); + final FilenameFilter filter = FilenameFilterFactory.prefixSuffix(prefix, suffix); + return dir.listFiles(filter); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/bootstrap/Utils.java openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/Utils.java --- openjdk-17-17.0.9+9/test/jdk/sun/management/jmxremote/bootstrap/Utils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/management/jmxremote/bootstrap/Utils.java 2024-01-09 21:18:15.000000000 +0000 @@ -21,6 +21,15 @@ * questions. */ +import java.io.*; +import java.nio.file.CopyOption; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + /** * Utility class. */ @@ -46,4 +55,141 @@ String newPath = new String(cs); return newPath; } + + /** + * Return file directories that satisfy the specified filter. + * + * @param searchDirectory the base directory to search + * @param filter a filename filter + * @return file directories + */ + public static List findFiles(Path searchDirectory, + FilenameFilter filter) { + return Arrays.stream(searchDirectory.toFile().listFiles(filter)) + .map(f -> f.toPath()) + .collect(Collectors.toList()); + } + + /** + * Copy files to the target path. + * + * @param source the paths to the files to copy + * @param target the path to the target files + * @param filenameMapper mapper function applied to filenames + * @param options options specifying how the copy should be done + * @return the paths to the target files + * @throws IOException if error occurs + */ + public static List copyFiles(List source, Path target, + Function filenameMapper, + CopyOption... options) throws IOException { + List result = new ArrayList<>(); + + if (!target.toFile().exists()) { + Files.createDirectory(target); + } + + for (Path file : source) { + if (!file.toFile().exists()) { + continue; + } + + String baseName = file.getFileName().toString(); + + Path targetFile = target.resolve(filenameMapper.apply(baseName)); + Files.copy(file, targetFile, options); + result.add(targetFile); + } + return result; + } + + /** + * Copy files to the target path. + * + * @param source the paths to the files to copy + * @param target the path to the target files + * @param options options specifying how the copy should be done + * @return the paths to the target files + * @throws IOException if error occurs + */ + public static List copyFiles(List source, Path target, + CopyOption... options) throws IOException { + return copyFiles(source, target, (s) -> s, options); + } + + /** + * Return an ACL entry that revokes owner access. + * + * @param acl original ACL entry to build from + * @return an ACL entry that revokes all access + */ + public static AclEntry revokeAccess(AclEntry acl) { + return buildAclEntry(acl, AclEntryType.DENY); + } + + /** + * Return an ACL entry that allow owner access. + * @param acl original ACL entry to build from + * @return an ACL entry that allows all access + */ + public static AclEntry allowAccess(AclEntry acl) { + return buildAclEntry(acl, AclEntryType.ALLOW); + } + + /** + * Build an ACL entry with a given ACL entry type. + * + * @param acl original ACL entry to build from + * @return an ACL entry with a given ACL entry type + */ + public static AclEntry buildAclEntry(AclEntry acl, AclEntryType type) { + return AclEntry.newBuilder() + .setType(type) + .setPrincipal(acl.principal()) + .setPermissions(acl.permissions()) + .build(); + } + + /** + * Replace file string by applying the given mapper function. + * + * @param source the file to read + * @param contentMapper the mapper function applied to file's content + * @throws IOException if an I/O error occurs + */ + public static void replaceFileString(Path source, + Function contentMapper) throws IOException { + StringBuilder sb = new StringBuilder(); + String lineSep = System.getProperty("line.separator"); + + try (BufferedReader reader = + new BufferedReader(new FileReader(source.toFile()))) { + + String line; + + // read all and replace all at once?? + while ((line = reader.readLine()) != null) { + sb.append(contentMapper.apply(line)) + .append(lineSep); + } + } + + try (FileWriter writer = new FileWriter(source.toFile())) { + writer.write(sb.toString()); + } + } + + /** + * Replace files' string by applying the given mapper function. + * + * @param source the file to read + * @param contentMapper the mapper function applied to files' content + * @throws IOException if an I/O error occurs + */ + public static void replaceFilesString(List source, + Function contentMapper) throws IOException { + for (Path file : source) { + replaceFileString(file, contentMapper); + } + } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/misc/UnsafeFieldOffsets.java openjdk-17-17.0.10+7/test/jdk/sun/misc/UnsafeFieldOffsets.java --- openjdk-17-17.0.9+9/test/jdk/sun/misc/UnsafeFieldOffsets.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/misc/UnsafeFieldOffsets.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -26,8 +26,8 @@ * @summary Ensure that sun.misc.Unsafe::objectFieldOffset and staticFieldOffset * throw UnsupportedOperationException on Field of a hidden or record class * @modules jdk.unsupported - * @compile --enable-preview -source ${jdk.version} UnsafeFieldOffsets.java - * @run testng/othervm --enable-preview UnsafeFieldOffsets + * @compile UnsafeFieldOffsets.java + * @run testng/othervm UnsafeFieldOffsets */ import sun.misc.Unsafe; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/http/HttpClient/ProxyFromCache.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/http/HttpClient/ProxyFromCache.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/http/HttpClient/ProxyFromCache.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/http/HttpClient/ProxyFromCache.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2022, 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 @@ -25,14 +25,22 @@ * @test * @bug 6498566 * @summary URL.openConnection(Proxy.NO_PROXY) may connect through a proxy. - * @modules java.base/sun.net.www * @library /test/lib * @run main/othervm ProxyFromCache */ -import java.net.*; -import java.io.*; -import sun.net.www.MessageHeader; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Proxy; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URL; + +import jdk.test.lib.net.HttpHeaderParser; import jdk.test.lib.net.URIBuilder; /* Creates a simple proxy and http server that just return 200 OK. @@ -135,15 +143,12 @@ connectionCount++; InputStream is = sock.getInputStream(); OutputStream os = sock.getOutputStream(); - - MessageHeader headers = new MessageHeader (is); + HttpHeaderParser httpHeaderParser = new HttpHeaderParser(is); os.write(replyOK.getBytes("UTF-8")); - - headers = new MessageHeader (is); + httpHeaderParser = new HttpHeaderParser(is); // If we get here then we received a second request. connectionCount++; os.write(replyOK.getBytes("UTF-8")); - sock.close(); } catch (Exception e) { //e.printStackTrace(); diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/http/HttpClient/RequestURI.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/http/HttpClient/RequestURI.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/http/HttpClient/RequestURI.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/http/HttpClient/RequestURI.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2022, 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 @@ -25,13 +25,14 @@ * @test * @bug 6469663 * @summary HTTP Request-URI contains fragment when connecting through proxy - * @modules java.base/sun.net.www + * @library /test/lib * @run main/othervm RequestURI */ import java.net.*; import java.io.*; -import sun.net.www.MessageHeader; + +import jdk.test.lib.net.HttpHeaderParser; // Create a Server listening on port 5001 to act as the proxy. Requests // never need to be forwared from it. We are only interested in the @@ -91,8 +92,8 @@ InputStream is = sock.getInputStream(); OutputStream os = sock.getOutputStream(); - MessageHeader headers = new MessageHeader (is); - String requestLine = headers.getValue(0); + HttpHeaderParser headers = new HttpHeaderParser (is); + String requestLine = headers.getRequestDetails(); int first = requestLine.indexOf(' '); int second = requestLine.lastIndexOf(' '); diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/CloseOptionHeader.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/CloseOptionHeader.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/CloseOptionHeader.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/CloseOptionHeader.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2022, 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 @@ -24,16 +24,23 @@ /** * @test * @bug 6189206 - * @modules java.base/sun.net.www * @library /test/lib * @run main/othervm -Dhttp.keepAlive=false CloseOptionHeader * @summary HTTP client should set "Connection: close" header in request when keepalive is disabled */ -import java.net.*; -import java.util.*; -import java.io.*; -import sun.net.www.MessageHeader; +import java.io.BufferedOutputStream; +import java.io.InputStream; +import java.io.PrintStream; +import java.net.HttpURLConnection; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.ServerSocket; +import java.net.Socket; +import java.net.URL; +import java.util.List; + +import jdk.test.lib.net.HttpHeaderParser; import jdk.test.lib.net.URIBuilder; public class CloseOptionHeader implements Runnable { @@ -49,10 +56,15 @@ /* check the request to find close connection option header */ InputStream is = s.getInputStream (); - MessageHeader mh = new MessageHeader(is); - String connHeader = mh.findValue("Connection"); - if (connHeader != null && connHeader.equalsIgnoreCase("close")) { - hasCloseHeader = true; + HttpHeaderParser mh = new HttpHeaderParser(is); + List connHeader = mh.getHeaderValue("Connection"); + if (connHeader != null) { + for(String value : connHeader) { + if (value.equalsIgnoreCase("close")) { + hasCloseHeader = true; + break; + } + } } PrintStream out = new PrintStream( diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/HttpHeaderParserTest.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/HttpHeaderParserTest.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/HttpHeaderParserTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/HttpHeaderParserTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,498 @@ + + +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8061729 + * @library /test/lib + * @summary Sanity check that HttpHeaderParser works same as MessageHeader + * @modules java.base/sun.net.www java.base/sun.net.www.protocol.http:open + * @run testng/othervm HttpHeaderParserTest + */ + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; + +import static java.lang.String.format; +import static java.nio.charset.StandardCharsets.ISO_8859_1; +import static java.nio.charset.StandardCharsets.US_ASCII; +import jdk.test.lib.net.HttpHeaderParser; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; +import sun.net.www.MessageHeader; + +public class HttpHeaderParserTest { + @DataProvider(name = "responses") + public Object[][] responses() { + List responses = new ArrayList<>(); + + String[] basic = + { "HTTP/1.1 200 OK\r\n\r\n", + + "HTTP/1.1 200 OK\r\n" + + "Date: Mon, 15 Jan 2001 12:18:21 GMT\r\n" + + "Server: Apache/1.3.14 (Unix)\r\n" + + "Connection: close\r\n" + + "Content-Type: text/html; charset=iso-8859-1\r\n" + + "Content-Length: 10\r\n\r\n" + + "123456789", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 9\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "X-Header: U\u00ffU\r\n" + // value with U+00FF - Extended Latin-1 + "Content-Length: 9\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 9\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + // more than one SP after ':' + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length:\t10\r\n" + + "Content-Type:\ttext/html; charset=UTF-8\r\n\r\n" + // HT separator + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length:\t\t10\r\n" + + "Content-Type:\t\ttext/html; charset=UTF-8\r\n\r\n" + // more than one HT after ':' + "XXXXX", + + "HTTP/1.1 407 Proxy Authorization Required\r\n" + + "Proxy-Authenticate: Basic realm=\"a fake realm\"\r\n\r\n", + + "HTTP/1.1 401 Unauthorized\r\n" + + "WWW-Authenticate: Digest realm=\"wally land\" domain=/ " + + "nonce=\"2B7F3A2B\" qop=\"auth\"\r\n\r\n", + + "HTTP/1.1 200 OK\r\n" + + "X-Foo:\r\n\r\n", // no value + + "HTTP/1.1 200 OK\r\n" + + "X-Foo:\r\n\r\n" + // no value, with response body + "Some Response Body", + + "HTTP/1.1 200 OK\r\n" + + "X-Foo:\r\n" + // no value, followed by another header + "Content-Length: 10\r\n\r\n" + + "Some Response Body", + + "HTTP/1.1 200 OK\r\n" + + "X-Foo:\r\n" + // no value, followed by another header, with response body + "Content-Length: 10\r\n\r\n", + + "HTTP/1.1 200 OK\r\n" + + "X-Foo: chegar\r\n" + + "X-Foo: dfuchs\r\n" + // same header appears multiple times + "Content-Length: 0\r\n" + + "X-Foo: michaelm\r\n" + + "X-Foo: prappo\r\n\r\n", + + "HTTP/1.1 200 OK\r\n" + + "X-Foo:\r\n" + // no value, same header appears multiple times + "X-Foo: dfuchs\r\n" + + "Content-Length: 0\r\n" + + "X-Foo: michaelm\r\n" + + "X-Foo: prappo\r\n\r\n", + + "HTTP/1.1 200 OK\r\n" + + "Accept-Ranges: bytes\r\n" + + "Cache-control: max-age=0, no-cache=\"set-cookie\"\r\n" + + "Content-Length: 132868\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n" + + "Date: Sun, 05 Nov 2017 22:24:03 GMT\r\n" + + "Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips Communique/4.2.2\r\n" + + "Set-Cookie: AWSELB=AF7927F5100F4202119876ED2436B5005EE;PATH=/;MAX-AGE=900\r\n" + + "Vary: Host,Accept-Encoding,User-Agent\r\n" + + "X-Mod-Pagespeed: 1.12.34.2-0\r\n" + + "Connection: keep-alive\r\n\r\n" + }; + Arrays.stream(basic).forEach(responses::add); + // add some tests where some of the CRLF are replaced + // by a single LF + Arrays.stream(basic) + .map(HttpHeaderParserTest::mixedCRLF) + .forEach(responses::add); + + String[] foldingTemplate = + { "HTTP/1.1 200 OK\r\n" + + "Content-Length: 9\r\n" + + "Content-Type: text/html;$NEWLINE" + // folding field-value with '\n'|'\r' + " charset=UTF-8\r\n" + // one preceding SP + "Connection: close\r\n\r\n" + + "XXYYZZAABBCCDDEE", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 19\r\n" + + "Content-Type: text/html;$NEWLINE" + // folding field-value with '\n'|'\r + " charset=UTF-8\r\n" + // more than one preceding SP + "Connection: keep-alive\r\n\r\n" + + "XXYYZZAABBCCDDEEFFGG", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 999\r\n" + + "Content-Type: text/html;$NEWLINE" + // folding field-value with '\n'|'\r + "\tcharset=UTF-8\r\n" + // one preceding HT + "Connection: close\r\n\r\n" + + "XXYYZZAABBCCDDEE", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 54\r\n" + + "Content-Type: text/html;$NEWLINE" + // folding field-value with '\n'|'\r + "\t\t\tcharset=UTF-8\r\n" + // more than one preceding HT + "Connection: keep-alive\r\n\r\n" + + "XXYYZZAABBCCDDEEFFGG", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: -1\r\n" + + "Content-Type: text/html;$NEWLINE" + // folding field-value with '\n'|'\r + "\t \t \tcharset=UTF-8\r\n" + // mix of preceding HT and SP + "Connection: keep-alive\r\n\r\n" + + "XXYYZZAABBCCDDEEFFGGHH", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 65\r\n" + + "Content-Type: text/html;$NEWLINE" + // folding field-value with '\n'|'\r + " \t \t charset=UTF-8\r\n" + // mix of preceding SP and HT + "Connection: keep-alive\r\n\r\n" + + "XXYYZZAABBCCDDEEFFGGHHII", + + "HTTP/1.1 401 Unauthorized\r\n" + + "WWW-Authenticate: Digest realm=\"wally land\"," + +"$NEWLINE domain=/," + +"$NEWLINE nonce=\"2B7F3A2B\"," + +"$NEWLINE\tqop=\"auth\"\r\n\r\n", + + }; + for (String newLineChar : new String[] { "\n", "\r", "\r\n" }) { + for (String template : foldingTemplate) + responses.add(template.replace("$NEWLINE", newLineChar)); + } + // add some tests where some of the CRLF are replaced + // by a single LF + for (String newLineChar : new String[] { "\n", "\r", "\r\n" }) { + for (String template : foldingTemplate) + responses.add(mixedCRLF(template).replace("$NEWLINE", newLineChar)); + } + + String[] bad = // much of this is to retain parity with legacy MessageHeaders + { "HTTP/1.1 200 OK\r\n" + + "Connection:\r\n\r\n", // empty value, no body + + "HTTP/1.1 200 OK\r\n" + + "Connection:\r\n\r\n" + // empty value, with body + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + ": no header\r\n\r\n", // no/empty header-name, no body, no following header + + "HTTP/1.1 200 OK\r\n" + + ": no; header\r\n" + // no/empty header-name, no body, following header + "Content-Length: 65\r\n\r\n", + + "HTTP/1.1 200 OK\r\n" + + ": no header\r\n" + // no/empty header-name + "Content-Length: 65\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "X-foo: bar\r\n" + + " : no header\r\n" + // fold, not a blank header-name + "Content-Length: 65\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "X-foo: bar\r\n" + + " \t : no header\r\n" + // fold, not a blank header-name + "Content-Length: 65\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + ": no header\r\n\r\n" + // no/empty header-name, followed by header + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "Conte\r" + + "nt-Length: 9\r\n" + // fold/bad header name ??? without preceding space + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXXYYZZ", + + "HTTP/1.0 404 Not Found\r\n" + + "header-without-colon\r\n\r\n", + + "HTTP/1.0 404 Not Found\r\n" + + "header-without-colon\r\n\r\n" + + "SOMEBODY", + + }; + Arrays.stream(bad).forEach(responses::add); + + return responses.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); + } + + static final AtomicInteger index = new AtomicInteger(); + static final AtomicInteger limit = new AtomicInteger(1); + static final AtomicBoolean useCRLF = new AtomicBoolean(); + // A small method to replace part of the CRLF present in a string + // with simple LF. The method uses a deterministic algorithm based + // on current values of static index/limit/useCRLF counters. + // These counters are used to produce a stream of substitutes that + // looks like this: + // LF CRLF LF LF CRLF CRLF LF LF LF CRLF CRLF CRLF (then repeat from start) + static final String mixedCRLF(String headers) { + int next; + int start = 0; + int last = headers.lastIndexOf("\r\n"); + String prev = ""; + StringBuilder res = new StringBuilder(); + while ((next = headers.indexOf("\r\n", start)) > 0) { + res.append(headers.substring(start, next)); + if ("\n".equals(prev) && next == last) { + // for some reason the legacy MessageHeader parser will + // not consume the final LF if the headers are terminated + // by instead of . It consume + // but leaves the last in the stream. + // Here we just make sure to avoid using + // as that would cause the legacy parser to consume + // 1 byte less than the Http1HeadersParser - which + // does consume the last , as it should. + // if this is the last CRLF and the previous one + // was replaced by LF then use LF. + res.append(prev); + } else { + prev = useCRLF.get() ? "\r\n" : "\n"; + res.append(prev); + } + // skip CRLF + start = next + 2; + + // The idea is to substitute some of the CRLF with LF. + // Rather than doing this randomly, always use the following + // sequence: + // LF CRLF LF LF CRLF CRLF LF LF LF CRLF CRLF CRLF + index.incrementAndGet(); + if (index.get() == limit.get()) { + index.set(0); + if (useCRLF.get()) limit.incrementAndGet(); + if (limit.get() > 3) limit.set(1); + useCRLF.set(!useCRLF.get()); + } + } + res.append(headers.substring(start)); + return res.toString(); + } + + + @Test(dataProvider = "responses") + public void verifyHeaders(String respString) throws Exception { + System.out.println("\ntesting:\n\t" + respString + .replace("\r\n", "") + .replace("\r", "") + .replace("\n","") + .replace("LF>", "LF>\n\t")); + byte[] bytes = respString.getBytes(ISO_8859_1); + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); + MessageHeader m = new MessageHeader(bais); + Map> messageHeaderMap = m.getHeaders(); + int availableBytes = bais.available(); + + HttpHeaderParser decoder = new HttpHeaderParser(); + ByteArrayInputStream headerStream = new ByteArrayInputStream(bytes); + int initialBytes = headerStream.available(); + decoder.parse(headerStream); + System.out.printf("HttpHeaderParser parsed %d bytes out of %d%n", initialBytes - headerStream.available(), bytes.length); + Map> decoderMap1 = decoder.getHeaderMap(); + + + // assert status-line + String statusLine1 = messageHeaderMap.get(null).get(0); + String statusLine2 = decoder.getRequestDetails(); + if (statusLine1.startsWith("HTTP")) {// skip the case where MH's messes up the status-line + assertEquals(statusLine2, statusLine1, "Status-line not equal"); + } else { + assertTrue(statusLine2.startsWith("HTTP/1."), "Status-line not HTTP/1."); + } + + // remove the null'th entry with is the status-line + Map> map = new HashMap<>(); + for (Map.Entry> e : messageHeaderMap.entrySet()) { + if (e.getKey() != null) { + map.put(e.getKey(), e.getValue()); + } + } + messageHeaderMap = map; + + assertHeadersEqual(messageHeaderMap, decoderMap1, + "messageHeaderMap not equal to decoderMap1"); + + assertEquals(availableBytes, headerStream.available(), + String.format("stream available (%d) not equal to remaining (%d)", + availableBytes, headerStream.available())); + } + + @DataProvider(name = "errors") + public Object[][] errors() { + List responses = new ArrayList<>(); + + // These responses are parsed, somewhat, by MessageHeaders but give + // nonsensible results. They, correctly, fail with the Http1HeaderParser. + String[] bad = + {// "HTTP/1.1 402 Payment Required\r\n" + + // "Content-Length: 65\r\n\r", // missing trailing LF //TODO: incomplete + + "HTTP/1.1 402 Payment Required\r\n" + + "Content-Length: 65\r\n\rT\r\n\r\nGGGGGG", + + "HTTP/1.1 200OK\r\n\rT", + + "HTTP/1.1 200OK\rT", + + "HTTP/1.0 FOO\r\n", + + "HTTP/1.1 BAR\r\n", + + "HTTP/1.1 +99\r\n", + + "HTTP/1.1 -22\r\n", + + "HTTP/1.1 -20 \r\n", + + "HTTP/1.1 200 OK\r\n" + + "X-fo\u00ffo: foo\r\n" + // invalid char in name + "Content-Length: 5\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "HTTP/1.1 200 OK\r\n" + + "X-foo : bar\r\n" + // trim space after name + "Content-Length: 5\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + " X-foo: bar\r\n" + // trim space before name + "Content-Length: 5\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "X foo: bar\r\n" + // invalid space in name + "Content-Length: 5\r\n" + + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "Content-Length: 5\r\n" + + "Content Type: text/html; charset=UTF-8\r\n\r\n" + // invalid space in name + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + "Conte\r" + + " nt-Length: 9\r\n" + // fold results in space in header name + "Content-Type: text/html; charset=UTF-8\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + " : no header\r\n" + // all blank header-name (not fold) + "Content-Length: 65\r\n\r\n" + + "XXXXX", + + "HTTP/1.1 200 OK\r\n" + + " \t : no header\r\n" + // all blank header-name (not fold) + "Content-Length: 65\r\n\r\n" + + "XXXXX", + + }; + Arrays.stream(bad).forEach(responses::add); + + return responses.stream().map(p -> new Object[] { p }).toArray(Object[][]::new); + } + + @Test(dataProvider = "errors", expectedExceptions = IOException.class) + public void errors(String respString) throws IOException { + byte[] bytes = respString.getBytes(US_ASCII); + HttpHeaderParser decoder = new HttpHeaderParser(); + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); + decoder.parse(bais); + } + + void assertHeadersEqual(Map> expected, + Map> actual, + String msg) { + + if (expected.equals(actual)) + return; + + assertEquals(expected.size(), actual.size(), + format("%s. Expected size %d, actual size %s. %nexpected= %s,%n actual=%s.", + msg, expected.size(), actual.size(), mapToString(expected), mapToString(actual))); + + for (Map.Entry> e : expected.entrySet()) { + String key = e.getKey(); + List values = e.getValue(); + + boolean found = false; + for (Map.Entry> other: actual.entrySet()) { + if (key.equalsIgnoreCase(other.getKey())) { + found = true; + List otherValues = other.getValue(); + assertEquals(values.size(), otherValues.size(), + format("%s. Expected list size %d, actual size %s", + msg, values.size(), otherValues.size())); + if (!(values.containsAll(otherValues) && otherValues.containsAll(values))) + assertTrue(false, format("Lists are unequal [%s] [%s]", values, otherValues)); + break; + } + } + assertTrue(found, format("header name, %s, not found in %s", key, actual)); + } + } + + static String mapToString(Map> map) { + StringBuilder sb = new StringBuilder(); + List sortedKeys = new ArrayList(map.keySet()); + Collections.sort(sortedKeys); + for (String key : sortedKeys) { + List values = map.get(key); + sb.append("\n\t" + key + " | " + values); + } + return sb.toString(); + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/NTLMTest.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/NTLMTest.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/NTLMTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/NTLMTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2022, 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 @@ -24,7 +24,6 @@ /* * @test * @bug 6520665 6357133 - * @modules java.base/sun.net.www * @library /test/lib * @run main/othervm NTLMTest * @summary 6520665 & 6357133: NTLM authentication issues. @@ -32,7 +31,8 @@ import java.net.*; import java.io.*; -import sun.net.www.MessageHeader; + +import jdk.test.lib.net.HttpHeaderParser; import jdk.test.lib.net.URIBuilder; public class NTLMTest @@ -160,7 +160,7 @@ OutputStream os = s.getOutputStream(); for (int i=start; i server // client <--- 401 ---- server try (Socket s = ss.accept()) { - new MessageHeader().parseHeader(s.getInputStream()); + new HttpHeaderParser().parse(s.getInputStream()); s.getOutputStream().write(reply.getBytes("US-ASCII")); } @@ -171,10 +171,10 @@ // client <--- 200 ---- server String auth; try (Socket s = ss.accept()) { - MessageHeader mh = new MessageHeader(); - mh.parseHeader(s.getInputStream()); + HttpHeaderParser mh = new HttpHeaderParser(); + mh.parse(s.getInputStream()); s.getOutputStream().write(OKAY.getBytes("US-ASCII")); - auth = mh.findValue("Authorization"); + auth = mh.getHeaderValue("Authorization").get(0); } // check Authorization header @@ -208,7 +208,7 @@ // client ---- GET ---> server // client <--- 401 ---- client try (Socket s = ss.accept()) { - new MessageHeader().parseHeader(s.getInputStream()); + new HttpHeaderParser().parse(s.getInputStream()); s.getOutputStream().write(reply.getBytes("US-ASCII")); } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/RetryUponTimeout.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/RetryUponTimeout.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/RetryUponTimeout.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/RetryUponTimeout.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2022, 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 @@ -26,13 +26,13 @@ * @bug 4772077 * @library /test/lib * @summary using defaultReadTimeout appear to retry request upon timeout - * @modules java.base/sun.net.www */ import java.net.*; import java.io.*; + +import jdk.test.lib.net.HttpHeaderParser; import jdk.test.lib.net.URIBuilder; -import sun.net.www.*; public class RetryUponTimeout implements Runnable { // run server @@ -42,7 +42,7 @@ for (int i = 0; i < 2; i++) { socket = server.accept(); InputStream is = socket.getInputStream (); - MessageHeader header = new MessageHeader (is); + HttpHeaderParser header = new HttpHeaderParser (is); count++; } } catch (Exception ex) { diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/UserAgent.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/UserAgent.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/http/UserAgent.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/http/UserAgent.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2022, 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 @@ -25,7 +25,6 @@ * @test * @bug 4512200 * @library /test/lib - * @modules java.base/sun.net.www * @run main/othervm -Dhttp.agent=foo UserAgent * @run main/othervm -Dhttp.agent=foo -Djava.net.preferIPv6Addresses=true UserAgent * @summary HTTP header "User-Agent" format incorrect @@ -34,8 +33,9 @@ import java.io.*; import java.util.*; import java.net.*; + +import jdk.test.lib.net.HttpHeaderParser; import jdk.test.lib.net.URIBuilder; -import sun.net.www.MessageHeader; class Server extends Thread { Server (ServerSocket server) { @@ -46,8 +46,8 @@ String version = System.getProperty ("java.version"); String expected = "foo Java/"+version; Socket s = server.accept (); - MessageHeader header = new MessageHeader (s.getInputStream()); - String v = header.findValue ("User-Agent"); + HttpHeaderParser header = new HttpHeaderParser (s.getInputStream()); + String v = header.getHeaderValue ("User-Agent").get(0); if (!expected.equals (v)) { error ("Got unexpected User-Agent: " + v); } else { diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/B6226610.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2022, 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 @@ -25,7 +25,7 @@ * @test * @bug 6226610 6973030 * @summary HTTP tunnel connections send user headers to proxy - * @modules java.base/sun.net.www + * @library /test/lib * @run main/othervm B6226610 */ @@ -37,7 +37,9 @@ import java.io.*; import java.net.*; -import sun.net.www.MessageHeader; + +import jdk.test.lib.net.HttpHeaderParser; + public class B6226610 { static HeaderCheckerProxyTunnelServer proxy; @@ -138,21 +140,21 @@ private void processRequests() throws IOException { InputStream in = clientSocket.getInputStream(); - MessageHeader mheader = new MessageHeader(in); - String statusLine = mheader.getValue(0); + HttpHeaderParser mheader = new HttpHeaderParser(in); + String statusLine = mheader.getRequestDetails(); if (statusLine.startsWith("CONNECT")) { // retrieve the host and port info from the status-line retrieveConnectInfo(statusLine); - if (mheader.findValue("X-TestHeader") != null) { + if (mheader.getHeaderValue("X-TestHeader") != null) { System.out.println("Proxy should not receive user defined headers for tunneled requests"); failed = true; } // 6973030 String value; - if ((value = mheader.findValue("Proxy-Connection")) == null || + if ((value = mheader.getHeaderValue("Proxy-Connection").get(0)) == null || !value.equals("keep-alive")) { System.out.println("Proxy-Connection:keep-alive not being sent"); failed = true; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java --- openjdk-17-17.0.9+9/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/TunnelProxy.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2022, 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 @@ -45,7 +45,8 @@ import java.util.Iterator; import java.util.Set; -import sun.net.www.MessageHeader; +import jdk.test.lib.net.HttpHeaderParser; + public class TunnelProxy { @@ -260,9 +261,9 @@ boolean res; try { InputStream is = new BufferedInputStream (new NioInputStream (chan)); - String requestline = readLine (is); - MessageHeader mhead = new MessageHeader (is); - String[] req = requestline.split (" "); + HttpHeaderParser mHead = new HttpHeaderParser (is); + String requestLine = mHead.getRequestDetails(); + String[] req = requestLine.split (" "); if (req.length < 2) { /* invalid request line */ return false; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java openjdk-17-17.0.10+7/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java 2024-01-09 21:18:15.000000000 +0000 @@ -28,7 +28,7 @@ * 8209452 8209506 8210432 8195793 8216577 8222089 8222133 8222137 8222136 * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 - * 8305975 8304760 8307134 8295894 8314960 + * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -47,12 +47,13 @@ + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 97; + private static final int COUNT = 106; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "88:72:92:56:FF:E5:A3:E4:39:98:6D:18:0B:BA:CC:0B:66:CB:1D:6D:52:CE:D7:C8:AD:63:B7:F1:5F:02:24:52"; + = "61:5F:6D:C5:9C:A3:8A:65:3F:CB:F9:F5:26:04:23:F4:53:A6:8C:B3:8B:2B:0A:F0:66:7D:9E:67:B9:4D:AC:B7"; + // Hex formatter to upper case with ":" delimiter private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase(); @@ -146,6 +147,8 @@ "5D:56:49:9B:E4:D2:E0:8B:CF:CA:D0:8A:3E:38:72:3D:50:50:3B:DE:70:69:48:E4:2F:55:60:30:19:E5:28:AE"); put("letsencryptisrgx1 [jdk]", "96:BC:EC:06:26:49:76:F3:74:60:77:9A:CF:28:C5:A7:CF:E8:A3:C0:AA:E1:1A:8F:FC:EE:05:C0:BD:DF:08:C6"); + put("letsencryptisrgx2 [jdk]", + "69:72:9B:8E:15:A8:6E:FC:17:7A:57:AF:B7:17:1D:FC:64:AD:D2:8C:2F:CA:8C:F1:50:7E:34:45:3C:CB:14:70"); put("luxtrustglobalrootca [jdk]", "A1:B2:DB:EB:64:E7:06:C6:16:9E:3C:41:18:B2:3B:AA:09:01:8A:84:27:66:6D:8B:F0:E2:88:91:EC:05:19:50"); put("quovadisrootca [jdk]", @@ -160,6 +163,14 @@ "18:F1:FC:7F:20:5D:F8:AD:DD:EB:7F:E0:07:DD:57:E3:AF:37:5A:9C:4D:8D:73:54:6B:F4:F1:FE:D1:E1:8D:35"); put("quovadisrootca3g3 [jdk]", "88:EF:81:DE:20:2E:B0:18:45:2E:43:F8:64:72:5C:EA:5F:BD:1F:C2:D9:D2:05:73:07:09:C5:D8:B8:69:0F:46"); + put("digicertcseccrootg5 [jdk]", + "26:C5:6A:D2:20:8D:1E:9B:15:2F:66:85:3B:F4:79:7C:BE:B7:55:2C:1F:3F:47:72:51:E8:CB:1A:E7:E7:97:BF"); + put("digicertcsrsarootg5 [jdk]", + "73:53:B6:D6:C2:D6:DA:42:47:77:3F:3F:07:D0:75:DE:CB:51:34:21:2B:EA:D0:92:8E:F1:F4:61:15:26:09:41"); + put("digicerttlseccrootg5 [jdk]", + "01:8E:13:F0:77:25:32:CF:80:9B:D1:B1:72:81:86:72:83:FC:48:C6:E1:3B:E9:C6:98:12:85:4A:49:0C:1B:05"); + put("digicerttlsrsarootg5 [jdk]", + "37:1A:00:DC:05:33:B3:72:1A:7E:EB:40:E8:41:9E:70:79:9D:2B:0A:0F:2C:1D:80:69:31:65:F7:CE:C4:AD:75"); put("secomscrootca2 [jdk]", "51:3B:2C:EC:B8:10:D4:CD:E5:DD:85:39:1A:DF:C6:C2:DD:60:D8:7B:B7:36:D2:B5:21:48:4A:A4:7A:0E:BE:F6"); put("swisssigngoldg2ca [jdk]", @@ -254,6 +265,14 @@ "34:9D:FA:40:58:C5:E2:63:12:3B:39:8A:E7:95:57:3C:4E:13:13:C8:3F:E6:8F:93:55:6C:D5:E8:03:1B:3C:7D"); put("certignarootca [jdk]", "D4:8D:3D:23:EE:DB:50:A4:59:E5:51:97:60:1C:27:77:4B:9D:7B:18:C9:4D:5A:05:95:11:A1:02:50:B9:31:68"); + put("teliarootcav2 [jdk]", + "24:2B:69:74:2F:CB:1E:5B:2A:BF:98:89:8B:94:57:21:87:54:4E:5B:4D:99:11:78:65:73:62:1F:6A:74:B8:2C"); + put("emsignrootcag1 [jdk]", + "40:F6:AF:03:46:A9:9A:A1:CD:1D:55:5A:4E:9C:CE:62:C7:F9:63:46:03:EE:40:66:15:83:3D:C8:C8:D0:03:67"); + put("emsigneccrootcag3 [jdk]", + "86:A1:EC:BA:08:9C:4A:8D:3B:BE:27:34:C6:12:BA:34:1D:81:3E:04:3C:F9:E8:A8:62:CD:5C:57:A3:6B:BE:6B"); + put("emsignrootcag2 [jdk]", + "1A:A0:C2:70:9E:83:1B:D6:E3:B5:12:9A:00:BA:41:F7:EE:EF:02:08:72:F1:E6:50:4B:F0:F6:C3:F2:4F:3A:F3"); } }; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/Provider/MultipleLogins.java 2024-01-09 21:18:15.000000000 +0000 @@ -89,10 +89,8 @@ Security.removeProvider(providers[i].getName()); providers[i] = null; - ForceGC gc = new ForceGC(); int finalI = i; - gc.await(() -> weakRef[finalI].get() == null); - if (!weakRef[i].refersTo(null)) { + if (!ForceGC.wait(() -> weakRef[finalI].refersTo(null))) { throw new RuntimeException("Expected SunPKCS11 Provider to be GC'ed.."); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/Signature/LargeDSAKey.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * 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. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.security.AlgorithmParameterGenerator; +import java.security.AlgorithmParameters; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.Signature; +import java.security.spec.DSAGenParameterSpec; +import java.security.spec.DSAParameterSpec; + +/* + * @test + * @bug 8271566 + * @library /test/lib .. + * @modules jdk.crypto.cryptoki + * @run main/othervm/timeout=30 LargeDSAKey + */ + +public final class LargeDSAKey extends PKCS11Test { + + private static final boolean enableDebug = false; + + private static final String knownText = + "Known text known text known text"; + + @Override + public void main(Provider p) throws Exception { + KeyPairGenerator kpg = KeyPairGenerator.getInstance("DSA", p); + AlgorithmParameterGenerator dsaParGen = + AlgorithmParameterGenerator.getInstance("DSA"); + DSAGenParameterSpec dsaParGenSpec = + new DSAGenParameterSpec(2048, 256); + dsaParGen.init(dsaParGenSpec, new SecureRandom()); + AlgorithmParameters params = dsaParGen.generateParameters(); + DSAParameterSpec dsaParams = + params.getParameterSpec(DSAParameterSpec.class); + kpg.initialize(dsaParams); + KeyPair kp = kpg.generateKeyPair(); + doTestSignature(kp, p); + } + + private static void doTestSignature(KeyPair kp, Provider p) + throws Exception { + byte[] knownTextSig = null; + Signature s = Signature.getInstance("SHA1withDSA", p); + PrivateKey privKey = kp.getPrivate(); + PublicKey pubKey = kp.getPublic(); + if (enableDebug) { + System.out.println("Signature algorithm: " + s.getAlgorithm()); + System.out.println("Signature Provider: " + s.getProvider()); + System.out.println("Private key for signature: " + privKey); + System.out.println("Public key for signature: " + pubKey); + } + s.initSign(privKey); + s.update(knownText.getBytes()); + knownTextSig = s.sign(); + s.initVerify(pubKey); + s.update(knownText.getBytes()); + if (s.verify(knownTextSig) == false) { + throw new Exception("Could not verify signature"); + } + if (enableDebug) { + System.out.println("Signature verified"); + } + } + + public static void main(String[] args) throws Throwable { + main(new LargeDSAKey()); + System.out.println("TEST PASS - OK"); + } + +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -37,7 +37,7 @@ * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" * ClientJSSEServerJSSE * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" - * ClientJSSEServerJSSE sm policy + * -Djava.security.manager=allow ClientJSSEServerJSSE sm policy */ import java.security.Provider; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/rsa/RSAPaddingCheck.java openjdk-17-17.0.10+7/test/jdk/sun/security/rsa/RSAPaddingCheck.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/rsa/RSAPaddingCheck.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/rsa/RSAPaddingCheck.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 8302017 + * @summary Ensure that RSAPadding class works as expected after refactoring + * @modules java.base/sun.security.rsa + */ +import java.util.Arrays; +import sun.security.rsa.RSAPadding; + +public class RSAPaddingCheck { + + private static int[] PADDING_TYPES = { + RSAPadding.PAD_BLOCKTYPE_1, + RSAPadding.PAD_BLOCKTYPE_2, + RSAPadding.PAD_NONE, + RSAPadding.PAD_OAEP_MGF1, + }; + + public static void main(String[] args) throws Exception { + int size = 2048 >> 3; + byte[] testData = "This is some random to-be-padded Data".getBytes(); + for (int type : PADDING_TYPES) { + byte[] data = (type == RSAPadding.PAD_NONE? + Arrays.copyOf(testData, size) : testData); + System.out.println("Testing PaddingType: " + type); + RSAPadding padding = RSAPadding.getInstance(type, size); + byte[] paddedData = padding.pad(data); + if (paddedData == null) { + throw new RuntimeException("Unexpected padding op failure!"); + } + + byte[] data2 = padding.unpad(paddedData); + if (data2 == null) { + throw new RuntimeException("Unexpected unpadding op failure!"); + } + if (!Arrays.equals(data, data2)) { + throw new RuntimeException("diff check failure!"); + } + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/rsa/WithoutNULL.java openjdk-17-17.0.10+7/test/jdk/sun/security/rsa/WithoutNULL.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/rsa/WithoutNULL.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/rsa/WithoutNULL.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8320597 + * @summary Verify RSA signature with omitted digest params (should be encoded as NULL) + * for backward compatibility + */ +import java.security.KeyFactory; +import java.security.Signature; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +public class WithoutNULL { + public static void main(String[] args) throws Exception { + + // A 1024-bit RSA public key + byte[] key = Base64.getMimeDecoder().decode(""" + MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrfTrEm4KvdFSpGAM7InrFEzALTKdphT9fK6Gu + eVjHtKsuCSEaULCdjhJvPpFK40ONr1JEC1Ywp1UYrfBBdKunnbDZqNZL1cFv+IzF4Yj6JO6pOeHi + 1Zpur1GaQRRlYTvzmyWY/AATQDh8JfKObNnDVwXeezFODUG8h5+XL1ZXZQIDAQAB"""); + + // A SHA1withRSA signature on an empty input where the digestAlgorithm + // inside DigestInfo does not have a parameters field. + byte[] sig = Base64.getMimeDecoder().decode(""" + D1FpiT44WEXlDfYK880bdorLO+e9qJVXZWiBgqs9dfK7lYQwyEt9dL23mbUAKm5TVEj2ZxtHkEvk + b8oaWkxk069jDTM1RhllPJZkAjeQRbw4gkg4N6wKZz9B/jdSRMNJg/b9QdRYZOHOBxsEHMbUREPV + DoCOLaxB8eIXX0EWkiE="""); + + Signature s = Signature.getInstance("SHA1withRSA", "SunRsaSign"); + s.initVerify(KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(key))); + if (!s.verify(sig)) { + throw new RuntimeException("Does not verify"); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/ALPN/AlpnGreaseTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -53,7 +53,7 @@ * (wrap/unwrap) pass before any application data is consumed or * produced. */ -public class AlpnGreaseTest implements SSLContextTemplate { +public class AlpnGreaseTest extends SSLContextTemplate { private final SSLEngine clientEngine; // client Engine private final ByteBuffer clientOut; // write side of clientEngine diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/CipherSuite/DisabledCurve.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/CipherSuite/DisabledCurve.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/CipherSuite/DisabledCurve.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/CipherSuite/DisabledCurve.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -48,21 +48,23 @@ { { "TLSv1.2" }, { "TLSv1.2" } }, { { "TLSv1.1" }, { "TLSv1.1" } }, { { "TLSv1" }, { "TLSv1" } } }; + @Override protected SSLContext createClientSSLContext() throws Exception { return createSSLContext( - new SSLSocketTemplate.Cert[] { - SSLSocketTemplate.Cert.CA_ECDSA_SECP384R1 }, - new SSLSocketTemplate.Cert[] { - SSLSocketTemplate.Cert.EE_ECDSA_SECP384R1 }, + new SSLContextTemplate.Cert[] { + SSLContextTemplate.Cert.CA_ECDSA_SECP384R1 }, + new SSLContextTemplate.Cert[] { + SSLContextTemplate.Cert.EE_ECDSA_SECP384R1 }, getClientContextParameters()); } + @Override protected SSLContext createServerSSLContext() throws Exception { return createSSLContext( - new SSLSocketTemplate.Cert[] { - SSLSocketTemplate.Cert.CA_ECDSA_SECP384R1 }, - new SSLSocketTemplate.Cert[] { - SSLSocketTemplate.Cert.EE_ECDSA_SECP384R1 }, + new SSLContextTemplate.Cert[] { + SSLContextTemplate.Cert.CA_ECDSA_SECP384R1 }, + new SSLContextTemplate.Cert[] { + SSLContextTemplate.Cert.EE_ECDSA_SECP384R1 }, getServerContextParameters()); } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/CipherSuite/RestrictSignatureScheme.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/CipherSuite/RestrictSignatureScheme.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/CipherSuite/RestrictSignatureScheme.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/CipherSuite/RestrictSignatureScheme.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -28,21 +28,12 @@ * @summary Restrict signature algorithms and named groups * @run main/othervm RestrictSignatureScheme */ -import java.io.ByteArrayInputStream; -import java.security.KeyFactory; -import java.security.KeyStore; -import java.security.PrivateKey; + import java.security.Security; -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.security.spec.PKCS8EncodedKeySpec; import java.util.Arrays; -import java.util.Base64; -import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLServerSocket; -import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.SSLException; public class RestrictSignatureScheme extends SSLSocketTemplate { @@ -58,16 +49,20 @@ private final SSLContext context; RestrictSignatureScheme() throws Exception { - this.context = createSSLContext(); + this.context = createSSLContext( + new Cert[]{Cert.EE_RSASSA_PSS}, + new Cert[]{Cert.EE_RSASSA_PSS}, + new ContextParameters("TLS", "PKIX", "NewSunX509") + ); } @Override - protected SSLContext createClientSSLContext() throws Exception { + public SSLContext createClientSSLContext() throws Exception { return context; } @Override - protected SSLContext createServerSSLContext() throws Exception { + public SSLContext createServerSSLContext() throws Exception { return context; } @@ -117,116 +112,4 @@ throw new Exception("The test case should be disabled"); } } - - - private static final String trustedCertStr = - /** - * Signature Algorithm: rsassaPss - * Issuer: CN = localhost - * Validity Not Before: Jun 6 07:11:00 2018 GMT - * Not After : Jun 1 07:11:00 2038 GMT - * Subject: CN = localhost - * Public Key Algorithm: rsassaPss - */ - "-----BEGIN CERTIFICATE-----\n" - + "MIIDZjCCAh2gAwIBAgIUHxwPs3eAgJ057nJwiLgWZWeNqdgwPgYJKoZIhvcNAQEK\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E9ACpBxxI3qChMahFZGHlXCCSjSmxpQa6UO4SQl8q5tPNnqdzWwvAW8qkCy4\n" - + "6barRQ4sMcGayhHh/uSTx7bcl0FMJpcI1ygbw7/Pc03zKtw0gMTBMns7q4yXjb/u\n" - + "ef47nW0t+LRAAg==\n" - + "-----END CERTIFICATE-----\n"; - - private static final String keyCertStr = trustedCertStr; - - private static final String privateKey = - "MIIEuwIBADALBgkqhkiG9w0BAQoEggSnMIIEowIBAAKCAQEApfK+EK4NuwWFDv9V\n" - + "WtiMfEDxszf5b85irz+RX9uqLzVuL0VMevB8wIYYlrXJfj8C0myaia3hJE5ZXuz5\n" - + "0QMqW8t3zu2QCtGN2Ih6rmgYO3fu2BYYR8L/IBtJWXMgNAZFxSR6nau+qmq9MRwu\n" - + "g1Xs15tCt5nHHsphrRUfQc1pgI/uw2LEsL7U0O1jaEJn9HHQzEjO9SMGk8CML09s\n" - + "M19b7+YXHQ8l3a+uFhalkgPbDSdiumq8WmlNZJcCkoA6JBep42n1kOFMXUeu3eVt\n" - + "TGKIoqA7NmMt7rbDKTtjlM2VQWTXU4JK9Y7CYSLq6c/+SudZcCSEUAXsxBUm/utA\n" - + "BVaDCQIDAQABAoIBAAc4vRS0vlw5LUUtz2UYr2Ro3xvRf8Vh0eGWfpkRUiKjzJu6\n" - + "BE4FUSh/rWpBlvcrfs/xcfgz3OxbjIAZB/YUkS9Vd21F4VLXM7kMl2onlYZg/b/h\n" - + "lkTpM3kONu7xl6Er9LVTlRJveuinpHwSoeONRbVMSGb9BjFM1VtW4/lVGxZBG05D\n" - + "y9i/o4vCZqULn9cAumOwicKuCyTcS58XcMJ+puSPfRA71PYLxqFkASAoJsUwCXpo\n" - + "gs39lLsIFgrfO8mBO1ux/SE+QaRc+9XqFSHHKD1XqF/9zSYBgWjE910EcpdYEdZx\n" - + "GEkwea7Fn4brO5OpIrHY/45naqbUOBzv6gufMAECgYEAz7PHCdcrQvmOb8EiNbQH\n" - + "uvSimwObWJFeN1ykp6mfRbSnkXw7p8+M4Tc8HFi8QLpoq63Ev2AwoaQCQvHbFC2Y\n" - + "1Cz0EkC0aOp+tZP7U2AUBdkcDesZAJQTad0zV6KesyIUXdxZXDG8JJ1XSNWfTJV4\n" - + "QD+BjLZ0jiAyCIfVYvWQqYkCgYEAzIln1nKTixLMPr5CldSmR7ZarEtPJU+hHwVg\n" - + "dV/Lc6d2Yy9JgunOXRo4BXB1TEo8JFbK3HBQH6tS8li4qDr7WK5wyYfh8qb4WZyu\n" - + "lc562f2WVYntcN8/Ojb+Vyrt7lk9sq/8KoVHxEAWd6mqL9VTPYuAu1Vw9fTGIZfB\n" - + "lDeELYECgYAvdzU4UXzofGGJtohb332YwwlaBZP9xJLUcg6K5l+orWVSASMc8XiP\n" - + "i3DoRXsYC8GZ4kdBOPlEJ1gA9oaLcPQpIPDSLwlLpLM6Scw4vI822uvnXl/DWxOo\n" - + "sM1n7Jj59QLUhGPDhvYpI+/rjC4wcUQe4qR3hMbUKBVnD6u7RsU9iQKBgQCQ17VK\n" - + "7bSCRfuRaxaoGADww7gOTv5rQ6qr1xjpxb7D1hFGR9Rc+smCsPB/GZZXQjK44SWj\n" - + "WX3ED4Ubzaxmpe4cbNu+O5XMSmWQwB36RFBHUwdE5/nXdqDFzu/qNqJrqZLBmVKP\n" - + "ofaiiWffsaytVvotmT6+atElvAMbAua42V+nAQKBgHtIn3mYMHLriYGhQzpkFEA2\n" - + "8YcAMlKppueOMAKVy8nLu2r3MidmLAhMiKJQKG45I3Yg0/t/25tXLiOPJlwrOebh\n" - + "xQqUBI/JUOIpGAEnr48jhOXnCS+i+z294G5U/RgjXrlR4bCPvrtCmwzWwe0h79w2\n" - + "Q2hO5ZTW6UD9CVA85whf"; - - private static SSLContext createSSLContext() throws Exception { - // Generate certificate from cert string - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - - // Create a key store - KeyStore ts = KeyStore.getInstance("PKCS12"); - KeyStore ks = KeyStore.getInstance("PKCS12"); - ts.load(null, null); - ks.load(null, null); - char passphrase[] = "passphrase".toCharArray(); - - // Import the trusted cert - ts.setCertificateEntry("trusted-cert-RSASSA-PSS", - cf.generateCertificate(new ByteArrayInputStream( - trustedCertStr.getBytes()))); - - boolean hasKeyMaterials = keyCertStr != null && privateKey != null; - if (hasKeyMaterials) { - - // Generate the private key. - PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( - Base64.getMimeDecoder().decode(privateKey)); - KeyFactory kf = KeyFactory.getInstance("RSASSA-PSS"); - PrivateKey priKey = kf.generatePrivate(priKeySpec); - - // Generate certificate chain - Certificate keyCert = cf.generateCertificate( - new ByteArrayInputStream(keyCertStr.getBytes())); - Certificate[] chain = new Certificate[]{keyCert}; - - // Import the key entry. - ks.setKeyEntry("cert-RSASSA-PSS", priKey, passphrase, chain); - } - - // Create SSL context - TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); - tmf.init(ts); - - SSLContext context = SSLContext.getInstance("TLS"); - if (hasKeyMaterials) { - KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); - kmf.init(ks, passphrase); - context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - } else { - context.init(null, tmf.getTrustManagers(), null); - } - - return context; - } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLContextImpl/MultipleChooseAlias.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLContextImpl/MultipleChooseAlias.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLContextImpl/MultipleChooseAlias.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLContextImpl/MultipleChooseAlias.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2021, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. +// + +import javax.net.ssl.KeyManager; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.KeyManagerFactorySpi; +import javax.net.ssl.ManagerFactoryParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.X509KeyManager; +import java.net.Socket; +import java.security.InvalidAlgorithmParameterException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.Principal; +import java.security.PrivateKey; +import java.security.Provider; +import java.security.Security; +import java.security.UnrecoverableKeyException; +import java.security.cert.X509Certificate; +import java.util.Arrays; + +/* + * @test + * @bug 8262186 + * @summary Callback semantics of the method X509KeyManager.chooseClientAlias(...) + * @library /javax/net/ssl/templates + * @modules java.base/sun.security.ssl:+open + * java.base/javax.net.ssl:+open + * @run main/othervm MultipleChooseAlias PKIX + * @run main/othervm MultipleChooseAlias SunX509 + */ +public class MultipleChooseAlias extends SSLSocketTemplate { + + static volatile int numOfCalls = 0; + static String kmfAlgorithm = null; + + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(true); + } + + @Override + protected ContextParameters getClientContextParameters() { + return new ContextParameters("TLS", "PKIX", "Mine"); + } + + public static void main(String[] args) throws Exception { + kmfAlgorithm = args[0]; + Security.addProvider(new MyProvider()); + try { + new MultipleChooseAlias().run(); + } catch (Exception e) { + // expected + } + if (numOfCalls != 1) { + throw new RuntimeException("Too many times " + numOfCalls); + } + } + + static class MyProvider extends Provider { + public MyProvider() { + super("Mine", "1", "many many things"); + put("KeyManagerFactory.Mine", "MultipleChooseAlias$MyKMF"); + } + } + + // This KeyManagerFactory impl returns key managers + // wrapped in MyKM + public static class MyKMF extends KeyManagerFactorySpi { + KeyManagerFactory fac; + + public MyKMF() { + try { + fac = KeyManagerFactory.getInstance(kmfAlgorithm); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + @Override + protected void engineInit(KeyStore ks, char[] password) + throws KeyStoreException, NoSuchAlgorithmException, + UnrecoverableKeyException { + fac.init(ks, password); + } + + @Override + protected void engineInit(ManagerFactoryParameters spec) + throws InvalidAlgorithmParameterException { + fac.init(spec); + } + + @Override + protected KeyManager[] engineGetKeyManagers() { + KeyManager[] result = fac.getKeyManagers(); + for (int i = 0; i < result.length; i++) { + result[i] = new MyKM((X509KeyManager)result[i]); + } + return result; + } + } + + // This KeyManager remembers how many times chooseClientAlias is called. + static class MyKM implements X509KeyManager { + + X509KeyManager km; + + MyKM(X509KeyManager km) { + this.km = km; + } + + public String[] getClientAliases(String keyType, Principal[] issuers) { + return km.getClientAliases(keyType, issuers); + } + + public String chooseClientAlias(String[] keyType, Principal[] issuers, + Socket socket) { + System.out.println("chooseClientAlias called on " + + Arrays.toString(keyType)); + numOfCalls++; + return null; // so it will try all key types and finally fails + } + + public String[] getServerAliases(String keyType, Principal[] issuers) { + return getServerAliases(keyType, issuers); + } + + public String chooseServerAlias(String keyType, Principal[] issuers, + Socket socket) { + return km.chooseServerAlias(keyType, issuers, socket); + } + + public X509Certificate[] getCertificateChain(String alias) { + return km.getCertificateChain(alias); + } + + public PrivateKey getPrivateKey(String alias) { + return km.getPrivateKey(alias); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineBadBufferArrayAccess.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineBadBufferArrayAccess.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineBadBufferArrayAccess.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineBadBufferArrayAccess.java 2024-01-09 21:18:15.000000000 +0000 @@ -30,7 +30,7 @@ * @test * @bug 7031830 * @summary bad_record_mac failure on TLSv1.2 enabled connection with SSLEngine - * @library /test/lib + * @library /test/lib /javax/net/ssl/templates * @run main/othervm SSLEngineBadBufferArrayAccess */ @@ -82,19 +82,19 @@ import javax.net.ssl.SSLEngineResult.*; import java.io.*; import java.net.*; -import java.security.*; import java.nio.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import jdk.test.lib.security.SecurityUtils; -public class SSLEngineBadBufferArrayAccess { +public class SSLEngineBadBufferArrayAccess extends SSLContextTemplate { /* * Enables logging of the SSL/TLS operations. */ - private static boolean logging = true; + private final static boolean logging = Boolean.parseBoolean( + System.getProperty("test.logging", "true")); /* * Enables the JSSE system debugging system property: @@ -105,8 +105,9 @@ * including specific handshake messages, and might be best examined * after gaining some familiarity with this application. */ - private static boolean debug = false; - private SSLContext sslc; + private final static boolean debug = Boolean.getBoolean("test.debug"); + private final String PROTOCOL; + private SSLEngine serverEngine; // server-side SSLEngine private final byte[] serverMsg = "Hi there Client, I'm a Server".getBytes(); @@ -125,20 +126,6 @@ private ByteBuffer sTOc; // "reliable" transport server->client /* - * The following is to set up the keystores/trust material. - */ - private static final String pathToStores = "../../../../javax/net/ssl/etc"; - private static final String keyStoreFile = "keystore"; - private static final String trustStoreFile = "truststore"; - private static final String passwd = "passphrase"; - private static String keyFilename = - System.getProperty("test.src", ".") + "/" + pathToStores - + "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", ".") + "/" + pathToStores - + "/" + trustStoreFile; - - /* * Is the server ready to serve? */ private static final CountDownLatch serverCondition = new CountDownLatch(1); @@ -156,7 +143,7 @@ /* * Main entry point for this test. */ - public static void main(String args[]) throws Exception { + public static void main(String[] args) throws Exception { if (debug) { System.setProperty("javax.net.debug", "all"); } @@ -165,7 +152,7 @@ SecurityUtils.removeFromDisabledTlsAlgs("TLSv1", "TLSv1.1"); String [] protocols = new String [] { - "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2" }; + "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}; for (String protocol : protocols) { /* @@ -184,32 +171,18 @@ /* * Create an initialized SSLContext to use for these tests. */ - public SSLEngineBadBufferArrayAccess(String protocol) throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - try (FileInputStream fis = new FileInputStream(keyFilename)) { - ks.load(fis, passphrase); - } - - try (FileInputStream fis = new FileInputStream(trustFilename)) { - ts.load(fis, passphrase); - } - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance(protocol); + public SSLEngineBadBufferArrayAccess(String protocol) { + PROTOCOL = protocol; + } - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + @Override + protected ContextParameters getServerContextParameters() { + return new ContextParameters(PROTOCOL, "PKIX", "NewSunX509"); + } - sslc = sslCtx; + @Override + protected ContextParameters getClientContextParameters() { + return new ContextParameters(PROTOCOL, "PKIX", "NewSunX509"); } /* @@ -232,6 +205,7 @@ private void runTest(boolean direct) throws Exception { boolean serverClose = direct; + System.out.println("Running test serverClose = " + serverClose); ServerSocket serverSocket = new ServerSocket(0); serverPort = serverSocket.getLocalPort(); @@ -244,7 +218,7 @@ Socket socket; try { serverSocket.setSoTimeout(30000); - socket = (Socket) serverSocket.accept(); + socket = serverSocket.accept(); } catch (SocketTimeoutException ste) { serverSocket.close(); @@ -327,7 +301,7 @@ byte[] outbound = new byte[8192]; while (!isEngineClosed(serverEngine)) { - int len = 0; + int len; // Inbound data log("================"); @@ -336,7 +310,14 @@ try { len = is.read(inbound); if (len == -1) { - throw new Exception("Unexpected EOF"); + logSocketStatus(socket); + if (socket.isClosed() + || socket.isOutputShutdown()) { + log("Client socket was closed or shutdown output"); + break; + } else { + throw new Exception("Unexpected EOF"); + } } cTOs.put(inbound, 0, len); } catch (SocketTimeoutException ste) { @@ -372,16 +353,13 @@ closed = true; /* - * We'll alternate initiatating the shutdown. + * We'll alternate initiating the shutdown. * When the server initiates, it will take one more * loop, but tests the orderly shutdown. */ if (serverClose) { serverEngine.closeOutbound(); } - } - - if (closed && isEngineClosed(serverEngine)) { serverIn.flip(); /* @@ -403,6 +381,7 @@ } } serverIn.compact(); + break; } } } @@ -450,7 +429,7 @@ return; } - SSLSocketFactory sslsf = sslc.getSocketFactory(); + SSLSocketFactory sslsf = createClientSSLContext().getSocketFactory(); try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket()) { try { sslSocket.connect( @@ -492,6 +471,7 @@ InputStream is = sslSocket.getInputStream(); // write(byte[]) goes in one shot. + System.out.println("writing message to server."); os.write(clientMsg); byte[] inbound = new byte[2048]; @@ -499,14 +479,16 @@ int len; while ((len = is.read(inbound, pos, 2048 - pos)) != -1) { + System.out.printf("Client read %d bytes. Waiting for %d from server.%n", len, serverMsg.length); pos += len; // Let the client do the closing. if ((pos == serverMsg.length) && !serverClose) { + System.out.println("Closing the socket"); sslSocket.close(); break; } } - + System.out.println("Read everything we're going to, I guess."); if (pos != serverMsg.length) { throw new Exception("Client: Data length error"); } @@ -527,7 +509,7 @@ * Configure the serverEngine to act as a server in the SSL/TLS * handshake. */ - serverEngine = sslc.createSSLEngine(); + serverEngine = createServerSSLContext().createSSLEngine(); serverEngine.setUseClientMode(false); serverEngine.getNeedClientAuth(); } @@ -589,6 +571,15 @@ return (engine.isOutboundDone() && engine.isInboundDone()); } + private static void logSocketStatus(Socket socket) { + log("##### " + socket + " #####"); + log("isBound: " + socket.isBound()); + log("isConnected: " + socket.isConnected()); + log("isClosed: " + socket.isClosed()); + log("isInputShutdown: " + socket.isInputShutdown()); + log("isOutputShutdown: " + socket.isOutputShutdown()); + } + /* * Logging code */ diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSessionImpl/InvalidateSession.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSessionImpl/InvalidateSession.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSessionImpl/InvalidateSession.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSessionImpl/InvalidateSession.java 2024-01-09 21:18:15.000000000 +0000 @@ -37,7 +37,7 @@ import jdk.test.lib.security.SecurityUtils; -public class InvalidateSession implements SSLContextTemplate { +public class InvalidateSession extends SSLContextTemplate { static ServerSocketFactory serverSsf = null; static SSLSocketFactory clientSsf = null; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/ClientSocketCloseHang.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/ClientSocketCloseHang.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/ClientSocketCloseHang.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/ClientSocketCloseHang.java 2024-01-09 21:18:15.000000000 +0000 @@ -34,7 +34,7 @@ import javax.net.ssl.*; import java.net.InetAddress; -public class ClientSocketCloseHang implements SSLContextTemplate { +public class ClientSocketCloseHang extends SSLContextTemplate { public static void main(String[] args) throws Exception { System.setProperty("jdk.tls.client.protocols", args[0]); diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruceForceClose.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruceForceClose.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruceForceClose.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruceForceClose.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -31,117 +31,72 @@ * @bug 8209333 * @summary Socket reset issue for TLS 1.3 socket close * @library /javax/net/ssl/templates - * @run main/othervm SSLSocketBruceForceClose + * @run main/othervm SSLSocketBruteForceClose */ import javax.net.ssl.*; import java.io.*; -import java.net.InetAddress; +import java.net.SocketException; -public class SSLSocketBruceForceClose implements SSLContextTemplate { +public class SSLSocketBruteForceClose extends SSLSocketTemplate { public static void main(String[] args) throws Exception { for (int i = 0; i<= 10; i++) { System.err.println("==================================="); System.err.println("loop " + i); System.err.println("==================================="); - new SSLSocketBruceForceClose().test(); + new SSLSocketBruteForceClose().run(); } } - private void test() throws Exception { - SSLServerSocket listenSocket = null; - SSLSocket serverSocket = null; - ClientSocket clientSocket = null; - try { - SSLServerSocketFactory serversocketfactory = - createServerSSLContext().getServerSocketFactory(); - listenSocket = - (SSLServerSocket)serversocketfactory.createServerSocket(0); - listenSocket.setNeedClientAuth(false); - listenSocket.setEnableSessionCreation(true); - listenSocket.setUseClientMode(false); - - - System.err.println("Starting client"); - clientSocket = new ClientSocket(listenSocket.getLocalPort()); - clientSocket.start(); - - System.err.println("Accepting client requests"); - serverSocket = (SSLSocket) listenSocket.accept(); - - System.err.println("Reading data from client"); - BufferedReader serverReader = new BufferedReader( - new InputStreamReader(serverSocket.getInputStream())); - String data = serverReader.readLine(); - System.err.println("Received data from client: " + data); - - System.err.println("Reading more data from client"); - data = serverReader.readLine(); - System.err.println("Received data from client: " + data); - } finally { - if (listenSocket != null) { - listenSocket.close(); - } - - if (serverSocket != null) { - serverSocket.close(); - } - } - - if (clientSocket != null && clientSocket.clientException != null) { - throw clientSocket.clientException; - } + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(false); + socket.setEnableSessionCreation(true); + socket.setUseClientMode(false); } - private class ClientSocket extends Thread{ - int serverPort = 0; - Exception clientException; + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { + System.err.println("Reading data from client"); + BufferedReader serverReader = new BufferedReader( + new InputStreamReader(socket.getInputStream())); + String data = serverReader.readLine(); + System.err.println("Received data from client: " + data); + + System.err.println("Reading more data from client"); + data = serverReader.readLine(); + System.err.println("Received data from client: " + data); + } - public ClientSocket(int serverPort) { - this.serverPort = serverPort; + @Override + protected void configureClientSocket(SSLSocket socket) { + try { + socket.setSoLinger(true, 3); + socket.setSoTimeout(1000); + } catch (SocketException exc) { + throw new RuntimeException("Could not configure client socket", exc); } + } - @Override - public void run() { - SSLSocket clientSocket = null; - String clientData = "Hi, I am client"; - try { - System.err.println( - "Connecting to server at port " + serverPort); - SSLSocketFactory sslSocketFactory = - createClientSSLContext().getSocketFactory(); - clientSocket = (SSLSocket)sslSocketFactory.createSocket( - InetAddress.getLocalHost(), serverPort); - clientSocket.setSoLinger(true, 3); - clientSocket.setSoTimeout(1000); - - - System.err.println("Sending data to server ..."); - - BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(clientSocket.getOutputStream())); - os.write(clientData, 0, clientData.length()); - os.newLine(); - os.flush(); - - System.err.println("Sending more data to server ..."); - os.write(clientData, 0, clientData.length()); - os.newLine(); - os.flush(); - } catch (Exception e) { - clientException = e; - } finally { - if (clientSocket != null) { - try{ - clientSocket.close(); - System.err.println("client socket closed"); - } catch (IOException ioe) { - clientException = ioe; - } - } - } - } + @Override + protected void runClientApplication(SSLSocket socket) throws Exception { + String clientData = "Hi, I am client"; + + System.err.println("Sending data to server ..."); + BufferedWriter os = new BufferedWriter( + new OutputStreamWriter(socket.getOutputStream())); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + System.err.println("Sending more data to server ..."); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + socket.close(); + System.err.println("client socket closed"); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruteForceClose.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruteForceClose.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruteForceClose.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketBruteForceClose.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// +// Please run in othervm mode. SunJSSE does not support dynamic system +// properties, no way to re-use system properties in samevm/agentvm mode. +// + +/* + * @test + * @bug 8209333 + * @summary Socket reset issue for TLS 1.3 socket close + * @library /javax/net/ssl/templates + * @run main/othervm SSLSocketBruteForceClose + */ + +import javax.net.ssl.*; +import java.io.*; +import java.net.SocketException; + +public class SSLSocketBruteForceClose extends SSLSocketTemplate { + + public static void main(String[] args) throws Exception { + for (int i = 0; i<= 10; i++) { + System.err.println("==================================="); + System.err.println("loop " + i); + System.err.println("==================================="); + new SSLSocketBruteForceClose().run(); + } + } + + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(false); + socket.setEnableSessionCreation(true); + socket.setUseClientMode(false); + } + + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { + System.err.println("Reading data from client"); + BufferedReader serverReader = new BufferedReader( + new InputStreamReader(socket.getInputStream())); + String data = serverReader.readLine(); + System.err.println("Received data from client: " + data); + + System.err.println("Reading more data from client"); + data = serverReader.readLine(); + System.err.println("Received data from client: " + data); + } + + @Override + protected void configureClientSocket(SSLSocket socket) { + try { + socket.setSoLinger(true, 3); + socket.setSoTimeout(1000); + } catch (SocketException exc) { + throw new RuntimeException("Could not configure client socket", exc); + } + } + + @Override + protected void runClientApplication(SSLSocket socket) throws Exception { + String clientData = "Hi, I am client"; + + System.err.println("Sending data to server ..."); + BufferedWriter os = new BufferedWriter( + new OutputStreamWriter(socket.getOutputStream())); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + System.err.println("Sending more data to server ..."); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + socket.close(); + System.err.println("client socket closed"); + } +} + diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketClose.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketClose.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketClose.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketClose.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -37,123 +37,79 @@ import javax.net.ssl.*; import java.io.*; import java.net.InetAddress; +import java.net.SocketException; -public class SSLSocketClose implements SSLContextTemplate { +public class SSLSocketClose extends SSLSocketTemplate { public static void main(String[] args) throws Exception { for (int i = 0; i<= 10; i++) { - System.err.println("==================================="); - System.err.println("loop " + i); - System.err.println("==================================="); - new SSLSocketClose().test(); + System.out.println("==================================="); + System.out.println("loop " + i); + System.out.println("==================================="); + new SSLSocketClose().run(); } } - private void test() throws Exception { - SSLServerSocket listenSocket = null; - SSLSocket serverSocket = null; - ClientSocket clientSocket = null; - try { - SSLServerSocketFactory serversocketfactory = - createServerSSLContext().getServerSocketFactory(); - listenSocket = - (SSLServerSocket)serversocketfactory.createServerSocket(0); - listenSocket.setNeedClientAuth(false); - listenSocket.setEnableSessionCreation(true); - listenSocket.setUseClientMode(false); - - - System.err.println("Starting client"); - clientSocket = new ClientSocket(listenSocket.getLocalPort()); - clientSocket.start(); - - System.err.println("Accepting client requests"); - serverSocket = (SSLSocket) listenSocket.accept(); - - System.err.println("Reading data from client"); - BufferedReader serverReader = new BufferedReader( - new InputStreamReader(serverSocket.getInputStream())); - String data = serverReader.readLine(); - System.err.println("Received data from client: " + data); - - System.err.println("Sending data to client ..."); - String serverData = "Hi, I am server"; - BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(serverSocket.getOutputStream())); - os.write(serverData, 0, serverData.length()); - os.newLine(); - os.flush(); - - System.err.println("Reading more data from client"); - data = serverReader.readLine(); - System.err.println("Received data from client: " + data); - } finally { - if (listenSocket != null) { - listenSocket.close(); - } - - if (serverSocket != null) { - serverSocket.close(); - } - } - - if (clientSocket != null && clientSocket.clientException != null) { - throw clientSocket.clientException; - } + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(false); + socket.setEnableSessionCreation(true); + socket.setUseClientMode(false); } - private class ClientSocket extends Thread{ - int serverPort = 0; - Exception clientException; + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { + System.out.println("Reading data from client"); + BufferedReader serverReader = new BufferedReader( + new InputStreamReader(socket.getInputStream())); + String data = serverReader.readLine(); + System.out.println("Received data from client: " + data); + + System.out.println("Sending data to client ..."); + String serverData = "Hi, I am server"; + BufferedWriter os = new BufferedWriter( + new OutputStreamWriter(socket.getOutputStream())); + os.write(serverData, 0, serverData.length()); + os.newLine(); + os.flush(); + + System.out.println("Reading more data from client"); + data = serverReader.readLine(); + System.out.println("Received data from client: " + data); + } - public ClientSocket(int serverPort) { - this.serverPort = serverPort; + @Override + protected void configureClientSocket(SSLSocket socket) { + try { + socket.setSoLinger(true, 3); + } catch (SocketException e) { + throw new RuntimeException("Could not configure client socket", e); } + } - @Override - public void run() { - SSLSocket clientSocket = null; - String clientData = "Hi, I am client"; - try { - System.err.println( - "Connecting to server at port " + serverPort); - SSLSocketFactory sslSocketFactory = - createClientSSLContext().getSocketFactory(); - clientSocket = (SSLSocket)sslSocketFactory.createSocket( - InetAddress.getLocalHost(), serverPort); - clientSocket.setSoLinger(true, 3); - - System.err.println("Sending data to server ..."); - - BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(clientSocket.getOutputStream())); - os.write(clientData, 0, clientData.length()); - os.newLine(); - os.flush(); - - System.err.println("Reading data from server"); - BufferedReader is = new BufferedReader( - new InputStreamReader(clientSocket.getInputStream())); - String data = is.readLine(); - System.err.println("Received Data from server: " + data); - - System.err.println("Sending more data to server ..."); - os.write(clientData, 0, clientData.length()); - os.newLine(); - os.flush(); - } catch (Exception e) { - clientException = e; - } finally { - if (clientSocket != null) { - try{ - clientSocket.close(); - System.err.println("client socket closed"); - } catch (IOException ioe) { - clientException = ioe; - } - } - } - } + @Override + protected void runClientApplication(SSLSocket socket) throws Exception { + String clientData = "Hi, I am client"; + System.out.println("Sending data to server ..."); + + BufferedWriter os = new BufferedWriter( + new OutputStreamWriter(socket.getOutputStream())); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + System.out.println("Reading data from server"); + BufferedReader is = new BufferedReader( + new InputStreamReader(socket.getInputStream())); + String data = is.readLine(); + System.out.println("Received Data from server: " + data); + + System.out.println("Sending more data to server ..."); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + socket.close(); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SocketExceptionForSocketIssues.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SocketExceptionForSocketIssues.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SSLSocketImpl/SocketExceptionForSocketIssues.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SSLSocketImpl/SocketExceptionForSocketIssues.java 2024-01-09 21:18:15.000000000 +0000 @@ -37,126 +37,84 @@ import javax.net.ssl.*; import java.io.*; import java.net.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; -public class SocketExceptionForSocketIssues implements SSLContextTemplate { +public class SocketExceptionForSocketIssues extends SSLSocketTemplate { + + private final CountDownLatch waitForClient = new CountDownLatch(1); public static void main(String[] args) throws Exception { - System.err.println("==================================="); - new SocketExceptionForSocketIssues().test(); + System.out.println("==================================="); + new SocketExceptionForSocketIssues().run(); + } + + @Override + protected void configureServerSocket(SSLServerSocket socket) { + socket.setNeedClientAuth(false); + socket.setEnableSessionCreation(true); + socket.setUseClientMode(false); } - private void test() throws Exception { - SSLServerSocket listenSocket = null; - SSLSocket serverSocket = null; - ClientSocket clientSocket = null; + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { try { - SSLServerSocketFactory serversocketfactory = - createServerSSLContext().getServerSocketFactory(); - listenSocket = - (SSLServerSocket)serversocketfactory.createServerSocket(0); - listenSocket.setNeedClientAuth(false); - listenSocket.setEnableSessionCreation(true); - listenSocket.setUseClientMode(false); - - System.err.println("Starting client"); - clientSocket = new ClientSocket(listenSocket.getLocalPort()); - clientSocket.start(); - - System.err.println("Accepting client requests"); - serverSocket = (SSLSocket)listenSocket.accept(); - - if (!clientSocket.isDone) { - System.err.println("Waiting 3 seconds for client "); - Thread.sleep(3000); + if (!waitForClient.await(5, TimeUnit.SECONDS)) { + throw new RuntimeException("Client didn't complete within 5 seconds."); } - System.err.println("Sending data to client ..."); + System.out.println("Sending data to client ..."); String serverData = "Hi, I am server"; BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(serverSocket.getOutputStream())); + new OutputStreamWriter(socket.getOutputStream())); os.write(serverData, 0, serverData.length()); os.newLine(); os.flush(); - } catch (SSLProtocolException | SSLHandshakeException sslhe) { - throw sslhe; + throw new RuntimeException("The expected SocketException was not thrown."); } catch (SocketException se) { // the expected exception, ignore it - System.err.println("server exception: " + se); - } finally { - if (listenSocket != null) { - listenSocket.close(); - } - - if (serverSocket != null) { - serverSocket.close(); - } + System.out.println("Caught expected SocketException: " + se); } + } - if (clientSocket != null && clientSocket.clientException != null) { - throw clientSocket.clientException; + @Override + protected void configureClientSocket(SSLSocket socket) { + try { + socket.setSoLinger(true, 3); + socket.setSoTimeout(100); + } catch (SocketException exc) { + throw new RuntimeException("Could not configure client socket.", exc); } } + @Override + protected void runClientApplication(SSLSocket socket) throws Exception { + try { + String clientData = "Hi, I am client"; + BufferedWriter os = new BufferedWriter( + new OutputStreamWriter(socket.getOutputStream())); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + System.out.println("Reading data from server"); + BufferedReader is = new BufferedReader( + new InputStreamReader(socket.getInputStream())); + String data = is.readLine(); + System.out.println("Received Data from server: " + data); - private class ClientSocket extends Thread{ - boolean isDone = false; - int serverPort = 0; - Exception clientException; + throw new RuntimeException("The expected client exception was not thrown."); - public ClientSocket(int serverPort) { - this.serverPort = serverPort; - } + } catch (SSLProtocolException | SSLHandshakeException sslhe) { + System.err.println("Client had unexpected SSL exception: " + sslhe); + throw sslhe; - @Override - public void run() { - SSLSocket clientSocket = null; - String clientData = "Hi, I am client"; - try { - System.err.println( - "Connecting to server at port " + serverPort); - SSLSocketFactory sslSocketFactory = - createClientSSLContext().getSocketFactory(); - clientSocket = (SSLSocket)sslSocketFactory.createSocket( - InetAddress.getLocalHost(), serverPort); - clientSocket.setSoLinger(true, 3); - clientSocket.setSoTimeout(100); - - - System.err.println("Sending data to server ..."); - - BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(clientSocket.getOutputStream())); - os.write(clientData, 0, clientData.length()); - os.newLine(); - os.flush(); - - System.err.println("Reading data from server"); - BufferedReader is = new BufferedReader( - new InputStreamReader(clientSocket.getInputStream())); - String data = is.readLine(); - System.err.println("Received Data from server: " + data); - } catch (SSLProtocolException | SSLHandshakeException sslhe) { - clientException = sslhe; - System.err.println("unexpected client exception: " + sslhe); - } catch (SSLException | SocketTimeoutException ssle) { - // the expected exception, ignore it - System.err.println("expected client exception: " + ssle); - } catch (Exception e) { - clientException = e; - System.err.println("unexpected client exception: " + e); - } finally { - if (clientSocket != null) { - try { - clientSocket.close(); - System.err.println("client socket closed"); - } catch (IOException ioe) { - clientException = ioe; - } - } + } catch (SSLException | SocketTimeoutException ssle) { + // the expected exception, ignore it + System.out.println("Caught expected client exception: " + ssle); - isDone = true; - } + } finally { + waitForClient.countDown(); } } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SignatureScheme/SigAlgosExtTestWithTLS12.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SignatureScheme/SigAlgosExtTestWithTLS12.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SignatureScheme/SigAlgosExtTestWithTLS12.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SignatureScheme/SigAlgosExtTestWithTLS12.java 2024-01-09 21:18:15.000000000 +0000 @@ -61,115 +61,7 @@ private static final boolean EXPECT_FAIL = Boolean.getBoolean("test.expectFail"); - private static final String[] CA_CERTS = new String[] { - // SHA256withECDSA, curve secp256r1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Subject Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + - "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + - "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + - "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + - "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + - "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + - "2YEHlSQUAbwwqCDEVB5KxaqP\n" + - "-----END CERTIFICATE-----", - - // SHA384withECDSA, curve secp384r1 - // Validity - // Not Before: Jun 24 08:15:06 2019 GMT - // Not After : Jun 19 08:15:06 2039 GMT - // Subject Key Identifier: - // 0a:93:a9:a0:bf:e7:d5:48:9d:4f:89:15:c6:51:98:80:05:51:4e:4e - "-----BEGIN CERTIFICATE-----\n" + - "MIICCDCCAY6gAwIBAgIUCpOpoL/n1UidT4kVxlGYgAVRTk4wCgYIKoZIzj0EAwMw\n" + - "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowOzEL\n" + - "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + - "dCBTZXJpdmNlMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAENVQN1wXWFdgC6u/dDdiC\n" + - "y+WtMTF66oL/0BSm+1ZqsogamzCryawOcHgiuXgWzx5CQ3LuOC+tDFyXpGfHuCvb\n" + - "dkzxPrP5n9NrR8/uRPe5l1KOUbchviU8z9cTP+LZxnZDo1MwUTAdBgNVHQ4EFgQU\n" + - "SktSFArR1p/5mXV0kyo0RxIVa/UwHwYDVR0jBBgwFoAUSktSFArR1p/5mXV0kyo0\n" + - "RxIVa/UwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjBZvoNmq3/v\n" + - "RD2gBTyvxjS9h0rsMRLHDnvul/KWngytwGPTOBo0Y8ixQXSjdKoc3rkCMQDkiNgx\n" + - "IDxuHedmrLQKIPnVcthTmwv7//jHiqGoKofwChMo2a1P+DQdhszmeHD/ARQ=\n" + - "-----END CERTIFICATE-----" - }; - - private static final String[] EE_CERTS = new String[] { - // SHA256withECDSA, curve secp256r1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Authority Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + - "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + - "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + - "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + - "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + - "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + - "-----END CERTIFICATE-----", - - // SHA384withECDSA, curve secp384r1 - // Validity - // Not Before: Jun 24 08:15:06 2019 GMT - // Not After : Jun 19 08:15:06 2039 GMT - // Authority Key Identifier: - // 40:2D:AA:EE:66:AA:33:27:AD:9B:5D:52:9B:60:67:6A:2B:AD:52:D2 - "-----BEGIN CERTIFICATE-----\n" + - "MIICEjCCAZegAwIBAgIUS3F0AqAXWRg07CnbknJzxofyBQMwCgYIKoZIzj0EAwMw\n" + - "OzELMAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0Ug\n" + - "VGVzdCBTZXJpdmNlMB4XDTE5MDYyNDA4MTUwNloXDTM5MDYxOTA4MTUwNlowVTEL\n" + - "MAkGA1UEBhMCVVMxDTALBgNVBAoMBEphdmExHTAbBgNVBAsMFFN1bkpTU0UgVGVz\n" + - "dCBTZXJpdmNlMRgwFgYDVQQDDA9SZWdyZXNzaW9uIFRlc3QwdjAQBgcqhkjOPQIB\n" + - "BgUrgQQAIgNiAARqElz8b6T07eyKomIinhztV3/3XBk9bKGtJ0W+JOltjuhMmP/w\n" + - "G8ASSevpgqgpi6EzpBZaaJxE3zNfkNnxXOZmQi2Ypd1uK0zRdbEOKg0XOcTTZwEj\n" + - "iLjYmt3O0pwpklijQjBAMB0GA1UdDgQWBBRALaruZqozJ62bXVKbYGdqK61S0jAf\n" + - "BgNVHSMEGDAWgBRKS1IUCtHWn/mZdXSTKjRHEhVr9TAKBggqhkjOPQQDAwNpADBm\n" + - "AjEArVDFKf48xijN6huVUJzKCOP0zlWB5Js+DItIkZmLQuhciPLhLIB/rChf3Y4C\n" + - "xuP4AjEAmfLhQRI0O3pifpYzYSVh2G7/jHNG4eO+2dvgAcU+Lh2IIj/cpLaPFSvL\n" + - "J8FXY9Nj\n" + - "-----END CERTIFICATE-----" - }; - - private static final String[] EE_KEYS = new String[] { - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + - "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + - "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6", - "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDASuI9EtK29APXPipkc\n" + - "qDA+qwlewMjv/OcjUJ77kP1Vz62oVF9iY9SRIyFIUju8wt+hZANiAARqElz8b6T0\n" + - "7eyKomIinhztV3/3XBk9bKGtJ0W+JOltjuhMmP/wG8ASSevpgqgpi6EzpBZaaJxE\n" + - "3zNfkNnxXOZmQi2Ypd1uK0zRdbEOKg0XOcTTZwEjiLjYmt3O0pwpklg=" - }; - - private static final String[] EE_ALGS = new String[] { - "EC", - "EC" - }; - - private static final String[] EE_ALIASES = new String[] { - "EC-SHA256", - "EC-SHA384" - }; - - private static final Map SIG_SCHEMES_MAP = Map.of( - 0x0403, "ecdsa_secp256r1_sha256", - 0x0503, "ecdsa_secp384r1_sha384"); - - private static final int TLS_HS_CLI_HELLO = 1; private static final int TLS_HS_CERT_REQ = 13; - private static final int HELLO_EXT_SIG_ALGS = 13; public SigAlgosExtTestWithTLS12() throws Exception { super(); @@ -178,36 +70,31 @@ /* * Create an instance of KeyManager for client use. */ - public KeyManager createClientKeyManager() throws Exception { - return SSLContextTemplate.createKeyManager( - EE_CERTS, - EE_KEYS, - EE_ALGS, - EE_ALIASES, - getServerContextParameters()); + @Override + protected KeyManager createClientKeyManager() throws Exception { + return createKeyManager( + new Cert[]{Cert.EE_ECDSA_SECP256R1, Cert.EE_ECDSA_SECP384R1}, + getClientContextParameters()); } @Override public TrustManager createClientTrustManager() throws Exception { - return SSLContextTemplate.createTrustManager( - CA_CERTS, + return createTrustManager( + new Cert[]{Cert.CA_ECDSA_SECP256R1, Cert.CA_ECDSA_SECP384R1}, getServerContextParameters()); } @Override public KeyManager createServerKeyManager() throws Exception { - return SSLContextTemplate.createKeyManager( - EE_CERTS, - EE_KEYS, - EE_ALGS, - EE_ALIASES, + return createKeyManager( + new Cert[]{Cert.EE_ECDSA_SECP256R1, Cert.EE_ECDSA_SECP384R1}, getServerContextParameters()); } @Override public TrustManager createServerTrustManager() throws Exception { - return SSLContextTemplate.createTrustManager( - CA_CERTS, + return createTrustManager( + new Cert[]{Cert.CA_ECDSA_SECP256R1, Cert.CA_ECDSA_SECP384R1}, getServerContextParameters()); } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SignatureScheme/Tls13NamedGroups.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SignatureScheme/Tls13NamedGroups.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/SignatureScheme/Tls13NamedGroups.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/SignatureScheme/Tls13NamedGroups.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -37,14 +37,7 @@ * @run main/othervm Tls13NamedGroups */ -import java.net.*; -import java.io.*; import javax.net.ssl.*; -import java.security.*; -import java.security.cert.*; -import java.security.spec.*; -import java.security.interfaces.*; -import java.util.Base64; public class Tls13NamedGroups extends SSLSocketTemplate { @@ -56,8 +49,10 @@ } @Override - protected SSLContext createServerSSLContext() throws Exception { - return generateSSLContext(); + public SSLContext createServerSSLContext() throws Exception { + return createSSLContext(new Cert[]{Cert.CA_ECDSA_SECP256R1}, + new Cert[]{Cert.EE_ECDSA_SECP256R1}, + new ContextParameters("TLSv1.3", "PKIX", "NewSunX509")); } @Override @@ -66,123 +61,9 @@ } @Override - protected SSLContext createClientSSLContext() throws Exception { - return generateSSLContext(); - } - - /* - * ============================================================= - * The remainder is just support stuff - */ - - // Certificates and key used in the test. - // - // Trusted Certificate. - static String trustedCertStr = - // SHA256withECDSA, curve prime256v1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Subject Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + - "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + - "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + - "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + - "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + - "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + - "2YEHlSQUAbwwqCDEVB5KxaqP\n" + - "-----END CERTIFICATE-----"; - // -----BEGIN PRIVATE KEY----- - // MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd - // XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd - // LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp - // -----END PRIVATE KEY----- - - // End entity certificate. - static String targetCertStr = - // SHA256withECDSA, curve prime256v1 - // Validity - // Not Before: May 22 07:18:16 2018 GMT - // Not After : May 17 07:18:16 2038 GMT - // Authority Key Identifier: - // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 - "-----BEGIN CERTIFICATE-----\n" + - "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + - "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + - "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + - "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + - "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + - "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + - "-----END CERTIFICATE-----"; - - // Private key in the format of PKCS#8. - static String targetPrivateKey = - // - // EC private key related to cert endEntityCertStrs[0]. - // - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + - "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + - "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6"; - - static char passphrase[] = "passphrase".toCharArray(); - - // Create the SSLContext instance. - private static SSLContext generateSSLContext() throws Exception { - - // generate certificate from cert string - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - - // create a key store - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(null, null); - - // import the trused cert - X509Certificate trusedCert = null; - ByteArrayInputStream is = - new ByteArrayInputStream(trustedCertStr.getBytes()); - trusedCert = (X509Certificate)cf.generateCertificate(is); - is.close(); - - ks.setCertificateEntry("Trusted EC Signer", trusedCert); - - // generate the private key. - PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( - Base64.getMimeDecoder().decode(targetPrivateKey)); - KeyFactory kf = KeyFactory.getInstance("EC"); - ECPrivateKey priKey = - (ECPrivateKey)kf.generatePrivate(priKeySpec); - - // generate certificate chain - is = new ByteArrayInputStream(targetCertStr.getBytes()); - X509Certificate keyCert = (X509Certificate)cf.generateCertificate(is); - is.close(); - - X509Certificate[] chain = new X509Certificate[2]; - chain[0] = keyCert; - chain[1] = trusedCert; - - // import the key entry and the chain - ks.setKeyEntry("TheKey", priKey, passphrase, chain); - - // create SSL context - TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); - tmf.init(ks); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); - kmf.init(ks, passphrase); - - SSLContext ctx = SSLContext.getInstance("TLSv1.3"); - ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - ks = null; - - return ctx; + public SSLContext createClientSSLContext() throws Exception { + return createSSLContext(new Cert[]{Cert.CA_ECDSA_SECP256R1}, + new Cert[]{Cert.EE_ECDSA_SECP256R1}, + new ContextParameters("TLSv1.3", "PKIX", "NewSunX509")); } } diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/X509TrustManagerImpl/TooManyCAs.java openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/TooManyCAs.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/ssl/X509TrustManagerImpl/TooManyCAs.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/ssl/X509TrustManagerImpl/TooManyCAs.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 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 @@ -32,18 +32,17 @@ import javax.net.ssl.*; import javax.security.auth.x500.X500Principal; import java.io.*; -import java.net.InetAddress; import java.net.Socket; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; -import java.util.Arrays; +import java.util.concurrent.CyclicBarrier; /** * Check if the connection can be established if the client or server trusts * more CAs such that it exceeds the size limit of the certificate_authorities * extension (2^16). */ -public class TooManyCAs implements SSLContextTemplate { +public class TooManyCAs extends SSLSocketTemplate { private static final String[][][] protocols = { {{"TLSv1.3"}, {"TLSv1.3"}}, @@ -55,44 +54,54 @@ private final String[] serverProtocols; private final boolean needClientAuth; + /* + * Used to synchronize client and server; there were intermittent + * failures on Windows due to the connection being killed. + */ + private final CyclicBarrier barrier = new CyclicBarrier(2); + TooManyCAs(int index, boolean needClientAuth) { this.clientProtocols = protocols[index][0]; this.serverProtocols = protocols[index][1]; this.needClientAuth = needClientAuth; + + System.out.printf("Testing%n\tclient protocols: %s%n\t" + + "server protocols: %s%n\tneed client auth: %s%n", + String.join(", ", clientProtocols), + String.join(", ", serverProtocols), + needClientAuth); } - // Servers are configured before clients, increment test case after. - void configureClientSocket(SSLSocket clientSocket) { - System.err.print("Setting client protocol(s): "); - Arrays.stream(clientProtocols).forEachOrdered(System.err::print); - System.err.println(); + @Override + protected void configureClientSocket(SSLSocket clientSocket) { + System.out.println("Setting client protocol(s): " + + String.join(",", clientProtocols)); clientSocket.setEnabledProtocols(clientProtocols); } - void configureServerSocket(SSLServerSocket serverSocket) { - System.err.print("Setting server protocol(s): "); - Arrays.stream(serverProtocols).forEachOrdered(System.err::print); - System.err.println(); + @Override + protected void configureServerSocket(SSLServerSocket serverSocket) { + serverSocket.setNeedClientAuth(needClientAuth); + serverSocket.setEnableSessionCreation(true); + serverSocket.setUseClientMode(false); + + System.out.println("Setting server protocol(s): " + + String.join(",", serverProtocols)); serverSocket.setEnabledProtocols(serverProtocols); - if (needClientAuth) { - serverSocket.setNeedClientAuth(true); - } } @Override - public TrustManager createClientTrustManager() throws Exception { - TrustManager trustManager = - SSLContextTemplate.super.createClientTrustManager(); + protected TrustManager createClientTrustManager() throws Exception { + TrustManager trustManager = super.createClientTrustManager(); return new BogusX509TrustManager( (X509TrustManager)trustManager); } @Override - public TrustManager createServerTrustManager() throws Exception { - TrustManager trustManager = - SSLContextTemplate.super.createServerTrustManager(); + protected TrustManager createServerTrustManager() throws Exception { + TrustManager trustManager = super.createServerTrustManager(); return new BogusX509TrustManager( (X509TrustManager)trustManager); } @@ -107,104 +116,42 @@ } } - private void run() throws Exception { - SSLServerSocket listenSocket = null; - SSLSocket serverSocket = null; - ClientSocket clientSocket = null; + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { try { - SSLServerSocketFactory serversocketfactory = - createServerSSLContext().getServerSocketFactory(); - listenSocket = - (SSLServerSocket)serversocketfactory.createServerSocket(0); - listenSocket.setNeedClientAuth(false); - listenSocket.setEnableSessionCreation(true); - listenSocket.setUseClientMode(false); - configureServerSocket(listenSocket); - - System.err.println("Starting client"); - clientSocket = new ClientSocket(listenSocket.getLocalPort()); - clientSocket.start(); - - System.err.println("Accepting client requests"); - serverSocket = (SSLSocket)listenSocket.accept(); - - if (!clientSocket.isDone) { - System.err.println("Waiting 3 seconds for client "); - Thread.sleep(3000); - } - - System.err.println("Sending data to client ..."); + System.out.println("Sending data to client ..."); String serverData = "Hi, I am server"; BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(serverSocket.getOutputStream())); + new OutputStreamWriter(socket.getOutputStream())); os.write(serverData, 0, serverData.length()); os.newLine(); os.flush(); } finally { - if (listenSocket != null) { - listenSocket.close(); - } - - if (serverSocket != null) { - serverSocket.close(); - } - } - - if (clientSocket != null && clientSocket.clientException != null) { - throw clientSocket.clientException; + barrier.await(); + System.out.println("Server done"); } } - private class ClientSocket extends Thread{ - boolean isDone = false; - int serverPort = 0; - Exception clientException; - - public ClientSocket(int serverPort) { - this.serverPort = serverPort; - } - - @Override - public void run() { - SSLSocket clientSocket = null; + @Override + protected void runClientApplication(SSLSocket socket) throws Exception { + try { String clientData = "Hi, I am client"; - try { - System.err.println( - "Connecting to server at port " + serverPort); - SSLSocketFactory sslSocketFactory = - createClientSSLContext().getSocketFactory(); - clientSocket = (SSLSocket)sslSocketFactory.createSocket( - InetAddress.getLocalHost(), serverPort); - configureClientSocket(clientSocket); - - System.err.println("Sending data to server ..."); - - BufferedWriter os = new BufferedWriter( - new OutputStreamWriter(clientSocket.getOutputStream())); - os.write(clientData, 0, clientData.length()); - os.newLine(); - os.flush(); - - System.err.println("Reading data from server"); - BufferedReader is = new BufferedReader( - new InputStreamReader(clientSocket.getInputStream())); - String data = is.readLine(); - System.err.println("Received Data from server: " + data); - } catch (Exception e) { - clientException = e; - System.err.println("unexpected client exception: " + e); - } finally { - if (clientSocket != null) { - try { - clientSocket.close(); - System.err.println("client socket closed"); - } catch (IOException ioe) { - clientException = ioe; - } - } + System.out.println("Sending data to server ..."); - isDone = true; - } + BufferedWriter os = new BufferedWriter( + new OutputStreamWriter(socket.getOutputStream())); + os.write(clientData, 0, clientData.length()); + os.newLine(); + os.flush(); + + System.out.println("Reading data from server"); + BufferedReader is = new BufferedReader( + new InputStreamReader(socket.getInputStream())); + String data = is.readLine(); + System.out.println("Received Data from server: " + data); + } finally { + barrier.await(); + System.out.println("client done."); } } @@ -273,7 +220,7 @@ for (int i = 0; i < duplicated; i++) { System.arraycopy(trustedCerts, 0, returnedCAs, - i * trustedCerts.length + 0, trustedCerts.length); + i * trustedCerts.length, trustedCerts.length); } return returnedCAs; diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/security/tools/jarsigner/Warning.java openjdk-17-17.0.10+7/test/jdk/sun/security/tools/jarsigner/Warning.java --- openjdk-17-17.0.9+9/test/jdk/sun/security/tools/jarsigner/Warning.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/security/tools/jarsigner/Warning.java 2024-01-09 21:18:15.000000000 +0000 @@ -36,7 +36,7 @@ * @summary warnings, errors and -strict * @library /lib/testlibrary /test/lib * @build jdk.test.lib.util.JarUtils - * @run main Warning + * @run main/othervm/timeout=400 Warning */ public class Warning { diff -Nru openjdk-17-17.0.9+9/test/jdk/sun/util/calendar/zi/GenDoc.java openjdk-17-17.0.10+7/test/jdk/sun/util/calendar/zi/GenDoc.java --- openjdk-17-17.0.9+9/test/jdk/sun/util/calendar/zi/GenDoc.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/sun/util/calendar/zi/GenDoc.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -154,10 +154,10 @@ outD.mkdirs(); /* If mapfile is available, add a link to the appropriate map */ - if ((mapList == null) && (Main.getMapFile() != null)) { + if (mapList == null && Main.getMapFile() != null) { + mapList = new HashMap(); FileReader fr = new FileReader(Main.getMapFile()); BufferedReader in = new BufferedReader(fr); - mapList = new HashMap(); String line; while ((line = in.readLine()) != null) { // skip blank and comment lines @@ -180,7 +180,7 @@ out.write(header1 + new Date() + header3 + zonename + header4); out.write(body1 + "" + zonename + ""); - LatitudeAndLongitude location = mapList.get(zonename); + LatitudeAndLongitude location = (mapList != null ? mapList.get(zonename) : null); if (location != null) { int deg, min, sec; diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/WindowsHelper.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/WindowsHelper.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/WindowsHelper.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/WindowsHelper.java 2024-01-09 21:18:15.000000000 +0000 @@ -92,7 +92,7 @@ BiConsumer installMsi = (cmd, install) -> { cmd.verifyIsOfType(PackageType.WIN_MSI); runMsiexecWithRetries(Executor.of("msiexec", "/qn", "/norestart", - install ? "/i" : "/x").addArgument(cmd.outputBundle())); + install ? "/i" : "/x").addArgument(cmd.outputBundle().normalize())); }; PackageHandlers msi = new PackageHandlers(); diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/share/jdk/jpackage/tests/UnicodeArgsTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -48,7 +48,19 @@ @Parameter("false") @Test public void test8246042(boolean onCommandLine) { - final String testString = new String(Character.toChars(0x00E9)); + final String testString; + + String encoding = System.getProperty("native.encoding"); + switch (encoding) { + default: + testString = new String(Character.toChars(0x00E9)); + break; + + case "MS932": + case "SJIS": + testString = new String(Character.toChars(0x3042)); + break; + } TKit.trace(String.format("Test string code points: %s", testString .codePoints() diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/Win8301247Test.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/Win8301247Test.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/Win8301247Test.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/Win8301247Test.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,164 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Stream; +import jdk.jpackage.test.JPackageCommand; +import jdk.jpackage.test.Annotations.Test; +import jdk.jpackage.test.Executor; +import jdk.jpackage.test.HelloApp; +import jdk.jpackage.test.TKit; + +/** + * Test that terminating of the parent app launcher process automatically + * terminates child app launcher process. + */ + +/* + * @test + * @summary Test case for JDK-8301247 + * @library ../helpers + * @build jdk.jpackage.test.* + * @build Win8301247Test + * @requires (os.family == "windows") + * @modules jdk.jpackage/jdk.jpackage.internal + * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * --jpt-run=Win8301247Test + */ +public class Win8301247Test { + + @Test + public void test() throws IOException, InterruptedException { + JPackageCommand cmd = JPackageCommand.helloAppImage(); + + // Launch the app in a way it doesn't exit to let us trap app laucnher + // processes in the process list + cmd.addArguments("--java-options", "-Djpackage.test.noexit=true"); + cmd.executeAndAssertImageCreated(); + + if (!cmd.canRunLauncher("Not running the test")) { + return; + } + + ExecutorService exec = null; + try { + // Launch the app in a separate thread + exec = Executors.newSingleThreadExecutor(); + exec.execute(() -> { + HelloApp.executeLauncher(cmd); + }); + + // Wait a bit to let the app start + Thread.sleep(10000); + + // Get PID of the main app launcher process + final long pid = findMainAppLauncherPID(cmd, 2).get(); + + // Kill the main app launcher process + Executor.of("taskkill", "/F", "/PID", Long.toString(pid)). + dumpOutput(true).execute(); + + // Wait a bit and check if child app launcher process is still running (it must NOT) + Thread.sleep(5000); + + findMainAppLauncherPID(cmd, 0); + } finally { + if (exec != null) { + exec.shutdown(); + } + } + } + + private static Optional findMainAppLauncherPID(JPackageCommand cmd, + int expectedCount) { + // Get the list of PIDs and PPIDs of app launcher processes. + // wmic process where (name = "foo.exe") get ProcessID,ParentProcessID + List output = Executor.of("wmic", "process", "where", "(name", + "=", + "\"" + cmd.appLauncherPath().getFileName().toString() + "\"", + ")", "get", "ProcessID,ParentProcessID").dumpOutput(true). + saveOutput().executeAndGetOutput(); + + if (output.isEmpty()) { + throw new NoSuchElementException(); + } + String first = output.get(0); + + if (expectedCount == 0) { + TKit.assertEquals("No Instance(s) Available.", first. + trim(), "Check no app launcher processes found running"); + return Optional.empty(); + } + + String[] headers = Stream.of(first.split("\\s+", 2)).map( + String::trim).map(String::toLowerCase).toArray(String[]::new); + Pattern pattern; + if (headers[0].equals("parentprocessid") && headers[1].equals( + "processid")) { + pattern = Pattern.compile("^(?\\d+)\\s+(?\\d+)\\s+$"); + } else if (headers[1].equals("parentprocessid") && headers[0].equals( + "processid")) { + pattern = Pattern.compile("^(?\\d+)\\s+(?\\d+)\\s+$"); + } else { + throw new RuntimeException( + "Unrecognizable output of \'wmic process\' command"); + } + + List processes = output.stream().skip(1).map(line -> { + Matcher m = pattern.matcher(line); + long[] pids = null; + if (m.matches()) { + pids = new long[]{Long.parseLong(m.group("pid")), Long. + parseLong(m.group("ppid"))}; + } + return pids; + }).filter(Objects::nonNull).toList(); + + TKit.assertEquals(expectedCount, processes.size(), String.format( + "Check [%d] app launcher processes found running", expectedCount)); + + switch (expectedCount) { + case 2 -> { + if (processes.get(0)[0] == processes.get(1)[1]) { + return Optional.of(processes.get(0)[0]); + } else if (processes.get(1)[0] == processes.get(0)[1]) { + return Optional.of(processes.get(1)[0]); + } else { + throw new RuntimeException( + "App launcher processes unrelated"); + } + } + default -> + throw new IllegalArgumentException(); + } + } +} diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinDirChooserTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinDirChooserTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinDirChooserTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinDirChooserTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -42,7 +42,7 @@ * @build WinDirChooserTest * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinDirChooserTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinInstallerIconTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinInstallerIconTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinInstallerIconTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinInstallerIconTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -44,7 +44,7 @@ * @build WinInstallerIconTest * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinInstallerIconTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinInstallerUiTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -45,7 +45,7 @@ * @build WinInstallerUiTest * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinInstallerUiTest */ public class WinInstallerUiTest { diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinL10nTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinL10nTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinL10nTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinL10nTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -94,8 +94,11 @@ private final static Stream getLightCommandLine( Executor.Result result) { - return result.getOutput().stream() - .filter(s -> s.trim().startsWith("light.exe")); + return result.getOutput().stream().filter(s -> { + s = s.trim(); + return s.startsWith("light.exe") || ((s.contains("\\light.exe ") + && s.contains(" -out "))); + }); } @Test diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinMenuGroupTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -45,7 +45,7 @@ * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinMenuGroupTest.java - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinMenuGroupTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinMenuTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinMenuTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinMenuTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinMenuTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -42,7 +42,7 @@ * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinMenuTest.java - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinMenuTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinPerUserInstallTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -43,7 +43,7 @@ * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinPerUserInstallTest.java - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinPerUserInstallTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinScriptTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinScriptTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinScriptTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinScriptTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -42,7 +42,7 @@ * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinScriptTest.java - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinScriptTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinShortcutPromptTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinShortcutPromptTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinShortcutPromptTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinShortcutPromptTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2022, 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 @@ -43,7 +43,7 @@ * @build WinShortcutPromptTest * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinShortcutPromptTest */ public class WinShortcutPromptTest { @@ -122,13 +122,13 @@ StringBuilder sb = new StringBuilder(cmd.name()); sb.append("With"); if (withShortcutPrompt) { - sb.append("ShortcutPrompt"); + sb.append("P"); } if (withStartMenuShortcut) { - sb.append("StartMenu"); + sb.append("M"); } if (withDesktopShortcut) { - sb.append("Desktop"); + sb.append("D"); } cmd.setArgumentValue("--name", sb.toString()); } diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinShortcutTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinShortcutTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinShortcutTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinShortcutTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -43,7 +43,7 @@ * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal * @compile WinShortcutTest.java - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=540 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinShortcutTest */ diff -Nru openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinUrlTest.java openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinUrlTest.java --- openjdk-17-17.0.9+9/test/jdk/tools/jpackage/windows/WinUrlTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jdk/tools/jpackage/windows/WinUrlTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -46,7 +46,7 @@ * @build WinUrlTest * @requires (os.family == "windows") * @modules jdk.jpackage/jdk.jpackage.internal - * @run main/othervm/timeout=360 -Xmx512m jdk.jpackage.test.Main + * @run main/othervm/timeout=720 -Xmx512m jdk.jpackage.test.Main * --jpt-run=WinUrlTest */ public class WinUrlTest { diff -Nru openjdk-17-17.0.9+9/test/jtreg-ext/requires/VMProps.java openjdk-17-17.0.10+7/test/jtreg-ext/requires/VMProps.java --- openjdk-17-17.0.9+9/test/jtreg-ext/requires/VMProps.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/jtreg-ext/requires/VMProps.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 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 @@ -27,10 +27,13 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; +import java.io.File; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; +import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -87,6 +90,7 @@ */ @Override public Map call() { + log("Entering call()"); SafeMap map = new SafeMap(); map.put("vm.flavor", this::vmFlavor); map.put("vm.compMode", this::vmCompMode); @@ -111,7 +115,7 @@ // vm.cds is true if the VM is compiled with cds support. map.put("vm.cds", this::vmCDS); map.put("vm.cds.custom.loaders", this::vmCDSForCustomLoaders); - map.put("vm.cds.archived.java.heap", this::vmCDSForArchivedJavaHeap); + map.put("vm.cds.write.archived.java.heap", this::vmCDSCanWriteArchivedJavaHeap); // vm.graal.enabled is true if Graal is used as JIT map.put("vm.graal.enabled", this::isGraalEnabled); map.put("vm.compiler1.enabled", this::isCompiler1Enabled); @@ -125,6 +129,7 @@ vmOptFinalFlags(map); dump(map.map); + log("Leaving call()"); return map.map; } @@ -386,12 +391,10 @@ } /** - * Check for CDS support for archived Java heap regions. - * - * @return true if CDS provides support for archive Java heap regions in the VM to be tested. + * @return true if this VM can write Java heap objects into the CDS archive */ - protected String vmCDSForArchivedJavaHeap() { - return "" + ("true".equals(vmCDS()) && WB.isJavaHeapArchiveSupported()); + protected String vmCDSCanWriteArchivedJavaHeap() { + return "" + ("true".equals(vmCDS()) && WB.canWriteJavaHeapArchive()); } /** @@ -434,6 +437,8 @@ * @return true if docker is supported in a given environment */ protected String dockerSupport() { + log("Entering dockerSupport()"); + boolean isSupported = false; if (Platform.isLinux()) { // currently docker testing is only supported for Linux, @@ -452,6 +457,8 @@ } } + log("dockerSupport(): platform check: isSupported = " + isSupported); + if (isSupported) { try { isSupported = checkDockerSupport(); @@ -460,15 +467,59 @@ } } + log("dockerSupport(): returning isSupported = " + isSupported); return "" + isSupported; } + // Configures process builder to redirect process stdout and stderr to a file. + // Returns file names for stdout and stderr. + private Map redirectOutputToLogFile(String msg, ProcessBuilder pb, String fileNameBase) { + Map result = new HashMap<>(); + String timeStamp = Instant.now().toString().replace(":", "-").replace(".", "-"); + + String stdoutFileName = String.format("./%s-stdout--%s.log", fileNameBase, timeStamp); + pb.redirectOutput(new File(stdoutFileName)); + log(msg + ": child process stdout redirected to " + stdoutFileName); + result.put("stdout", stdoutFileName); + + String stderrFileName = String.format("./%s-stderr--%s.log", fileNameBase, timeStamp); + pb.redirectError(new File(stderrFileName)); + log(msg + ": child process stderr redirected to " + stderrFileName); + result.put("stderr", stderrFileName); + + return result; + } + + private void printLogfileContent(Map logFileNames) { + logFileNames.entrySet().stream() + .forEach(entry -> + { + log("------------- " + entry.getKey()); + try { + Files.lines(Path.of(entry.getValue())) + .forEach(line -> log(line)); + } catch (IOException ie) { + log("Exception while reading file: " + ie); + } + log("-------------"); + }); + } + private boolean checkDockerSupport() throws IOException, InterruptedException { + log("checkDockerSupport(): entering"); ProcessBuilder pb = new ProcessBuilder(Container.ENGINE_COMMAND, "ps"); + Map logFileNames = redirectOutputToLogFile("checkDockerSupport(): ps", + pb, "container-ps"); Process p = pb.start(); p.waitFor(10, TimeUnit.SECONDS); + int exitValue = p.exitValue(); + + log(String.format("checkDockerSupport(): exitValue = %s, pid = %s", exitValue, p.pid())); + if (exitValue != 0) { + printLogfileContent(logFileNames); + } - return (p.exitValue() == 0); + return (exitValue == 0); } /** @@ -583,6 +634,40 @@ } } + /** + * Log diagnostic message. + * + * @param msg + */ + protected static void log(String msg) { + // Always log to a file. + logToFile(msg); + + // Also log to stderr; guarded by property to avoid excessive verbosity. + // By jtreg design stderr produced here will be visible + // in the output of a parent process. Note: stdout should not be used + // for logging as jtreg parses that output directly and only echoes it + // in the event of a failure. + if (Boolean.getBoolean("jtreg.log.vmprops")) { + System.err.println("VMProps: " + msg); + } + } + + /** + * Log diagnostic message to a file. + * + * @param msg + */ + protected static void logToFile(String msg) { + String fileName = "./vmprops.log"; + try { + Files.writeString(Paths.get(fileName), msg + "\n", Charset.forName("ISO-8859-1"), + StandardOpenOption.APPEND, StandardOpenOption.CREATE); + } catch (IOException e) { + throw new RuntimeException("Failed to log into '" + fileName + "'", e); + } + } + /** * This method is for the testing purpose only. * diff -Nru openjdk-17-17.0.9+9/test/langtools/TEST.ROOT openjdk-17-17.0.10+7/test/langtools/TEST.ROOT --- openjdk-17-17.0.9+9/test/langtools/TEST.ROOT 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/TEST.ROOT 2024-01-09 21:18:15.000000000 +0000 @@ -15,7 +15,7 @@ groups=TEST.groups # Minimum jtreg version -requiredVersion=6+1 +requiredVersion=7.3.1+1 # Use new module options useNewOptions=true diff -Nru openjdk-17-17.0.9+9/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java --- openjdk-17-17.0.9+9/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/doclet/testLinkOption/TestRedirectLinks.java 2024-01-09 21:18:15.000000000 +0000 @@ -26,11 +26,14 @@ * @bug 8190312 * @summary test redirected URLs for -link * @library /tools/lib ../../lib + * @library /test/lib * @modules jdk.compiler/com.sun.tools.javac.api * jdk.compiler/com.sun.tools.javac.main * jdk.javadoc/jdk.javadoc.internal.api * jdk.javadoc/jdk.javadoc.internal.tool * @build toolbox.ToolBox toolbox.JavacTask javadoc.tester.* + * @build jtreg.SkippedException + * @build jdk.test.lib.Platform * @run main TestRedirectLinks */ @@ -66,12 +69,18 @@ import toolbox.JavacTask; import toolbox.ToolBox; +import jdk.test.lib.Platform; +import jtreg.SkippedException; + public class TestRedirectLinks extends JavadocTester { /** * The entry point of the test. * @param args the array of command line arguments. */ public static void main(String... args) throws Exception { + if (Platform.isSlowDebugBuild()) { + throw new SkippedException("Test is unstable with slowdebug bits"); + } TestRedirectLinks tester = new TestRedirectLinks(); tester.runTests(); } diff -Nru openjdk-17-17.0.9+9/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java --- openjdk-17-17.0.9+9/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/jdk/javadoc/doclet/testTypeAnnotations/TestTypeAnnotations.java 2024-01-09 21:18:15.000000000 +0000 @@ -136,7 +136,6 @@ ="FldB.html" title="annotation interface in typeannos">@FldB [][]&nbs\ p;array2SecondOld""", - // When JDK-8068737, we should change the order """
@FldD java.lang.String @MRtnA java.lang.Strin\ g method()
""", - // When JDK-8068737 is fixed, we should change the order """
@MRtnA java.lang.String @ParamB java.lang.String> a)""", - // When JDK-8068737 is fixed, we should change the order """
void array2Deep((); + toolDocletOnly.addAll(toolOptions); + toolDocletOnly.addAll(docletOptions); + toolDocletOnly.removeAll(manPageOptions); + toolDocletOnly.removeAll(MISSING_IN_MAN_PAGE); + if (!toolDocletOnly.isEmpty()) { + error("The following options are defined by the tool or doclet, but not defined in the man page:\n" + + toSimpleList(toolDocletOnly)); + } + + var manPageOnly = new TreeSet(); + manPageOnly.addAll(manPageOptions); + manPageOnly.removeAll(toolOptions); + manPageOnly.removeAll(docletOptions); + if (!manPageOnly.isEmpty()) { + error("The following options are defined in the man page, but not defined by the tool or doclet:\n" + + toSimpleList(manPageOnly)); + } + + if (!MISSING_IN_MAN_PAGE.isEmpty()) { + var notMissing = new TreeSet<>(MISSING_IN_MAN_PAGE); + notMissing.retainAll(manPageOptions); + if (!notMissing.isEmpty()) { + error("The following options were declared as missing, but were found on the man page:\n" + + toSimpleList(notMissing)); + } + + out.println("NOTE: the following options are currently excluded and need to be documented in the man page:"); + out.println(toSimpleList(MISSING_IN_MAN_PAGE)); + } + + if (errors > 0) { + out.println(errors + " errors found"); + throw new Exception(errors + " errors found"); + } + } + + int errors = 0; + void error(String message) { + ("Error: " + message).lines().forEach(out::println); + errors++; + } + + String toSimpleList(Collection items) { + return items.stream().collect(Collectors.joining(", ", " ", "")); + } + + Path findDefaultFile() { + return findRootDir().resolve("src/jdk.javadoc/share/man/javadoc.1"); + } + + Path findRootDir() { + Path dir = Path.of(System.getProperty("test.src", ".")).toAbsolutePath(); + while (dir != null) { + if (Files.exists(dir.resolve("src"))) { + return dir; + } else { + Path openDir = dir.resolve("open"); + if (Files.exists(openDir.resolve("src"))) { + return openDir; + } + } + dir = dir.getParent(); + } + throw new IllegalStateException("cannot find root dir"); + } + + List getToolOptions() throws Error { + try { + Class toolOptionsClass = ToolOptions.class; + + Constructor constr = toolOptionsClass.getDeclaredConstructor(); + constr.setAccessible(true); + + Method getSupportedOptions = toolOptionsClass.getMethod("getSupportedOptions"); + Class toolOptionClass = List.of(toolOptionsClass.getDeclaredClasses()).stream() + .filter(c -> c.getSimpleName().equals("ToolOption")) + .findFirst() + .orElseThrow(); + + Field kindField = toolOptionClass.getDeclaredField("kind"); + kindField.setAccessible(true); + Method getNames = toolOptionClass.getDeclaredMethod("getNames"); + getNames.setAccessible(true); + + ToolOptions t = constr.newInstance(); + var list = new ArrayList(); + var options = (List) getSupportedOptions.invoke(t); + for (var option : options) { + Object kind = kindField.get(option); + if (kind.toString().equals("HIDDEN")) { + continue; + } + + @SuppressWarnings("unchecked") + var oNames = (List) getNames.invoke(option); + oNames.stream() + .filter(o -> !o.equals("@")) + .forEach(list::add); + } + return list; + } catch (ReflectiveOperationException e) { + throw new Error(e); + } + } + + List getDocletOptions() { + StandardDoclet d = new StandardDoclet(); + d.init(Locale.getDefault(), null); + return getDocletOptions(d); + } + + List getDocletOptions(Doclet d) { + return d.getSupportedOptions().stream() + .filter(o -> o.getKind() != Doclet.Option.Kind.OTHER) + .flatMap(o -> o.getNames().stream()) + .map(n -> n.replaceAll(":$", "")) + .toList(); + } + + List getManPageOptions(Path file) throws IOException { + String page = Files.readString(file); + String name = file.getFileName().toString(); + String extn = name.substring(name.lastIndexOf('.')); + return switch (extn) { + case ".1" -> parseNRoff(page); + case ".md" -> parseMarkdown(page); + default -> throw new IllegalArgumentException(file.toString()); + }; + } + + List parseNRoff(String page) { + var list = new ArrayList(); + + // In the troff man page, options are defined in one of two forms: + // 1. options delegated to javac appear in pairs of lines of the form + // .IP \[bu] 2 + // \f[CB]\-.... + // 2. options implemented by the tool or doclet appear in lines of the form + // .B \f[CB]\-... + + Pattern p1 = Pattern.compile("\\R" + Pattern.quote(".IP \\[bu] 2") + "\\R" + Pattern.quote("\\f[CB]\\-") + ".*"); + Pattern p2 = Pattern.compile("\\R" + Pattern.quote(".B \\f[CB]\\-") + ".*"); + Pattern outer = Pattern.compile("(" + p1.pattern() + "|" + p2.pattern() + ")"); + Matcher outerMatcher = outer.matcher(page); + + // In the defining areas, option names are represented as follows: + // \f[CB]OPTION\f[R] or \f[CB]OPTION: + // where OPTION is the shortest string not containing whitespace or colon, + // and in which all '-' characters are escaped with a single backslash. + + Pattern inner = Pattern.compile("\\s\\\\f\\[CB](\\\\-[^ :]+?)(:|\\\\f\\[R])"); + + while (outerMatcher.find()) { + String lines = outerMatcher.group(); + out.println("found:" + lines + "\n"); + + Matcher innerMatcher = inner.matcher(lines); + while (innerMatcher.find()) { + String option = innerMatcher.group(1).replace("\\-", "-"); + list.add(option); + } + } + + return list; + } + + List parseMarkdown(String page) { + var list = new ArrayList(); + // In the Markdown man page, options are defined in one of two forms: + // 1. options delegated to javac appear in lines of the form + // - `-... + // 2. options implemented by the tool or doclet appear in lines of the form + // `-...` + + Pattern p1 = Pattern.compile("\\R- `-.*"); + Pattern p2 = Pattern.compile("\\R`-.*"); + Pattern outer = Pattern.compile("(" + p1.pattern() + "|" + p2.pattern() + ")"); + Matcher outerMatcher = outer.matcher(page); + + // In the defining areas, option names are represented as follows: + // `OPTION` + // where OPTION is the shortest string not containing whitespace or colon + Pattern inner = Pattern.compile("\\s`([^:`]+)"); + + while (outerMatcher.find()) { + String lines = outerMatcher.group(); + out.println("found:" + lines + "\n"); + + Matcher innerMatcher = inner.matcher(lines); + while (innerMatcher.find()) { + String option = innerMatcher.group(1); + list.add(option); + } + } + + return list; + } + } diff -Nru openjdk-17-17.0.9+9/test/langtools/jdk/jshell/HangingRemoteAgent.java openjdk-17-17.0.10+7/test/langtools/jdk/jshell/HangingRemoteAgent.java --- openjdk-17-17.0.9+9/test/langtools/jdk/jshell/HangingRemoteAgent.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/jdk/jshell/HangingRemoteAgent.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2022, 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 @@ -30,12 +30,15 @@ import jdk.jshell.spi.ExecutionControlProvider; /** - * Hang for three minutes (long enough to cause a timeout). + * HangingRemoteAgent main() runs in its loop for 2X the timeout + * we give the launcher to fail to attach. */ class HangingRemoteAgent extends RemoteExecutionControl { - private static final long DELAY = 4000L; - private static final int TIMEOUT = 2000; + private static float timeoutFactor = Float.parseFloat(System.getProperty("test.timeout.factor", "1.0")); + + private static final int TIMEOUT = (int)(2000 * timeoutFactor); + private static final long DELAY = TIMEOUT * 2L; private static final boolean INFRA_VERIFY = false; public static void main(String[] args) throws Exception { diff -Nru openjdk-17-17.0.9+9/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java openjdk-17-17.0.10+7/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java --- openjdk-17-17.0.9+9/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/jdk/jshell/JdiHangingLaunchExecutionControlTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2022, 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 @@ -23,7 +23,7 @@ /* * @test - * @bug 8169519 + * @bug 8169519 8207166 * @summary Tests for JDI connector timeout failure * @modules jdk.jshell/jdk.jshell jdk.jshell/jdk.jshell.spi jdk.jshell/jdk.jshell.execution * @build HangingRemoteAgent diff -Nru openjdk-17-17.0.9+9/test/langtools/tools/javac/ConditionalExpressionResolvePending.java openjdk-17-17.0.10+7/test/langtools/tools/javac/ConditionalExpressionResolvePending.java --- openjdk-17-17.0.9+9/test/langtools/tools/javac/ConditionalExpressionResolvePending.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/tools/javac/ConditionalExpressionResolvePending.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2022, 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 @@ -35,7 +35,7 @@ * @build toolbox.ToolBox toolbox.JavacTask * @build combo.ComboTestHelper * @compile ConditionalExpressionResolvePending.java - * @run main/othervm --enable-preview ConditionalExpressionResolvePending + * @run main/othervm ConditionalExpressionResolvePending */ import combo.ComboInstance; diff -Nru openjdk-17-17.0.9+9/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java openjdk-17-17.0.10+7/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java --- openjdk-17-17.0.9+9/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/tools/javac/inference_context_min/DontMinimizeInfContextTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8232933 + * @summary Javac inferred type does not conform to equality constraint + * @compile DontMinimizeInfContextTest.java + */ + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +class DontMinimizeInfContextTest { + void m() { + List> a = new LinkedList<>(); + Map>> b = a.stream().collect( + Collectors.groupingBy(A::getval, Collectors.toList()) + ); + } + + class A { + String getval() { + return "s"; + } + } +} diff -Nru openjdk-17-17.0.9+9/test/langtools/tools/javac/lib/DPrinter.java openjdk-17-17.0.10+7/test/langtools/tools/javac/lib/DPrinter.java --- openjdk-17-17.0.9+9/test/langtools/tools/javac/lib/DPrinter.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/tools/javac/lib/DPrinter.java 2024-01-09 21:18:15.000000000 +0000 @@ -601,6 +601,7 @@ protected Object getField(Object o, Class clazz, String name) { try { Field f = clazz.getDeclaredField(name); + @SuppressWarnings("deprecation") boolean prev = f.isAccessible(); f.setAccessible(true); try { @@ -618,6 +619,7 @@ protected Object callMethod(Object o, Class clazz, String name) { try { Method m = clazz.getDeclaredMethod(name); + @SuppressWarnings("deprecation") boolean prev = m.isAccessible(); m.setAccessible(true); try { diff -Nru openjdk-17-17.0.9+9/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.java openjdk-17-17.0.10+7/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.java --- openjdk-17-17.0.9+9/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,13 @@ +/* + * @test /nodynamiccopyright/ + * @bug 8291154 + * @summary Disallow static nested subclasses of non-static nested classes + * @compile/fail/ref=StaticNestedNonStaticSuper.out -XDrawDiagnostics StaticNestedNonStaticSuper.java + */ + +class StaticNestedNonStaticSuper{ + public abstract class NonStaticNested { + public static class StaticNested extends NonStaticNested { + } + } +} diff -Nru openjdk-17-17.0.9+9/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.out openjdk-17-17.0.10+7/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.out --- openjdk-17-17.0.9+9/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.out 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/langtools/tools/javac/nested/StaticNestedNonStaticSuper.out 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,2 @@ +StaticNestedNonStaticSuper.java:10:23: compiler.err.no.encl.instance.of.type.in.scope: StaticNestedNonStaticSuper +1 error diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/Platform.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/Platform.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/Platform.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/Platform.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2022, 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 @@ -261,13 +261,13 @@ } /** - * Return true if the test JDK is signed, otherwise false. Only valid on OSX. + * Return true if the test JDK is hardened, otherwise false. Only valid on OSX. */ - public static boolean isSignedOSX() throws IOException { - // We only care about signed binaries for 10.14 and later (actually 10.14.5, but + public static boolean isHardenedOSX() throws IOException { + // We only care about hardened binaries for 10.14 and later (actually 10.14.5, but // for simplicity we'll also include earlier 10.14 versions). if (getOsVersionMajor() == 10 && getOsVersionMinor() < 14) { - return false; // assume not signed + return false; // assume not hardened } // Find the path to the java binary. @@ -279,38 +279,45 @@ } // Run codesign on the java binary. - ProcessBuilder pb = new ProcessBuilder("codesign", "-d", "-v", javaFileName); - pb.redirectError(ProcessBuilder.Redirect.DISCARD); - pb.redirectOutput(ProcessBuilder.Redirect.DISCARD); + ProcessBuilder pb = new ProcessBuilder("codesign", "--display", "--verbose", javaFileName); + pb.redirectErrorStream(true); // redirect stderr to stdout Process codesignProcess = pb.start(); + BufferedReader is = new BufferedReader(new InputStreamReader(codesignProcess.getInputStream())); + String line; + boolean isHardened = false; + boolean hardenedStatusConfirmed = false; // set true when we confirm whether or not hardened + while ((line = is.readLine()) != null) { + System.out.println("STDOUT: " + line); + if (line.indexOf("flags=0x10000(runtime)") != -1 ) { + hardenedStatusConfirmed = true; + isHardened = true; + System.out.println("Target JDK is hardened. Some tests may be skipped."); + } else if (line.indexOf("flags=0x20002(adhoc,linker-signed)") != -1 ) { + hardenedStatusConfirmed = true; + isHardened = false; + System.out.println("Target JDK is adhoc signed, but not hardened."); + } else if (line.indexOf("code object is not signed at all") != -1) { + hardenedStatusConfirmed = true; + isHardened = false; + System.out.println("Target JDK is not signed, therefore not hardened."); + } + } + if (!hardenedStatusConfirmed) { + System.out.println("Could not confirm if TargetJDK is hardened. Assuming not hardened."); + isHardened = false; + } + try { if (codesignProcess.waitFor(10, TimeUnit.SECONDS) == false) { - System.err.println("Timed out waiting for the codesign process to complete. Assuming not signed."); + System.err.println("Timed out waiting for the codesign process to complete. Assuming not hardened."); codesignProcess.destroyForcibly(); - return false; // assume not signed + return false; // assume not hardened } } catch (InterruptedException e) { throw new RuntimeException(e); } - // Check codesign result to see if java binary is signed. Here are the - // exit code meanings: - // 0: signed - // 1: not signed - // 2: invalid arguments - // 3: only has meaning with the -R argument. - // So we should always get 0 or 1 as an exit value. - if (codesignProcess.exitValue() == 0) { - System.out.println("Target JDK is signed. Some tests may be skipped."); - return true; // signed - } else if (codesignProcess.exitValue() == 1) { - System.out.println("Target JDK is not signed."); - return false; // not signed - } else { - System.err.println("Executing codesign failed. Assuming unsigned: " + - codesignProcess.exitValue()); - return false; // not signed - } + return isHardened; } private static boolean isArch(String archnameRE) { diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/SA/SATestUtils.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/SA/SATestUtils.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/SA/SATestUtils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/SA/SATestUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2022, 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 @@ -63,8 +63,8 @@ throw new SkippedException("SA Attach not expected to work. Ptrace attach not supported."); } } else if (Platform.isOSX()) { - if (Platform.isSignedOSX()) { - throw new SkippedException("SA Attach not expected to work. JDK is signed."); + if (Platform.isHardenedOSX()) { + throw new SkippedException("SA Attach not expected to work. JDK is hardened."); } if (!Platform.isRoot() && !canAddPrivileges()) { throw new SkippedException("SA Attach not expected to work. Insufficient privileges (not root and can't use sudo)."); diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/SecurityTools.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/SecurityTools.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/SecurityTools.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/SecurityTools.java 2024-01-09 21:18:15.000000000 +0000 @@ -224,6 +224,18 @@ } /** + * Runs kinit. + * + * @param args arguments to kinit in a single string. The string is + * converted to be List with makeList. + * @return an {@link OutputAnalyzer} object + * @throws Exception if there is an error + */ + public static OutputAnalyzer kinit(String args) throws Exception { + return execute(getProcessBuilder("kinit", makeList(args))); + } + + /** * Runs jar. * * @param args arguments to jar in a single string. The string is diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/cds/CDSTestUtils.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/cds/CDSTestUtils.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -399,6 +399,12 @@ .addPrefix(cliPrefix) ); } + // Enable basic verification (VerifyArchivedFields=1, no side effects) for all CDS + // tests to make sure the archived heap objects are mapped/loaded properly. + public static void addVerifyArchivedFields(ArrayList cmd) { + cmd.add("-XX:+UnlockDiagnosticVMOptions"); + cmd.add("-XX:VerifyArchivedFields=1"); + } // Execute JVM with CDS archive, specify CDSOptions public static OutputAnalyzer runWithArchive(CDSOptions opts) @@ -416,6 +422,7 @@ opts.archiveName = getDefaultArchiveName(); cmd.add("-XX:SharedArchiveFile=" + opts.archiveName); } + addVerifyArchivedFields(cmd); if (opts.useVersion) cmd.add("-version"); @@ -587,8 +594,12 @@ // ============================= Logging public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception { + return executeAndLog(pb.start(), logName); + } + + public static OutputAnalyzer executeAndLog(Process process, String logName) throws Exception { long started = System.currentTimeMillis(); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); + OutputAnalyzer output = new OutputAnalyzer(process); String logFileNameStem = String.format("%04d", getNextLogCounter()) + "-" + logName; diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/compiler/InMemoryJavaCompiler.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -32,10 +32,11 @@ import java.util.Arrays; import java.util.List; -import javax.tools.ForwardingJavaFileManager; import javax.tools.FileObject; +import javax.tools.ForwardingJavaFileManager; import javax.tools.JavaCompiler; import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileManager; import javax.tools.JavaFileObject; import javax.tools.JavaFileObject.Kind; import javax.tools.SimpleJavaFileObject; @@ -167,25 +168,12 @@ * @param className The name of the class * @param sourceCode The source code for the class with name {@code className} * @param options additional command line options - * @throws RuntimeException if the compilation did not succeed + * @throws RuntimeException if the compilation did not succeed or if closing + * the {@code JavaFileManager} used for the compilation did not succeed * @return The resulting byte code from the compilation */ public static byte[] compile(String className, CharSequence sourceCode, String... options) { MemoryJavaFileObject file = new MemoryJavaFileObject(className, sourceCode); - CompilationTask task = getCompilationTask(file, options); - - if(!task.call()) { - throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode); - } - - return file.getByteCode(); - } - - private static JavaCompiler getCompiler() { - return ToolProvider.getSystemJavaCompiler(); - } - - private static CompilationTask getCompilationTask(MemoryJavaFileObject file, String... options) { List opts = new ArrayList<>(); String moduleOverride = null; for (String opt : options) { @@ -195,6 +183,19 @@ opts.add(opt); } } - return getCompiler().getTask(null, new FileManagerWrapper(file, moduleOverride), null, opts, null, Arrays.asList(file)); + try (JavaFileManager fileManager = new FileManagerWrapper(file, moduleOverride)) { + CompilationTask task = getCompiler().getTask(null, fileManager, null, opts, null, Arrays.asList(file)); + if (!task.call()) { + throw new RuntimeException("Could not compile " + className + " with source code " + sourceCode); + } + + return file.getByteCode(); + } catch (IOException ioe) { + throw new RuntimeException(ioe); + } + } + + private static JavaCompiler getCompiler() { + return ToolProvider.getSystemJavaCompiler(); } } diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/hexdump/ASN1Formatter.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hexdump/ASN1Formatter.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/hexdump/ASN1Formatter.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hexdump/ASN1Formatter.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 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 @@ -303,7 +303,7 @@ case TAG_BitString: out.append(String.format("%s [%d]", tagName(tag), len)); do { - var skipped = in.skip(len); + var skipped = (int) in.skip(len); len -= skipped; available -= skipped; } while (len > 0); diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/hprof/model/JavaObject.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hprof/model/JavaObject.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/hprof/model/JavaObject.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hprof/model/JavaObject.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -192,7 +192,7 @@ if (getClazz().isString()) { JavaThing value = getField("value"); if (value instanceof JavaValueArray) { - return ((JavaValueArray)value).valueString(); + return ((JavaValueArray)value).valueAsString(); } else { return "null"; } diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/hprof/model/JavaValueArray.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -68,17 +68,17 @@ private static int elementSize(byte type) { switch (type) { - case T_BYTE: - case T_BOOLEAN: + case 'B': + case 'Z': return 1; - case T_CHAR: - case T_SHORT: + case 'C': + case 'S': return 2; - case T_INT: - case T_FLOAT: + case 'I': + case 'F': return 4; - case T_LONG: - case T_DOUBLE: + case 'J': + case 'D': return 8; default: throw new RuntimeException("invalid array element type: " + type); @@ -351,4 +351,18 @@ } return result.toString(); } + + // Tries to represent the value as string (used by JavaObject.toString). + public String valueAsString() { + if (getElementType() == 'B') { + JavaThing[] things = getValue(); + byte[] bytes = new byte[things.length]; + for (int i = 0; i < things.length; i++) { + bytes[i] = ((JavaByte)things[i]).value; + } + return new String(bytes); + } + // fallback + return valueString(); + } } diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/jfr/StreamingUtils.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/jfr/StreamingUtils.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/jfr/StreamingUtils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/jfr/StreamingUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2021, 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 @@ -51,8 +51,8 @@ try { VirtualMachine vm = VirtualMachine.attach(String.valueOf(process.pid())); String repo = vm.getSystemProperties().getProperty("jdk.jfr.repository"); + vm.detach(); if (repo != null) { - vm.detach(); System.out.println("JFR repository: " + repo); return Paths.get(repo); } diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/net/HttpHeaderParser.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/net/HttpHeaderParser.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/net/HttpHeaderParser.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/net/HttpHeaderParser.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,390 @@ +/* + * Copyright (c) 2022, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.test.lib.net; + +import java.io.IOException; +import java.io.InputStream; +import java.net.ProtocolException; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import static java.util.Objects.requireNonNull; + +public final class HttpHeaderParser { + private static final char CR = '\r'; + private static final char LF = '\n'; + private static final char HT = '\t'; + private static final char SP = ' '; + // ABNF primitives defined in RFC 7230 + private static boolean[] tchar = new boolean[256]; + private static boolean[] fieldvchar = new boolean[256]; + + static { + char[] allowedTokenChars = + ("!#$%&'*+-.^_`|~0123456789" + + "abcdefghijklmnopqrstuvwxyz" + + "ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray(); + for (char c : allowedTokenChars) { + tchar[c] = true; + } + for (char c = 0x21; c <= 0xFF; c++) { + fieldvchar[c] = true; + } + fieldvchar[0x7F] = false; // a little hole (DEL) in the range + } + + private StringBuilder sb = new StringBuilder(); + + private Map > headerMap = new LinkedHashMap<>(); + private List keyList = new ArrayList<>(); + private String requestOrStatusLine; + private int responseCode; + private boolean eof; + + + + enum State { INITIAL, + STATUS_OR_REQUEST_LINE, + STATUS_OR_REQUEST_LINE_FOUND_CR, + STATUS_OR_REQUEST_LINE_FOUND_LF, + STATUS_OR_REQUEST_LINE_END, + STATUS_OR_REQUEST_LINE_END_CR, + STATUS_OR_REQUEST_LINE_END_LF, + HEADER, + HEADER_FOUND_CR, + HEADER_FOUND_LF, + HEADER_FOUND_CR_LF, + HEADER_FOUND_CR_LF_CR, + FINISHED } + + private HttpHeaderParser.State state = HttpHeaderParser.State.INITIAL; + + public HttpHeaderParser() { + } + + + public HttpHeaderParser(InputStream is) throws IOException, ProtocolException { + parse(is); + } + + public Map> getHeaderMap() { + return headerMap; + } + + public List getHeaderValue(String key) { + if(headerMap.containsKey(key.toLowerCase(Locale.ROOT))) { + return headerMap.get(key.toLowerCase(Locale.ROOT)); + } + return null; + } + public List getValue(int id) { + String key = keyList.get(id); + return headerMap.get(key); + } + + public String getRequestDetails() { + return requestOrStatusLine; + } + + /** + * Parses HTTP/1.X status-line or request-line and headers from the given input stream. + * @param input Containing the input stream of bytes representing request or response header data + * @return true if the end of the headers block has been reached + */ + public boolean parse(InputStream input) throws IOException { + requireNonNull(input, "null input"); + while (canContinueParsing()) { + switch (state) { + case INITIAL -> state = HttpHeaderParser.State.STATUS_OR_REQUEST_LINE; + case STATUS_OR_REQUEST_LINE -> readResumeStatusLine(input); + case STATUS_OR_REQUEST_LINE_FOUND_CR, STATUS_OR_REQUEST_LINE_FOUND_LF -> readStatusLineFeed(input); + case STATUS_OR_REQUEST_LINE_END -> maybeStartHeaders(input); + case STATUS_OR_REQUEST_LINE_END_CR, STATUS_OR_REQUEST_LINE_END_LF -> maybeEndHeaders(input); + case HEADER -> readResumeHeader(input); + case HEADER_FOUND_CR, HEADER_FOUND_LF -> resumeOrLF(input); + case HEADER_FOUND_CR_LF -> resumeOrSecondCR(input); + case HEADER_FOUND_CR_LF_CR -> resumeOrEndHeaders(input); + default -> throw new InternalError("Unexpected state: " + state); + } + } + return state == HttpHeaderParser.State.FINISHED; + } + + private boolean canContinueParsing() { + // some states don't require any input to transition + // to the next state. + return switch (state) { + case FINISHED -> false; + case STATUS_OR_REQUEST_LINE_FOUND_LF, STATUS_OR_REQUEST_LINE_END_LF, HEADER_FOUND_LF -> true; + default -> !eof; + }; + } + + /** + * Returns a character (char) corresponding to the next byte in the + * input, interpreted as an ISO-8859-1 encoded character. + *

+ * The ISO-8859-1 encoding is a 8-bit character coding that + * corresponds to the first 256 Unicode characters - from U+0000 to + * U+00FF. UTF-16 is backward compatible with ISO-8859-1 - which + * means each byte in the input should be interpreted as an unsigned + * value from [0, 255] representing the character code. + * + * @param input a {@code InputStream} containing input stream of Bytes. + * @return the next byte in the input, interpreted as an ISO-8859-1 + * encoded char + * @throws IOException + * if an I/O error occurs. + */ + private char get(InputStream input) throws IOException { + int c = input.read(); + if(c < 0) + eof = true; + return (char)(c & 0xFF); + } + + private void readResumeStatusLine(InputStream input) throws IOException { + char c; + while ((c = get(input)) != CR && !eof) { + if (c == LF) break; + sb.append(c); + } + if (c == CR) { + state = HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_FOUND_CR; + } else if (c == LF) { + state = HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_FOUND_LF; + } + } + + private void readStatusLineFeed(InputStream input) throws IOException { + char c = state == HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_FOUND_LF ? LF : get(input); + if (c != LF) { + throw protocolException("Bad trailing char, \"%s\", when parsing status line, \"%s\"", + c, sb.toString()); + } + requestOrStatusLine = sb.toString(); + sb = new StringBuilder(); + if (!requestOrStatusLine.startsWith("HTTP/1.")) { + if(!requestOrStatusLine.startsWith("GET") && !requestOrStatusLine.startsWith("POST") && + !requestOrStatusLine.startsWith("PUT") && !requestOrStatusLine.startsWith("DELETE") && + !requestOrStatusLine.startsWith("OPTIONS") && !requestOrStatusLine.startsWith("HEAD") && + !requestOrStatusLine.startsWith("PATCH") && !requestOrStatusLine.startsWith("CONNECT")) { + throw protocolException("Invalid request Or Status line: \"%s\"", requestOrStatusLine); + } else { //This is request + System.out.println("Request is :"+requestOrStatusLine); + } + } else { //This is response + if (requestOrStatusLine.length() < 12) { + throw protocolException("Invalid status line: \"%s\"", requestOrStatusLine); + } + try { + responseCode = Integer.parseInt(requestOrStatusLine.substring(9, 12)); + } catch (NumberFormatException nfe) { + throw protocolException("Invalid status line: \"%s\"", requestOrStatusLine); + } + // response code expected to be a 3-digit integer (RFC-2616, section 6.1.1) + if (responseCode < 100) { + throw protocolException("Invalid status line: \"%s\"", requestOrStatusLine); + } + } + state = HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END; + } + + private void maybeStartHeaders(InputStream input) throws IOException { + assert state == HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END; + assert sb.length() == 0; + char c = get(input); + if(!eof) { + if (c == CR) { + state = HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END_CR; + } else if (c == LF) { + state = HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END_LF; + } else { + sb.append(c); + state = HttpHeaderParser.State.HEADER; + } + } + } + + private void maybeEndHeaders(InputStream input) throws IOException { + assert state == HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END_CR || state == HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END_LF; + assert sb.length() == 0; + char c = state == HttpHeaderParser.State.STATUS_OR_REQUEST_LINE_END_LF ? LF : get(input); + if (c == LF) { + state = HttpHeaderParser.State.FINISHED; // no headers + } else { + throw protocolException("Unexpected \"%s\", after status line CR", c); + } + } + + private void readResumeHeader(InputStream input) throws IOException { + assert state == HttpHeaderParser.State.HEADER; + assert !eof; + char c = get(input); + while (!eof) { + if (c == CR) { + state = HttpHeaderParser.State.HEADER_FOUND_CR; + break; + } else if (c == LF) { + state = HttpHeaderParser.State.HEADER_FOUND_LF; + break; + } + if (c == HT) + c = SP; + sb.append(c); + c = get(input); + } + } + + private void addHeaderFromString(String headerString) throws ProtocolException { + assert sb.length() == 0; + int idx = headerString.indexOf(':'); + if (idx == -1) + return; + String name = headerString.substring(0, idx); + + // compatibility with HttpURLConnection; + if (name.isEmpty()) return; + + if (!isValidName(name)) { + throw protocolException("Invalid header name \"%s\"", name); + } + String value = headerString.substring(idx + 1).trim(); + if (!isValidValue(value)) { + throw protocolException("Invalid header value \"%s: %s\"", name, value); + } + + keyList.add(name); + headerMap.computeIfAbsent(name.toLowerCase(Locale.US), + k -> new ArrayList<>()).add(value); + } + + private void resumeOrLF(InputStream input) throws IOException { + assert state == HttpHeaderParser.State.HEADER_FOUND_CR || state == HttpHeaderParser.State.HEADER_FOUND_LF; + char c = state == HttpHeaderParser.State.HEADER_FOUND_LF ? LF : get(input); + if (!eof) { + if (c == LF) { + state = HttpHeaderParser.State.HEADER_FOUND_CR_LF; + } else if (c == SP || c == HT) { + sb.append(SP); // parity with MessageHeaders + state = HttpHeaderParser.State.HEADER; + } else { + sb = new StringBuilder(); + sb.append(c); + state = HttpHeaderParser.State.HEADER; + } + } + } + + private void resumeOrSecondCR(InputStream input) throws IOException { + assert state == HttpHeaderParser.State.HEADER_FOUND_CR_LF; + char c = get(input); + if (!eof) { + if (c == CR || c == LF) { + if (sb.length() > 0) { + // no continuation line - flush + // previous header value. + String headerString = sb.toString(); + sb = new StringBuilder(); + addHeaderFromString(headerString); + } + if (c == CR) { + state = HttpHeaderParser.State.HEADER_FOUND_CR_LF_CR; + } else { + state = HttpHeaderParser.State.FINISHED; + } + } else if (c == SP || c == HT) { + assert sb.length() != 0; + sb.append(SP); // continuation line + state = HttpHeaderParser.State.HEADER; + } else { + if (sb.length() > 0) { + // no continuation line - flush + // previous header value. + String headerString = sb.toString(); + sb = new StringBuilder(); + addHeaderFromString(headerString); + } + sb.append(c); + state = HttpHeaderParser.State.HEADER; + } + } + } + + private void resumeOrEndHeaders(InputStream input) throws IOException { + assert state == HttpHeaderParser.State.HEADER_FOUND_CR_LF_CR; + char c = get(input); + if (!eof) { + if (c == LF) { + state = HttpHeaderParser.State.FINISHED; + } else { + throw protocolException("Unexpected \"%s\", after CR LF CR", c); + } + } + } + + private ProtocolException protocolException(String format, Object ... args) { + return new ProtocolException(String.format(format, args)); + } + + /* + * Validates a RFC 7230 field-name. + */ + public boolean isValidName(String token) { + for (int i = 0; i < token.length(); i++) { + char c = token.charAt(i); + if (c > 255 || !tchar[c]) { + return false; + } + } + return !token.isEmpty(); + } + + /* + * Validates a RFC 7230 field-value. + * + * "Obsolete line folding" rule + * + * obs-fold = CRLF 1*( SP / HTAB ) + * + * is not permitted! + */ + public boolean isValidValue(String token) { + for (int i = 0; i < token.length(); i++) { + char c = token.charAt(i); + if (c > 255) { + return false; + } + if (c == ' ' || c == '\t') { + continue; + } else if (!fieldvchar[c]) { + return false; // forbidden byte + } + } + return true; + } +} diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/net/SimpleHttpServer.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/net/SimpleHttpServer.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/net/SimpleHttpServer.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/net/SimpleHttpServer.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 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 @@ -71,7 +71,7 @@ } public void stop() { - httpServer.stop(2); + httpServer.stop(0); executor.shutdown(); } diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/process/OutputAnalyzer.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/process/OutputAnalyzer.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/process/OutputAnalyzer.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/process/OutputAnalyzer.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -671,15 +671,15 @@ /** * @see #shouldMatchByLine(String, String, String) */ - public OutputAnalyzer shouldMatchByLineFrom(String from, String pattern) { - return shouldMatchByLine(from, null, pattern); + public OutputAnalyzer shouldMatchByLineFrom(String fromPattern, String pattern) { + return shouldMatchByLine(fromPattern, null, pattern); } /** * @see #shouldMatchByLine(String, String, String) */ - public OutputAnalyzer shouldMatchByLineTo(String to, String pattern) { - return shouldMatchByLine(null, to, pattern); + public OutputAnalyzer shouldMatchByLineTo(String toPattern, String pattern) { + return shouldMatchByLine(null, toPattern, pattern); } /** @@ -687,17 +687,17 @@ * {@code pattern} line by line. The whole output could be matched or * just a subset of it. * - * @param from - * The line (excluded) from where output will be matched. - * Set {@code from} to null for matching from the first line. - * @param to - * The line (excluded) until where output will be matched. - * Set {@code to} to null for matching until the last line. + * @param fromPattern + * The pattern of line (excluded) from where output will be matched. + * Set {@code fromPattern} to null for matching from the first line. + * @param toPattern + * The pattern of line (excluded) until where output will be matched. + * Set {@code toPattern} to null for matching until the last line. * @param pattern * Matching pattern */ - public OutputAnalyzer shouldMatchByLine(String from, String to, String pattern) { - return shouldMatchByLine(getOutput(), from, to, pattern); + public OutputAnalyzer shouldMatchByLine(String fromPattern, String toPattern, String pattern) { + return shouldMatchByLine(getOutput(), fromPattern, toPattern, pattern); } /** @@ -705,34 +705,34 @@ * {@code pattern} line by line. The whole stdout could be matched or * just a subset of it. * - * @param from - * The line (excluded) from where stdout will be matched. - * Set {@code from} to null for matching from the first line. - * @param to - * The line (excluded) until where stdout will be matched. - * Set {@code to} to null for matching until the last line. + * @param fromPattern + * The pattern of line (excluded) from where stdout will be matched. + * Set {@code fromPattern} to null for matching from the first line. + * @param toPattern + * The pattern of line (excluded) until where stdout will be matched. + * Set {@code toPattern} to null for matching until the last line. * @param pattern * Matching pattern */ - public OutputAnalyzer stdoutShouldMatchByLine(String from, String to, String pattern) { - return shouldMatchByLine(getStdout(), from, to, pattern); + public OutputAnalyzer stdoutShouldMatchByLine(String fromPattern, String toPattern, String pattern) { + return shouldMatchByLine(getStdout(), fromPattern, toPattern, pattern); } - private OutputAnalyzer shouldMatchByLine(String buffer, String from, String to, String pattern) { + private OutputAnalyzer shouldMatchByLine(String buffer, String fromPattern, String toPattern, String pattern) { List lines = asLines(buffer); int fromIndex = 0; - if (from != null) { - fromIndex = indexOf(lines, from, 0) + 1; // + 1 -> apply 'pattern' to lines after 'from' match + if (fromPattern != null) { + fromIndex = indexOf(lines, fromPattern, 0) + 1; // + 1 -> apply 'pattern' to lines after 'from' match Asserts.assertGreaterThan(fromIndex, 0, - "The line/pattern '" + from + "' from where the output should match can not be found"); + "The line matched with pattern '" + fromPattern + "' from where the output should match can not be found"); } int toIndex = lines.size(); - if (to != null) { - toIndex = indexOf(lines, to, fromIndex); + if (toPattern != null) { + toIndex = indexOf(lines, toPattern, fromIndex); Asserts.assertGreaterThan(toIndex, fromIndex, - "The line/pattern '" + to + "' until where the output should match can not be found"); + "The line matched with pattern '" + toPattern + "' until where the output should match can not be found"); } List subList = lines.subList(fromIndex, toIndex); diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/security/SecurityUtils.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/security/SecurityUtils.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/security/SecurityUtils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/security/SecurityUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, 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 @@ -29,6 +29,7 @@ import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; +import java.util.stream.Stream; /** * Common library for various security test helper functions. @@ -53,6 +54,26 @@ } /** + * Adds the specified protocols to the jdk.tls.disabledAlgorithms + * security property + */ + public static void addToDisabledTlsAlgs(String... protocols) { + addToDisabledArgs("jdk.tls.disabledAlgorithms", List.of(protocols)); + } + + /** + * Adds constraints to the specified security property. + */ + public static void addToDisabledArgs(String prop, List constraints) { + String value = Security.getProperty(prop); + value = Stream.concat(Arrays.stream(value.split(",")), + constraints.stream()) + .map(String::trim) + .collect(Collectors.joining(",")); + Security.setProperty(prop, value); + } + + /** * Removes the specified protocols from the jdk.tls.disabledAlgorithms * security property. */ diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/util/CoreUtils.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/util/CoreUtils.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/util/CoreUtils.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/util/CoreUtils.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2020, 2022, 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 @@ -136,12 +136,12 @@ if (!coresDir.canWrite()) { throw new SkippedException("Directory \"" + coresDir + "\" is not writable"); } - if (Platform.isSignedOSX()) { + if (Platform.isHardenedOSX()) { if (Platform.getOsVersionMajor() > 10 || (Platform.getOsVersionMajor() == 10 && Platform.getOsVersionMinor() >= 15)) { - // We can't generate cores files with signed binaries on OSX 10.15 and later. - throw new SkippedException("Cannot produce core file with signed binary on OSX 10.15 and later"); + // We can't generate cores files with hardened binaries on OSX 10.15 and later. + throw new SkippedException("Cannot produce core file with hardened binary on OSX 10.15 and later"); } } } else if (Platform.isLinux()) { @@ -258,4 +258,14 @@ } } + public static String getAlwaysPretouchArg(boolean withCore) { + // macosx-aarch64 has an issue where sometimes the java heap will not be dumped to the + // core file. Using -XX:+AlwaysPreTouch fixes the problem. + if (withCore && Platform.isOSX() && Platform.isAArch64()) { + return "-XX:+AlwaysPreTouch"; + } else { + return "-XX:-AlwaysPreTouch"; + } + } + } diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/lib/util/ForceGC.java openjdk-17-17.0.10+7/test/lib/jdk/test/lib/util/ForceGC.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/lib/util/ForceGC.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/lib/util/ForceGC.java 2024-01-09 21:18:15.000000000 +0000 @@ -23,57 +23,56 @@ package jdk.test.lib.util; -import java.lang.ref.Cleaner; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; +import java.lang.ref.PhantomReference; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; import java.util.function.BooleanSupplier; /** * Utility class to invoke System.gc() */ public class ForceGC { - private final CountDownLatch cleanerInvoked = new CountDownLatch(1); - private final Cleaner cleaner = Cleaner.create(); - private Object o; - - public ForceGC() { - this.o = new Object(); - cleaner.register(o, () -> cleanerInvoked.countDown()); - } - - private void doit(int iter) { - try { - for (int i = 0; i < 10; i++) { - System.gc(); - System.out.println("doit() iter: " + iter + ", gc " + i); - if (cleanerInvoked.await(1L, TimeUnit.SECONDS)) { - return; - } - } - } catch (InterruptedException unexpected) { - throw new AssertionError("unexpected InterruptedException"); - } - } + // The jtreg testing timeout factor. + private static final double TIMEOUT_FACTOR = Double.valueOf( + System.getProperty("test.timeout.factor", "1.0")); /** - * Causes the current thread to wait until the {@code BooleanSupplier} returns true, - * unless the thread is interrupted or a predefined waiting time elapses. + * Causes the current thread to wait until the {@code booleanSupplier} + * returns true, or a specific waiting time elapses. The waiting time + * is 1 second scaled with the jtreg testing timeout factor. * - * @param s boolean supplier - * @return true if the {@code BooleanSupplier} returns true and false if - * the predefined waiting time elapsed before the count reaches zero. - * @throws InterruptedException if the current thread is interrupted while waiting + * @param booleanSupplier boolean supplier + * @return true if the {@code booleanSupplier} returns true, or false + * if did not complete after the specific waiting time. */ - public boolean await(BooleanSupplier s) { - o = null; // Keep reference to Object until now, to ensure the Cleaner - // doesn't count down the latch before await() is called. - for (int i = 0; i < 10; i++) { - if (s.getAsBoolean()) return true; - doit(i); - try { Thread.sleep(1000); } catch (InterruptedException e) { - throw new AssertionError("unexpected interrupted sleep", e); + public static boolean wait(BooleanSupplier booleanSupplier) { + ReferenceQueue queue = new ReferenceQueue<>(); + Object obj = new Object(); + PhantomReference ref = new PhantomReference<>(obj, queue); + obj = null; + Reference.reachabilityFence(obj); + Reference.reachabilityFence(ref); + + int retries = (int)(Math.round(1000L * TIMEOUT_FACTOR) / 200); + for (; retries >= 0; retries--) { + if (booleanSupplier.getAsBoolean()) { + return true; + } + + System.gc(); + + try { + // The remove() will always block for the specified milliseconds + // if the reference has already been removed from the queue. + // But it is fine. For most cases, the 1st GC is sufficient + // to trigger and complete the cleanup. + queue.remove(200L); + } catch (InterruptedException ie) { + // ignore, the loop will try again } } - return false; + + return booleanSupplier.getAsBoolean(); } } + diff -Nru openjdk-17-17.0.9+9/test/lib/jdk/test/whitebox/WhiteBox.java openjdk-17-17.0.10+7/test/lib/jdk/test/whitebox/WhiteBox.java --- openjdk-17-17.0.9+9/test/lib/jdk/test/whitebox/WhiteBox.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib/jdk/test/whitebox/WhiteBox.java 2024-01-09 21:18:15.000000000 +0000 @@ -600,7 +600,7 @@ public native boolean isCDSIncluded(); public native boolean isJFRIncluded(); public native boolean isDTraceIncluded(); - public native boolean isJavaHeapArchiveSupported(); + public native boolean canWriteJavaHeapArchive(); public native Object getResolvedReferences(Class c); public native void linkClass(Class c); public native boolean areOpenArchiveHeapObjectsMapped(); diff -Nru openjdk-17-17.0.9+9/test/lib-test/TEST.ROOT openjdk-17-17.0.10+7/test/lib-test/TEST.ROOT --- openjdk-17-17.0.9+9/test/lib-test/TEST.ROOT 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib-test/TEST.ROOT 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2020, 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 @@ -29,7 +29,7 @@ keys=randomness # Minimum jtreg version -requiredVersion=6+1 +requiredVersion=7.3.1+1 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them diff -Nru openjdk-17-17.0.9+9/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java openjdk-17-17.0.10+7/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java --- openjdk-17-17.0.9+9/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java 2023-10-11 18:18:14.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib-test/jdk/test/lib/TestMutuallyExclusivePlatformPredicates.java 2024-01-09 21:18:15.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2022, 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 @@ -53,7 +53,7 @@ IGNORED("isEmulatedClient", "isDebugBuild", "isFastDebugBuild", "isMusl", "isSlowDebugBuild", "hasSA", "isRoot", "isTieredSupported", "areCustomLoadersSupportedForCDS", "isDefaultCDSArchiveSupported", - "isSignedOSX"); + "isHardenedOSX"); public final List methodNames; diff -Nru openjdk-17-17.0.9+9/test/lib-test/jdk/test/lib/hprof/HprofTest.java openjdk-17-17.0.10+7/test/lib-test/jdk/test/lib/hprof/HprofTest.java --- openjdk-17-17.0.9+9/test/lib-test/jdk/test/lib/hprof/HprofTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/lib-test/jdk/test/lib/hprof/HprofTest.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.File; +import java.lang.ref.Reference; +import java.util.Enumeration; +import java.util.concurrent.TimeUnit; + +import jdk.test.lib.Asserts; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.apps.LingeredApp; +import jdk.test.lib.process.ProcessTools; + +import jdk.test.lib.hprof.model.JavaClass; +import jdk.test.lib.hprof.model.JavaHeapObject; +import jdk.test.lib.hprof.model.JavaObject; +import jdk.test.lib.hprof.model.JavaValueArray; +import jdk.test.lib.hprof.model.JavaThing; +import jdk.test.lib.hprof.model.Snapshot; +import jdk.test.lib.hprof.parser.Reader; + +/** + * @test + * @bug 8316778 + * @library /test/lib + * @run main HprofTest + */ + +class HprofTestTarg extends LingeredApp { + // Array of primitive types + int[] intArray = new int[2]; + // String + String str = "test_string"; + + public static void main(String[] args) { + HprofTestTarg testObj = new HprofTestTarg(); + + LingeredApp.main(args); + + Reference.reachabilityFence(testObj); + } + +} + + +public class HprofTest { + + public static void main(String[] args) throws Exception { + File dumpFile = new File("Myheapdump.hprof"); + createDump(dumpFile); + test(dumpFile); + } + + private static void createDump(File dumpFile) throws Exception { + LingeredApp theApp = null; + try { + theApp = new HprofTestTarg(); + + LingeredApp.startApp(theApp); + + //jcmd GC.heap_dump + JDKToolLauncher launcher = JDKToolLauncher + .createUsingTestJDK("jcmd") + .addToolArg(Long.toString(theApp.getPid())) + .addToolArg("GC.heap_dump") + .addToolArg(dumpFile.getAbsolutePath()); + Process p = ProcessTools.startProcess("jcmd", new ProcessBuilder(launcher.getCommand())); + while (!p.waitFor(5, TimeUnit.SECONDS)) { + if (!theApp.getProcess().isAlive()) { + log("ERROR: target VM died, killing jcmd..."); + p.destroyForcibly(); + throw new Exception("Target VM died"); + } + } + + if (p.exitValue() != 0) { + throw new Exception("Jcmd exited with code " + p.exitValue()); + } + } finally { + LingeredApp.stopApp(theApp); + } + } + + private static void test(File dumpFile) throws Exception { + Asserts.assertTrue(dumpFile.exists(), "Heap dump file not found."); + + log("Reading " + dumpFile + "..."); + try (Snapshot snapshot = Reader.readFile(dumpFile.getPath(), true, 0)) { + log("Resolving snapshot..."); + snapshot.resolve(true); + log("Snapshot resolved."); + + JavaObject testObj = getTestObject(snapshot); + testPrimitiveArray(testObj); + testString(testObj); + } + + } + + // verifies JavaValueArray.valueString does not throw + // "invalid array element type" exception + private static void testPrimitiveArray(JavaObject obj) { + JavaHeapObject field = getObjectField(obj, "intArray"); + Asserts.assertTrue(field instanceof JavaValueArray); + log("int array: " + ((JavaValueArray)field).valueString()); + } + + // verifies JavaObject.toString returns String value + private static void testString(JavaObject obj) { + JavaHeapObject field = getObjectField(obj, "str"); + Asserts.assertTrue(field instanceof JavaObject); + JavaObject javaObj = (JavaObject)field; + Asserts.assertTrue(javaObj.getClazz().isString()); + log("string: " + javaObj.toString()); + assert(javaObj.toString().contains(new HprofTestTarg().str)); + } + + + private static JavaHeapObject getObjectField(JavaObject obj, String fieldName) { + JavaThing thing = obj.getField(fieldName); + // only non-primitive types are supported + return (JavaHeapObject)thing; + } + + // gets test HprofTestTarg + private static JavaObject getTestObject(Snapshot snapshot) { + String testClassName = HprofTestTarg.class.getName(); + JavaHeapObject testObject = getObjects(snapshot, testClassName).nextElement(); + Asserts.assertTrue(testObject instanceof JavaObject); + return (JavaObject)testObject; + } + + // finds all objects of the specified type + private static Enumeration getObjects(Snapshot snapshot, String className) { + log("Looking for '" + className + "' objects..."); + JavaClass jClass = snapshot.findClass(className); + if (jClass == null) { + throw new RuntimeException("Class '" + className + "' not found"); + } + int instanceCount = jClass.getInstancesCount(false); + if (instanceCount < 1) { + throw new RuntimeException("Not instances of '" + className + "' found"); + } + log("Found " + instanceCount + " instance(s)."); + return jClass.getInstances(false); + } + + private static void log(Object s) { + System.out.println(s); + } +} diff -Nru openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/Multiple.java openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/Multiple.java --- openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/Multiple.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/Multiple.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +public class Multiple { + + @Benchmark + public void plain() { + // Do nothing + } + + @Benchmark + public void loadLoad() { + VarHandle.loadLoadFence(); + VarHandle.loadLoadFence(); + VarHandle.loadLoadFence(); + VarHandle.loadLoadFence(); + } + + @Benchmark + public void storeStore() { + VarHandle.storeStoreFence(); + VarHandle.storeStoreFence(); + VarHandle.storeStoreFence(); + VarHandle.storeStoreFence(); + } + + @Benchmark + public void acquire() { + VarHandle.acquireFence(); + VarHandle.acquireFence(); + VarHandle.acquireFence(); + VarHandle.acquireFence(); + } + + @Benchmark + public void release() { + VarHandle.releaseFence(); + VarHandle.releaseFence(); + VarHandle.releaseFence(); + VarHandle.releaseFence(); + } + + @Benchmark + public void full() { + VarHandle.fullFence(); + VarHandle.fullFence(); + VarHandle.fullFence(); + VarHandle.fullFence(); + } + +} diff -Nru openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java --- openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/MultipleWithLoads.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class MultipleWithLoads { + + int x, y, z; + + @Benchmark + public int plain() { + int t1 = x + y + z; + int t2 = x + y + z; + int t3 = x + y + z; + return t1 + t2 + t3; + } + + @Benchmark + public int loadLoad() { + VarHandle.loadLoadFence(); + int t1 = x + y + z; + VarHandle.loadLoadFence(); + int t2 = x + y + z; + VarHandle.loadLoadFence(); + int t3 = x + y + z; + VarHandle.loadLoadFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int storeStore() { + VarHandle.storeStoreFence(); + int t1 = x + y + z; + VarHandle.storeStoreFence(); + int t2 = x + y + z; + VarHandle.storeStoreFence(); + int t3 = x + y + z; + VarHandle.storeStoreFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int acquire() { + VarHandle.acquireFence(); + int t1 = x + y + z; + VarHandle.acquireFence(); + int t2 = x + y + z; + VarHandle.acquireFence(); + int t3 = x + y + z; + VarHandle.acquireFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int release() { + VarHandle.releaseFence(); + int t1 = x + y + z; + VarHandle.releaseFence(); + int t2 = x + y + z; + VarHandle.releaseFence(); + int t3 = x + y + z; + VarHandle.releaseFence(); + return t1 + t2 + t3; + } + + @Benchmark + public int full() { + VarHandle.fullFence(); + int t1 = x + y + z; + VarHandle.fullFence(); + int t2 = x + y + z; + VarHandle.fullFence(); + int t3 = x + y + z; + VarHandle.fullFence(); + return t1 + t2 + t3; + } + +} diff -Nru openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java --- openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/MultipleWithStores.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class MultipleWithStores { + + int x, y, z; + + @Benchmark + public void plain() { + x = 1; + y = 1; + z = 1; + } + + @Benchmark + public void loadLoad() { + VarHandle.loadLoadFence(); + x = 1; + VarHandle.loadLoadFence(); + y = 1; + VarHandle.loadLoadFence(); + z = 1; + VarHandle.loadLoadFence(); + } + + @Benchmark + public void storeStore() { + VarHandle.storeStoreFence(); + x = 1; + VarHandle.storeStoreFence(); + y = 1; + VarHandle.storeStoreFence(); + z = 1; + VarHandle.storeStoreFence(); + } + + @Benchmark + public void acquire() { + VarHandle.releaseFence(); + x = 1; + VarHandle.releaseFence(); + y = 1; + VarHandle.releaseFence(); + z = 1; + VarHandle.releaseFence(); + } + + @Benchmark + public void release() { + VarHandle.releaseFence(); + x = 1; + VarHandle.releaseFence(); + y = 1; + VarHandle.releaseFence(); + z = 1; + VarHandle.releaseFence(); + } + + @Benchmark + public void full() { + VarHandle.fullFence(); + x = 1; + VarHandle.fullFence(); + y = 1; + VarHandle.fullFence(); + z = 1; + VarHandle.fullFence(); + } + +} diff -Nru openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java --- openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/SafePublishing.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(value = 3, jvmArgsAppend = {"-XX:+UseParallelGC", "-Xmx128m"}) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@State(Scope.Thread) +public class SafePublishing { + + @Benchmark + public Object plain() { + return new Plain(); + } + + @Benchmark + public Object release() { + return new Release(); + } + + @Benchmark + public Object storeStore() { + return new StoreStore(); + } + + static class Plain { + int x; + public Plain() { + x = 1; + VarHandle.releaseFence(); + } + } + + static class Release { + int x; + public Release() { + x = 1; + VarHandle.releaseFence(); + } + } + + static class StoreStore { + int x; + public StoreStore() { + x = 1; + VarHandle.storeStoreFence(); + } + } + +} diff -Nru openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/Single.java openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/Single.java --- openjdk-17-17.0.9+9/test/micro/org/openjdk/bench/vm/fences/Single.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-17-17.0.10+7/test/micro/org/openjdk/bench/vm/fences/Single.java 2024-01-09 21:18:15.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021, Red Hat, Inc. 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package org.openjdk.bench.vm.fences; + +import org.openjdk.jmh.annotations.*; + +import java.lang.invoke.VarHandle; +import java.util.concurrent.TimeUnit; + +@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Measurement(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS) +@Fork(3) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +public class Single { + + @Benchmark + public void plain() { + // Do nothing + } + + @Benchmark + public void loadLoad() { + VarHandle.loadLoadFence(); + } + + @Benchmark + public void storeStore() { + VarHandle.storeStoreFence(); + } + + @Benchmark + public void acquire() { + VarHandle.acquireFence(); + } + + @Benchmark + public void release() { + VarHandle.releaseFence(); + } + + @Benchmark + public void full() { + VarHandle.fullFence(); + } + +}