* ChallengeResponse.cs: FxCop-ized.
* NtlmFlags.cs: FxCop-ized. CLS compliance.
* Type1Message.cs: FxCop-ized.
* Type3Message.cs: FxCop-ized.
svn path=/trunk/mcs/; revision=25860
// Implements Challenge Response for NTLM v1
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2004 Novell (http://www.novell.com)
//
// References
// a. NTLM Authentication Scheme for HTTP, Ronald Tschalär
//
using System;
+using System.Globalization;
using System.Security.Cryptography;
using System.Text;
// properties
public string Password {
+ get { return null; }
set {
if (_disposed)
throw new ObjectDisposedException ("too late");
}
public byte[] Challenge {
+ get { return null; }
set {
if (value == null)
throw new ArgumentNullException ("Challenge");
{
byte[] key7 = new byte [7];
int len = System.Math.Min (password.Length - position, 7);
- Encoding.ASCII.GetBytes (password.ToUpper (), position, len, key7, 0);
+ Encoding.ASCII.GetBytes (password.ToUpper (CultureInfo.CurrentCulture), position, len, key7, 0);
byte[] key8 = PrepareDESKey (key7, 0);
// cleanup intermediate key material
Array.Clear (key7, 0, key7.Length);
+2004-04-22 Sebastien Pouliot <sebastien@ximian.com>
+
+ * ChallengeResponse.cs: FxCop-ized.
+ * NtlmFlags.cs: FxCop-ized. CLS compliance.
+ * Type1Message.cs: FxCop-ized.
+ * Type3Message.cs: FxCop-ized.
+
2004-04-20 Sebastien Pouliot <sebastien@ximian.com>
* NtlmFlags.cs: Changed enum to int for CLS compliance.
// Mono.Security.Protocol.Ntlm.NtlmFlags
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2004 Novell (http://www.novell.com)
//
// References
// a. NTLM Authentication Scheme for HTTP, Ronald Tschalär
// The client sets this flag to indicate that it supports Unicode strings.
NegotiateUnicode = 0x00000001,
// This is set to indicate that the client supports OEM strings.
- NegotiateOEM = 0x00000002,
+ NegotiateOem = 0x00000002,
// This requests that the server send the authentication target with the Type 2 reply.
RequestTarget = 0x00000004,
// Indicates that NTLM authentication is supported.
- NegotiateNTLM = 0x00000200,
+ NegotiateNtlm = 0x00000200,
// When set, the client will send with the message the name of the domain in which the workstation has membership.
NegotiateDomainSupplied = 0x00001000,
// Indicates that the client is sending its workstation name with the message.
// Indicates that communication between the client and server after authentication should carry a "dummy" signature.
NegotiateAlwaysSign = 0x00008000,
// Indicates that this client supports the NTLM2 signing and sealing scheme; if negotiated, this can also affect the response calculations.
- NegotiateNTLM2Key = 0x00080000,
+ NegotiateNtlm2Key = 0x00080000,
// Indicates that this client supports strong (128-bit) encryption.
Negotiate128 = 0x20000000,
// Indicates that this client supports medium (56-bit) encryption.
// Mono.Security.Protocol.Ntlm.Type1Message - Negotiation
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2004 Novell (http://www.novell.com)
//
// References
// a. NTLM Authentication Scheme for HTTP, Ronald Tschalär
//
using System;
+using System.Globalization;
using System.Text;
namespace Mono.Security.Protocol.Ntlm {
public class Type1Message : MessageBase {
- //static private byte[] header = { 0x4e, 0x54, 0x4c, 0x4d, 0x53, 0x53, 0x50, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0xb2, 0x00, 0x00 };
-
private string _host;
private string _domain;
data [28] = 0x20;
data [29] = 0x00;
- byte[] host = Encoding.ASCII.GetBytes (_host.ToUpper ());
+ byte[] host = Encoding.ASCII.GetBytes (_host.ToUpper (CultureInfo.InvariantCulture));
Buffer.BlockCopy (host, 0, data, 32, host.Length);
- byte[] domain = Encoding.ASCII.GetBytes (_domain.ToUpper ());
+ byte[] domain = Encoding.ASCII.GetBytes (_domain.ToUpper (CultureInfo.InvariantCulture));
Buffer.BlockCopy (domain, 0, data, dom_off, domain.Length);
return data;
// Mono.Security.Protocol.Ntlm.Type3Message - Authentication
//
// Author:
-// Sebastien Pouliot (spouliot@motus.com)
+// Sebastien Pouliot <sebastien@ximian.com>
//
-// Copyright (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+// (C) 2004 Novell (http://www.novell.com)
//
// References
// a. NTLM Authentication Scheme for HTTP, Ronald Tschalär
//
using System;
+using System.Globalization;
using System.Text;
namespace Mono.Security.Protocol.Ntlm {
public override byte[] GetBytes ()
{
- byte[] domain = Encoding.Unicode.GetBytes (_domain.ToUpper ());
+ byte[] domain = Encoding.Unicode.GetBytes (_domain.ToUpper (CultureInfo.InvariantCulture));
byte[] user = Encoding.Unicode.GetBytes (_username);
- byte[] host = Encoding.Unicode.GetBytes (_host.ToUpper ());
+ byte[] host = Encoding.Unicode.GetBytes (_host.ToUpper (CultureInfo.InvariantCulture));
byte[] data = PrepareMessage (64 + domain.Length + user.Length + host.Length + 24 + 24);