mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-27 19:26:08 +02:00
SMB2Command: Renamed parameter
This commit is contained in:
parent
1636079cc2
commit
d50ce6f710
1 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 2017-2019 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
/* Copyright (C) 2017-2020 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
|
||||||
*
|
*
|
||||||
* You can redistribute this program and/or modify it under the terms of
|
* 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,
|
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||||
|
@ -133,7 +133,7 @@ namespace SMBLibrary.SMB2
|
||||||
/// <param name="dialect">
|
/// <param name="dialect">
|
||||||
/// Used for signature calculation when applicable.
|
/// Used for signature calculation when applicable.
|
||||||
/// </param>
|
/// </param>
|
||||||
public static byte[] GetCommandChainBytes(List<SMB2Command> commands, byte[] sessionKey, SMB2Dialect dialect)
|
public static byte[] GetCommandChainBytes(List<SMB2Command> commands, byte[] signingKey, SMB2Dialect dialect)
|
||||||
{
|
{
|
||||||
int totalLength = 0;
|
int totalLength = 0;
|
||||||
for (int index = 0; index < commands.Count; index++)
|
for (int index = 0; index < commands.Count; index++)
|
||||||
|
@ -167,10 +167,10 @@ namespace SMBLibrary.SMB2
|
||||||
paddedLength = commandLength;
|
paddedLength = commandLength;
|
||||||
}
|
}
|
||||||
command.WriteBytes(buffer, offset);
|
command.WriteBytes(buffer, offset);
|
||||||
if (command.Header.IsSigned && sessionKey != null)
|
if (command.Header.IsSigned && signingKey != null)
|
||||||
{
|
{
|
||||||
// [MS-SMB2] Any padding at the end of the message MUST be used in the hash computation.
|
// [MS-SMB2] Any padding at the end of the message MUST be used in the hash computation.
|
||||||
byte[] signature = SMB2Cryptography.CalculateSignature(sessionKey, dialect, buffer, offset, paddedLength);
|
byte[] signature = SMB2Cryptography.CalculateSignature(signingKey, dialect, buffer, offset, paddedLength);
|
||||||
// [MS-SMB2] The first 16 bytes of the hash MUST be copied into the 16-byte signature field of the SMB2 Header.
|
// [MS-SMB2] The first 16 bytes of the hash MUST be copied into the 16-byte signature field of the SMB2 Header.
|
||||||
ByteWriter.WriteBytes(buffer, offset + SMB2Header.SignatureOffset, signature, 16);
|
ByteWriter.WriteBytes(buffer, offset + SMB2Header.SignatureOffset, signature, 16);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue