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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ using NUnit.Framework;
|
||||
namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
|
||||
[TestFixture]
|
||||
public class MessageBaseTest : Assertion {
|
||||
public class MessageBaseTest {
|
||||
|
||||
//
|
||||
|
||||
@@ -42,4 +42,4 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,17 +16,17 @@ using NUnit.Framework;
|
||||
namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
|
||||
[TestFixture]
|
||||
public class Type1MessageTest : Assertion {
|
||||
public class Type1MessageTest {
|
||||
|
||||
[Test]
|
||||
// Example from http://www.innovation.ch/java/ntlm.html
|
||||
public void Encode1 ()
|
||||
{
|
||||
Type1Message msg = new Type1Message ();
|
||||
AssertEquals ("Type", 1, msg.Type);
|
||||
Assert.AreEqual (1, msg.Type, "Type");
|
||||
msg.Domain = "Ursa-Minor";
|
||||
msg.Host = "LightCity";
|
||||
AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-01-00-00-00-07-B2-00-00-0A-00-0A-00-29-00-00-00-09-00-09-00-20-00-00-00-4C-49-47-48-54-43-49-54-59-55-52-53-41-2D-4D-49-4E-4F-52", BitConverter.ToString (msg.GetBytes ()));
|
||||
Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-01-00-00-00-07-B2-00-00-0A-00-0A-00-29-00-00-00-09-00-09-00-20-00-00-00-4C-49-47-48-54-43-49-54-59-55-52-53-41-2D-4D-49-4E-4F-52", BitConverter.ToString (msg.GetBytes ()), "GetBytes");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -35,10 +35,10 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xb2, 0x00, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x29, 0x00, 0x00, 0x00, 0x09, 0x00, 0x09, 0x00, 0x20, 0x00, 0x00, 0x00, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x43, 0x49, 0x54, 0x59, 0x55, 0x52, 0x53, 0x41, 0x2d, 0x4d, 0x49, 0x4e, 0x4f, 0x52 };
|
||||
Type1Message msg = new Type1Message (data);
|
||||
AssertEquals ("Domain", "URSA-MINOR", msg.Domain);
|
||||
AssertEquals ("Flags", (NtlmFlags)0xb203, msg.Flags);
|
||||
AssertEquals ("Host", "LIGHTCITY", msg.Host);
|
||||
AssertEquals ("Type", 1, msg.Type);
|
||||
Assert.AreEqual ("URSA-MINOR", msg.Domain, "Domain");
|
||||
Assert.AreEqual ((NtlmFlags)0xb203, msg.Flags, "Flags");
|
||||
Assert.AreEqual ("LIGHTCITY", msg.Host, "Host");
|
||||
Assert.AreEqual (1, msg.Type, "Type");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -47,10 +47,10 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x32, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x0b, 0x00, 0x20, 0x00, 0x00, 0x00, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x54, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x44, 0x4f, 0x4d, 0x41, 0x49, 0x4e };
|
||||
Type1Message msg = new Type1Message (data);
|
||||
AssertEquals ("Domain", "DOMAIN", msg.Domain);
|
||||
AssertEquals ("Flags", (NtlmFlags)0x3207, msg.Flags);
|
||||
AssertEquals ("Host", "WORKSTATION", msg.Host);
|
||||
AssertEquals ("Type", 1, msg.Type);
|
||||
Assert.AreEqual ("DOMAIN", msg.Domain, "Domain");
|
||||
Assert.AreEqual ((NtlmFlags)0x3207, msg.Flags, "Flags");
|
||||
Assert.AreEqual ("WORKSTATION", msg.Host, "Host");
|
||||
Assert.AreEqual (1, msg.Type, "Type");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ using NUnit.Framework;
|
||||
namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
|
||||
[TestFixture]
|
||||
public class Type2MessageTest : Assertion {
|
||||
public class Type2MessageTest {
|
||||
|
||||
static byte[] nonce = { 0x53, 0x72, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65 };
|
||||
|
||||
@@ -26,9 +26,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
public void Encode1 ()
|
||||
{
|
||||
Type2Message msg = new Type2Message ();
|
||||
AssertEquals ("Type", 2, msg.Type);
|
||||
Assert.AreEqual (2, msg.Type, "Type");
|
||||
msg.Nonce = nonce;
|
||||
AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-02-00-00-00-00-00-00-00-28-00-00-00-01-82-00-00-53-72-76-4E-6F-6E-63-65-00-00-00-00-00-00-00-00", BitConverter.ToString (msg.GetBytes ()));
|
||||
Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-02-00-00-00-00-00-00-00-28-00-00-00-01-82-00-00-53-72-76-4E-6F-6E-63-65-00-00-00-00-00-00-00-00", BitConverter.ToString (msg.GetBytes ()), "GetBytes");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -37,9 +37,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x53, 0x72, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
Type2Message msg = new Type2Message (data);
|
||||
AssertEquals ("Flags", (NtlmFlags)0x8201, msg.Flags);
|
||||
AssertEquals ("Nonce", BitConverter.ToString (nonce), BitConverter.ToString (msg.Nonce));
|
||||
AssertEquals ("Type", 2, msg.Type);
|
||||
Assert.AreEqual ((NtlmFlags)0x8201, msg.Flags, "Flags");
|
||||
Assert.AreEqual (BitConverter.ToString (nonce), BitConverter.ToString (msg.Nonce), "Nonce");
|
||||
Assert.AreEqual (2, msg.Type, "Type");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -48,9 +48,9 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
{
|
||||
byte[] data = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x02, 0x81, 0x00, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0x00, 0x62, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x41, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x02, 0x00, 0x0c, 0x00, 0x44, 0x00, 0x4f, 0x00, 0x4d, 0x00, 0x41, 0x00, 0x49, 0x00, 0x4e, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x53, 0x00, 0x45, 0x00, 0x52, 0x00, 0x56, 0x00, 0x45, 0x00, 0x52, 0x00, 0x04, 0x00, 0x14, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x2e, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x03, 0x00, 0x22, 0x00, 0x73, 0x00, 0x65, 0x00, 0x72, 0x00, 0x76, 0x00, 0x65, 0x00, 0x72, 0x00, 0x2e, 0x00, 0x64, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x61, 0x00, 0x69, 0x00, 0x6e, 0x00, 0x2e, 0x00, 0x63, 0x00, 0x6f, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
Type2Message msg = new Type2Message (data);
|
||||
AssertEquals ("Flags", (NtlmFlags)0x00810201, msg.Flags);
|
||||
AssertEquals ("Nonce", "01-23-45-67-89-AB-CD-EF", BitConverter.ToString (msg.Nonce));
|
||||
AssertEquals ("Type", 2, msg.Type);
|
||||
Assert.AreEqual ((NtlmFlags)0x00810201, msg.Flags, "Flags");
|
||||
Assert.AreEqual ("01-23-45-67-89-AB-CD-EF", BitConverter.ToString (msg.Nonce), "Nonce");
|
||||
Assert.AreEqual (2, msg.Type, "Type");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -17,7 +17,7 @@ using NUnit.Framework;
|
||||
namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
|
||||
[TestFixture]
|
||||
public class Type3MessageTest : Assertion {
|
||||
public class Type3MessageTest {
|
||||
|
||||
static byte[] nonce = { 0x53, 0x72, 0x76, 0x4e, 0x6f, 0x6e, 0x63, 0x65 };
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
msg.Host = "HOST";
|
||||
msg.Password = "WELCOME";
|
||||
msg.Username = "username";
|
||||
AssertEquals ("Type", 3, msg.Type);
|
||||
AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-64-00-00-00-18-00-18-00-7C-00-00-00-0C-00-0C-00-40-00-00-00-10-00-10-00-4C-00-00-00-08-00-08-00-5C-00-00-00-00-00-00-00-94-00-00-00-01-B2-00-00-44-00-4F-00-4D-00-41-00-49-00-4E-00-75-00-73-00-65-00-72-00-6E-00-61-00-6D-00-65-00-48-00-4F-00-53-00-54-00-CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8-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 (msg.GetBytes ()));
|
||||
Assert.AreEqual (3, msg.Type, "Type");
|
||||
Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-64-00-00-00-18-00-18-00-7C-00-00-00-0C-00-0C-00-40-00-00-00-10-00-10-00-4C-00-00-00-08-00-08-00-5C-00-00-00-00-00-00-00-94-00-00-00-01-B2-00-00-44-00-4F-00-4D-00-41-00-49-00-4E-00-75-00-73-00-65-00-72-00-6E-00-61-00-6D-00-65-00-48-00-4F-00-53-00-54-00-CA-12-00-72-3C-41-D5-77-AB-18-C7-64-C6-DE-F3-4F-A6-1B-FA-06-71-EA-5F-C8-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 (msg.GetBytes ()), "GetBytes");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -55,8 +55,8 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
msg.Host = "LIGHTCITY";
|
||||
msg.Password = "Beeblebrox";
|
||||
msg.Username = "Zaphod";
|
||||
AssertEquals ("Type", 3, msg.Type);
|
||||
AssertEquals ("GetBytes", "4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-72-00-00-00-18-00-18-00-8A-00-00-00-14-00-14-00-40-00-00-00-0C-00-0C-00-54-00-00-00-12-00-12-00-60-00-00-00-00-00-00-00-A2-00-00-00-01-B2-00-00-55-00-52-00-53-00-41-00-2D-00-4D-00-49-00-4E-00-4F-00-52-00-5A-00-61-00-70-00-68-00-6F-00-64-00-4C-00-49-00-47-00-48-00-54-00-43-00-49-00-54-00-59-00-AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97-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 (msg.GetBytes ()));
|
||||
Assert.AreEqual (3, msg.Type, "Type");
|
||||
Assert.AreEqual ("4E-54-4C-4D-53-53-50-00-03-00-00-00-18-00-18-00-72-00-00-00-18-00-18-00-8A-00-00-00-14-00-14-00-40-00-00-00-0C-00-0C-00-54-00-00-00-12-00-12-00-60-00-00-00-00-00-00-00-A2-00-00-00-01-B2-00-00-55-00-52-00-53-00-41-00-2D-00-4D-00-49-00-4E-00-4F-00-52-00-5A-00-61-00-70-00-68-00-6F-00-64-00-4C-00-49-00-47-00-48-00-54-00-43-00-49-00-54-00-59-00-AD-87-CA-6D-EF-E3-46-85-B9-C4-3C-47-7A-8C-42-D6-00-66-7D-68-92-E7-E8-97-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 (msg.GetBytes ()), "GetBytes");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -64,14 +64,14 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
public void Decode1 ()
|
||||
{
|
||||
Type3Message msg = new Type3Message (data1);
|
||||
AssertEquals ("Domain", "URSA-MINOR", msg.Domain);
|
||||
AssertEquals ("Host", "LIGHTCITY", msg.Host);
|
||||
AssertEquals ("Username", "Zaphod", msg.Username);
|
||||
AssertEquals ("Flags", (NtlmFlags)0x8201, msg.Flags);
|
||||
AssertEquals ("Type", 3, msg.Type);
|
||||
AssertNull ("Password", msg.Password);
|
||||
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 (msg.LM));
|
||||
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 (msg.NT));
|
||||
Assert.AreEqual ("URSA-MINOR", msg.Domain, "Domain");
|
||||
Assert.AreEqual ("LIGHTCITY", msg.Host, "Host");
|
||||
Assert.AreEqual ("Zaphod", msg.Username, "Username");
|
||||
Assert.AreEqual ((NtlmFlags)0x8201, msg.Flags, "Flags");
|
||||
Assert.AreEqual (3, msg.Type, "Type");
|
||||
Assert.IsNull (msg.Password, "Password");
|
||||
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 (msg.LM), "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 (msg.NT), "NT");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -79,28 +79,28 @@ namespace MonoTests.Mono.Security.Protocol.Ntlm {
|
||||
public void Decode2 ()
|
||||
{
|
||||
Type3Message msg = new Type3Message (data2);
|
||||
AssertEquals ("Domain", "DOMAIN", msg.Domain);
|
||||
AssertEquals ("Host", "WORKSTATION", msg.Host);
|
||||
AssertEquals ("Username", "user", msg.Username);
|
||||
AssertEquals ("Flags", (NtlmFlags)0x201, msg.Flags);
|
||||
AssertEquals ("Type", 3, msg.Type);
|
||||
AssertNull ("Password", msg.Password);
|
||||
AssertEquals ("LM", "C3-37-CD-5C-BD-44-FC-97-82-A6-67-AF-6D-42-7C-6D-E6-7C-20-C2-D3-E7-7C-56", BitConverter.ToString (msg.LM));
|
||||
AssertEquals ("NT", "25-A9-8C-1C-31-E8-18-47-46-6B-29-B2-DF-46-80-F3-99-58-FB-8C-21-3A-9C-C6", BitConverter.ToString (msg.NT));
|
||||
Assert.AreEqual ("DOMAIN", msg.Domain, "Domain");
|
||||
Assert.AreEqual ("WORKSTATION", msg.Host, "Host");
|
||||
Assert.AreEqual ("user", msg.Username, "Username");
|
||||
Assert.AreEqual ((NtlmFlags)0x201, msg.Flags, "Flags");
|
||||
Assert.AreEqual (3, msg.Type, "Type");
|
||||
Assert.IsNull (msg.Password, "Password");
|
||||
Assert.AreEqual ("C3-37-CD-5C-BD-44-FC-97-82-A6-67-AF-6D-42-7C-6D-E6-7C-20-C2-D3-E7-7C-56", BitConverter.ToString (msg.LM), "LM");
|
||||
Assert.AreEqual ("25-A9-8C-1C-31-E8-18-47-46-6B-29-B2-DF-46-80-F3-99-58-FB-8C-21-3A-9C-C6", BitConverter.ToString (msg.NT), "NT");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Challenge ()
|
||||
{
|
||||
Type3Message msg = new Type3Message ();
|
||||
AssertNull ("Challenge", msg.Challenge);
|
||||
Assert.IsNull (msg.Challenge, "Challenge");
|
||||
|
||||
byte[] c = new byte [8];
|
||||
msg.Challenge = c;
|
||||
AssertEquals ("Challenge.Length", 8, msg.Challenge.Length);
|
||||
Assert.AreEqual (8, msg.Challenge.Length, "Challenge.Length");
|
||||
|
||||
c [0] = 1;
|
||||
AssertEquals ("Challenge not directly accessible", 0, msg.Challenge [0]);
|
||||
Assert.AreEqual (0, msg.Challenge [0], "Challenge not directly accessible");
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user