![]() |
MySQL 8.0.40
Source Code Documentation
|
#include <errno.h>
#include <stddef.h>
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "mysql/psi/mysql_socket.h"
#include "vio/vio_priv.h"
Typedefs | |
typedef int(* | ssl_handshake_func_t) (SSL *) |
SSL handshake handler. More... | |
Functions | |
static void | report_errors (SSL *ssl) |
static void | ssl_set_sys_error (int ssl_error) |
Obtain the equivalent system error status for the last SSL I/O operation. More... | |
static bool | ssl_should_retry (Vio *vio, int ret, enum enum_vio_io_event *event, unsigned long *ssl_errno_holder) |
Check if an operation should be retried and handle errors. More... | |
size_t | vio_ssl_read (Vio *vio, uchar *buf, size_t size) |
size_t | vio_ssl_write (Vio *vio, const uchar *buf, size_t size) |
int | vio_ssl_shutdown (Vio *vio) |
void | vio_ssl_delete (Vio *vio) |
static size_t | ssl_handshake_loop (Vio *vio, SSL *ssl, ssl_handshake_func_t func, unsigned long *ssl_errno_holder) |
Loop and wait until a SSL handshake is completed. More... | |
long | pfs_ssl_bio_callback_ex (BIO *b, int oper, const char *, size_t len, int, long, int ret, size_t *processed) |
long | pfs_ssl_bio_callback (BIO *b, int oper, const char *argp, int argi, long argl, long ret) |
Forward openSSL old style callback to openSSL 1.1.1 style callback. More... | |
static void | pfs_ssl_setup_instrumentation (Vio *vio, const SSL *ssl) |
static void | print_ssl_session_id (SSL_SESSION *sess, const char *action) |
static int | ssl_do (struct st_VioSSLFd *ptr, Vio *vio, long timeout, SSL_SESSION *ssl_session, ssl_handshake_func_t func, unsigned long *ssl_errno_holder, SSL **sslptr) |
int | sslaccept (struct st_VioSSLFd *ptr, Vio *vio, long timeout, unsigned long *ssl_errno_holder) |
int | sslconnect (struct st_VioSSLFd *ptr, Vio *vio, long timeout, SSL_SESSION *session, unsigned long *ssl_errno_holder, SSL **ssl) |
bool | vio_ssl_has_data (Vio *vio) |
typedef int(* ssl_handshake_func_t) (SSL *) |
SSL handshake handler.
long pfs_ssl_bio_callback | ( | BIO * | b, |
int | oper, | ||
const char * | argp, | ||
int | argi, | ||
long | argl, | ||
long | ret | ||
) |
Forward openSSL old style callback to openSSL 1.1.1 style callback.
long pfs_ssl_bio_callback_ex | ( | BIO * | b, |
int | oper, | ||
const char * | , | ||
size_t | len, | ||
int | , | ||
long | , | ||
int | ret, | ||
size_t * | processed | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
Loop and wait until a SSL handshake is completed.
vio | VIO object representing a SSL connection. | |
ssl | SSL structure for the connection. | |
func | SSL handshake handler. | |
[out] | ssl_errno_holder | The SSL error code. |
|
static |
Obtain the equivalent system error status for the last SSL I/O operation.
ssl_error | The result code of the failed TLS/SSL I/O operation. |
|
static |
Check if an operation should be retried and handle errors.
This function does the following:
Note that this is not done for SSL_ERROR_WANT_READ/SSL_ERROR_WANT_WRITE since these are not treated as errors and a call to the function is retried.
When SSL_ERROR_SSL is returned the ERR code of the top error in the queue is peeked and returned to the caller so they can call ERR_error_string_n() and retrieve the right error message.
vio | VIO object representing a SSL connection. | |
ret | Value returned by a SSL I/O function. | |
[out] | event | The type of I/O event to wait/retry. |
[out] | ssl_errno_holder | The SSL error code. |
true | Temporary failure, retry operation. |
false | Indeterminate failure. |
int sslaccept | ( | struct st_VioSSLFd * | ptr, |
Vio * | vio, | ||
long | timeout, | ||
unsigned long * | ssl_errno_holder | ||
) |
int sslconnect | ( | struct st_VioSSLFd * | ptr, |
Vio * | vio, | ||
long | timeout, | ||
SSL_SESSION * | session, | ||
unsigned long * | ssl_errno_holder, | ||
SSL ** | ssl | ||
) |
void vio_ssl_delete | ( | Vio * | vio | ) |
bool vio_ssl_has_data | ( | Vio * | vio | ) |
int vio_ssl_shutdown | ( | Vio * | vio | ) |