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"
28typedef 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>
35FREERDP_LOCAL
void credssp_auth_free(rdpCredsspAuth* auth);
37WINPR_ATTR_MALLOC(credssp_auth_free, 1)
39FREERDP_LOCAL rdpCredsspAuth* credssp_auth_new(const rdpContext* context);
41FREERDP_LOCAL BOOL credssp_auth_init(rdpCredsspAuth* auth, TCHAR* pkg_name,
43FREERDP_LOCAL BOOL credssp_auth_setup_client(rdpCredsspAuth* auth, const
char* target_service,
44 const
char* target_hostname,
45 const SEC_WINNT_AUTH_IDENTITY* identity,
47FREERDP_LOCAL BOOL credssp_auth_setup_server(rdpCredsspAuth* auth);
48FREERDP_LOCAL
void credssp_auth_set_flags(rdpCredsspAuth* auth, ULONG flags);
49FREERDP_LOCAL
int credssp_auth_authenticate(rdpCredsspAuth* auth);
50FREERDP_LOCAL BOOL credssp_auth_encrypt(rdpCredsspAuth* auth, const
SecBuffer* plaintext,
51 SecBuffer* ciphertext,
size_t* signature_length,
53FREERDP_LOCAL BOOL credssp_auth_decrypt(rdpCredsspAuth* auth, const
SecBuffer* ciphertext,
55FREERDP_LOCAL BOOL credssp_auth_impersonate(rdpCredsspAuth* auth);
56FREERDP_LOCAL BOOL credssp_auth_revert_to_self(rdpCredsspAuth* auth);
57FREERDP_LOCAL BOOL credssp_auth_set_spn(rdpCredsspAuth* auth, const
char* service,
58 const
char* hostname);
59FREERDP_LOCAL
void credssp_auth_take_input_buffer(rdpCredsspAuth* auth,
SecBuffer* buffer);
60FREERDP_LOCAL const
SecBuffer* credssp_auth_get_output_buffer(const rdpCredsspAuth* auth);
61FREERDP_LOCAL BOOL credssp_auth_have_output_token(rdpCredsspAuth* auth);
62FREERDP_LOCAL BOOL credssp_auth_is_complete(const rdpCredsspAuth* auth);
63FREERDP_LOCAL const
char* credssp_auth_pkg_name(const rdpCredsspAuth* auth);
64FREERDP_LOCAL
size_t credssp_auth_trailer_size(const rdpCredsspAuth* auth);
65FREERDP_LOCAL INT32 credssp_auth_sspi_error(const rdpCredsspAuth* auth);
67FREERDP_LOCAL
void credssp_auth_tableAndContext(rdpCredsspAuth* auth,
68 SecurityFunctionTable** ptable,