You've already forked linux-packaging-mono
Imported Upstream version 4.8.0.309
Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
parent
ee1447783b
commit
94b2861243
@@ -17,7 +17,7 @@ using NUnit.Framework;
|
||||
namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
|
||||
[TestFixture]
|
||||
public class ChallengeResponseTest : Assertion {
|
||||
public class ChallengeResponseTest {
|
||||
|
||||
[Test]
|
||||
// Example from http://www.innovation.ch/java/ntlm.html
|
||||
@@ -25,8 +25,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] SrvNonce = Encoding.ASCII.GetBytes ("SrvNonce");
|
||||
using (ChallengeResponse ntlm = new ChallengeResponse ("Beeblebrox", SrvNonce)) {
|
||||
AssertEquals ("NT", "E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (ntlm.NT));
|
||||
AssertEquals ("LM", "AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97", BitConverter.ToString (ntlm.LM));
|
||||
Assert.AreEqual ("E0-E0-0D-E3-10-4A-1B-F2-05-3F-07-C7-DD-A8-2D-3C-48-9A-E9-89-E1-B0-00-D3", BitConverter.ToString (ntlm.NT), "NT");
|
||||
Assert.AreEqual ("AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97", BitConverter.ToString (ntlm.LM), "LM");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] SrvNonce = new byte [8] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
|
||||
using (ChallengeResponse ntlm = new ChallengeResponse ("WELCOME", SrvNonce)) {
|
||||
AssertEquals ("NT", "7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString (ntlm.NT));
|
||||
AssertEquals ("LM", "CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM));
|
||||
Assert.AreEqual ("7A-CE-90-85-AB-CC-37-59-38-0B-1C-68-62-E3-98-C3-C0-EF-9C-FC-22-E8-A2-C2", BitConverter.ToString (ntlm.NT), "NT");
|
||||
Assert.AreEqual ("CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM), "LM");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] SrvNonce = new byte [8] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
|
||||
using (ChallengeResponse ntlm = new ChallengeResponse (null, SrvNonce)) {
|
||||
AssertEquals ("NT", "4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT));
|
||||
Assert.AreEqual ("4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT), "NT");
|
||||
// note the last 8 bytes... they are the same as the previous unit test ;-)
|
||||
AssertEquals ("LM", "0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM));
|
||||
Assert.AreEqual ("0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM), "LM");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
byte[] SrvNonce = new byte [8] { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 };
|
||||
using (ChallengeResponse ntlm = new ChallengeResponse (String.Empty, SrvNonce)) {
|
||||
// same as the previous one as this is the same (null/empty) password expressed diffently
|
||||
AssertEquals ("NT", "4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT));
|
||||
AssertEquals ("LM", "0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM));
|
||||
Assert.AreEqual ("4A-FD-81-EC-01-87-E8-8D-97-77-8D-F7-93-C6-DA-D4-F0-3A-36-63-66-9D-20-1C", BitConverter.ToString (ntlm.NT), "NT");
|
||||
Assert.AreEqual ("0A-39-2B-11-CF-05-2B-02-6D-65-CF-F5-68-BD-E4-15-A6-1B-FA-06-71-EA-5F-C8", BitConverter.ToString (ntlm.LM), "LM");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
ChallengeResponse ntlm = new ChallengeResponse ("Mono", new byte [8]);
|
||||
// no out!
|
||||
AssertNull ("Password", ntlm.Password);
|
||||
AssertNull ("Challenge", ntlm.Challenge);
|
||||
Assert.IsNull (ntlm.Password, "Password");
|
||||
Assert.IsNull (ntlm.Challenge, "Challenge");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -104,7 +104,7 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
ChallengeResponse ntlm = new ChallengeResponse ("Mono", new byte [8]);
|
||||
ntlm.Dispose ();
|
||||
AssertNotNull ("NT", ntlm.NT);
|
||||
Assert.IsNotNull (ntlm.NT, "NT");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -113,7 +113,7 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
ChallengeResponse ntlm = new ChallengeResponse ("Mono", new byte [8]);
|
||||
ntlm.Dispose ();
|
||||
AssertNotNull ("LM", ntlm.LM);
|
||||
Assert.IsNotNull (ntlm.LM, "LM");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user