Преглед изворни кода

Return accept-completed at the final stage of a GSS authentication

Tal Aloni пре 8 година
родитељ
комит
4ac83f6d97

+ 9 - 0
SMBLibrary/Authentication/GSSAPI/GSSAPIHelper.cs

@@ -58,5 +58,14 @@ namespace SMBLibrary.Authentication
             token.Tokens.Add(entry);
             return token.GetBytes();
         }
+
+        public static byte[] GetGSSTokenAcceptCompletedResponse()
+        {
+            SimpleProtectedNegotiationTokenResponse token = new SimpleProtectedNegotiationTokenResponse();
+            TokenResponseEntry entry = new TokenResponseEntry();
+            entry.NegState = NegState.AcceptCompleted;
+            token.Tokens.Add(entry);
+            return token.GetBytes();
+        }
     }
 }

+ 5 - 0
SMBLibrary/Server/SMB1/SessionSetupHelper.cs

@@ -159,6 +159,11 @@ namespace SMBLibrary.Server.SMB1
                     header.Status = NTStatus.STATUS_LOGON_FAILURE;
                     return new ErrorResponse(CommandName.SMB_COM_SESSION_SETUP_ANDX);
                 }
+
+                if (!isRawMessage)
+                {
+                    response.SecurityBlob = GSSAPIHelper.GetGSSTokenAcceptCompletedResponse();
+                }
             }
             response.NativeOS = String.Empty; // "Windows Server 2003 3790 Service Pack 2"
             response.NativeLanMan = String.Empty; // "Windows Server 2003 5.2"