FreeRDP
Loading...
Searching...
No Matches
include/winpr/credssp.h
1
17
18#ifndef WINPR_SSPI_CREDSSP_H
19#define WINPR_SSPI_CREDSSP_H
20
21#include <winpr/winpr.h>
22#include <winpr/wtypes.h>
23
24#if defined(_WIN32) && !defined(_UWP)
25
26#include <credssp.h>
27
28#else
29
30typedef enum
31{
32 CredsspPasswordCreds = 2,
33 CredsspSchannelCreds = 4,
34 CredsspCertificateCreds = 13,
35 CredsspSubmitBufferBoth = 50,
36 CredsspSubmitBufferBothOld = 51,
37 CredsspCredEx = 100
38} CREDSPP_SUBMIT_TYPE;
39
40typedef struct
41{
42 CREDSPP_SUBMIT_TYPE Type;
43 void* pSchannelCred;
44 void* pSpnegoCred;
45} CREDSSP_CRED, *PCREDSSP_CRED;
46
47#define CREDSSP_CRED_EX_VERSION 0
48
49typedef struct
50{
51 CREDSPP_SUBMIT_TYPE Type;
52 DWORD Version;
53 DWORD Flags;
54 DWORD Reserved;
55 CREDSSP_CRED Cred;
56} CREDSSP_CRED_EX, *PCREDSSP_CRED_EX;
57
58#define CREDSSP_FLAG_REDIRECT 0x00000001
59
60#endif /* _WIN32 && !_UWP */
61
62/* TSRequest codec, shared by the FreeRDP NLA client and the WinPR CredSSP package.
63 * See [MS-CSSP] 2.2.1. This is WinPR's own codec, available on every platform. */
64
65#include <winpr/sspi.h>
66#include <winpr/stream.h>
67
69typedef struct
70{
71 UINT32 version;
72 SecBuffer negoToken;
73 SecBuffer authInfo;
74 SecBuffer pubKeyAuth;
75 INT32 errorCode;
76 SecBuffer clientNonce;
78
79#ifdef __cplusplus
80extern "C"
81{
82#endif
83
86 WINPR_API void winpr_tsrequest_free_contents(WINPR_TSREQUEST* request);
87
100 WINPR_ATTR_NODISCARD
101 WINPR_API BOOL winpr_tsrequest_encode(const WINPR_TSREQUEST* request, UINT32 peerVersion,
102 BOOL server, SecBuffer* output);
103
109 WINPR_ATTR_NODISCARD
110 WINPR_API BOOL winpr_tsrequest_decode(wStream* s, WINPR_TSREQUEST* request);
111
112#ifdef __cplusplus
113}
114#endif
115
116/* TSCredentials codec ([MS-CSSP] 2.2.1.2). credType selects the inner structure. */
117#define WINPR_TSCREDS_USER_PASSWD 1
118#define WINPR_TSCREDS_SMARTCARD 2
119#define WINPR_TSCREDS_REMOTEGUARD 6
120
121#include <winpr/secapi.h>
122
123#ifdef __cplusplus
124extern "C"
125{
126#endif
127
131 WINPR_ATTR_NODISCARD
132 WINPR_API BOOL winpr_kerb_ticket_logon_encode(const KERB_TICKET_LOGON* ticket,
133 SecBuffer* output);
134
138 WINPR_ATTR_NODISCARD
139 WINPR_API BOOL winpr_kerb_ticket_logon_decode(const BYTE* data, size_t length,
140 KERB_TICKET_LOGON* ticket);
141
144 WINPR_ATTR_NODISCARD
145 WINPR_API BOOL winpr_tscredentials_encode_password(const SEC_WINNT_AUTH_IDENTITY_W* identity,
146 SecBuffer* output);
147
151 WINPR_ATTR_NODISCARD
152 WINPR_API BOOL winpr_tscredentials_encode_remoteguard_kerb(const KERB_TICKET_LOGON* ticket,
153 SecBuffer* output);
154
167 WINPR_ATTR_NODISCARD
168 WINPR_API BOOL winpr_credssp_public_key_hash(BOOL server, const SecBuffer* nonce,
169 const SecBuffer* publicKey, SecBuffer* hash);
170
171#ifdef __cplusplus
172}
173#endif
174
175#endif /* WINPR_SSPI_CREDSSP_H */
[MS-CSSP] 2.2.1 TSRequest fields the CredSSP exchange carries.