SMB2: EncryptionCapabilities.GetBytes: Bugfix: Corrected Data length computation

This commit is contained in:
Tal Aloni 2024-08-03 13:50:39 +03:00
parent 5f4af1e35b
commit d7d65f0ef2

View file

@ -32,7 +32,7 @@ namespace SMBLibrary.SMB2
public byte[] GetBytes() public byte[] GetBytes()
{ {
int length = 2 * Ciphers.Count * 2; int length = 2 + Ciphers.Count * 2;
byte[] buffer = new byte[length]; byte[] buffer = new byte[length];
LittleEndianWriter.WriteUInt16(buffer, 0, (ushort)Ciphers.Count); LittleEndianWriter.WriteUInt16(buffer, 0, (ushort)Ciphers.Count);
for (int index = 0; index < Ciphers.Count; index++) for (int index = 0; index < Ciphers.Count; index++)