-
Bug
-
Resolution: Fixed
-
P2
-
8u40, 9
-
b64
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084834 | emb-9 | Weijun Wang | P2 | Resolved | Fixed | team |
JDK-8131595 | 8u66 | Ivan Gerasimov | P2 | Resolved | Fixed | b01 |
JDK-8079754 | 8u65 | Ivan Gerasimov | P2 | Resolved | Fixed | b01 |
JDK-8079346 | 8u60 | Ivan Gerasimov | P2 | Resolved | Fixed | b16 |
JDK-8079722 | 8u51 | Ivan Gerasimov | P2 | Closed | Fixed | b12 |
JDK-8138114 | emb-8u65 | Unassigned | P2 | Resolved | Fixed | b01 |
JDK-8081166 | emb-8u60 | Ivan Gerasimov | P2 | Resolved | Fixed | b24 |
JDK-8080210 | emb-8u51 | Ivan Gerasimov | P2 | Resolved | Fixed | team |
JDK-8134222 | openjdk7u | Ivan Gerasimov | P2 | Resolved | Fixed | master |
openjdk version "1.8.0_40-"
OpenJDK Runtime Environment (build 1.8.0_40--vagrant_2015_03_13_10_36-b25)
OpenJDK 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Ubuntu 10.04 64-bit
A DESCRIPTION OF THE PROBLEM :
I believe I've found a bug in OpenJDK 1.8.0_40, introduced in commit d777e2918a77: http://hg.openjdk.java.net/jdk8u/jdk8u40/jdk/file/d777e2918a77/src/share/classes/sun/security/jgss/spnego/SpNegoContext.java
The change introduced on line 548 means that an authentication mechanism is only accepted if the OID of the mechanism desired is the first in the list of mechanisms specified as acceptable in the incoming ticket.
In the case of my current client their service tickets are specifying 4 acceptable mechanism OIDs, but the only available mechanism's OID appears second on that list. So whilst the server can satisfy the ticket, the code change on line 548 prevents this from happening.
Using the same server code, the same Kerberos KDC, and OpenJDK 1.8.0_31, everything works. Changing only the JDK results in the mechContext not being properly populated, which in turn causes a NullPointerException from some Spring Security Kerberos code.
REGRESSION. Last worked in version 8u31
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Provide a Kerberos ticket where the mechanism OID that is supported by the server is _not_ the first listed in the ticket.
The list of acceptable mechanism OIDs in our ticket was: 1.2.840.48018.1.2.2, 1.2.840.113554.1.2.2, 1.3.6.1.4.1.311.2.2.30, 1.3.6.1.4.1.311.2.2.10
Our server supported 1.2.840.113554.1.2.2.
The following code then throws a NullPointer on context.getSrcName(), as the context has not been created.
GSSContext context = GSSManager.getInstance().createContext((GSSCredential) null);
byte[] responseToken = context.acceptSecContext(kerberosTicket, 0, kerberosTicket.length);
String user = context.getSrcName().toString();
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Executing the following line...
context.acceptSecContext(kerberosTicket, 0, kerberosTicket.length);
... should result in context's mechCtxt being set to a SpNegoContext instance. This in turn has a member mechContext that should be a GSSContextImpl wrapping a Krb5Context.
ACTUAL -
SpNegoContext's mechContext member was never populated.
REPRODUCIBILITY :
This bug can be reproduced always.
- backported by
-
JDK-8079346 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8079754 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8080210 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8081166 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8084834 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8131595 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8134222 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8138114 SPNEGO auth fails if client proposes MS krb5 OID
- Resolved
-
JDK-8079722 SPNEGO auth fails if client proposes MS krb5 OID
- Closed
- duplicates
-
JDK-8080122 SPNEGO GSS token processing broken in latest JDK
- Closed
-
JDK-8080125 SpNegoContext.acceptSecContext fails if mech_wanted is not the first mechanism
- Closed
-
JDK-8080128 GSSContext.acceptSecContext does not established context with valid Spnego ticke
- Closed
-
JDK-8080129 spnego works in 1.8.0_31 but broken in 1.8.0_40 and 1.8.0_45
- Closed
-
JDK-8080124 SPNEGO authentication broken
- Closed
-
JDK-8080125 SpNegoContext.acceptSecContext fails if mech_wanted is not the first mechanism
- Closed
-
JDK-8080128 GSSContext.acceptSecContext does not established context with valid Spnego ticke
- Closed
- relates to
-
JDK-8048194 GSSContext.acceptSecContext fails when a supported mech is initiator preferred
- Resolved
-
JDK-8134248 Fix recently backported tests to work with OpenJDK 7u
- Resolved
-
JDK-8079821 MSOID2.java test is not perfect
- Closed