public void SPNegoInitTokenRoundtrip() { NegotiationToken negToken = new NegotiationToken { InitialToken = new NegTokenInit { MechTypes = new Oid[] { new Oid(MechType.NTLM) }, MechToken = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } } }; var encoded = negToken.Encode(); var decoded = NegotiationToken.Decode(encoded); Assert.IsNotNull(decoded); Assert.IsNotNull(decoded.InitialToken); Assert.IsNull(decoded.ResponseToken); }
public void ChoiceEncoding() { NegotiationToken negToken = new NegotiationToken { InitialToken = new NegTokenInit { MechTypes = new Oid[] { new Oid(MechType.NTLM) }, MechToken = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } }, ResponseToken = new NegTokenResp { State = NegotiateState.Rejected, SupportedMech = new Oid(MechType.NTLM), ResponseToken = new byte[] { 7, 6, 5, 4, 3, 2, 1, 0 } } }; negToken.Encode(); }
public void SPNegoResponseTokenRoundtrip() { NegotiationToken negToken = new NegotiationToken { ResponseToken = new NegTokenResp { State = NegotiateState.Rejected, SupportedMech = new Oid(MechType.NTLM), ResponseToken = new byte[] { 7, 6, 5, 4, 3, 2, 1, 0 } } }; var encoded = negToken.Encode(); var decoded = NegotiationToken.Decode(encoded); Assert.IsNotNull(decoded); Assert.IsNull(decoded.InitialToken); Assert.IsNotNull(decoded.ResponseToken); }