FreeRDP
winpr/libwinpr/sspi/NTLM/ntlm.h File Reference
#include <winpr/sspi.h>
#include <winpr/windows.h>
#include <winpr/nt.h>
#include <winpr/crypto.h>
#include "../sspi.h"
This graph shows which files directly or indirectly include this file:

Data Structures

struct  NTLM_AV_PAIR
 
struct  NTLM_VERSION_INFO
 
struct  NTLM_SINGLE_HOST_DATA
 
struct  NTLM_RESPONSE
 
struct  NTLMv2_CLIENT_CHALLENGE
 
struct  NTLMv2_RESPONSE
 
struct  NTLM_MESSAGE_FIELDS
 
struct  NTLM_MESSAGE_HEADER
 
struct  NTLM_NEGOTIATE_MESSAGE
 
struct  NTLM_CHALLENGE_MESSAGE
 
struct  NTLM_AUTHENTICATE_MESSAGE
 
struct  NTLM_CONTEXT
 

Macros

#define MESSAGE_TYPE_NEGOTIATE   1
 
#define MESSAGE_TYPE_CHALLENGE   2
 
#define MESSAGE_TYPE_AUTHENTICATE   3
 
#define NTLMSSP_NEGOTIATE_56   0x80000000 /* W (0) */
 
#define NTLMSSP_NEGOTIATE_KEY_EXCH   0x40000000 /* V (1) */
 
#define NTLMSSP_NEGOTIATE_128   0x20000000 /* U (2) */
 
#define NTLMSSP_RESERVED1   0x10000000 /* r1 (3) */
 
#define NTLMSSP_RESERVED2   0x08000000 /* r2 (4) */
 
#define NTLMSSP_RESERVED3   0x04000000 /* r3 (5) */
 
#define NTLMSSP_NEGOTIATE_VERSION   0x02000000 /* T (6) */
 
#define NTLMSSP_RESERVED4   0x01000000 /* r4 (7) */
 
#define NTLMSSP_NEGOTIATE_TARGET_INFO   0x00800000 /* S (8) */
 
#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY   0x00400000 /* R (9) */
 
#define NTLMSSP_RESERVED5   0x00200000 /* r5 (10) */
 
#define NTLMSSP_NEGOTIATE_IDENTIFY   0x00100000 /* Q (11) */
 
#define NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY   0x00080000 /* P (12) */
 
#define NTLMSSP_RESERVED6   0x00040000 /* r6 (13) */
 
#define NTLMSSP_TARGET_TYPE_SERVER   0x00020000 /* O (14) */
 
#define NTLMSSP_TARGET_TYPE_DOMAIN   0x00010000 /* N (15) */
 
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN   0x00008000 /* M (16) */
 
#define NTLMSSP_RESERVED7   0x00004000 /* r7 (17) */
 
#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED   0x00002000 /* L (18) */
 
#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED   0x00001000 /* K (19) */
 
#define NTLMSSP_NEGOTIATE_ANONYMOUS   0x00000800 /* J (20) */
 
#define NTLMSSP_RESERVED8   0x00000400 /* r8 (21) */
 
#define NTLMSSP_NEGOTIATE_NTLM   0x00000200 /* H (22) */
 
#define NTLMSSP_RESERVED9   0x00000100 /* r9 (23) */
 
#define NTLMSSP_NEGOTIATE_LM_KEY   0x00000080 /* G (24) */
 
#define NTLMSSP_NEGOTIATE_DATAGRAM   0x00000040 /* F (25) */
 
#define NTLMSSP_NEGOTIATE_SEAL   0x00000020 /* E (26) */
 
#define NTLMSSP_NEGOTIATE_SIGN   0x00000010 /* D (27) */
 
#define NTLMSSP_RESERVED10   0x00000008 /* r10 (28) */
 
#define NTLMSSP_REQUEST_TARGET   0x00000004 /* C (29) */
 
#define NTLMSSP_NEGOTIATE_OEM   0x00000002 /* B (30) */
 
#define NTLMSSP_NEGOTIATE_UNICODE   0x00000001 /* A (31) */
 
#define MSV_AV_FLAGS_AUTHENTICATION_CONSTRAINED   0x00000001
 
#define MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK   0x00000002
 
#define MSV_AV_FLAGS_TARGET_SPN_UNTRUSTED_SOURCE   0x00000004
 
#define WINDOWS_MAJOR_VERSION_5   0x05
 
#define WINDOWS_MAJOR_VERSION_6   0x06
 
#define WINDOWS_MINOR_VERSION_0   0x00
 
#define WINDOWS_MINOR_VERSION_1   0x01
 
#define WINDOWS_MINOR_VERSION_2   0x02
 
#define NTLMSSP_REVISION_W2K3   0x0F
 

Enumerations

enum  NTLM_STATE {
  NTLM_STATE_INITIAL, NTLM_STATE_NEGOTIATE, NTLM_STATE_CHALLENGE, NTLM_STATE_AUTHENTICATE,
  NTLM_STATE_FINAL
}
 
enum  NTLM_AV_ID {
  MsvAvEOL, MsvAvNbComputerName, MsvAvNbDomainName, MsvAvDnsComputerName,
  MsvAvDnsDomainName, MsvAvDnsTreeName, MsvAvFlags, MsvAvTimestamp,
  MsvAvSingleHost, MsvAvTargetName, MsvAvChannelBindings
}
 

Functions

char * ntlm_negotiate_flags_string (char *buffer, size_t size, UINT32 flags)
 
const char * ntlm_message_type_string (UINT32 messageType)
 
const char * ntlm_state_string (NTLM_STATE state)
 
void ntlm_change_state (NTLM_CONTEXT *ntlm, NTLM_STATE state)
 
NTLM_STATE ntlm_get_state (NTLM_CONTEXT *ntlm)
 
void ntlm_reset_cipher_state (PSecHandle phContext)
 
SECURITY_STATUS ntlm_computeProofValue (NTLM_CONTEXT *ntlm, SecBuffer *ntproof)
 
SECURITY_STATUS ntlm_computeMicValue (NTLM_CONTEXT *ntlm, SecBuffer *micvalue)
 

Macro Definition Documentation

◆ MESSAGE_TYPE_AUTHENTICATE

#define MESSAGE_TYPE_AUTHENTICATE   3

◆ MESSAGE_TYPE_CHALLENGE

#define MESSAGE_TYPE_CHALLENGE   2

◆ MESSAGE_TYPE_NEGOTIATE

#define MESSAGE_TYPE_NEGOTIATE   1

WinPR: Windows Portable Runtime NTLM Security Package

Copyright 2011-2014 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

◆ MSV_AV_FLAGS_AUTHENTICATION_CONSTRAINED

#define MSV_AV_FLAGS_AUTHENTICATION_CONSTRAINED   0x00000001

◆ MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK

#define MSV_AV_FLAGS_MESSAGE_INTEGRITY_CHECK   0x00000002

◆ MSV_AV_FLAGS_TARGET_SPN_UNTRUSTED_SOURCE

#define MSV_AV_FLAGS_TARGET_SPN_UNTRUSTED_SOURCE   0x00000004

◆ NTLMSSP_NEGOTIATE_128

#define NTLMSSP_NEGOTIATE_128   0x20000000 /* U (2) */

◆ NTLMSSP_NEGOTIATE_56

#define NTLMSSP_NEGOTIATE_56   0x80000000 /* W (0) */

◆ NTLMSSP_NEGOTIATE_ALWAYS_SIGN

#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN   0x00008000 /* M (16) */

◆ NTLMSSP_NEGOTIATE_ANONYMOUS

#define NTLMSSP_NEGOTIATE_ANONYMOUS   0x00000800 /* J (20) */

◆ NTLMSSP_NEGOTIATE_DATAGRAM

#define NTLMSSP_NEGOTIATE_DATAGRAM   0x00000040 /* F (25) */

◆ NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED

#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED   0x00001000 /* K (19) */

◆ NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY

#define NTLMSSP_NEGOTIATE_EXTENDED_SESSION_SECURITY   0x00080000 /* P (12) */

◆ NTLMSSP_NEGOTIATE_IDENTIFY

#define NTLMSSP_NEGOTIATE_IDENTIFY   0x00100000 /* Q (11) */

◆ NTLMSSP_NEGOTIATE_KEY_EXCH

#define NTLMSSP_NEGOTIATE_KEY_EXCH   0x40000000 /* V (1) */

◆ NTLMSSP_NEGOTIATE_LM_KEY

#define NTLMSSP_NEGOTIATE_LM_KEY   0x00000080 /* G (24) */

◆ NTLMSSP_NEGOTIATE_NTLM

#define NTLMSSP_NEGOTIATE_NTLM   0x00000200 /* H (22) */

◆ NTLMSSP_NEGOTIATE_OEM

#define NTLMSSP_NEGOTIATE_OEM   0x00000002 /* B (30) */

◆ NTLMSSP_NEGOTIATE_SEAL

#define NTLMSSP_NEGOTIATE_SEAL   0x00000020 /* E (26) */

◆ NTLMSSP_NEGOTIATE_SIGN

#define NTLMSSP_NEGOTIATE_SIGN   0x00000010 /* D (27) */

◆ NTLMSSP_NEGOTIATE_TARGET_INFO

#define NTLMSSP_NEGOTIATE_TARGET_INFO   0x00800000 /* S (8) */

◆ NTLMSSP_NEGOTIATE_UNICODE

#define NTLMSSP_NEGOTIATE_UNICODE   0x00000001 /* A (31) */

◆ NTLMSSP_NEGOTIATE_VERSION

#define NTLMSSP_NEGOTIATE_VERSION   0x02000000 /* T (6) */

◆ NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED

#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED   0x00002000 /* L (18) */

◆ NTLMSSP_REQUEST_NON_NT_SESSION_KEY

#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY   0x00400000 /* R (9) */

◆ NTLMSSP_REQUEST_TARGET

#define NTLMSSP_REQUEST_TARGET   0x00000004 /* C (29) */

◆ NTLMSSP_RESERVED1

#define NTLMSSP_RESERVED1   0x10000000 /* r1 (3) */

◆ NTLMSSP_RESERVED10

#define NTLMSSP_RESERVED10   0x00000008 /* r10 (28) */

◆ NTLMSSP_RESERVED2

#define NTLMSSP_RESERVED2   0x08000000 /* r2 (4) */

◆ NTLMSSP_RESERVED3

#define NTLMSSP_RESERVED3   0x04000000 /* r3 (5) */

◆ NTLMSSP_RESERVED4

#define NTLMSSP_RESERVED4   0x01000000 /* r4 (7) */

◆ NTLMSSP_RESERVED5

#define NTLMSSP_RESERVED5   0x00200000 /* r5 (10) */

◆ NTLMSSP_RESERVED6

#define NTLMSSP_RESERVED6   0x00040000 /* r6 (13) */

◆ NTLMSSP_RESERVED7

#define NTLMSSP_RESERVED7   0x00004000 /* r7 (17) */

◆ NTLMSSP_RESERVED8

#define NTLMSSP_RESERVED8   0x00000400 /* r8 (21) */

◆ NTLMSSP_RESERVED9

#define NTLMSSP_RESERVED9   0x00000100 /* r9 (23) */

◆ NTLMSSP_REVISION_W2K3

#define NTLMSSP_REVISION_W2K3   0x0F

◆ NTLMSSP_TARGET_TYPE_DOMAIN

#define NTLMSSP_TARGET_TYPE_DOMAIN   0x00010000 /* N (15) */

◆ NTLMSSP_TARGET_TYPE_SERVER

#define NTLMSSP_TARGET_TYPE_SERVER   0x00020000 /* O (14) */

◆ WINDOWS_MAJOR_VERSION_5

#define WINDOWS_MAJOR_VERSION_5   0x05

◆ WINDOWS_MAJOR_VERSION_6

#define WINDOWS_MAJOR_VERSION_6   0x06

◆ WINDOWS_MINOR_VERSION_0

#define WINDOWS_MINOR_VERSION_0   0x00

◆ WINDOWS_MINOR_VERSION_1

#define WINDOWS_MINOR_VERSION_1   0x01

◆ WINDOWS_MINOR_VERSION_2

#define WINDOWS_MINOR_VERSION_2   0x02

Enumeration Type Documentation

◆ NTLM_AV_ID

enum NTLM_AV_ID
Enumerator
MsvAvEOL 
MsvAvNbComputerName 
MsvAvNbDomainName 
MsvAvDnsComputerName 
MsvAvDnsDomainName 
MsvAvDnsTreeName 
MsvAvFlags 
MsvAvTimestamp 
MsvAvSingleHost 
MsvAvTargetName 
MsvAvChannelBindings 

◆ NTLM_STATE

enum NTLM_STATE
Enumerator
NTLM_STATE_INITIAL 
NTLM_STATE_NEGOTIATE 
NTLM_STATE_CHALLENGE 
NTLM_STATE_AUTHENTICATE 
NTLM_STATE_FINAL 

Function Documentation

◆ ntlm_change_state()

void ntlm_change_state ( NTLM_CONTEXT ntlm,
NTLM_STATE  state 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_computeMicValue()

SECURITY_STATUS ntlm_computeMicValue ( NTLM_CONTEXT ntlm,
SecBuffer micvalue 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_computeProofValue()

SECURITY_STATUS ntlm_computeProofValue ( NTLM_CONTEXT ntlm,
SecBuffer ntproof 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_get_state()

NTLM_STATE ntlm_get_state ( NTLM_CONTEXT ntlm)
Here is the caller graph for this function:

◆ ntlm_message_type_string()

const char* ntlm_message_type_string ( UINT32  messageType)
Here is the caller graph for this function:

◆ ntlm_negotiate_flags_string()

char* ntlm_negotiate_flags_string ( char *  buffer,
size_t  size,
UINT32  flags 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_reset_cipher_state()

void ntlm_reset_cipher_state ( PSecHandle  phContext)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_state_string()

const char* ntlm_state_string ( NTLM_STATE  state)
Here is the caller graph for this function: