2012-02-24 00:56:50 +04:00
|
|
|
/**
|
2012-05-22 06:48:33 +04:00
|
|
|
* WinPR: Windows Portable Runtime
|
2012-02-24 00:56:50 +04:00
|
|
|
* Security Support Provider Interface (SSPI)
|
|
|
|
*
|
2014-06-06 06:54:31 +04:00
|
|
|
* Copyright 2012-2014 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2012-02-24 00:56:50 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-05-22 06:48:33 +04:00
|
|
|
#ifndef WINPR_SSPI_PRIVATE_H
|
|
|
|
#define WINPR_SSPI_PRIVATE_H
|
2012-02-24 00:56:50 +04:00
|
|
|
|
2012-05-05 03:48:53 +04:00
|
|
|
#include <winpr/sspi.h>
|
2012-02-24 00:56:50 +04:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
#define SCHANNEL_CB_MAX_TOKEN 0x00006000
|
2012-12-24 05:20:41 +04:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
#define SSPI_CREDENTIALS_PASSWORD_HASH 0x00000001
|
2013-11-06 19:02:58 +04:00
|
|
|
|
2019-11-06 17:24:51 +03:00
|
|
|
#define SSPI_CREDENTIALS_HASH_LENGTH_OFFSET 512
|
2013-11-06 19:02:58 +04:00
|
|
|
|
2022-02-23 18:49:12 +03:00
|
|
|
typedef struct
|
2012-02-24 00:56:50 +04:00
|
|
|
{
|
2013-11-06 19:02:58 +04:00
|
|
|
DWORD flags;
|
2014-06-09 23:25:00 +04:00
|
|
|
ULONG fCredentialUse;
|
|
|
|
SEC_GET_KEY_FN pGetKeyFn;
|
|
|
|
void* pvGetKeyArgument;
|
2012-03-16 04:37:38 +04:00
|
|
|
SEC_WINNT_AUTH_IDENTITY identity;
|
2022-06-09 05:39:42 +03:00
|
|
|
SEC_WINPR_NTLM_SETTINGS ntlmSettings;
|
|
|
|
SEC_WINPR_KERBEROS_SETTINGS kerbSettings;
|
2022-02-23 18:49:12 +03:00
|
|
|
} SSPI_CREDENTIALS;
|
2012-02-24 00:56:50 +04:00
|
|
|
|
2014-06-09 23:25:00 +04:00
|
|
|
SSPI_CREDENTIALS* sspi_CredentialsNew(void);
|
|
|
|
void sspi_CredentialsFree(SSPI_CREDENTIALS* credentials);
|
2012-02-24 00:56:50 +04:00
|
|
|
|
2013-01-11 23:23:54 +04:00
|
|
|
PSecBuffer sspi_FindSecBuffer(PSecBufferDesc pMessage, ULONG BufferType);
|
|
|
|
|
2013-02-15 01:20:43 +04:00
|
|
|
SecHandle* sspi_SecureHandleAlloc(void);
|
2012-03-16 04:37:38 +04:00
|
|
|
void sspi_SecureHandleInvalidate(SecHandle* handle);
|
|
|
|
void* sspi_SecureHandleGetLowerPointer(SecHandle* handle);
|
|
|
|
void sspi_SecureHandleSetLowerPointer(SecHandle* handle, void* pointer);
|
|
|
|
void* sspi_SecureHandleGetUpperPointer(SecHandle* handle);
|
|
|
|
void sspi_SecureHandleSetUpperPointer(SecHandle* handle, void* pointer);
|
|
|
|
void sspi_SecureHandleFree(SecHandle* handle);
|
2012-02-24 00:56:50 +04:00
|
|
|
|
2012-02-25 00:00:49 +04:00
|
|
|
enum SecurityFunctionTableIndex
|
|
|
|
{
|
2019-11-06 17:24:51 +03:00
|
|
|
EnumerateSecurityPackagesIndex = 1,
|
|
|
|
Reserved1Index = 2,
|
|
|
|
QueryCredentialsAttributesIndex = 3,
|
|
|
|
AcquireCredentialsHandleIndex = 4,
|
|
|
|
FreeCredentialsHandleIndex = 5,
|
|
|
|
Reserved2Index = 6,
|
|
|
|
InitializeSecurityContextIndex = 7,
|
|
|
|
AcceptSecurityContextIndex = 8,
|
|
|
|
CompleteAuthTokenIndex = 9,
|
|
|
|
DeleteSecurityContextIndex = 10,
|
|
|
|
ApplyControlTokenIndex = 11,
|
|
|
|
QueryContextAttributesIndex = 12,
|
|
|
|
ImpersonateSecurityContextIndex = 13,
|
|
|
|
RevertSecurityContextIndex = 14,
|
|
|
|
MakeSignatureIndex = 15,
|
|
|
|
VerifySignatureIndex = 16,
|
|
|
|
FreeContextBufferIndex = 17,
|
|
|
|
QuerySecurityPackageInfoIndex = 18,
|
|
|
|
Reserved3Index = 19,
|
|
|
|
Reserved4Index = 20,
|
|
|
|
ExportSecurityContextIndex = 21,
|
|
|
|
ImportSecurityContextIndex = 22,
|
|
|
|
AddCredentialsIndex = 23,
|
|
|
|
Reserved8Index = 24,
|
|
|
|
QuerySecurityContextTokenIndex = 25,
|
|
|
|
EncryptMessageIndex = 26,
|
|
|
|
DecryptMessageIndex = 27,
|
2022-09-29 04:57:28 +03:00
|
|
|
SetContextAttributesIndex = 28,
|
|
|
|
SetCredentialsAttributesIndex = 29
|
2012-02-25 00:00:49 +04:00
|
|
|
};
|
|
|
|
|
2015-09-17 18:16:20 +03:00
|
|
|
BOOL IsSecurityStatusError(SECURITY_STATUS status);
|
|
|
|
|
2017-05-11 19:51:45 +03:00
|
|
|
#include "sspi_gss.h"
|
2014-06-06 23:34:12 +04:00
|
|
|
#include "sspi_winpr.h"
|
|
|
|
|
2012-05-22 06:48:33 +04:00
|
|
|
#endif /* WINPR_SSPI_PRIVATE_H */
|