FreeRDP
Loading...
Searching...
No Matches
credssp_auth.h
1
20#ifndef FREERDP_LIB_CORE_CREDSSP_AUTH_H
21#define FREERDP_LIB_CORE_CREDSSP_AUTH_H
22
23#define CREDSSP_AUTH_PKG_SPNEGO "Negotiate"
24#define CREDSSP_AUTH_PKG_NTLM "NTLM"
25#define CREDSSP_AUTH_PKG_KERBEROS "Kerberos"
26#define CREDSSP_AUTH_PKG_SCHANNEL "Schannel"
27
28typedef struct rdp_credssp_auth rdpCredsspAuth;
29
30#include <freerdp/freerdp.h>
31#include <winpr/tchar.h>
32#include <winpr/sspi.h>
33#include <winpr/secapi.h>
34
35FREERDP_LOCAL void credssp_auth_free(rdpCredsspAuth* auth);
36
37WINPR_ATTR_MALLOC(credssp_auth_free, 1)
38WINPR_ATTR_NODISCARD
39FREERDP_LOCAL rdpCredsspAuth* credssp_auth_new(const rdpContext* context);
40
41WINPR_ATTR_NODISCARD
42FREERDP_LOCAL BOOL credssp_auth_init(rdpCredsspAuth* auth, TCHAR* pkg_name,
43 SecPkgContext_Bindings* bindings);
44
45WINPR_ATTR_NODISCARD
46FREERDP_LOCAL BOOL credssp_auth_setup_client(rdpCredsspAuth* auth, const char* target_service,
47 const char* target_hostname,
48 const SEC_WINNT_AUTH_IDENTITY* identity,
49 const char* pkinit);
50
51WINPR_ATTR_NODISCARD
52FREERDP_LOCAL BOOL credssp_auth_setup_server(rdpCredsspAuth* auth);
53
54FREERDP_LOCAL void credssp_auth_set_flags(rdpCredsspAuth* auth, ULONG flags);
55
56WINPR_ATTR_NODISCARD
57FREERDP_LOCAL int credssp_auth_authenticate(rdpCredsspAuth* auth);
58
59WINPR_ATTR_NODISCARD
60FREERDP_LOCAL BOOL credssp_auth_encrypt(rdpCredsspAuth* auth, const SecBuffer* plaintext,
61 SecBuffer* ciphertext, size_t* signature_length,
62 ULONG sequence);
63
64WINPR_ATTR_NODISCARD
65FREERDP_LOCAL BOOL credssp_auth_decrypt(rdpCredsspAuth* auth, const SecBuffer* ciphertext,
66 SecBuffer* plaintext, ULONG sequence);
67
68WINPR_ATTR_NODISCARD
69FREERDP_LOCAL BOOL credssp_auth_impersonate(rdpCredsspAuth* auth);
70
71WINPR_ATTR_NODISCARD
72FREERDP_LOCAL BOOL credssp_auth_revert_to_self(rdpCredsspAuth* auth);
73
74WINPR_ATTR_NODISCARD
75FREERDP_LOCAL BOOL credssp_auth_set_spn(rdpCredsspAuth* auth, const char* service,
76 const char* hostname);
77
78FREERDP_LOCAL void credssp_auth_take_input_buffer(rdpCredsspAuth* auth, SecBuffer* buffer);
79
80WINPR_ATTR_NODISCARD
81FREERDP_LOCAL const SecBuffer* credssp_auth_get_output_buffer(const rdpCredsspAuth* auth);
82
83WINPR_ATTR_NODISCARD
84FREERDP_LOCAL BOOL credssp_auth_have_output_token(rdpCredsspAuth* auth);
85
86WINPR_ATTR_NODISCARD
87FREERDP_LOCAL BOOL credssp_auth_is_complete(const rdpCredsspAuth* auth);
88
89WINPR_ATTR_NODISCARD
90FREERDP_LOCAL const char* credssp_auth_pkg_name(const rdpCredsspAuth* auth);
91
92WINPR_ATTR_NODISCARD
93FREERDP_LOCAL size_t credssp_auth_trailer_size(const rdpCredsspAuth* auth);
94
95WINPR_ATTR_NODISCARD
96FREERDP_LOCAL INT32 credssp_auth_sspi_error(const rdpCredsspAuth* auth);
97
98FREERDP_LOCAL void credssp_auth_tableAndContext(rdpCredsspAuth* auth,
99 SecurityFunctionTable** ptable,
100 CtxtHandle* pcontext);
101
102#endif /* FREERDP_LIB_CORE_CREDSSP_AUTH_H */