SMB2Cryptography: Improved method names

This commit is contained in:
TalAloni 2020-11-28 18:12:09 +02:00
parent e3fcef80f3
commit 95fa303bca
2 changed files with 4 additions and 4 deletions

View file

@ -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 };

View file

@ -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)
{