Skip to content

Commit 47cfe86

Browse files
committed
Rectify DES cipher tests. There's no padding in the data.
1 parent 8c566f5 commit 47cfe86

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

test/Renci.SshNet.Tests/Classes/Security/Cryptography/Ciphers/DesCipherTest.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Renci.SshNet.Common;
66
using Renci.SshNet.Security.Cryptography.Ciphers;
77
using Renci.SshNet.Security.Cryptography.Ciphers.Modes;
8-
using Renci.SshNet.Security.Cryptography.Ciphers.Paddings;
98
using Renci.SshNet.Tests.Common;
109

1110
namespace Renci.SshNet.Tests.Classes.Security.Cryptography.Ciphers
@@ -30,7 +29,7 @@ public void Cbc_Encrypt()
3029
var key = new byte[] { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef };
3130
var iv = new byte[] { 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 };
3231

33-
var des = new DesCipher(key, new CbcCipherMode(iv), new PKCS7Padding());
32+
var des = new DesCipher(key, new CbcCipherMode(iv), padding: null);
3433
var actualCypher = des.Encrypt(input);
3534

3635
Assert.IsTrue((expectedCypher.IsEqualTo(actualCypher)));
@@ -50,7 +49,7 @@ public void Cbc_Decrypt()
5049
0xe3, 0xbd
5150
};
5251

53-
var des = new DesCipher(key, new CbcCipherMode(iv), new PKCS7Padding());
52+
var des = new DesCipher(key, new CbcCipherMode(iv), padding: null);
5453
var plain = des.Decrypt(cypher);
5554

5655
Assert.IsTrue(expectedPlain.IsEqualTo(plain));

0 commit comments

Comments
 (0)