From fdc823442985fa86e7a7007369c6b7afd1a68ac0 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Sat, 3 Aug 2024 12:54:30 +0300 Subject: [PATCH] NegotiateContext: Added constructors taking PreAuthIntegrityCapabilities and EncryptionCapabilities --- SMBLibrary/SMB2/Structures/NegotiateContext.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SMBLibrary/SMB2/Structures/NegotiateContext.cs b/SMBLibrary/SMB2/Structures/NegotiateContext.cs index 4b81068..00e897e 100644 --- a/SMBLibrary/SMB2/Structures/NegotiateContext.cs +++ b/SMBLibrary/SMB2/Structures/NegotiateContext.cs @@ -26,6 +26,18 @@ namespace SMBLibrary.SMB2 { } + public NegotiateContext(PreAuthIntegrityCapabilities preAuthIntegrityCapabilities) + { + ContextType = NegotiateContextType.SMB2_PREAUTH_INTEGRITY_CAPABILITIES; + Data = preAuthIntegrityCapabilities.GetBytes(); + } + + public NegotiateContext(EncryptionCapabilities encryptionCapabilities) + { + ContextType = NegotiateContextType.SMB2_ENCRYPTION_CAPABILITIES; + Data = encryptionCapabilities.GetBytes(); + } + public NegotiateContext(byte[] buffer, int offset) { ContextType = (NegotiateContextType)LittleEndianConverter.ToUInt16(buffer, offset + 0);