ntlm.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #ifndef HEADER_VAUTH_NTLM_H
  2. #define HEADER_VAUTH_NTLM_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  11. *
  12. * This software is licensed as described in the file COPYING, which
  13. * you should have received as part of this distribution. The terms
  14. * are also available at https://curl.se/docs/copyright.html.
  15. *
  16. * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  17. * copies of the Software, and permit persons to whom the Software is
  18. * furnished to do so, under the terms of the COPYING file.
  19. *
  20. * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  21. * KIND, either express or implied.
  22. *
  23. * SPDX-License-Identifier: curl
  24. *
  25. ***************************************************************************/
  26. #include "curl_setup.h"
  27. #ifdef USE_NTLM
  28. /* NTLM buffer fixed size, large enough for long user + host + domain */
  29. #define NTLM_BUFSIZE 1024
  30. /* Stuff only required for curl_ntlm_msgs.c */
  31. #ifdef BUILDING_CURL_NTLM_MSGS_C
  32. /* Flag bits definitions based on
  33. https://davenport.sourceforge.net/ntlm.html */
  34. #define NTLMFLAG_NEGOTIATE_UNICODE (1<<0)
  35. /* Indicates that Unicode strings are supported for use in security buffer
  36. data. */
  37. #define NTLMFLAG_NEGOTIATE_OEM (1<<1)
  38. /* Indicates that OEM strings are supported for use in security buffer data. */
  39. #define NTLMFLAG_REQUEST_TARGET (1<<2)
  40. /* Requests that the server's authentication realm be included in the Type 2
  41. message. */
  42. /* unknown (1<<3) */
  43. #define NTLMFLAG_NEGOTIATE_SIGN (1<<4)
  44. /* Specifies that authenticated communication between the client and server
  45. should carry a digital signature (message integrity). */
  46. #define NTLMFLAG_NEGOTIATE_SEAL (1<<5)
  47. /* Specifies that authenticated communication between the client and server
  48. should be encrypted (message confidentiality). */
  49. #define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6)
  50. /* Indicates that datagram authentication is being used. */
  51. #define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7)
  52. /* Indicates that the LAN Manager session key should be used for signing and
  53. sealing authenticated communications. */
  54. #define NTLMFLAG_NEGOTIATE_NETWARE (1<<8)
  55. /* unknown purpose */
  56. #define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9)
  57. /* Indicates that NTLM authentication is being used. */
  58. /* unknown (1<<10) */
  59. #define NTLMFLAG_NEGOTIATE_ANONYMOUS (1<<11)
  60. /* Sent by the client in the Type 3 message to indicate that an anonymous
  61. context has been established. This also affects the response fields. */
  62. #define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12)
  63. /* Sent by the client in the Type 1 message to indicate that a desired
  64. authentication realm is included in the message. */
  65. #define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13)
  66. /* Sent by the client in the Type 1 message to indicate that the client
  67. workstation's name is included in the message. */
  68. #define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14)
  69. /* Sent by the server to indicate that the server and client are on the same
  70. machine. Implies that the client may use a pre-established local security
  71. context rather than responding to the challenge. */
  72. #define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15)
  73. /* Indicates that authenticated communication between the client and server
  74. should be signed with a "dummy" signature. */
  75. #define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16)
  76. /* Sent by the server in the Type 2 message to indicate that the target
  77. authentication realm is a domain. */
  78. #define NTLMFLAG_TARGET_TYPE_SERVER (1<<17)
  79. /* Sent by the server in the Type 2 message to indicate that the target
  80. authentication realm is a server. */
  81. #define NTLMFLAG_TARGET_TYPE_SHARE (1<<18)
  82. /* Sent by the server in the Type 2 message to indicate that the target
  83. authentication realm is a share. Presumably, this is for share-level
  84. authentication. Usage is unclear. */
  85. #define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19)
  86. /* Indicates that the NTLM2 signing and sealing scheme should be used for
  87. protecting authenticated communications. */
  88. #define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20)
  89. /* unknown purpose */
  90. #define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21)
  91. /* unknown purpose */
  92. #define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22)
  93. /* unknown purpose */
  94. #define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23)
  95. /* Sent by the server in the Type 2 message to indicate that it is including a
  96. Target Information block in the message. */
  97. /* unknown (1<24) */
  98. /* unknown (1<25) */
  99. /* unknown (1<26) */
  100. /* unknown (1<27) */
  101. /* unknown (1<28) */
  102. #define NTLMFLAG_NEGOTIATE_128 (1<<29)
  103. /* Indicates that 128-bit encryption is supported. */
  104. #define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30)
  105. /* Indicates that the client will provide an encrypted master key in
  106. the "Session Key" field of the Type 3 message. */
  107. #define NTLMFLAG_NEGOTIATE_56 (1<<31)
  108. /* Indicates that 56-bit encryption is supported. */
  109. #endif /* BUILDING_CURL_NTLM_MSGS_C */
  110. #endif /* USE_NTLM */
  111. #endif /* HEADER_VAUTH_NTLM_H */