6901085: SPNEGO does not works with native program

Reviewed-by: valeriep
This commit is contained in:
Weijun Wang 2009-11-27 08:51:42 +08:00
parent 6a6d0a3c7a
commit 61fe319f78

View File

@ -317,14 +317,9 @@ public class SpNegoContext implements GSSContextSpi {
mechToken = GSS_initSecContext(null); mechToken = GSS_initSecContext(null);
errorCode = GSSException.DEFECTIVE_TOKEN; errorCode = GSSException.DEFECTIVE_TOKEN;
byte[] micToken = null;
if (!GSSUtil.useMSInterop()) {
// calculate MIC only in normal mode
micToken = generateMechListMIC(DER_mechTypes);
}
// generate SPNEGO token // generate SPNEGO token
initToken = new NegTokenInit(DER_mechTypes, getContextFlags(), initToken = new NegTokenInit(DER_mechTypes, getContextFlags(),
mechToken, micToken); mechToken, null);
if (DEBUG) { if (DEBUG) {
System.out.println("SpNegoContext.initSecContext: " + System.out.println("SpNegoContext.initSecContext: " +
"sending token of type = " + "sending token of type = " +
@ -583,15 +578,9 @@ public class SpNegoContext implements GSSContextSpi {
"negotiated result = " + negoResult); "negotiated result = " + negoResult);
} }
// calculate MIC only in normal mode
byte[] micToken = null;
if (!GSSUtil.useMSInterop() && valid) {
micToken = generateMechListMIC(DER_mechTypes);
}
// generate SPNEGO token // generate SPNEGO token
NegTokenTarg targToken = new NegTokenTarg(negoResult.ordinal(), NegTokenTarg targToken = new NegTokenTarg(negoResult.ordinal(),
mech_wanted, accept_token, micToken); mech_wanted, accept_token, null);
if (DEBUG) { if (DEBUG) {
System.out.println("SpNegoContext.acceptSecContext: " + System.out.println("SpNegoContext.acceptSecContext: " +
"sending token of type = " + "sending token of type = " +
@ -735,9 +724,9 @@ public class SpNegoContext implements GSSContextSpi {
} }
/** /**
* generate MIC on mechList * generate MIC on mechList. Not used at the moment.
*/ */
private byte[] generateMechListMIC(byte[] mechTypes) /*private byte[] generateMechListMIC(byte[] mechTypes)
throws GSSException { throws GSSException {
// sanity check the required input // sanity check the required input
@ -774,7 +763,7 @@ public class SpNegoContext implements GSSContextSpi {
} }
} }
return mic; return mic;
} }*/
/** /**
* verify MIC on MechList * verify MIC on MechList