/hg/icedtea8-forest/jdk: 4 new changesets
andrew at icedtea.classpath.org
andrew at icedtea.classpath.org
Tue Jun 23 18:42:13 UTC 2015
changeset 948ef7cac691 in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=948ef7cac691
author: dl
date: Fri Apr 24 15:39:41 2015 +0200
8078490, PR2431, RH1213280: Missed submissions in ForkJoinPool
Reviewed-by: psandoz, shade, martin, chegar
changeset 2c90bcd8d40f in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=2c90bcd8d40f
author: igerasim
date: Tue May 05 20:04:16 2015 +0300
8078439, PR2430, RH1231999: SPNEGO auth fails if client proposes MS krb5 OID
Reviewed-by: valeriep
changeset c73cca6a510d in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=c73cca6a510d
author: valeriep
date: Wed Jan 07 00:02:43 2015 +0000
8039921, PR2467: SHA1WithDSA with key > 1024 bits not working
Summary: Removed the key size limits for all SHAXXXWithDSA signatures
Reviewed-by: weijun
changeset f0137fa5ba52 in /hg/icedtea8-forest/jdk
details: http://icedtea.classpath.org/hg/icedtea8-forest/jdk?cmd=changeset;node=f0137fa5ba52
author: omajid
date: Thu Apr 23 13:48:02 2015 -0400
8074761, PR2471: Empty optional parameters of LDAP query are not interpreted as empty
Reviewed-by: vinnie
Contributed-by: Stanislav Baiduzhyi <sbaiduzh at redhat.com>
diffstat:
src/share/classes/com/sun/jndi/ldap/LdapURL.java | 64 ++++----
src/share/classes/java/util/concurrent/ForkJoinPool.java | 2 +-
src/share/classes/sun/security/jgss/GSSUtil.java | 5 +-
src/share/classes/sun/security/jgss/spnego/SpNegoContext.java | 9 +-
src/share/classes/sun/security/provider/DSA.java | 22 +--
test/com/sun/jndi/ldap/LdapURLOptionalFields.java | 62 ++++++++
test/java/util/concurrent/forkjoin/SubmissionTest.java | 49 ++++++
test/sun/security/jgss/spnego/MSOID.java | 75 ++++++++++
test/sun/security/jgss/spnego/msoid.txt | 27 +++
test/sun/security/krb5/auto/MSOID2.java | 78 +++++++++++
test/sun/security/provider/DSA/TestDSA2.java | 4 +-
11 files changed, 342 insertions(+), 55 deletions(-)
diffs (truncated from 540 to 500 lines):
diff -r adf1b3700c5b -r f0137fa5ba52 src/share/classes/com/sun/jndi/ldap/LdapURL.java
--- a/src/share/classes/com/sun/jndi/ldap/LdapURL.java Wed Jun 17 00:37:45 2015 +0100
+++ b/src/share/classes/com/sun/jndi/ldap/LdapURL.java Thu Apr 23 13:48:02 2015 -0400
@@ -26,9 +26,6 @@
package com.sun.jndi.ldap;
import javax.naming.*;
-import javax.naming.directory.*;
-import javax.naming.spi.*;
-import java.net.URL;
import java.net.MalformedURLException;
import java.io.UnsupportedEncodingException;
import java.util.StringTokenizer;
@@ -211,43 +208,52 @@
// query begins with a '?' or is null
- if (query == null) {
+ if (query == null || query.length() < 2) {
return;
}
- int qmark2 = query.indexOf('?', 1);
+ int currentIndex = 1;
+ int nextQmark;
+ int endIndex;
- if (qmark2 < 0) {
- attributes = query.substring(1);
+ // attributes:
+ nextQmark = query.indexOf('?', currentIndex);
+ endIndex = nextQmark == -1 ? query.length() : nextQmark;
+ if (endIndex - currentIndex > 0) {
+ attributes = query.substring(currentIndex, endIndex);
+ }
+ currentIndex = endIndex + 1;
+ if (currentIndex >= query.length()) {
return;
- } else if (qmark2 != 1) {
- attributes = query.substring(1, qmark2);
}
- int qmark3 = query.indexOf('?', qmark2 + 1);
-
- if (qmark3 < 0) {
- scope = query.substring(qmark2 + 1);
+ // scope:
+ nextQmark = query.indexOf('?', currentIndex);
+ endIndex = nextQmark == -1 ? query.length() : nextQmark;
+ if (endIndex - currentIndex > 0) {
+ scope = query.substring(currentIndex, endIndex);
+ }
+ currentIndex = endIndex + 1;
+ if (currentIndex >= query.length()) {
return;
- } else if (qmark3 != qmark2 + 1) {
- scope = query.substring(qmark2 + 1, qmark3);
}
- int qmark4 = query.indexOf('?', qmark3 + 1);
+ // filter:
+ nextQmark = query.indexOf('?', currentIndex);
+ endIndex = nextQmark == -1 ? query.length() : nextQmark;
+ if (endIndex - currentIndex > 0) {
+ filter = query.substring(currentIndex, endIndex);
+ filter = UrlUtil.decode(filter, "UTF8");
+ }
+ currentIndex = endIndex + 1;
+ if (currentIndex >= query.length()) {
+ return;
+ }
- if (qmark4 < 0) {
- filter = query.substring(qmark3 + 1);
- } else {
- if (qmark4 != qmark3 + 1) {
- filter = query.substring(qmark3 + 1, qmark4);
- }
- extensions = query.substring(qmark4 + 1);
- if (extensions.length() > 0) {
- extensions = UrlUtil.decode(extensions, "UTF8");
- }
- }
- if (filter != null && filter.length() > 0) {
- filter = UrlUtil.decode(filter, "UTF8");
+ // extensions:
+ if (query.length() - currentIndex > 0) {
+ extensions = query.substring(currentIndex);
+ extensions = UrlUtil.decode(extensions, "UTF8");
}
}
diff -r adf1b3700c5b -r f0137fa5ba52 src/share/classes/java/util/concurrent/ForkJoinPool.java
--- a/src/share/classes/java/util/concurrent/ForkJoinPool.java Wed Jun 17 00:37:45 2015 +0100
+++ b/src/share/classes/java/util/concurrent/ForkJoinPool.java Thu Apr 23 13:48:02 2015 -0400
@@ -2406,7 +2406,7 @@
int j = ((am & s) << ASHIFT) + ABASE;
U.putOrderedObject(a, j, task);
U.putOrderedInt(q, QTOP, s + 1);
- U.putOrderedInt(q, QLOCK, 0);
+ U.putIntVolatile(q, QLOCK, 0);
if (n <= 1)
signalWork(ws, q);
return;
diff -r adf1b3700c5b -r f0137fa5ba52 src/share/classes/sun/security/jgss/GSSUtil.java
--- a/src/share/classes/sun/security/jgss/GSSUtil.java Wed Jun 17 00:37:45 2015 +0100
+++ b/src/share/classes/sun/security/jgss/GSSUtil.java Thu Apr 23 13:48:02 2015 -0400
@@ -59,6 +59,8 @@
GSSUtil.createOid("1.2.840.113554.1.2.2");
public static final Oid GSS_KRB5_MECH_OID2 =
GSSUtil.createOid("1.3.5.1.5.2");
+ public static final Oid GSS_KRB5_MECH_OID_MS =
+ GSSUtil.createOid("1.2.840.48018.1.2.2");
public static final Oid GSS_SPNEGO_MECH_OID =
GSSUtil.createOid("1.3.6.1.5.5.2");
@@ -101,7 +103,8 @@
public static boolean isKerberosMech(Oid oid) {
return (GSS_KRB5_MECH_OID.equals(oid) ||
- GSS_KRB5_MECH_OID2.equals(oid));
+ GSS_KRB5_MECH_OID2.equals(oid) ||
+ GSS_KRB5_MECH_OID_MS.equals(oid));
}
diff -r adf1b3700c5b -r f0137fa5ba52 src/share/classes/sun/security/jgss/spnego/SpNegoContext.java
--- a/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Wed Jun 17 00:37:45 2015 +0100
+++ b/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java Thu Apr 23 13:48:02 2015 -0400
@@ -540,14 +540,21 @@
// get the token for mechanism
byte[] accept_token;
- if (mechList[0].equals(mech_wanted)) {
+ if (mechList[0].equals(mech_wanted) ||
+ (GSSUtil.isKerberosMech(mechList[0]) &&
+ GSSUtil.isKerberosMech(mech_wanted))) {
// get the mechanism token
+ if (DEBUG && !mech_wanted.equals(mechList[0])) {
+ System.out.println("SpNegoContext.acceptSecContext: " +
+ "negotiated mech adjusted to " + mechList[0]);
+ }
byte[] mechToken = initToken.getMechToken();
if (mechToken == null) {
throw new GSSException(GSSException.FAILURE, -1,
"mechToken is missing");
}
accept_token = GSS_acceptSecContext(mechToken);
+ mech_wanted = mechList[0];
} else {
accept_token = null;
}
diff -r adf1b3700c5b -r f0137fa5ba52 src/share/classes/sun/security/provider/DSA.java
--- a/src/share/classes/sun/security/provider/DSA.java Wed Jun 17 00:37:45 2015 +0100
+++ b/src/share/classes/sun/security/provider/DSA.java Thu Apr 23 13:48:02 2015 -0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -117,7 +117,6 @@
if (params == null) {
throw new InvalidKeyException("DSA private key lacks parameters");
}
- checkKey(params);
this.params = params;
this.presetX = priv.getX();
@@ -149,7 +148,6 @@
if (params == null) {
throw new InvalidKeyException("DSA public key lacks parameters");
}
- checkKey(params);
this.params = params;
this.presetY = pub.getY();
@@ -291,16 +289,6 @@
return null;
}
- protected void checkKey(DSAParams params) throws InvalidKeyException {
- // FIPS186-3 states in sec4.2 that a hash function which provides
- // a lower security strength than the (L, N) pair ordinarily should
- // not be used.
- int valueN = params.getQ().bitLength();
- if (valueN > md.getDigestLength()*8) {
- throw new InvalidKeyException("Key is too strong for this signature algorithm");
- }
- }
-
private BigInteger generateR(BigInteger p, BigInteger q, BigInteger g,
BigInteger k) {
BigInteger temp = g.modPow(k, p);
@@ -480,14 +468,6 @@
}
}
- @Override
- protected void checkKey(DSAParams params) throws InvalidKeyException {
- int valueL = params.getP().bitLength();
- if (valueL > 1024) {
- throw new InvalidKeyException("Key is too long for this algorithm");
- }
- }
-
/*
* Please read bug report 4044247 for an alternative, faster,
* NON-FIPS approved method to generate K
diff -r adf1b3700c5b -r f0137fa5ba52 test/com/sun/jndi/ldap/LdapURLOptionalFields.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/jndi/ldap/LdapURLOptionalFields.java Thu Apr 23 13:48:02 2015 -0400
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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
+ * @bug 8074761
+ * @summary RFC-2255 allows attribute, scope and filter to be empty.
+ */
+
+import com.sun.jndi.ldap.LdapURL;
+
+public class LdapURLOptionalFields {
+
+ private static final String[] TEST_URLS = {
+ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com",
+ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com?",
+ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com??",
+ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com???",
+ "ldap://localhost:10389/ou=RefPeople,dc=example,dc=com????"
+ };
+
+ public static void main(String[] args) throws Exception {
+ for (int i = 0; i < TEST_URLS.length; i++) {
+ String url = TEST_URLS[i];
+ checkEmptyAttributes(url);
+ }
+ }
+
+ private static void checkEmptyAttributes(String urlString) throws Exception {
+ LdapURL url = new LdapURL(urlString);
+ if (url.getAttributes() != null) {
+ throw new Exception("Expected null attributes for url: '" + urlString + "'");
+ }
+ if (url.getScope() != null) {
+ throw new Exception("Expected null scope for url: '" + urlString + "'");
+ }
+ if (url.getFilter() != null) {
+ throw new Exception("Expected null filter for url: '" + urlString + "'");
+ }
+ }
+
+}
diff -r adf1b3700c5b -r f0137fa5ba52 test/java/util/concurrent/forkjoin/SubmissionTest.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/java/util/concurrent/forkjoin/SubmissionTest.java Thu Apr 23 13:48:02 2015 -0400
@@ -0,0 +1,49 @@
+/*
+ * 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.util.concurrent.ForkJoinPool;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/*
+ * @test
+ * @bug 8078490
+ * @summary Test submission and execution of task without joining
+ */
+public class SubmissionTest {
+ public static void main(String[] args) throws Throwable {
+ final ForkJoinPool e = new ForkJoinPool(1);
+ final AtomicBoolean b = new AtomicBoolean();
+ final Runnable setFalse = () -> b.set(false);
+ for (int i = 0; i < 100000; i++) {
+ b.set(true);
+ e.execute(setFalse);
+ long st = System.nanoTime();
+ while (b.get()) {
+ if (System.nanoTime() - st >= TimeUnit.SECONDS.toNanos(10)) {
+ throw new RuntimeException("Submitted task failed to execute");
+ }
+ }
+ }
+ }
+}
diff -r adf1b3700c5b -r f0137fa5ba52 test/sun/security/jgss/spnego/MSOID.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/jgss/spnego/MSOID.java Thu Apr 23 13:48:02 2015 -0400
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8078439
+ * @summary SPNEGO auth fails if client proposes MS krb5 OID
+ */
+
+import org.ietf.jgss.GSSContext;
+import org.ietf.jgss.GSSCredential;
+import org.ietf.jgss.GSSException;
+import org.ietf.jgss.GSSManager;
+
+import java.lang.Exception;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.Base64;
+
+public class MSOID {
+ public static void main(String[] args) throws Exception {
+
+ // msoid.txt is a NegTokenInit packet sent from Internet Explorer to
+ // IIS server on a test machine. No sensitive info included.
+ byte[] header = Files.readAllBytes(
+ Paths.get(System.getProperty("test.src"), "msoid.txt"));
+ byte[] token = Base64.getMimeDecoder().decode(
+ Arrays.copyOfRange(header, 10, header.length));
+
+ GSSCredential cred = null;
+ GSSContext ctx = GSSManager.getInstance().createContext(cred);
+
+ try {
+ ctx.acceptSecContext(token, 0, token.length);
+ // Before the fix, GSS_KRB5_MECH_OID_MS is not recognized
+ // and acceptor chooses another mech and goes on
+ throw new Exception("Should fail");
+ } catch (GSSException gsse) {
+ // After the fix, GSS_KRB5_MECH_OID_MS is recognized but the token
+ // cannot be accepted because we don't have any krb5 credential.
+ gsse.printStackTrace();
+ if (gsse.getMajor() != GSSException.NO_CRED) {
+ throw gsse;
+ }
+ for (StackTraceElement st: gsse.getStackTrace()) {
+ if (st.getClassName().startsWith("sun.security.jgss.krb5.")) {
+ // Good, it is already in krb5 mech's hand.
+ return;
+ }
+ }
+ throw gsse;
+ }
+ }
+}
diff -r adf1b3700c5b -r f0137fa5ba52 test/sun/security/jgss/spnego/msoid.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/jgss/spnego/msoid.txt Thu Apr 23 13:48:02 2015 -0400
@@ -0,0 +1,27 @@
+Negotiate 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
diff -r adf1b3700c5b -r f0137fa5ba52 test/sun/security/krb5/auto/MSOID2.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/sun/security/krb5/auto/MSOID2.java Thu Apr 23 13:48:02 2015 -0400
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8078439
+ * @summary SPNEGO auth fails if client proposes MS krb5 OID
+ * @compile -XDignore.symbol.file MSOID2.java
+ * @run main/othervm MSOID2
+ */
+
+import sun.security.jgss.GSSUtil;
+
+// The basic krb5 test skeleton you can copy from
+public class MSOID2 {
+
+ public static void main(String[] args) throws Exception {
+
+ new OneKDC(null).writeJAASConf();
+
+ Context c, s;
+ c = Context.fromJAAS("client");
+ s = Context.fromJAAS("server");
+
+ c.startAsClient(OneKDC.SERVER, GSSUtil.GSS_SPNEGO_MECH_OID);
+ s.startAsServer(GSSUtil.GSS_SPNEGO_MECH_OID);
+
+ byte[] t = new byte[0];
+ boolean first = true;
+ while (true) {
+ if (t != null || !c.x().isEstablished()) t = c.take(t);
+ if (first) {
+ // Tweak the packet to append an extra OID
+ int len = t.length;
+ byte[] nt = new byte[len + 11];
+ System.arraycopy(t, 0, nt, 0, 0x23);
+ System.arraycopy(t, 0x18, nt, 0x23, 11); // dup the OID
More information about the distro-pkg-dev
mailing list