2004-04-22 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Thu, 22 Apr 2004 19:40:34 +0000 (19:40 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Thu, 22 Apr 2004 19:40:34 +0000 (19:40 -0000)
* ChallengeResponse.cs: FxCop-ized.
* NtlmFlags.cs: FxCop-ized. CLS compliance.
* Type1Message.cs: FxCop-ized.
* Type3Message.cs: FxCop-ized.

svn path=/trunk/mcs/; revision=25860

mcs/class/Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Ntlm/ChangeLog
mcs/class/Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
mcs/class/Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs

index 29e876890da9bb750ff6c539eadf537b575f0d93..8e49d8d2eb0c0b7522e610d5c80e9f7758269135 100755 (executable)
@@ -3,9 +3,10 @@
 //     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
@@ -15,6 +16,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Security.Cryptography;
 using System.Text;
 
@@ -59,6 +61,7 @@ namespace Mono.Security.Protocol.Ntlm {
                // properties
 
                public string Password {
+                       get { return null; }
                        set { 
                                if (_disposed)
                                        throw new ObjectDisposedException ("too late");
@@ -103,6 +106,7 @@ namespace Mono.Security.Protocol.Ntlm {
                }
 
                public byte[] Challenge {
+                       get { return null; }
                        set {
                                if (value == null)
                                        throw new ArgumentNullException ("Challenge");
@@ -189,7 +193,7 @@ namespace Mono.Security.Protocol.Ntlm {
                {
                        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);
index 0c00072b11d5f63efd65736fa724eb1559b42aa3..38ef148489bcf7be214b95fa885a4d8ae7d84809 100755 (executable)
@@ -1,3 +1,10 @@
+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.
index 60ae7af500b3ef3e543ebedfe06744ede2eef237..c8002404167f46499a0394a2e8c85f57653da675 100755 (executable)
@@ -2,9 +2,10 @@
 // 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
@@ -22,11 +23,11 @@ namespace Mono.Security.Protocol.Ntlm {
                // 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.  
@@ -34,7 +35,7 @@ namespace Mono.Security.Protocol.Ntlm {
                // 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.
index 3376456db17731e84bd07a6a4a881fa556108fd0..a12fa7ab84484198158af773760a5f563b3414ff 100755 (executable)
@@ -2,9 +2,10 @@
 // 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;
 
@@ -94,10 +94,10 @@ namespace Mono.Security.Protocol.Ntlm {
                        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;
index 63fce06139541e6bf72e9ceb55cf6257f9ddae0f..a37c5ffb36fd6a2b6bb3e93461729fdf348b54b1 100755 (executable)
@@ -2,9 +2,10 @@
 // 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
@@ -14,6 +15,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.Text;
 
 namespace Mono.Security.Protocol.Ntlm {
@@ -133,9 +135,9 @@ 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);