FreeRDP
Loading...
Searching...
No Matches
secapi.h
1
19
20#ifndef WINPR_SECAPI_H_
21#define WINPR_SECAPI_H_
22
23#ifdef _WIN32
24#define _NTDEF_
25#include <ntsecapi.h>
26#define KerbInvalidValue 0
27#else
28
29#include <winpr/wtypes.h>
30
31typedef enum
32{
33 KerbInvalidValue = 0,
34 KerbInteractiveLogon = 2,
35 KerbSmartCardLogon = 6,
36 KerbWorkstationUnlockLogon = 7,
37 KerbSmartCardUnlockLogon = 8,
38 KerbProxyLogon = 9,
39 KerbTicketLogon = 10,
40 KerbTicketUnlockLogon = 11,
41 KerbS4ULogon = 12,
42 KerbCertificateLogon = 13,
43 KerbCertificateS4ULogon = 14,
44 KerbCertificateUnlockLogon = 15,
45 KerbNoElevationLogon = 83,
46 KerbLuidLogon = 84
47} KERB_LOGON_SUBMIT_TYPE,
48 *PKERB_LOGON_SUBMIT_TYPE;
49
50typedef struct
51{
52 KERB_LOGON_SUBMIT_TYPE MessageType;
53 ULONG Flags;
54 ULONG ServiceTicketLength;
55 ULONG TicketGrantingTicketLength;
56 PUCHAR ServiceTicket;
57 PUCHAR TicketGrantingTicket;
58} KERB_TICKET_LOGON, *PKERB_TICKET_LOGON;
59
60#define KERB_LOGON_FLAG_ALLOW_EXPIRED_TICKET 0x1
61
62#define MSV1_0_OWF_PASSWORD_LENGTH 16
63
64typedef struct
65{
66 ULONG Version;
67 ULONG Flags;
68 UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH];
69 UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH];
70} MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL;
71
72#define MSV1_0_CRED_VERSION_REMOTE 0xffff0002
73
74typedef enum
75{
76 InvalidCredKey,
77 DeprecatedIUMCredKey,
78 DomainUserCredKey,
79 LocalUserCredKey,
80 ExternallySuppliedCredKey
81} MSV1_0_CREDENTIAL_KEY_TYPE;
82
83#define MSV1_0_CREDENTIAL_KEY_LENGTH 20
84#define MSV1_0_CRED_LM_PRESENT 0x1
85#define MSV1_0_CRED_NT_PRESENT 0x2
86#define MSV1_0_CRED_REMOVED 0x4
87#define MSV1_0_CRED_CREDKEY_PRESENT 0x8
88#define MSV1_0_CRED_SHA_PRESENT 0x10
89
90typedef struct
91{
92 UCHAR Data[MSV1_0_CREDENTIAL_KEY_LENGTH];
93} MSV1_0_CREDENTIAL_KEY, *PMSV1_0_CREDENTIAL_KEY;
94
95typedef struct
96{
97 ULONG Version;
98 ULONG Flags;
99 MSV1_0_CREDENTIAL_KEY CredentialKey;
100 MSV1_0_CREDENTIAL_KEY_TYPE CredentialKeyType;
101 ULONG EncryptedCredsSize;
102 UCHAR EncryptedCreds[1];
103} MSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_REMOTE_SUPPLEMENTAL_CREDENTIAL;
104
105/* LSA authentication package client API, mirroring <ntsecapi.h>. On non-Windows
106 * it is backed by the per-user lsa4posix daemon (winpr/libwinpr/sspicli/lsa.c). */
107
108typedef struct
109{
110 USHORT Length;
111 USHORT MaximumLength;
112 PCHAR Buffer;
113} LSA_STRING, *PLSA_STRING;
114
115typedef LONG LSA_OPERATIONAL_MODE, *PLSA_OPERATIONAL_MODE;
116
117#include <winpr/winpr.h>
118
119#ifdef __cplusplus
120extern "C"
121{
122#endif
123
130 WINPR_ATTR_NODISCARD
131 WINPR_API NTSTATUS LsaConnectUntrusted(PHANDLE LsaHandle);
132
141 WINPR_ATTR_NODISCARD
142 WINPR_API NTSTATUS LsaLookupAuthenticationPackage(HANDLE LsaHandle, PLSA_STRING PackageName,
143 PULONG AuthenticationPackage);
144
157 WINPR_ATTR_NODISCARD
158 WINPR_API NTSTATUS LsaCallAuthenticationPackage(HANDLE LsaHandle, ULONG AuthenticationPackage,
159 PVOID ProtocolSubmitBuffer,
160 ULONG SubmitBufferLength,
161 PVOID* ProtocolReturnBuffer,
162 PULONG ReturnBufferLength,
163 PNTSTATUS ProtocolStatus);
164
170 WINPR_API NTSTATUS LsaFreeReturnBuffer(PVOID Buffer);
171
177 WINPR_API NTSTATUS LsaDeregisterLogonProcess(HANDLE LsaHandle);
178
186 WINPR_ATTR_NODISCARD
187 WINPR_API ULONG LsaNtStatusToWinError(NTSTATUS);
188
189#ifdef __cplusplus
190}
191#endif
192
193#endif /* _WIN32 */
194
195#ifndef KERB_LOGON_FLAG_REDIRECTED
196#define KERB_LOGON_FLAG_REDIRECTED 0x2
197#endif
198
199#endif /* WINPR_SECAPI_H_ */