MySQL 9.1.0
Source Code Documentation
viosslfactories.cc File Reference
#include <memory>
#include <string>
#include "m_string.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "mysql/my_loglevel.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/service_mysql_alloc.h"
#include "mysys_err.h"
#include "template_utils.h"
#include "vio/vio_priv.h"
#include <dh_ecdh_config.h>
#include <tls_ciphers.h>
#include "my_openssl_fips.h"

Classes

struct  CRYPTO_dynlock_value
 

Macros

#define TLS_VERSION_OPTION_SIZE   256
 

Typedefs

typedef struct CRYPTO_dynlock_value openssl_lock_t
 

Functions

static void report_errors ()
 
const char * sslGetErrString (enum enum_ssl_init_error e)
 
static int vio_set_cert_stuff (SSL_CTX *ctx, const char *cert_file, const char *key_file, enum enum_ssl_init_error *error)
 
static void openssl_lock (int mode, openssl_lock_t *lock, const char *file, int line)
 
static void openssl_lock_function (int mode, int n, const char *file, int line)
 
static openssl_lock_topenssl_dynlock_create (const char *file, int line)
 
static void openssl_dynlock_destroy (openssl_lock_t *lock, const char *file, int line)
 
static unsigned long openssl_id_function ()
 
static void init_ssl_locks ()
 
static void set_lock_callback_functions (bool init)
 
static void init_lock_callback_functions ()
 
static void deinit_lock_callback_functions ()
 
void vio_ssl_end ()
 
void ssl_start ()
 
long process_tls_version (const char *tls_version)
 
static struct st_VioSSLFdnew_VioSSLFd (const char *key_file, const char *cert_file, const char *ca_file, const char *ca_path, const char *cipher, const char *ciphersuites, bool is_client, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, const long ssl_ctx_flags, const char *server_host)
 
struct st_VioSSLFdnew_VioSSLConnectorFd (const char *key_file, const char *cert_file, const char *ca_file, const char *ca_path, const char *cipher, const char *ciphersuites, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, const long ssl_ctx_flags, const char *server_host)
 
struct st_VioSSLFdnew_VioSSLAcceptorFd (const char *key_file, const char *cert_file, const char *ca_file, const char *ca_path, const char *cipher, const char *ciphersuites, enum enum_ssl_init_error *error, const char *crl_file, const char *crl_path, const long ssl_ctx_flags)
 
void free_vio_ssl_acceptor_fd (struct st_VioSSLFd *fd)
 

Variables

static bool ssl_initialized = false
 
static const char * ssl_error_string []
 
static PSI_rwlock_key key_rwlock_openssl
 
static PSI_rwlock_info openssl_rwlocks []
 
static openssl_lock_topenssl_stdlocks
 

Macro Definition Documentation

◆ TLS_VERSION_OPTION_SIZE

#define TLS_VERSION_OPTION_SIZE   256

Typedef Documentation

◆ openssl_lock_t

Function Documentation

◆ deinit_lock_callback_functions()

static void deinit_lock_callback_functions ( )
static

◆ free_vio_ssl_acceptor_fd()

void free_vio_ssl_acceptor_fd ( struct st_VioSSLFd fd)

◆ init_lock_callback_functions()

static void init_lock_callback_functions ( )
static

◆ init_ssl_locks()

static void init_ssl_locks ( )
static

◆ new_VioSSLAcceptorFd()

struct st_VioSSLFd * new_VioSSLAcceptorFd ( const char *  key_file,
const char *  cert_file,
const char *  ca_file,
const char *  ca_path,
const char *  cipher,
const char *  ciphersuites,
enum enum_ssl_init_error error,
const char *  crl_file,
const char *  crl_path,
const long  ssl_ctx_flags 
)

◆ new_VioSSLConnectorFd()

struct st_VioSSLFd * new_VioSSLConnectorFd ( const char *  key_file,
const char *  cert_file,
const char *  ca_file,
const char *  ca_path,
const char *  cipher,
const char *  ciphersuites,
enum enum_ssl_init_error error,
const char *  crl_file,
const char *  crl_path,
const long  ssl_ctx_flags,
const char *  server_host 
)

◆ new_VioSSLFd()

static struct st_VioSSLFd * new_VioSSLFd ( const char *  key_file,
const char *  cert_file,
const char *  ca_file,
const char *  ca_path,
const char *  cipher,
const char *  ciphersuites,
bool  is_client,
enum enum_ssl_init_error error,
const char *  crl_file,
const char *  crl_path,
const long  ssl_ctx_flags,
const char *  server_host 
)
static

◆ openssl_dynlock_create()

static openssl_lock_t * openssl_dynlock_create ( const char *  file,
int  line 
)
static

◆ openssl_dynlock_destroy()

static void openssl_dynlock_destroy ( openssl_lock_t lock,
const char *  file,
int  line 
)
static

◆ openssl_id_function()

static unsigned long openssl_id_function ( )
static

◆ openssl_lock()

static void openssl_lock ( int  mode,
openssl_lock_t lock,
const char *  file,
int  line 
)
static

◆ openssl_lock_function()

static void openssl_lock_function ( int  mode,
int  n,
const char *  file,
int  line 
)
static

◆ process_tls_version()

long process_tls_version ( const char *  tls_version)

◆ report_errors()

static void report_errors ( )
static

◆ set_lock_callback_functions()

static void set_lock_callback_functions ( bool  init)
static

◆ ssl_start()

void ssl_start ( void  )

◆ sslGetErrString()

const char * sslGetErrString ( enum enum_ssl_init_error  e)

◆ vio_set_cert_stuff()

static int vio_set_cert_stuff ( SSL_CTX *  ctx,
const char *  cert_file,
const char *  key_file,
enum enum_ssl_init_error error 
)
static

◆ vio_ssl_end()

void vio_ssl_end ( )

Variable Documentation

◆ key_rwlock_openssl

PSI_rwlock_key key_rwlock_openssl
static

◆ openssl_rwlocks

PSI_rwlock_info openssl_rwlocks[]
static
Initial value:
= {
{&key_rwlock_openssl, "CRYPTO_dynlock_value::lock", 0, 0, nullptr}}
static PSI_rwlock_key key_rwlock_openssl
Definition: viosslfactories.cc:153

◆ openssl_stdlocks

openssl_lock_t* openssl_stdlocks
static

◆ ssl_error_string

const char* ssl_error_string[]
static
Initial value:
= {
"No error",
"Unable to get certificate",
"Unable to get private key",
"Private key does not match the certificate public key",
"SSL_CTX_set_default_verify_paths failed",
"Failed to set ciphers to use",
"SSL_CTX_new failed",
"SSL context is not usable without certificate and private key",
"SSL_CTX_set_tmp_dh failed",
"TLS version is invalid",
"FIPS mode invalid",
"FIPS mode failed",
"Failed to set ecdh information",
"Failed to set X509 verification parameter",
"Invalid certificates"}

◆ ssl_initialized

bool ssl_initialized = false
static