20 #ifndef FREERDP_LIB_CORE_CREDSSP_AUTH_H
21 #define FREERDP_LIB_CORE_CREDSSP_AUTH_H
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"
28 typedef struct rdp_credssp_auth rdpCredsspAuth;
30 #include <freerdp/freerdp.h>
31 #include <winpr/tchar.h>
32 #include <winpr/sspi.h>
33 #include <winpr/secapi.h>
35 FREERDP_LOCAL
void credssp_auth_free(rdpCredsspAuth* auth);
37 WINPR_ATTR_MALLOC(credssp_auth_free, 1)
38 FREERDP_LOCAL rdpCredsspAuth* credssp_auth_new(const rdpContext* context);
40 FREERDP_LOCAL BOOL credssp_auth_init(rdpCredsspAuth* auth, TCHAR* pkg_name,
42 FREERDP_LOCAL BOOL credssp_auth_setup_client(rdpCredsspAuth* auth, const
char* target_service,
43 const
char* target_hostname,
44 const SEC_WINNT_AUTH_IDENTITY* identity,
46 FREERDP_LOCAL BOOL credssp_auth_setup_server(rdpCredsspAuth* auth);
47 FREERDP_LOCAL
void credssp_auth_set_flags(rdpCredsspAuth* auth, ULONG flags);
48 FREERDP_LOCAL
int credssp_auth_authenticate(rdpCredsspAuth* auth);
49 FREERDP_LOCAL BOOL credssp_auth_encrypt(rdpCredsspAuth* auth, const
SecBuffer* plaintext,
50 SecBuffer* ciphertext,
size_t* signature_length,
52 FREERDP_LOCAL BOOL credssp_auth_decrypt(rdpCredsspAuth* auth, const
SecBuffer* ciphertext,
54 FREERDP_LOCAL BOOL credssp_auth_impersonate(rdpCredsspAuth* auth);
55 FREERDP_LOCAL BOOL credssp_auth_revert_to_self(rdpCredsspAuth* auth);
56 FREERDP_LOCAL BOOL credssp_auth_set_spn(rdpCredsspAuth* auth, const
char* service,
57 const
char* hostname);
58 FREERDP_LOCAL
void credssp_auth_take_input_buffer(rdpCredsspAuth* auth,
SecBuffer* buffer);
59 FREERDP_LOCAL const
SecBuffer* credssp_auth_get_output_buffer(rdpCredsspAuth* auth);
60 FREERDP_LOCAL BOOL credssp_auth_have_output_token(rdpCredsspAuth* auth);
61 FREERDP_LOCAL BOOL credssp_auth_is_complete(rdpCredsspAuth* auth);
62 FREERDP_LOCAL const
char* credssp_auth_pkg_name(rdpCredsspAuth* auth);
63 FREERDP_LOCAL
size_t credssp_auth_trailer_size(rdpCredsspAuth* auth);
64 FREERDP_LOCAL UINT32 credssp_auth_sspi_error(rdpCredsspAuth* auth);
66 FREERDP_LOCAL
void credssp_auth_tableAndContext(rdpCredsspAuth* auth,
67 SecurityFunctionTable** ptable,