Skip to content

Commit f434c97

Browse files
committed
Attempt to recover from Git merge struggels ...
1 parent 88b2432 commit f434c97

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/SshNet.Security.Cryptography.Shared.Tests/HMACMD5Test.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void Rfc2202_6()
9696
public void Rfc2202_7()
9797
{
9898
var key = ByteExtensions.Repeat(0xaa, 80);
99-
var data = Encoding.ASCII.GetBytes("Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data");
99+
var data = ByteExtensions.HexToByteArray("54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461"); // "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
100100
var expectedHash = ByteExtensions.HexToByteArray("6f630fad67cda0ee1fb1f562db3aa53e");
101101
var hmac = CreateHMACMD5(key);
102102

@@ -118,7 +118,7 @@ public void ComputeHashShouldInitializeHashProvider()
118118
Assert.Equal(expectedHash, actualHash);
119119

120120
// Rfc2202_6
121-
data = Encoding.ASCII.GetBytes("Test Using Larger Than Block-Size Key - Hash Key First");
121+
data = ByteExtensions.HexToByteArray("54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b6579202d2048617368204b6579204669727374"); // "Test Using Larger Than Block-Size Key - Hash Key First"
122122
expectedHash = ByteExtensions.HexToByteArray("6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd");
123123

124124
actualHash = hmac.ComputeHash(data);
@@ -130,7 +130,7 @@ public void ModifyKeyBeforeCompute()
130130
{
131131
// Rfc2202_7
132132
var key = ByteExtensions.Repeat(0xaa, 80);
133-
var data = Encoding.ASCII.GetBytes("Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data");
133+
var data = ByteExtensions.HexToByteArray("54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461"); // "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
134134
var expectedHash = ByteExtensions.HexToByteArray("6f630fad67cda0ee1fb1f562db3aa53e");
135135

136136
// first initialize HMAC with a dummy key
@@ -155,8 +155,8 @@ public void ModifyKeyAfterCompute()
155155
Assert.Equal(expectedHash, actualHash);
156156

157157
// Rfc2202_2: assign key smaller than block size
158-
key = Encoding.ASCII.GetBytes("Jefe");
159-
data = Encoding.ASCII.GetBytes("what do ya want for nothing?");
158+
key = ByteExtensions.HexToByteArray("4a656665"); // "Jefe";
159+
data = ByteExtensions.HexToByteArray("7768617420646f2079612077616e7420666f72206e6f7468696e673f"); // "what do ya want for nothing?"
160160
expectedHash = ByteExtensions.HexToByteArray("750c783e6ab0b503eaa86e310a5db738");
161161
hmac.Key = key;
162162

@@ -165,7 +165,7 @@ public void ModifyKeyAfterCompute()
165165

166166
// Rfc2202_7: assign key larger than block size
167167
key = ByteExtensions.Repeat(0xaa, 80);
168-
data = Encoding.ASCII.GetBytes("Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data");
168+
data = ByteExtensions.HexToByteArray("54657374205573696e67204c6172676572205468616e20426c6f636b2d53697a65204b657920616e64204c6172676572205468616e204f6e6520426c6f636b2d53697a652044617461"); // "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"
169169
expectedHash = ByteExtensions.HexToByteArray("6f630fad67cda0ee1fb1f562db3aa53e");
170170
hmac.Key = key;
171171

0 commit comments

Comments
 (0)