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)
38FREERDP_LOCAL rdpCredsspAuth* credssp_auth_new(const rdpContext* context);
39
40WINPR_ATTR_NODISCARD
41FREERDP_LOCAL BOOL credssp_auth_init(rdpCredsspAuth* auth, TCHAR* pkg_name,
42 SecPkgContext_Bindings* bindings);
43
44WINPR_ATTR_NODISCARD
45FREERDP_LOCAL BOOL credssp_auth_setup_client(rdpCredsspAuth* auth, const char* target_service,
46 const char* target_hostname,
47 const SEC_WINNT_AUTH_IDENTITY* identity,
48 const char* pkinit);
49
50WINPR_ATTR_NODISCARD
51FREERDP_LOCAL BOOL credssp_auth_setup_server(rdpCredsspAuth* auth);
52
53FREERDP_LOCAL void credssp_auth_set_flags(rdpCredsspAuth* auth, ULONG flags);
54
55WINPR_ATTR_NODISCARD
56FREERDP_LOCAL int credssp_auth_authenticate(rdpCredsspAuth* auth);
57
58WINPR_ATTR_NODISCARD
59FREERDP_LOCAL BOOL credssp_auth_encrypt(rdpCredsspAuth* auth, const SecBuffer* plaintext,
60 SecBuffer* ciphertext, size_t* signature_length,
61 ULONG sequence);
62
63WINPR_ATTR_NODISCARD
64FREERDP_LOCAL BOOL credssp_auth_decrypt(rdpCredsspAuth* auth, const SecBuffer* ciphertext,
65 SecBuffer* plaintext, ULONG sequence);
66
67WINPR_ATTR_NODISCARD
68FREERDP_LOCAL BOOL credssp_auth_impersonate(rdpCredsspAuth* auth);
69
70WINPR_ATTR_NODISCARD
71FREERDP_LOCAL BOOL credssp_auth_revert_to_self(rdpCredsspAuth* auth);
72
73WINPR_ATTR_NODISCARD
74FREERDP_LOCAL BOOL credssp_auth_set_spn(rdpCredsspAuth* auth, const char* service,
75 const char* hostname);
76
77FREERDP_LOCAL void credssp_auth_take_input_buffer(rdpCredsspAuth* auth, SecBuffer* buffer);
78
79WINPR_ATTR_NODISCARD
80FREERDP_LOCAL const SecBuffer* credssp_auth_get_output_buffer(const rdpCredsspAuth* auth);
81
82WINPR_ATTR_NODISCARD
83FREERDP_LOCAL BOOL credssp_auth_have_output_token(rdpCredsspAuth* auth);
84
85WINPR_ATTR_NODISCARD
86FREERDP_LOCAL BOOL credssp_auth_is_complete(const rdpCredsspAuth* auth);
87
88WINPR_ATTR_NODISCARD
89FREERDP_LOCAL const char* credssp_auth_pkg_name(const rdpCredsspAuth* auth);
90
91WINPR_ATTR_NODISCARD
92FREERDP_LOCAL size_t credssp_auth_trailer_size(const rdpCredsspAuth* auth);
93
94WINPR_ATTR_NODISCARD
95FREERDP_LOCAL INT32 credssp_auth_sspi_error(const rdpCredsspAuth* auth);
96
97FREERDP_LOCAL void credssp_auth_tableAndContext(rdpCredsspAuth* auth,
98 SecurityFunctionTable** ptable,
99 CtxtHandle* pcontext);
100
101#endif /* FREERDP_LIB_CORE_CREDSSP_AUTH_H */