Skip to content

Commit

Permalink
Merge master jdk-11.0.25+5 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: J9 Build <[email protected]>
  • Loading branch information
j9build committed Aug 29, 2024
2 parents 3c24a4f + 1156827 commit d9bc103
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ private void onCertificate(ServerHandshakeContext shc,
ClientAuthType.CLIENT_AUTH_REQUESTED) {
// unexpected or require client authentication
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
"Empty server certificate chain");
"Empty client certificate chain");
} else {
return;
}
Expand All @@ -405,7 +405,7 @@ private void onCertificate(ServerHandshakeContext shc,
}
} catch (CertificateException ce) {
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
"Failed to parse server certificates", ce);
"Failed to parse client certificates", ce);
}

checkClientCerts(shc, x509Certs);
Expand Down Expand Up @@ -1253,7 +1253,7 @@ private static X509Certificate[] checkClientCerts(
}
} catch (CertificateException ce) {
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
"Failed to parse server certificates", ce);
"Failed to parse client certificates", ce);
}

// find out the types of client authentication used
Expand Down
4 changes: 3 additions & 1 deletion src/java.desktop/share/native/liblcms/cmsio0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ cmsBool IsTypeSupported(cmsTagDescriptor* TagDescriptor, cmsTagTypeSignature Typ
void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig)
{
_cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile;
cmsIOHANDLER* io = Icc ->IOhandler;
cmsIOHANDLER* io;
cmsTagTypeHandler* TypeHandler;
cmsTagTypeHandler LocalTypeHandler;
cmsTagDescriptor* TagDescriptor;
Expand Down Expand Up @@ -1705,6 +1705,8 @@ void* CMSEXPORT cmsReadTag(cmsHPROFILE hProfile, cmsTagSignature sig)

if (TagSize < 8) goto Error;

io = Icc ->IOhandler;

if (io == NULL) { // This is a built-in profile that has been manipulated, abort early

cmsSignalError(Icc->ContextID, cmsERROR_CORRUPTION_DETECTED, "Corrupted built-in profile.");
Expand Down
16 changes: 8 additions & 8 deletions test/hotspot/jtreg/gc/arguments/TestDisableDefaultGC.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -42,13 +42,13 @@
public class TestDisableDefaultGC {
public static void main(String[] args) throws Exception {
// Start VM, disabling all possible default GCs
ProcessBuilder pb = GCArguments.createJavaProcessBuilder("-XX:-UseSerialGC",
"-XX:-UseParallelGC",
"-XX:-UseG1GC",
"-XX:-UseConcMarkSweepGC",
"-XX:+UnlockExperimentalVMOptions",
"-XX:-UseZGC",
"-version");
ProcessBuilder pb = GCArguments.createTestJvm("-XX:-UseSerialGC",
"-XX:-UseParallelGC",
"-XX:-UseG1GC",
"-XX:-UseConcMarkSweepGC",
"-XX:+UnlockExperimentalVMOptions",
"-XX:-UseZGC",
"-version");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldMatch("Garbage collector not selected");
output.shouldHaveExitValue(1);
Expand Down
1 change: 0 additions & 1 deletion test/jdk/java/lang/reflect/OldenCompilingWithDefaults.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @test
* @bug 8009267
* @summary Verify uses of isAnnotationPresent compile under older source versions
* @compile -source 1.6 -target 1.6 OldenCompilingWithDefaults.java
* @compile -source 1.7 -target 1.7 OldenCompilingWithDefaults.java
* @compile OldenCompilingWithDefaults.java
*/
Expand Down
16 changes: 10 additions & 6 deletions test/jdk/java/net/Socks/SocksProxyVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/*
* @test
* @bug 6964547 5001942 8129444
* @library /test/lib
* @run main/othervm SocksProxyVersion
* @summary test socksProxyVersion system property
*/
Expand All @@ -35,6 +36,7 @@
import java.io.IOException;
import java.net.InetAddress;
import java.net.Proxy;
import jdk.test.lib.net.IPSupport;

public class SocksProxyVersion implements Runnable {
final ServerSocket ss;
Expand Down Expand Up @@ -80,14 +82,16 @@ final void runTest(int port) throws Exception {
Proxy proxy = new Proxy(Proxy.Type.SOCKS,
new InetSocketAddress(addr, port));

// SOCKS V4
System.setProperty("socksProxyVersion", Integer.toString(4));
this.expected = 4;
check(new Socket(), addr, port);
check(new Socket(proxy), addr, port);
if (IPSupport.hasIPv4()) {
// SOCKS V4 (requires IPv4)
System.setProperty("socksProxyVersion", "4");
this.expected = 4;
check(new Socket(), addr, port);
check(new Socket(proxy), addr, port);
}

// SOCKS V5
System.setProperty("socksProxyVersion", Integer.toString(5));
System.setProperty("socksProxyVersion", "5");
this.expected = 5;
check(new Socket(), addr, port);
check(new Socket(proxy), addr, port);
Expand Down
22 changes: 13 additions & 9 deletions test/jdk/javax/xml/crypto/dsig/GenerationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public static void main(String args[]) throws Exception {
try (Http server = Http.startServer()) {
server.start();

// tests for XML documents
System.out.println("\ntests for XML documents");
Arrays.stream(canonicalizationMethods).forEach(c ->
Arrays.stream(allSignatureMethods).forEach(s ->
Arrays.stream(allDigestMethods).forEach(d ->
Expand All @@ -366,7 +366,7 @@ public static void main(String args[]) throws Exception {
}
})))));

// tests for text data with no transform
System.out.println("\ntests for text data with no transform");
Arrays.stream(canonicalizationMethods).forEach(c ->
Arrays.stream(allSignatureMethods).forEach(s ->
Arrays.stream(allDigestMethods).forEach(d ->
Expand All @@ -379,7 +379,7 @@ public static void main(String args[]) throws Exception {
}
}))));

// tests for base64 data
System.out.println("\ntests for base64 data");
Arrays.stream(canonicalizationMethods).forEach(c ->
Arrays.stream(allSignatureMethods).forEach(s ->
Arrays.stream(allDigestMethods).forEach(d ->
Expand All @@ -396,7 +396,7 @@ public static void main(String args[]) throws Exception {

// negative tests

// unknown CanonicalizationMethod
System.out.println("\nunknown CanonicalizationMethod");
test_create_detached_signature(
CanonicalizationMethod.EXCLUSIVE + BOGUS,
SignatureMethod.DSA_SHA1,
Expand All @@ -408,7 +408,7 @@ public static void main(String args[]) throws Exception {
true,
NoSuchAlgorithmException.class);

// unknown SignatureMethod
System.out.println("\nunknown SignatureMethod");
test_create_detached_signature(
CanonicalizationMethod.EXCLUSIVE,
SignatureMethod.DSA_SHA1 + BOGUS,
Expand All @@ -419,7 +419,7 @@ public static void main(String args[]) throws Exception {
true,
NoSuchAlgorithmException.class);

// unknown DigestMethod
System.out.println("\nunknown DigestMethod");
test_create_detached_signature(
CanonicalizationMethod.EXCLUSIVE,
SignatureMethod.DSA_SHA1,
Expand All @@ -430,7 +430,7 @@ public static void main(String args[]) throws Exception {
true,
NoSuchAlgorithmException.class);

// unknown Transform
System.out.println("\nunknown Transform");
test_create_detached_signature(
CanonicalizationMethod.EXCLUSIVE,
SignatureMethod.DSA_SHA1,
Expand All @@ -441,7 +441,7 @@ public static void main(String args[]) throws Exception {
true,
NoSuchAlgorithmException.class);

// no source document
System.out.println("\nno source document");
test_create_detached_signature(
CanonicalizationMethod.EXCLUSIVE,
SignatureMethod.DSA_SHA1,
Expand All @@ -453,7 +453,7 @@ public static void main(String args[]) throws Exception {
true,
XMLSignatureException.class);

// wrong transform for text data
System.out.println("\nwrong transform for text data");
test_create_detached_signature(
CanonicalizationMethod.EXCLUSIVE,
SignatureMethod.DSA_SHA1,
Expand Down Expand Up @@ -1823,6 +1823,7 @@ static boolean test_create_detached_signature0(String canonicalizationMethod,
throws Exception {

System.out.print("-S");
System.out.flush();

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Expand Down Expand Up @@ -1907,6 +1908,7 @@ static boolean test_create_detached_signature0(String canonicalizationMethod,
}

System.out.print("V");
System.out.flush();
try (ByteArrayInputStream bis = new ByteArrayInputStream(
signatureString.getBytes())) {
doc = dbf.newDocumentBuilder().parse(bis);
Expand All @@ -1930,12 +1932,14 @@ static boolean test_create_detached_signature0(String canonicalizationMethod,
boolean success = signature.validate(vc);
if (!success) {
System.out.print("x");
System.out.flush();
return false;
}

success = signature.getSignatureValue().validate(vc);
if (!success) {
System.out.print("X");
System.out.flush();
return false;
}

Expand Down
8 changes: 5 additions & 3 deletions test/jdk/sun/security/x509/URICertStore/SocksProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Objects;
Expand All @@ -30,7 +31,7 @@
import javax.net.ServerSocketFactory;

/*
* A simple socks4 proxy for traveling socket.
* A simple socks proxy for traveling socket.
*/
class SocksProxy implements Runnable, AutoCloseable {

Expand All @@ -49,10 +50,11 @@ static SocksProxy startProxy(Consumer<Socket> socketConsumer)
ServerSocket server
= ServerSocketFactory.getDefault().createServerSocket(0);

System.setProperty("socksProxyHost", "127.0.0.1");
System.setProperty("socksProxyHost",
InetAddress.getLoopbackAddress().getHostAddress());
System.setProperty("socksProxyPort",
String.valueOf(server.getLocalPort()));
System.setProperty("socksProxyVersion", "4");
System.setProperty("socksProxyVersion", "5");

SocksProxy proxy = new SocksProxy(server, socketConsumer);
Thread proxyThread = new Thread(proxy, "Proxy");
Expand Down
1 change: 1 addition & 0 deletions test/langtools/jdk/jshell/AnalyzeSnippetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void setUp() {
state = JShell.builder()
.out(new PrintStream(new ByteArrayOutputStream()))
.err(new PrintStream(new ByteArrayOutputStream()))
.executionEngine(Presets.TEST_DEFAULT_EXECUTION)
.build();
sca = state.sourceCodeAnalysis();
}
Expand Down
3 changes: 2 additions & 1 deletion test/langtools/jdk/jshell/CustomInputToolBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ private void doTest(boolean interactiveTerminal, String code, String... expected
.interactiveTerminal(interactiveTerminal)
.promptCapture(true)
.persistence(new HashMap<>())
.start("--no-startup");
.start("--no-startup",
"--execution", Presets.TEST_DEFAULT_EXECUTION);

String actual = new String(out.toByteArray());
List<String> actualLines = Arrays.asList(actual.split("\\R"));
Expand Down
20 changes: 3 additions & 17 deletions test/langtools/jdk/jshell/ExecutionControlTestBase.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 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
Expand All @@ -25,28 +25,14 @@

import org.testng.annotations.Test;
import jdk.jshell.VarSnippet;
import java.net.InetAddress;

import static jdk.jshell.Snippet.Status.VALID;
import static jdk.jshell.Snippet.SubKind.*;

public class ExecutionControlTestBase extends KullaTesting {

String standardListenSpec() {
String loopback = InetAddress.getLoopbackAddress().getHostAddress();
return "jdi:hostname(" + loopback + ")";
}

String standardLaunchSpec() {
return "jdi:launch(true)";
}

String standardJdiSpec() {
return "jdi";
}

String standardSpecs() {
return "5(" + standardListenSpec() + "), 6(" + standardLaunchSpec() + "), 7(" + standardJdiSpec() + ")";
String alwaysPassingSpec() {
return "5(local)";
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, 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
Expand Down Expand Up @@ -129,9 +129,7 @@ public void setUp() {
Map<String, String> pm = provider.defaultParameters();
pm.put("0", "alwaysFailing");
pm.put("1", "alwaysFailing");
pm.put("2", standardListenSpec());
pm.put("3", standardLaunchSpec());
pm.put("4", standardJdiSpec());
pm.put("2", "local");
setUp(builder -> builder.executionEngine(provider, pm));
}

Expand Down Expand Up @@ -159,9 +157,7 @@ public void variables() {
assertTrue(log.contains("This operation intentionally broken"), log);
log = logged.get(Level.FINEST).get(0);
assertTrue(
log.contains("Success failover -- 2 = " + standardListenSpec())
|| log.contains("Success failover -- 3 = " + standardLaunchSpec())
|| log.contains("Success failover -- 4 = " + standardJdiSpec()),
log.contains("Success failover -- 2 = local"),
log);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, 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
Expand Down Expand Up @@ -43,6 +43,6 @@ public class FailOverExecutionControlDyingLaunchTest extends ExecutionControlTes
public void setUp() {
setUp(builder -> builder.executionEngine(
"failover:0(jdi:remoteAgent(DyingRemoteAgent),launch(true)), "
+ standardSpecs()));
+ alwaysPassingSpec()));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 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
Expand Down Expand Up @@ -42,6 +42,6 @@ public class FailOverExecutionControlHangingLaunchTest extends ExecutionControlT
public void setUp() {
setUp(builder -> builder.executionEngine(
"failover:0(jdi:remoteAgent(HangingRemoteAgent),launch(true)), "
+ standardSpecs()));
+ alwaysPassingSpec()));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, 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
Expand Down Expand Up @@ -45,6 +45,6 @@ public void setUp() {
String loopback = InetAddress.getLoopbackAddress().getHostAddress();
setUp(builder -> builder.executionEngine(
"failover:0(jdi:remoteAgent(HangingRemoteAgent),hostname(" + loopback + ")),"
+ standardSpecs()));
+ alwaysPassingSpec()));
}
}
Loading

0 comments on commit d9bc103

Please sign in to comment.