23#ifndef SQL_COMMON_CLIENT_ASYNC_AUTHENTICATION_H
24#define SQL_COMMON_CLIENT_ASYNC_AUTHENTICATION_H
26#define MAX_CIPHER_LENGTH 1024
28#include <openssl/ossl_typ.h>
29#include <openssl/pem.h>
30#include <openssl/rsa.h>
44 const unsigned char *
pkt,
100#if OPENSSL_VERSION_NUMBER >= 0x30000000L
client_auth_caching_sha2_password_plugin_status
Definition: client_async_authentication.h:84
@ CACHING_SHA2_REQUEST_PUBLIC_KEY
Definition: client_async_authentication.h:88
@ CACHING_SHA2_READ_PUBLIC_KEY
Definition: client_async_authentication.h:89
@ CACHING_SHA2_SEND_PLAIN_PASSWORD
Definition: client_async_authentication.h:91
@ CACHING_SHA2_SEND_ENCRYPTED_PASSWORD
Definition: client_async_authentication.h:90
@ CACHING_SHA2_READING_PASSWORD
Definition: client_async_authentication.h:85
@ CACHING_SHA2_CHALLENGE_RESPONSE
Definition: client_async_authentication.h:87
@ CACHING_SHA2_WRITING_RESPONSE
Definition: client_async_authentication.h:86
mysql_state_machine_status
Definition: client_async_authentication.h:63
@ STATE_MACHINE_FAILED
Definition: client_async_authentication.h:64
@ STATE_MACHINE_CONTINUE
Definition: client_async_authentication.h:65
@ STATE_MACHINE_DONE
Definition: client_async_authentication.h:67
@ STATE_MACHINE_WOULD_BLOCK
Definition: client_async_authentication.h:66
client_auth_native_password_plugin_status
Definition: client_async_authentication.h:71
@ NATIVE_READING_PASSWORD
Definition: client_async_authentication.h:72
@ NATIVE_WRITING_RESPONSE
Definition: client_async_authentication.h:73
client_auth_sha256_password_plugin_status
Definition: client_async_authentication.h:76
@ SHA256_REQUEST_PUBLIC_KEY
Definition: client_async_authentication.h:78
@ SHA256_SEND_ENCRYPTED_PASSWORD
Definition: client_async_authentication.h:80
@ SHA256_READING_PASSWORD
Definition: client_async_authentication.h:77
@ SHA256_READ_PUBLIC_KEY
Definition: client_async_authentication.h:79
@ SHA256_SEND_PLAIN_PASSWORD
Definition: client_async_authentication.h:81
#define MAX_CIPHER_LENGTH
Definition: client_async_authentication.h:26
mysql_state_machine_status(* csm_function)(mysql_async_connect *)
Definition: client_async_authentication.h:145
ssl_exchange_state
Definition: client_async_authentication.h:150
@ SSL_REQUEST
Definition: client_async_authentication.h:151
@ SSL_CONNECT
Definition: client_async_authentication.h:152
@ SSL_COMPLETE
Definition: client_async_authentication.h:153
@ SSL_NONE
Definition: client_async_authentication.h:154
mysql_state_machine_status(* authsm_function)(mysql_async_auth *)
Definition: client_async_authentication.h:96
unsigned char uchar
Definition: my_inttypes.h:52
Declarations for asynchronous client communication.
Common definition between mysql server & client.
#define SCRAMBLE_LENGTH
Length of random string sent by server on handshake; this is also length of obfuscated password,...
Definition: mysql_com.h:128
#define NAME_LEN
Definition: mysql_com.h:67
#define USERNAME_LENGTH
Definition: mysql_com.h:69
Definition: buf0block_hint.cc:30
struct result result
Definition: result.h:34
This file defines constants and data structures that are the same for both client- and server-side au...
net_async_status
Definition: plugin_auth_common.h:136
struct rsa_st RSA
Definition: sql_authentication.h:103
Definition: client_async_authentication.h:37
auth_plugin_t * plugin
what plugin we're under
Definition: client_async_authentication.h:49
struct MCPVIO_EXT::@30 cached_server_reply
uchar * pkt
pointer into NET::buff
Definition: client_async_authentication.h:52
int packets_read
Definition: client_async_authentication.h:57
void(* info)(MYSQL_PLUGIN_VIO *vio, MYSQL_PLUGIN_VIO_INFO *info)
Definition: client_async_authentication.h:40
net_async_status(* write_packet_nonblocking)(struct MYSQL_PLUGIN_VIO *vio, const unsigned char *pkt, int pkt_len, int *result)
Definition: client_async_authentication.h:43
bool pkt_received
a flag indicating that pkt, pkt_len contain valid packet to be reused
Definition: client_async_authentication.h:55
const char * db
Definition: client_async_authentication.h:50
net_async_status(* read_packet_nonblocking)(struct MYSQL_PLUGIN_VIO *vio, unsigned char **buf, int *result)
Definition: client_async_authentication.h:41
uint pkt_len
Definition: client_async_authentication.h:53
MYSQL * mysql
Definition: client_async_authentication.h:48
int(* read_packet)(MYSQL_PLUGIN_VIO *vio, uchar **buf)
Definition: client_async_authentication.h:38
int(* write_packet)(MYSQL_PLUGIN_VIO *vio, const uchar *pkt, int pkt_len)
Definition: client_async_authentication.h:39
int last_read_packet_len
the length of the last read packet
Definition: client_async_authentication.h:59
int mysql_change_user
if it's mysql_change_user()
Definition: client_async_authentication.h:58
int packets_written
counters for send/received packets
Definition: client_async_authentication.h:57
Definition: plugin_auth_common.h:121
Provides plugin access to communication channel.
Definition: plugin_auth_common.h:146
Definition: client_plugin.h:121
Definition: client_async_authentication.h:109
bool non_blocking
Definition: client_async_authentication.h:111
const char * data_plugin
set to mysql_async_connect::scramble_plugin
Definition: client_async_authentication.h:116
sha2_async_auth sha2_auth
Definition: client_async_authentication.h:133
auth_plugin_t * auth_plugin
Definition: client_async_authentication.h:120
char * change_user_buff
Definition: client_async_authentication.h:125
int client_auth_plugin_state
Used by caching_sha256_password plugin.
Definition: client_async_authentication.h:129
MCPVIO_EXT mpvio
Definition: client_async_authentication.h:121
const char * auth_plugin_name
Definition: client_async_authentication.h:119
uint current_factor_index
Definition: client_async_authentication.h:131
MYSQL * mysql
Definition: client_async_authentication.h:110
char * data
Definition: client_async_authentication.h:113
authsm_function state_function
Definition: client_async_authentication.h:130
uint data_len
Definition: client_async_authentication.h:114
ulong pkt_length
Definition: client_async_authentication.h:122
int change_user_buff_len
Definition: client_async_authentication.h:126
const char * db
Definition: client_async_authentication.h:117
int res
Definition: client_async_authentication.h:123
Definition: client_async_authentication.h:162
const char * scramble_plugin
The server sends the default plugin name in Protocol::HandshakeV10.
Definition: client_async_authentication.h:180
char * scramble_data
Definition: client_async_authentication.h:178
char buff[NAME_LEN+USERNAME_LENGTH+100]
Definition: client_async_authentication.h:176
SSL * ssl
Definition: client_async_authentication.h:191
int scramble_data_len
Definition: client_async_authentication.h:177
csm_function state_function
Definition: client_async_authentication.h:193
ssl_exchange_state ssl_state
Definition: client_async_authentication.h:190
char ** current_init_command
Definition: client_async_authentication.h:188
MYSQL * mysql
Definition: client_async_authentication.h:164
char * host_info
Definition: client_async_authentication.h:175
ulong client_flag
Definition: client_async_authentication.h:171
uint port
Definition: client_async_authentication.h:169
struct mysql_async_auth * auth_context
Definition: client_async_authentication.h:185
bool scramble_buffer_allocated
Definition: client_async_authentication.h:182
bool non_blocking
Definition: client_async_authentication.h:172
ulong pkt_length
Definition: client_async_authentication.h:174
const char * user
Definition: client_async_authentication.h:166
bool saved_reconnect
Definition: client_async_authentication.h:187
const char * db
Definition: client_async_authentication.h:168
const char * passwd
Definition: client_async_authentication.h:167
const char * unix_socket
Definition: client_async_authentication.h:170
char * scramble_buffer
Definition: client_async_authentication.h:181
const char * host
Definition: client_async_authentication.h:165
Definition: client_async_authentication.h:98
int cipher_length
Definition: client_async_authentication.h:106
unsigned char encrypted_password[MAX_CIPHER_LENGTH]
Definition: client_async_authentication.h:99
unsigned char scramble_pkt[SCRAMBLE_LENGTH]
Definition: client_async_authentication.h:105
RSA * public_key
Definition: client_async_authentication.h:103
unsigned int uint
Definition: uca9-dump.cc:75