diff --git a/SMBLibrary/SMB2/Commands/SMB2Command.cs b/SMBLibrary/SMB2/Commands/SMB2Command.cs index 041a43b..23b3796 100644 --- a/SMBLibrary/SMB2/Commands/SMB2Command.cs +++ b/SMBLibrary/SMB2/Commands/SMB2Command.cs @@ -1,4 +1,4 @@ -/* Copyright (C) 2017-2019 Tal Aloni . All rights reserved. +/* Copyright (C) 2017-2020 Tal Aloni . All rights reserved. * * 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, @@ -133,7 +133,7 @@ namespace SMBLibrary.SMB2 /// /// Used for signature calculation when applicable. /// - public static byte[] GetCommandChainBytes(List commands, byte[] sessionKey, SMB2Dialect dialect) + public static byte[] GetCommandChainBytes(List commands, byte[] signingKey, SMB2Dialect dialect) { int totalLength = 0; for (int index = 0; index < commands.Count; index++) @@ -167,10 +167,10 @@ namespace SMBLibrary.SMB2 paddedLength = commandLength; } 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. - 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. ByteWriter.WriteBytes(buffer, offset + SMB2Header.SignatureOffset, signature, 16); }