8044215: Unable to initiate SpNego using a S4U2Proxy GSSCredential (Krb5ProxyCredential)

Reviewed-by: mullan
This commit is contained in:
Weijun Wang 2014-10-14 10:08:32 +08:00
parent 5468e30603
commit cd3c6765c2
2 changed files with 10 additions and 3 deletions

View File

@ -244,8 +244,11 @@ class Krb5Context implements GSSContextSpi {
* establishment.
*/
public final void requestCredDeleg(boolean value) throws GSSException {
if (state == STATE_NEW && isInitiator())
credDelegState = value;
if (state == STATE_NEW && isInitiator()) {
if (myCred == null || !(myCred instanceof Krb5ProxyCredential)) {
credDelegState = value;
}
}
}
/**

View File

@ -23,7 +23,7 @@
/*
* @test
* @bug 6355584
* @bug 6355584 8044215
* @summary Introduce constrained Kerberos delegation
* @compile -XDignore.symbol.file S4U2proxy.java
* @run main/othervm S4U2proxy krb5
@ -69,6 +69,10 @@ public class S4U2proxy {
Context p = s.delegated();
p.startAsClient(OneKDC.BACKEND, mech);
// 8044215: requestCredDeleg is useless and harmless
p.x().requestCredDeleg(true);
b.startAsServer(mech);
Context.handshake(p, b);