FreeRDP
ntlm_av_pairs.c File Reference
#include <winpr/config.h>
#include <winpr/assert.h>
#include "ntlm.h"
#include "../sspi.h"
#include <winpr/crt.h>
#include <winpr/print.h>
#include <winpr/sysinfo.h>
#include <winpr/tchar.h>
#include <winpr/crypto.h>
#include "ntlm_compute.h"
#include "ntlm_av_pairs.h"
#include "../../log.h"

Macros

#define TAG   WINPR_TAG("sspi.NTLM")
 

Functions

static BOOL ntlm_av_pair_get_next_offset (const NTLM_AV_PAIR *pAvPair, size_t size, size_t *pOffset)
 
static BOOL ntlm_av_pair_check_data (const NTLM_AV_PAIR *pAvPair, size_t cbAvPair, size_t size)
 
static const char * get_av_pair_string (UINT16 pair)
 
static BOOL ntlm_av_pair_check (const NTLM_AV_PAIR *pAvPair, size_t cbAvPair)
 
static NTLM_AV_PAIRntlm_av_pair_next (NTLM_AV_PAIR *pAvPairList, size_t *pcbAvPairList)
 
static INLINE void ntlm_av_pair_set_id (NTLM_AV_PAIR *pAvPair, UINT16 id)
 
static INLINE void ntlm_av_pair_set_len (NTLM_AV_PAIR *pAvPair, UINT16 len)
 
static BOOL ntlm_av_pair_list_init (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairList)
 
static INLINE BOOL ntlm_av_pair_get_id (const NTLM_AV_PAIR *pAvPair, size_t size, UINT16 *pair)
 
ULONG ntlm_av_pair_list_length (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairList)
 
static INLINE BOOL ntlm_av_pair_get_len (const NTLM_AV_PAIR *pAvPair, size_t size, size_t *pAvLen)
 
static ULONG ntlm_av_pair_list_size (ULONG AvPairsCount, ULONG AvPairsValueLength)
 
PBYTE ntlm_av_pair_get_value_pointer (NTLM_AV_PAIR *pAvPair)
 
NTLM_AV_PAIRntlm_av_pair_get (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairList, NTLM_AV_ID AvId, size_t *pcbAvPairListRemaining)
 
static BOOL ntlm_av_pair_add (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairList, NTLM_AV_ID AvId, PBYTE Value, UINT16 AvLen)
 
static BOOL ntlm_av_pair_add_copy (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairList, NTLM_AV_PAIR *pAvPair, size_t cbAvPair)
 
static int ntlm_get_target_computer_name (PUNICODE_STRING pName, COMPUTER_NAME_FORMAT type)
 
static void ntlm_free_unicode_string (PUNICODE_STRING string)
 
static BOOL ntlm_md5_update_uint32_be (WINPR_DIGEST_CTX *md5, UINT32 num)
 
static void ntlm_compute_channel_bindings (NTLM_CONTEXT *context)
 
static void ntlm_compute_single_host_data (NTLM_CONTEXT *context)
 
BOOL ntlm_construct_challenge_target_info (NTLM_CONTEXT *context)
 
BOOL ntlm_construct_authenticate_target_info (NTLM_CONTEXT *context)
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("sspi.NTLM")

WinPR: Windows Portable Runtime NTLM Security Package (AV_PAIRs)

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.

Function Documentation

◆ get_av_pair_string()

static const char* get_av_pair_string ( UINT16  pair)
static

◆ ntlm_av_pair_add()

static BOOL ntlm_av_pair_add ( NTLM_AV_PAIR pAvPairList,
size_t  cbAvPairList,
NTLM_AV_ID  AvId,
PBYTE  Value,
UINT16  AvLen 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_add_copy()

static BOOL ntlm_av_pair_add_copy ( NTLM_AV_PAIR pAvPairList,
size_t  cbAvPairList,
NTLM_AV_PAIR pAvPair,
size_t  cbAvPair 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_check()

static BOOL ntlm_av_pair_check ( const NTLM_AV_PAIR pAvPair,
size_t  cbAvPair 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_check_data()

static BOOL ntlm_av_pair_check_data ( const NTLM_AV_PAIR pAvPair,
size_t  cbAvPair,
size_t  size 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_get()

NTLM_AV_PAIR* ntlm_av_pair_get ( NTLM_AV_PAIR pAvPairList,
size_t  cbAvPairList,
NTLM_AV_ID  AvId,
size_t *  pcbAvPairListRemaining 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_get_id()

static INLINE BOOL ntlm_av_pair_get_id ( const NTLM_AV_PAIR pAvPair,
size_t  size,
UINT16 pair 
)
static
Here is the caller graph for this function:

◆ ntlm_av_pair_get_len()

static INLINE BOOL ntlm_av_pair_get_len ( const NTLM_AV_PAIR pAvPair,
size_t  size,
size_t *  pAvLen 
)
static
Here is the caller graph for this function:

◆ ntlm_av_pair_get_next_offset()

static BOOL ntlm_av_pair_get_next_offset ( const NTLM_AV_PAIR pAvPair,
size_t  size,
size_t *  pOffset 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_get_value_pointer()

PBYTE ntlm_av_pair_get_value_pointer ( NTLM_AV_PAIR pAvPair)
Here is the caller graph for this function:

◆ ntlm_av_pair_list_init()

static BOOL ntlm_av_pair_list_init ( NTLM_AV_PAIR pAvPairList,
size_t  cbAvPairList 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_list_length()

ULONG ntlm_av_pair_list_length ( NTLM_AV_PAIR pAvPairList,
size_t  cbAvPairList 
)

WinPR: Windows Portable Runtime NTLM Security Package (AV_PAIRs)

Copyright 2011-2012 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_list_size()

static ULONG ntlm_av_pair_list_size ( ULONG  AvPairsCount,
ULONG  AvPairsValueLength 
)
static
Here is the caller graph for this function:

◆ ntlm_av_pair_next()

static NTLM_AV_PAIR * ntlm_av_pair_next ( NTLM_AV_PAIR pAvPairList,
size_t *  pcbAvPairList 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_av_pair_set_id()

static INLINE void ntlm_av_pair_set_id ( NTLM_AV_PAIR pAvPair,
UINT16  id 
)
static
Here is the caller graph for this function:

◆ ntlm_av_pair_set_len()

static INLINE void ntlm_av_pair_set_len ( NTLM_AV_PAIR pAvPair,
UINT16  len 
)
static
Here is the caller graph for this function:

◆ ntlm_compute_channel_bindings()

static void ntlm_compute_channel_bindings ( NTLM_CONTEXT context)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_compute_single_host_data()

static void ntlm_compute_single_host_data ( NTLM_CONTEXT context)
static

The Single_Host_Data structure allows a client to send machine-specific information within an authentication exchange to services on the same machine. The client can produce additional information to be processed in an implementation-specific way when the client and server are on the same host. If the server and client platforms are different or if they are on different hosts, then the information MUST be ignored. Any fields after the MachineID field MUST be ignored on receipt.

Here is the caller graph for this function:

◆ ntlm_construct_authenticate_target_info()

BOOL ntlm_construct_authenticate_target_info ( NTLM_CONTEXT context)

Extended Protection for Authentication: http://blogs.technet.com/b/srd/archive/2009/12/08/extended-protection-for-authentication.aspx

SEC_CHANNEL_BINDINGS structure http://msdn.microsoft.com/en-us/library/windows/desktop/dd919963/

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_construct_challenge_target_info()

BOOL ntlm_construct_challenge_target_info ( NTLM_CONTEXT context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_free_unicode_string()

static void ntlm_free_unicode_string ( PUNICODE_STRING  string)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_get_target_computer_name()

static int ntlm_get_target_computer_name ( PUNICODE_STRING  pName,
COMPUTER_NAME_FORMAT  type 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ntlm_md5_update_uint32_be()

static BOOL ntlm_md5_update_uint32_be ( WINPR_DIGEST_CTX *  md5,
UINT32  num 
)
static

From http://www.ietf.org/proceedings/72/slides/sasl-2.pdf:

tls-server-end-point:

The hash of the TLS server's end entity certificate as it appears, octet for octet, in the server's Certificate message (note that the Certificate message contains a certificate_list, the first element of which is the server's end entity certificate.) The hash function to be selected is as follows: if the certificate's signature hash algorithm is either MD5 or SHA-1, then use SHA-256, otherwise use the certificate's signature hash algorithm. Channel Bindings sample usage: https://raw.github.com/mozilla/mozilla-central/master/extensions/auth/nsAuthSSPI.cpp

Here is the call graph for this function:
Here is the caller graph for this function: