23#ifndef AUTH_LDAP_SASL_CLIENT_H_
24#define AUTH_LDAP_SASL_CLIENT_H_
28#ifdef HAVE_SASL_SASL_H
38#define SASL_MAX_STR_SIZE 1024
39#define SASL_SERVICE_NAME "ldap"
88 void interact(sasl_interact_t *ilist);
107 int sasl_start(
const char **client_output,
int *client_output_length);
120 int sasl_step(
char *server_input,
int server_input_length,
121 const char **client_output,
int *client_output_length);
136 char **reponse,
int *response_len);
#define SASL_MAX_STR_SIZE
Definition: auth_ldap_sasl_client.h:38
Class representing SASL client.
Definition: auth_ldap_sasl_client.h:46
int sasl_step(char *server_input, int server_input_length, const char **client_output, int *client_output_length)
Perform a step of SASL client exchange.
Definition: auth_ldap_sasl_client.cc:255
Sasl_client()=delete
Default constructor -not wanted.
char m_user_pwd[SASL_MAX_STR_SIZE]
user password used for authentication
Definition: auth_ldap_sasl_client.h:177
MYSQL_PLUGIN_VIO * m_vio
pointer to server communication channel
Definition: auth_ldap_sasl_client.h:183
bool require_conclude_by_server()
Check if the authentication method requires conclusion message from the server.
Definition: auth_ldap_sasl_client.h:145
MYSQL * m_mysql
pointer to MYSQL structure
Definition: auth_ldap_sasl_client.h:186
void interact(sasl_interact_t *ilist)
Perform SASL interaction, callled as SASL callback.
Definition: auth_ldap_sasl_client.cc:70
char m_user_name[SASL_MAX_STR_SIZE]
user name used for authentication
Definition: auth_ldap_sasl_client.h:174
void set_user_info(const char *name, const char *pwd)
Sets (copies) user name and password to the members.
Definition: auth_ldap_sasl_client.cc:301
bool set_mechanism()
Decides and sets SASL mechanism to be used for authentication.
Definition: auth_ldap_sasl_client.cc:99
Sasl_mechanism * m_sasl_mechanism
the SASL mechanism used for authentication
Definition: auth_ldap_sasl_client.h:192
int sasl_start(const char **client_output, int *client_output_length)
Starts SASL client exchange.
Definition: auth_ldap_sasl_client.cc:225
sasl_conn_t * m_connection
SASL connection data.
Definition: auth_ldap_sasl_client.h:180
bool initilize_connection()
Initializes SASL client exchange.
Definition: auth_ldap_sasl_client.cc:155
char * m_mysql_user
the original user name,
Definition: auth_ldap_sasl_client.h:189
bool set_user()
If an empty original user name was given as client parameter and passed to the plugin via MYSQL struc...
Definition: auth_ldap_sasl_client.cc:277
bool preauthenticate()
Perform preauthentication step if needed, specific to the SASL mechanism e.g.
Definition: auth_ldap_sasl_client.cc:150
int send_sasl_request_to_server(const char *request, int request_len, char **reponse, int *response_len)
Sends SASL message to server and receive an response.
Definition: auth_ldap_sasl_client.cc:186
~Sasl_client()
Destructor.
Definition: auth_ldap_sasl_client.cc:172
Base class representing SASL mechanism.
Definition: auth_ldap_sasl_mechanism.h:47
virtual bool require_conclude_by_server()
Check if the authentication method requires conclusion message from the server.
Definition: auth_ldap_sasl_mechanism.h:112
Definition: auth_ldap_kerberos.cc:29
Definition: instrumented_condition_variable.h:31
case opt name
Definition: sslopt-case.h:32
Provides plugin access to communication channel.
Definition: plugin_auth_common.h:145