GSSProvider: Properly handle invalid SPNEGO Token

This commit is contained in:
Tal Aloni 2017-08-25 02:29:42 +03:00
parent 477af8e690
commit 97a48adf4a

View file

@ -54,7 +54,15 @@ namespace SMBLibrary.Authentication.GSSAPI
public virtual NTStatus AcceptSecurityContext(ref GSSContext context, byte[] inputToken, out byte[] outputToken) public virtual NTStatus AcceptSecurityContext(ref GSSContext context, byte[] inputToken, out byte[] outputToken)
{ {
outputToken = null; outputToken = null;
SimpleProtectedNegotiationToken spnegoToken = SimpleProtectedNegotiationToken.ReadToken(inputToken, 0); SimpleProtectedNegotiationToken spnegoToken = null;
try
{
spnegoToken = SimpleProtectedNegotiationToken.ReadToken(inputToken, 0);
}
catch
{
}
if (spnegoToken != null) if (spnegoToken != null)
{ {
if (spnegoToken is SimpleProtectedNegotiationTokenInit) if (spnegoToken is SimpleProtectedNegotiationTokenInit)