Skip to content

Commit 7fa44fc

Browse files
committed
Merge master jdk-17.0.4+7 into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents 466e89a + 76b69eb commit 7fa44fc

File tree

6 files changed

+43
-163
lines changed

6 files changed

+43
-163
lines changed

src/java.base/unix/native/libnio/ch/DatagramChannelImpl.c

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,28 @@ Java_sun_nio_ch_DatagramChannelImpl_disconnect0(JNIEnv *env, jclass clazz,
5050
jint fd = fdval(env, fdo);
5151
int rv;
5252

53+
#if defined(__APPLE__)
54+
// On macOS systems we use disconnectx
55+
rv = disconnectx(fd, SAE_ASSOCID_ANY, SAE_CONNID_ANY);
56+
#else
5357
SOCKETADDRESS sa;
58+
memset(&sa, 0, sizeof(sa));
59+
#if defined(_ALLBSD_SOURCE)
60+
sa.sa.sa_family = isIPv6 ? AF_INET6 : AF_INET;
61+
#else
62+
sa.sa.sa_family = AF_UNSPEC;
63+
#endif
5464
socklen_t len = isIPv6 ? sizeof(struct sockaddr_in6) :
5565
sizeof(struct sockaddr_in);
56-
57-
memset(&sa, 0, sizeof(sa));
58-
#if defined(_ALLBSD_SOURCE)
59-
sa.sa.sa_family = isIPv6 ? AF_INET6 : AF_INET;
60-
#else
61-
sa.sa.sa_family = AF_UNSPEC;
62-
#endif
63-
6466
rv = connect(fd, &sa.sa, len);
67+
#endif
6568

66-
#if defined(_ALLBSD_SOURCE)
69+
#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__)
70+
// On _ALLBSD_SOURCE except __APPLE__ we consider EADDRNOTAVAIL
71+
// error to be OK and ignore it. __APPLE__ systems are excluded
72+
// in this check since for __APPLE__ systems, unlike other BSD systems,
73+
// we issue a "disconnectx" call (a few lines above),
74+
// which isn't expected to return this error code.
6775
if (rv < 0 && errno == EADDRNOTAVAIL)
6876
rv = errno = 0;
6977
#elif defined(_AIX)

test/jdk/ProblemList.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,6 @@ sun/security/provider/PolicyParser/ExtDirsChange.java 8039280 generic-
688688
sun/security/provider/PolicyParser/PrincipalExpansionError.java 8039280 generic-all
689689
sun/security/ssl/SSLSessionImpl/NoInvalidateSocketException.java 8277970 linux-all,macosx-x64
690690

691-
sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java 8287109 generic-all
692-
693691
############################################################################
694692

695693
# jdk_sound

test/jdk/java/nio/channels/DatagramChannel/Disconnect.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
2222
*/
2323

2424
/* @test
25-
* @bug 7132924
25+
* @bug 7132924 8285515
2626
* @library /test/lib
2727
* @key intermittent
2828
* @summary Test DatagramChannel.disconnect when DatagramChannel is connected to an IPv4 socket

test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/Distrust.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,15 +54,14 @@ public class Distrust {
5454
// Each of the roots have a test certificate chain stored in a file
5555
// named "<root>-chain.pem".
5656
private static String[] rootsToTest = new String[] {
57-
"geotrustglobalca", "geotrustprimarycag2", "geotrustprimarycag3",
57+
"geotrustprimarycag2", "geotrustprimarycag3",
5858
"geotrustuniversalca", "thawteprimaryrootca", "thawteprimaryrootcag2",
5959
"thawteprimaryrootcag3", "verisignclass3g3ca", "verisignclass3g4ca",
6060
"verisignclass3g5ca", "verisignuniversalrootca" };
6161

6262
// Each of the subCAs with a delayed distrust date have a test certificate
6363
// chain stored in a file named "<subCA>-chain.pem".
64-
private static String[] subCAsToTest = new String[] {
65-
"appleistca2g1", "appleistca8g1" };
64+
private static String[] subCAsToTest = new String[]{"appleistca8g1"};
6665

6766
// A date that is after the restrictions take affect
6867
private static final Date APRIL_17_2019 =
@@ -180,13 +179,19 @@ private static void testTM(X509TrustManager xtm, X509Certificate[] chain,
180179
throw new Exception("chain should be invalid");
181180
}
182181
} catch (CertificateException ce) {
182+
// expired TLS certificates should not be treated as failure
183+
if (expired(ce)) {
184+
System.err.println("Test is N/A, chain is expired");
185+
return;
186+
}
183187
if (valid) {
184188
throw new Exception("Unexpected exception, chain " +
185189
"should be valid", ce);
186190
}
187191
if (ce instanceof ValidatorException) {
188192
ValidatorException ve = (ValidatorException)ce;
189193
if (ve.getErrorType() != ValidatorException.T_UNTRUSTED_CERT) {
194+
ce.printStackTrace(System.err);
190195
throw new Exception("Unexpected exception: " + ce);
191196
}
192197
} else {
@@ -195,6 +200,21 @@ private static void testTM(X509TrustManager xtm, X509Certificate[] chain,
195200
}
196201
}
197202

203+
// check if a cause of exception is an expired cert
204+
private static boolean expired(CertificateException ce) {
205+
if (ce instanceof CertificateExpiredException) {
206+
return true;
207+
}
208+
Throwable t = ce.getCause();
209+
while (t != null) {
210+
if (t instanceof CertificateExpiredException) {
211+
return true;
212+
}
213+
t = t.getCause();
214+
}
215+
return false;
216+
}
217+
198218
private static X509Certificate[] loadCertificateChain(String name)
199219
throws Exception {
200220
try (InputStream in = new FileInputStream(TEST_SRC + File.separator +

test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/appleistca2g1-chain.pem

Lines changed: 0 additions & 80 deletions
This file was deleted.

test/jdk/sun/security/ssl/X509TrustManagerImpl/Symantec/geotrustglobalca-chain.pem

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)