FreeRDP
ntlm_av_pairs.c File Reference
#include <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 NTLM_AV_PAIR * ntlm_av_pair_get_next_pointer (NTLM_AV_PAIR *pAvPair, size_t *pcbAvPair)
 
static void ntlm_av_pair_set_id (NTLM_AV_PAIR *pAvPair, UINT16 id)
 
static 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 UINT16 ntlm_av_pair_get_id (const NTLM_AV_PAIR *pAvPair)
 
ULONG ntlm_av_pair_list_length (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairListMaxLength)
 
static INLINE SSIZE_T ntlm_av_pair_get_len (const NTLM_AV_PAIR *pAvPair, size_t cbAvPair)
 
void ntlm_print_av_pair_list (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairList)
 
static ULONG ntlm_av_pair_list_size (ULONG AvPairsCount, ULONG AvPairsValueLength)
 
PBYTE ntlm_av_pair_get_value_pointer (NTLM_AV_PAIR *pAvPair, size_t cbAvPairListMaxLength)
 
static SSIZE_T ntlm_av_pair_get_next_offset (NTLM_AV_PAIR *pAvPair, size_t cbAvPairListMaxLength)
 
NTLM_AV_PAIR * ntlm_av_pair_get (void *pAvPairList, size_t avPairListLength, NTLM_AV_ID AvId, size_t *pcbAvPairListRemainingLength)
 
static NTLM_AV_PAIR * ntlm_av_pair_add (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairListLength, NTLM_AV_ID AvId, PBYTE Value, UINT16 AvLen)
 
static NTLM_AV_PAIR * ntlm_av_pair_add_copy (NTLM_AV_PAIR *pAvPairList, size_t cbAvPairListLength, 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)
 
int ntlm_construct_challenge_target_info (NTLM_CONTEXT *context)
 
int ntlm_construct_authenticate_target_info (NTLM_CONTEXT *context)
 

Variables

static const char *const AV_PAIR_STRINGS []
 

Macro Definition Documentation

#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

static NTLM_AV_PAIR* ntlm_av_pair_add ( NTLM_AV_PAIR *  pAvPairList,
size_t  cbAvPairListLength,
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:

static NTLM_AV_PAIR* ntlm_av_pair_add_copy ( NTLM_AV_PAIR *  pAvPairList,
size_t  cbAvPairListLength,
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* ntlm_av_pair_get ( void pAvPairList,
size_t  avPairListLength,
NTLM_AV_ID  AvId,
size_t *  pcbAvPairListRemainingLength 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE UINT16 ntlm_av_pair_get_id ( const NTLM_AV_PAIR *  pAvPair)
static

Here is the caller graph for this function:

static INLINE SSIZE_T ntlm_av_pair_get_len ( const NTLM_AV_PAIR *  pAvPair,
size_t  cbAvPair 
)
static

Here is the caller graph for this function:

static SSIZE_T ntlm_av_pair_get_next_offset ( NTLM_AV_PAIR *  pAvPair,
size_t  cbAvPairListMaxLength 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

NTLM_AV_PAIR * ntlm_av_pair_get_next_pointer ( NTLM_AV_PAIR *  pAvPair,
size_t *  pcbAvPair 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

PBYTE ntlm_av_pair_get_value_pointer ( NTLM_AV_PAIR *  pAvPair,
size_t  cbAvPairListMaxLength 
)

Here is the caller graph for this function:

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:

ULONG ntlm_av_pair_list_length ( NTLM_AV_PAIR *  pAvPairList,
size_t  cbAvPairListMaxLength 
)

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:

static ULONG ntlm_av_pair_list_size ( ULONG  AvPairsCount,
ULONG  AvPairsValueLength 
)
static

Here is the caller graph for this function:

static void ntlm_av_pair_set_id ( NTLM_AV_PAIR *  pAvPair,
UINT16  id 
)
static

Here is the caller graph for this function:

static void ntlm_av_pair_set_len ( NTLM_AV_PAIR *  pAvPair,
UINT16  len 
)
static

Here is the caller graph for this function:

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:

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:

int 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:

int ntlm_construct_challenge_target_info ( NTLM_CONTEXT *  context)

Here is the call graph for this function:

Here is the caller graph for this function:

static void ntlm_free_unicode_string ( PUNICODE_STRING  string)
static

Here is the caller graph for this function:

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:

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:

void ntlm_print_av_pair_list ( NTLM_AV_PAIR *  pAvPairList,
size_t  cbAvPairList 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

const char* const AV_PAIR_STRINGS[]
static
Initial value:
=
{
"MsvAvEOL",
"MsvAvNbComputerName",
"MsvAvNbDomainName",
"MsvAvDnsComputerName",
"MsvAvDnsDomainName",
"MsvAvDnsTreeName",
"MsvAvFlags",
"MsvAvTimestamp",
"MsvAvRestrictions",
"MsvAvTargetName",
"MsvChannelBindings"
}