Browse Source

Win32 authentication: fail authentication if AcceptSecurityContext return SEC_E_INVALID_TOKEN

Tal Aloni 8 years ago
parent
commit
c94ea8ad68
1 changed files with 8 additions and 2 deletions
  1. 8 2
      SMBLibrary/Win32/Win32UserCollection.cs

+ 8 - 2
SMBLibrary/Win32/Win32UserCollection.cs

@@ -67,8 +67,14 @@ namespace SMBLibrary.Server.Win32
             }
 
             byte[] messageBytes = message.GetBytes();
-            bool success = SSPIHelper.AuthenticateType3Message(m_serverContext, messageBytes);
-            return success;
+            try
+            {
+                return SSPIHelper.AuthenticateType3Message(m_serverContext, messageBytes);
+            }
+            catch (Exception)
+            {
+                return false;
+            }
         }
 
         public bool IsPasswordEmpty(AuthenticateMessage message)