FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
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
40FREERDP_LOCAL BOOL credssp_auth_init(rdpCredsspAuth* auth, TCHAR* pkg_name,
41 SecPkgContext_Bindings* bindings);
42FREERDP_LOCAL BOOL credssp_auth_setup_client(rdpCredsspAuth* auth, const char* target_service,
43 const char* target_hostname,
44 const SEC_WINNT_AUTH_IDENTITY* identity,
45 const char* pkinit);
46FREERDP_LOCAL BOOL credssp_auth_setup_server(rdpCredsspAuth* auth);
47FREERDP_LOCAL void credssp_auth_set_flags(rdpCredsspAuth* auth, ULONG flags);
48FREERDP_LOCAL int credssp_auth_authenticate(rdpCredsspAuth* auth);
49FREERDP_LOCAL BOOL credssp_auth_encrypt(rdpCredsspAuth* auth, const SecBuffer* plaintext,
50 SecBuffer* ciphertext, size_t* signature_length,
51 ULONG sequence);
52FREERDP_LOCAL BOOL credssp_auth_decrypt(rdpCredsspAuth* auth, const SecBuffer* ciphertext,
53 SecBuffer* plaintext, ULONG sequence);
54FREERDP_LOCAL BOOL credssp_auth_impersonate(rdpCredsspAuth* auth);
55FREERDP_LOCAL BOOL credssp_auth_revert_to_self(rdpCredsspAuth* auth);
56FREERDP_LOCAL BOOL credssp_auth_set_spn(rdpCredsspAuth* auth, const char* service,
57 const char* hostname);
58FREERDP_LOCAL void credssp_auth_take_input_buffer(rdpCredsspAuth* auth, SecBuffer* buffer);
59FREERDP_LOCAL const SecBuffer* credssp_auth_get_output_buffer(rdpCredsspAuth* auth);
60FREERDP_LOCAL BOOL credssp_auth_have_output_token(rdpCredsspAuth* auth);
61FREERDP_LOCAL BOOL credssp_auth_is_complete(rdpCredsspAuth* auth);
62FREERDP_LOCAL const char* credssp_auth_pkg_name(rdpCredsspAuth* auth);
63FREERDP_LOCAL size_t credssp_auth_trailer_size(rdpCredsspAuth* auth);
64FREERDP_LOCAL INT32 credssp_auth_sspi_error(rdpCredsspAuth* auth);
65
66FREERDP_LOCAL void credssp_auth_tableAndContext(rdpCredsspAuth* auth,
67 SecurityFunctionTable** ptable,
68 CtxtHandle* pcontext);
69
70#endif /* FREERDP_LIB_CORE_CREDSSP_AUTH_H */