|
@@ -1,4 +1,4 @@
|
|
|
-
|
|
|
+
|
|
|
*
|
|
|
* You can redistribute this program and/or modify it under the terms of
|
|
|
* the GNU Lesser Public License as published by the Free Software Foundation,
|
|
@@ -6,7 +6,6 @@
|
|
|
*/
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.Text;
|
|
|
using Utilities;
|
|
|
|
|
|
namespace SMBLibrary.Authentication.GSSAPI
|
|
@@ -49,7 +48,7 @@ namespace SMBLibrary.Authentication.GSSAPI
|
|
|
|
|
|
|
|
|
|
|
|
- public static SimpleProtectedNegotiationToken ReadToken(byte[] tokenBytes, int offset)
|
|
|
+ public static SimpleProtectedNegotiationToken ReadToken(byte[] tokenBytes, int offset, bool serverInitiatedNegotiation)
|
|
|
{
|
|
|
byte tag = ByteReader.ReadByte(tokenBytes, ref offset);
|
|
|
if (tag == ApplicationTag)
|
|
@@ -71,7 +70,17 @@ namespace SMBLibrary.Authentication.GSSAPI
|
|
|
tag = ByteReader.ReadByte(tokenBytes, ref offset);
|
|
|
if (tag == SimpleProtectedNegotiationTokenInit.NegTokenInitTag)
|
|
|
{
|
|
|
- return new SimpleProtectedNegotiationTokenInit(tokenBytes, offset);
|
|
|
+ if (serverInitiatedNegotiation)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return new SimpleProtectedNegotiationTokenInit2(tokenBytes, offset);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return new SimpleProtectedNegotiationTokenInit(tokenBytes, offset);
|
|
|
+ }
|
|
|
}
|
|
|
else if (tag == SimpleProtectedNegotiationTokenResponse.NegTokenRespTag)
|
|
|
{
|