diff --git a/SMBLibrary.Tests/SMB2EncryptionTests.cs b/SMBLibrary.Tests/SMB2EncryptionTests.cs index ef9c428..f27e6f3 100644 --- a/SMBLibrary.Tests/SMB2EncryptionTests.cs +++ b/SMBLibrary.Tests/SMB2EncryptionTests.cs @@ -22,7 +22,7 @@ namespace SMBLibrary.Tests byte[] expectedEncryptionKey = new byte[] { 0x26, 0x1B, 0x72, 0x35, 0x05, 0x58, 0xF2, 0xE9, 0xDC, 0xF6, 0x13, 0x07, 0x03, 0x83, 0xED, 0xBF }; - byte[] encryptionKey = SMB2Cryptography.GenerateEncryptionKey(sessionKey, SMB2Dialect.SMB300, null); + byte[] encryptionKey = SMB2Cryptography.GenerateClientEncryptionKey(sessionKey, SMB2Dialect.SMB300, null); Assert.IsTrue(ByteUtils.AreByteArraysEqual(expectedEncryptionKey, encryptionKey)); } @@ -32,7 +32,7 @@ namespace SMBLibrary.Tests { byte[] sessionKey = new byte[] { 0xB4, 0x54, 0x67, 0x71, 0xB5, 0x15, 0xF7, 0x66, 0xA8, 0x67, 0x35, 0x53, 0x2D, 0xD6, 0xC4, 0xF0 }; - byte[] decryptionKey = SMB2Cryptography.GenerateDecryptionKey(sessionKey, SMB2Dialect.SMB300, null); + byte[] decryptionKey = SMB2Cryptography.GenerateClientDecryptionKey(sessionKey, SMB2Dialect.SMB300, null); byte[] expectedDecryptionKey = new byte[] { 0x8F, 0xE2, 0xB5, 0x7E, 0xC3, 0x4D, 0x2D, 0xB5, 0xB1, 0xA9, 0x72, 0x7F, 0x52, 0x6B, 0xBD, 0xB5 }; diff --git a/SMBLibrary/SMB2/SMB2Cryptography.cs b/SMBLibrary/SMB2/SMB2Cryptography.cs index fcbb815..5f510ee 100644 --- a/SMBLibrary/SMB2/SMB2Cryptography.cs +++ b/SMBLibrary/SMB2/SMB2Cryptography.cs @@ -44,7 +44,7 @@ namespace SMBLibrary.SMB2 return SP800_1008.DeriveKey(hmac, label, context, 128); } - public static byte[] GenerateEncryptionKey(byte[] sessionKey, SMB2Dialect dialect, byte[] preauthIntegrityHashValue) + public static byte[] GenerateClientEncryptionKey(byte[] sessionKey, SMB2Dialect dialect, byte[] preauthIntegrityHashValue) { if (dialect == SMB2Dialect.SMB311 && preauthIntegrityHashValue == null) { @@ -59,7 +59,7 @@ namespace SMBLibrary.SMB2 return SP800_1008.DeriveKey(hmac, label, context, 128); } - public static byte[] GenerateDecryptionKey(byte[] sessionKey, SMB2Dialect dialect, byte[] preauthIntegrityHashValue) + public static byte[] GenerateClientDecryptionKey(byte[] sessionKey, SMB2Dialect dialect, byte[] preauthIntegrityHashValue) { if (dialect == SMB2Dialect.SMB311 && preauthIntegrityHashValue == null) {