FreeRDP
negotiate.c File Reference
#include <winpr/crt.h>
#include <winpr/sspi.h>
#include <winpr/tchar.h>
#include "negotiate.h"
#include "../sspi.h"
#include "../log.h"

Macros

#define TAG   WINPR_TAG("negotiate")
 

Functions

static void negotiate_SetSubPackage (NEGOTIATE_CONTEXT *context, const TCHAR *name)
 
static NEGOTIATE_CONTEXT * negotiate_ContextNew (void)
 
static void negotiate_ContextFree (NEGOTIATE_CONTEXT *context)
 
static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW (PCredHandle phCredential, PCtxtHandle phContext, SEC_WCHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA (PCredHandle phCredential, PCtxtHandle phContext, SEC_CHAR *pszTargetName, ULONG fContextReq, ULONG Reserved1, ULONG TargetDataRep, PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext (PCredHandle phCredential, PCtxtHandle phContext, PSecBufferDesc pInput, ULONG fContextReq, ULONG TargetDataRep, PCtxtHandle phNewContext, PSecBufferDesc pOutput, PULONG pfContextAttr, PTimeStamp ptsTimeStamp)
 
static SECURITY_STATUS SEC_ENTRY negotiate_CompleteAuthToken (PCtxtHandle phContext, PSecBufferDesc pToken)
 
static SECURITY_STATUS SEC_ENTRY negotiate_DeleteSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY negotiate_ImpersonateSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY negotiate_RevertSecurityContext (PCtxtHandle phContext)
 
static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesW (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesA (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesW (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer)
 
static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesA (PCtxtHandle phContext, ULONG ulAttribute, void *pBuffer, ULONG cbBuffer)
 
static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleW (SEC_WCHAR *pszPrincipal, SEC_WCHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleA (SEC_CHAR *pszPrincipal, SEC_CHAR *pszPackage, ULONG fCredentialUse, void *pvLogonID, void *pAuthData, SEC_GET_KEY_FN pGetKeyFn, void *pvGetKeyArgument, PCredHandle phCredential, PTimeStamp ptsExpiry)
 
static SECURITY_STATUS SEC_ENTRY negotiate_QueryCredentialsAttributesW (PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY negotiate_QueryCredentialsAttributesA (PCredHandle phCredential, ULONG ulAttribute, void *pBuffer)
 
static SECURITY_STATUS SEC_ENTRY negotiate_FreeCredentialsHandle (PCredHandle phCredential)
 
static SECURITY_STATUS SEC_ENTRY negotiate_EncryptMessage (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
static SECURITY_STATUS SEC_ENTRY negotiate_DecryptMessage (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG *pfQOP)
 
static SECURITY_STATUS SEC_ENTRY negotiate_MakeSignature (PCtxtHandle phContext, ULONG fQOP, PSecBufferDesc pMessage, ULONG MessageSeqNo)
 
static SECURITY_STATUS SEC_ENTRY negotiate_VerifySignature (PCtxtHandle phContext, PSecBufferDesc pMessage, ULONG MessageSeqNo, ULONG *pfQOP)
 

Variables

const SecurityFunctionTableA NTLM_SecurityFunctionTableA
 
const SecurityFunctionTableW NTLM_SecurityFunctionTableW
 
const SecurityFunctionTableA KERBEROS_SecurityFunctionTableA
 
const SecurityFunctionTableW KERBEROS_SecurityFunctionTableW
 
static BOOL ErrorInitContextKerberos = TRUE
 
const SecPkgInfoA NEGOTIATE_SecPkgInfoA
 
static WCHAR NEGOTIATE_SecPkgInfoW_Name [] = { 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'e', '\0' }
 
static WCHAR NEGOTIATE_SecPkgInfoW_Comment []
 
const SecPkgInfoW NEGOTIATE_SecPkgInfoW
 
const SecurityFunctionTableA NEGOTIATE_SecurityFunctionTableA
 
const SecurityFunctionTableW NEGOTIATE_SecurityFunctionTableW
 

Macro Definition Documentation

#define TAG   WINPR_TAG("negotiate")

WinPR: Windows Portable Runtime Negotiate 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 Copyright 2017 Dorian Ducournau doria.nosp@m.n.du.nosp@m.courn.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 SECURITY_STATUS SEC_ENTRY negotiate_AcceptSecurityContext ( PCredHandle  phCredential,
PCtxtHandle  phContext,
PSecBufferDesc  pInput,
ULONG  fContextReq,
ULONG  TargetDataRep,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsTimeStamp 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleA ( SEC_CHAR pszPrincipal,
SEC_CHAR pszPackage,
ULONG  fCredentialUse,
void pvLogonID,
void pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
void pvGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_AcquireCredentialsHandleW ( SEC_WCHAR pszPrincipal,
SEC_WCHAR pszPackage,
ULONG  fCredentialUse,
void pvLogonID,
void pAuthData,
SEC_GET_KEY_FN  pGetKeyFn,
void pvGetKeyArgument,
PCredHandle  phCredential,
PTimeStamp  ptsExpiry 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_CompleteAuthToken ( PCtxtHandle  phContext,
PSecBufferDesc  pToken 
)
static

Here is the call graph for this function:

static void negotiate_ContextFree ( NEGOTIATE_CONTEXT *  context)
static

Here is the caller graph for this function:

static NEGOTIATE_CONTEXT* negotiate_ContextNew ( void  )
static

Here is the call graph for this function:

Here is the caller graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_DecryptMessage ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
ULONG *  pfQOP 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_DeleteSecurityContext ( PCtxtHandle  phContext)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_EncryptMessage ( PCtxtHandle  phContext,
ULONG  fQOP,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_FreeCredentialsHandle ( PCredHandle  phCredential)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_ImpersonateSecurityContext ( PCtxtHandle  phContext)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextA ( PCredHandle  phCredential,
PCtxtHandle  phContext,
SEC_CHAR pszTargetName,
ULONG  fContextReq,
ULONG  Reserved1,
ULONG  TargetDataRep,
PSecBufferDesc  pInput,
ULONG  Reserved2,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsExpiry 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_InitializeSecurityContextW ( PCredHandle  phCredential,
PCtxtHandle  phContext,
SEC_WCHAR pszTargetName,
ULONG  fContextReq,
ULONG  Reserved1,
ULONG  TargetDataRep,
PSecBufferDesc  pInput,
ULONG  Reserved2,
PCtxtHandle  phNewContext,
PSecBufferDesc  pOutput,
PULONG  pfContextAttr,
PTimeStamp  ptsExpiry 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_MakeSignature ( PCtxtHandle  phContext,
ULONG  fQOP,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesA ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_QueryContextAttributesW ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_QueryCredentialsAttributesA ( PCredHandle  phCredential,
ULONG  ulAttribute,
void pBuffer 
)
static
static SECURITY_STATUS SEC_ENTRY negotiate_QueryCredentialsAttributesW ( PCredHandle  phCredential,
ULONG  ulAttribute,
void pBuffer 
)
static
static SECURITY_STATUS SEC_ENTRY negotiate_RevertSecurityContext ( PCtxtHandle  phContext)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesA ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer,
ULONG  cbBuffer 
)
static

Here is the call graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_SetContextAttributesW ( PCtxtHandle  phContext,
ULONG  ulAttribute,
void pBuffer,
ULONG  cbBuffer 
)
static

Here is the call graph for this function:

static void negotiate_SetSubPackage ( NEGOTIATE_CONTEXT *  context,
const TCHAR name 
)
static

Here is the caller graph for this function:

static SECURITY_STATUS SEC_ENTRY negotiate_VerifySignature ( PCtxtHandle  phContext,
PSecBufferDesc  pMessage,
ULONG  MessageSeqNo,
ULONG *  pfQOP 
)
static

Here is the call graph for this function:

Variable Documentation

BOOL ErrorInitContextKerberos = TRUE
static
const SecurityFunctionTableA KERBEROS_SecurityFunctionTableA
const SecurityFunctionTableW KERBEROS_SecurityFunctionTableW
const SecPkgInfoA NEGOTIATE_SecPkgInfoA
Initial value:
=
{
0x00083BB3,
1,
0x0009,
0x00002FE0,
"Negotiate",
"Microsoft Package Negotiator"
}
const SecPkgInfoW NEGOTIATE_SecPkgInfoW
Initial value:
=
{
0x00083BB3,
1,
0x0009,
0x00002FE0,
}
static WCHAR NEGOTIATE_SecPkgInfoW_Comment[]
Definition: negotiate.c:59
static WCHAR NEGOTIATE_SecPkgInfoW_Name[]
Definition: negotiate.c:57
WCHAR NEGOTIATE_SecPkgInfoW_Comment[]
static
Initial value:
=
{
'M', 'i', 'c', 'r', 'o', 's', 'o', 'f', 't', ' ',
'P', 'a', 'c', 'k', 'a', 'g', 'e', ' ',
'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'o', 'r', '\0'
}
WCHAR NEGOTIATE_SecPkgInfoW_Name[] = { 'N', 'e', 'g', 'o', 't', 'i', 'a', 't', 'e', '\0' }
static
const SecurityFunctionTableA NEGOTIATE_SecurityFunctionTableA
const SecurityFunctionTableW NEGOTIATE_SecurityFunctionTableW
const SecurityFunctionTableA NTLM_SecurityFunctionTableA
const SecurityFunctionTableW NTLM_SecurityFunctionTableW