NtlmFlags.cs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // This code is derived from jcifs smb client library <jcifs at samba dot org>
  2. // Ported by J. Arturo <webmaster at komodosoft dot net>
  3. //
  4. // This library is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser General Public
  6. // License as published by the Free Software Foundation; either
  7. // version 2.1 of the License, or (at your option) any later version.
  8. //
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. // Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public
  15. // License along with this library; if not, write to the Free Software
  16. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. namespace SharpCifs.Ntlmssp
  18. {
  19. /// <summary>Flags used during negotiation of NTLMSSP authentication.</summary>
  20. /// <remarks>Flags used during negotiation of NTLMSSP authentication.</remarks>
  21. public abstract class NtlmFlags
  22. {
  23. /// <summary>Indicates whether Unicode strings are supported or used.</summary>
  24. /// <remarks>Indicates whether Unicode strings are supported or used.</remarks>
  25. public const int NtlmsspNegotiateUnicode = unchecked(0x00000001);
  26. /// <summary>Indicates whether OEM strings are supported or used.</summary>
  27. /// <remarks>Indicates whether OEM strings are supported or used.</remarks>
  28. public const int NtlmsspNegotiateOem = unchecked(0x00000002);
  29. /// <summary>
  30. /// Indicates whether the authentication target is requested from
  31. /// the server.
  32. /// </summary>
  33. /// <remarks>
  34. /// Indicates whether the authentication target is requested from
  35. /// the server.
  36. /// </remarks>
  37. public const int NtlmsspRequestTarget = unchecked(0x00000004);
  38. /// <summary>
  39. /// Specifies that communication across the authenticated channel
  40. /// should carry a digital signature (message integrity).
  41. /// </summary>
  42. /// <remarks>
  43. /// Specifies that communication across the authenticated channel
  44. /// should carry a digital signature (message integrity).
  45. /// </remarks>
  46. public const int NtlmsspNegotiateSign = unchecked(0x00000010);
  47. /// <summary>
  48. /// Specifies that communication across the authenticated channel
  49. /// should be encrypted (message confidentiality).
  50. /// </summary>
  51. /// <remarks>
  52. /// Specifies that communication across the authenticated channel
  53. /// should be encrypted (message confidentiality).
  54. /// </remarks>
  55. public const int NtlmsspNegotiateSeal = unchecked(0x00000020);
  56. /// <summary>Indicates datagram authentication.</summary>
  57. /// <remarks>Indicates datagram authentication.</remarks>
  58. public const int NtlmsspNegotiateDatagramStyle = unchecked(0x00000040);
  59. /// <summary>
  60. /// Indicates that the LAN Manager session key should be used for
  61. /// signing and sealing authenticated communication.
  62. /// </summary>
  63. /// <remarks>
  64. /// Indicates that the LAN Manager session key should be used for
  65. /// signing and sealing authenticated communication.
  66. /// </remarks>
  67. public const int NtlmsspNegotiateLmKey = unchecked(0x00000080);
  68. public const int NtlmsspNegotiateNetware = unchecked(0x00000100);
  69. /// <summary>Indicates support for NTLM authentication.</summary>
  70. /// <remarks>Indicates support for NTLM authentication.</remarks>
  71. public const int NtlmsspNegotiateNtlm = unchecked(0x00000200);
  72. /// <summary>
  73. /// Indicates whether the OEM-formatted domain name in which the
  74. /// client workstation has membership is supplied in the Type-1 message.
  75. /// </summary>
  76. /// <remarks>
  77. /// Indicates whether the OEM-formatted domain name in which the
  78. /// client workstation has membership is supplied in the Type-1 message.
  79. /// This is used in the negotation of local authentication.
  80. /// </remarks>
  81. public const int NtlmsspNegotiateOemDomainSupplied = unchecked(0x00001000);
  82. /// <summary>
  83. /// Indicates whether the OEM-formatted workstation name is supplied
  84. /// in the Type-1 message.
  85. /// </summary>
  86. /// <remarks>
  87. /// Indicates whether the OEM-formatted workstation name is supplied
  88. /// in the Type-1 message. This is used in the negotiation of local
  89. /// authentication.
  90. /// </remarks>
  91. public const int NtlmsspNegotiateOemWorkstationSupplied = unchecked(0x00002000);
  92. /// <summary>
  93. /// Sent by the server to indicate that the server and client are
  94. /// on the same machine.
  95. /// </summary>
  96. /// <remarks>
  97. /// Sent by the server to indicate that the server and client are
  98. /// on the same machine. This implies that the server will include
  99. /// a local security context handle in the Type 2 message, for
  100. /// use in local authentication.
  101. /// </remarks>
  102. public const int NtlmsspNegotiateLocalCall = unchecked(0x00004000);
  103. /// <summary>
  104. /// Indicates that authenticated communication between the client
  105. /// and server should carry a "dummy" digital signature.
  106. /// </summary>
  107. /// <remarks>
  108. /// Indicates that authenticated communication between the client
  109. /// and server should carry a "dummy" digital signature.
  110. /// </remarks>
  111. public const int NtlmsspNegotiateAlwaysSign = unchecked(0x00008000);
  112. /// <summary>
  113. /// Sent by the server in the Type 2 message to indicate that the
  114. /// target authentication realm is a domain.
  115. /// </summary>
  116. /// <remarks>
  117. /// Sent by the server in the Type 2 message to indicate that the
  118. /// target authentication realm is a domain.
  119. /// </remarks>
  120. public const int NtlmsspTargetTypeDomain = unchecked(0x00010000);
  121. /// <summary>
  122. /// Sent by the server in the Type 2 message to indicate that the
  123. /// target authentication realm is a server.
  124. /// </summary>
  125. /// <remarks>
  126. /// Sent by the server in the Type 2 message to indicate that the
  127. /// target authentication realm is a server.
  128. /// </remarks>
  129. public const int NtlmsspTargetTypeServer = unchecked(0x00020000);
  130. /// <summary>
  131. /// Sent by the server in the Type 2 message to indicate that the
  132. /// target authentication realm is a share (presumably for share-level
  133. /// authentication).
  134. /// </summary>
  135. /// <remarks>
  136. /// Sent by the server in the Type 2 message to indicate that the
  137. /// target authentication realm is a share (presumably for share-level
  138. /// authentication).
  139. /// </remarks>
  140. public const int NtlmsspTargetTypeShare = unchecked(0x00040000);
  141. /// <summary>
  142. /// Indicates that the NTLM2 signing and sealing scheme should be used
  143. /// for protecting authenticated communications.
  144. /// </summary>
  145. /// <remarks>
  146. /// Indicates that the NTLM2 signing and sealing scheme should be used
  147. /// for protecting authenticated communications. This refers to a
  148. /// particular session security scheme, and is not related to the use
  149. /// of NTLMv2 authentication.
  150. /// </remarks>
  151. public const int NtlmsspNegotiateNtlm2 = unchecked(0x00080000);
  152. public const int NtlmsspRequestInitResponse = unchecked(0x00100000);
  153. public const int NtlmsspRequestAcceptResponse = unchecked(0x00200000);
  154. public const int NtlmsspRequestNonNtSessionKey = unchecked(0x00400000
  155. );
  156. /// <summary>
  157. /// Sent by the server in the Type 2 message to indicate that it is
  158. /// including a Target Information block in the message.
  159. /// </summary>
  160. /// <remarks>
  161. /// Sent by the server in the Type 2 message to indicate that it is
  162. /// including a Target Information block in the message. The Target
  163. /// Information block is used in the calculation of the NTLMv2 response.
  164. /// </remarks>
  165. public const int NtlmsspNegotiateTargetInfo = unchecked(0x00800000);
  166. /// <summary>Indicates that 128-bit encryption is supported.</summary>
  167. /// <remarks>Indicates that 128-bit encryption is supported.</remarks>
  168. public const int NtlmsspNegotiate128 = unchecked(0x20000000);
  169. public const int NtlmsspNegotiateKeyExch = unchecked(0x40000000);
  170. /// <summary>Indicates that 56-bit encryption is supported.</summary>
  171. /// <remarks>Indicates that 56-bit encryption is supported.</remarks>
  172. public const int NtlmsspNegotiate56 = unchecked((int)(0x80000000));
  173. }
  174. }