Current File : //usr/include/mysql/ma_tls.h
#ifndef _ma_tls_h_
#define _ma_tls_h_

enum enum_pvio_tls_type {
  SSL_TYPE_DEFAULT=0,
#ifdef _WIN32
  SSL_TYPE_SCHANNEL,
#endif
  SSL_TYPE_OPENSSL,
  SSL_TYPE_GNUTLS
};

#define PROTOCOL_SSLV3    0
#define PROTOCOL_TLS_1_0  1
#define PROTOCOL_TLS_1_1  2
#define PROTOCOL_TLS_1_2  3
#define PROTOCOL_TLS_1_3  4
#define PROTOCOL_UNKNOWN  5
#define PROTOCOL_MAX PROTOCOL_TLS_1_3

#define TLS_VERSION_LENGTH 64
extern char tls_library_version[TLS_VERSION_LENGTH];

typedef struct st_ma_pvio_tls {
  void *data;
  MARIADB_PVIO *pvio;
  void *ssl;
} MARIADB_TLS;

/* Function prototypes */

/* ma_tls_start
   initializes the ssl library
   Parameter:
     errmsg      pointer to error message buffer
     errmsg_len  length of error message buffer
   Returns:
     0           success
     1           if an error occurred
   Notes:
     On success the global variable ma_tls_initialized will be set to 1
*/
int ma_tls_start(char *errmsg, size_t errmsg_len);

/* ma_tls_end
   unloads/deinitializes ssl library and unsets global variable
   ma_tls_initialized
*/
void ma_tls_end(void);

/* ma_tls_init
   creates a new SSL structure for a SSL connection and loads
   client certificates

   Parameters:
     MYSQL        a mysql structure
   Returns:
     void *       a pointer to internal SSL structure
*/
void * ma_tls_init(MYSQL *mysql);

/* ma_tls_connect
   performs SSL handshake
   Parameters:
     MARIADB_TLS   MariaDB SSL container
   Returns:
     0             success
     1             error
*/
my_bool ma_tls_connect(MARIADB_TLS *ctls);

/* ma_tls_read
   reads up to length bytes from socket
   Parameters:
     ctls         MariaDB SSL container
     buffer       read buffer
     length       buffer length
   Returns:
     0-n          bytes read
     -1           if an error occurred
*/
ssize_t ma_tls_read(MARIADB_TLS *ctls, const uchar* buffer, size_t length);

/* ma_tls_write
   write buffer to socket
   Parameters:
     ctls         MariaDB SSL container
     buffer       write buffer
     length       buffer length
   Returns:
     0-n          bytes written
     -1           if an error occurred
*/
ssize_t ma_tls_write(MARIADB_TLS *ctls, const uchar* buffer, size_t length);

/* ma_tls_close
   closes SSL connection and frees SSL structure which was previously
   created by ma_tls_init call
   Parameters:
     MARIADB_TLS  MariaDB SSL container
   Returns:
     0            success
     1            error
*/
my_bool ma_tls_close(MARIADB_TLS *ctls);

/* ma_tls_verify_server_cert
   validation check of server certificate
   Parameter:
     MARIADB_TLS  MariaDB SSL container
   Returns:
     ß            success
     1            error
*/
int ma_tls_verify_server_cert(MARIADB_TLS *ctls);

/* ma_tls_get_cipher
   returns cipher for current ssl connection
   Parameter:
     MARIADB_TLS  MariaDB SSL container
   Returns: 
     cipher in use or
     NULL on error
*/
const char *ma_tls_get_cipher(MARIADB_TLS *ssl);

/* ma_tls_get_finger_print
   returns SHA1 finger print of server certificate
   Parameter:
     MARIADB_TLS  MariaDB SSL container
     fp           buffer for fingerprint
     fp_len       buffer length
   Returns:
     actual size of finger print
*/
unsigned int ma_tls_get_finger_print(MARIADB_TLS *ctls, char *fp, unsigned int fp_len);

/* ma_tls_get_protocol_version 
   returns protocol version number in use
   Parameter:
     MARIADB_TLS    MariaDB SSL container
   Returns:
     protocol number
*/
int ma_tls_get_protocol_version(MARIADB_TLS *ctls);
const char *ma_pvio_tls_get_protocol_version(MARIADB_TLS *ctls);
int ma_pvio_tls_get_protocol_version_id(MARIADB_TLS *ctls);

/* Function prototypes */
MARIADB_TLS *ma_pvio_tls_init(MYSQL *mysql);
my_bool ma_pvio_tls_connect(MARIADB_TLS *ctls);
ssize_t ma_pvio_tls_read(MARIADB_TLS *ctls, const uchar *buffer, size_t length);
ssize_t ma_pvio_tls_write(MARIADB_TLS *ctls, const uchar *buffer, size_t length);
my_bool ma_pvio_tls_close(MARIADB_TLS *ctls);
int ma_pvio_tls_verify_server_cert(MARIADB_TLS *ctls);
const char *ma_pvio_tls_cipher(MARIADB_TLS *ctls);
my_bool ma_pvio_tls_check_fp(MARIADB_TLS *ctls, const char *fp, const char *fp_list);
my_bool ma_pvio_start_ssl(MARIADB_PVIO *pvio);
void ma_pvio_tls_end();

#endif /* _ma_tls_h_ */
blog

blog

казино – Официальный сайт Pin up играть онлайн Зеркало и вход.494

Пин Ап казино – Официальный сайт Pin up играть онлайн | Зеркало и вход ▶️ ИГРАТЬ Содержимое Официальный сайт Pin Up Казино: Как играть онлайн, зеркало и вход Pin Up Casino – Официальный сайт Описание и функции Pin Up Казино Бонусы и акции Как играть онлайн и вход в Pin …

Read More »

Beste Online Casinos in Deutschland.64

Beste Online Casinos in Deutschland ▶️ SPIELEN Содержимое Regulierung und Sicherheit Top Casino-Anbieter 1. Bwin 2. LeoVegas 3. Betway 4. 888 Casino 5. Casino.de Bonusangebote und Promotions No-Deposit-Bonus Einwilligungsbasierte Bonus Freispins Wiederholungsbasierte Bonus Spiele und Anpassung an Spieler Vielfältige Spielangebote Anpassungsfunktionen für Spieler Wenn es um das Vergnügen und die …

Read More »

91 Club Online Casino in India Demo Mode and Practice.211

91 Club Online Casino in India – Demo Mode and Practice ▶️ PLAY Содержимое 91 Club Online Casino in India: A Comprehensive Guide What is 91 Club Online Casino? Games and Features Unlock the Fun with Demo Mode and Practice Start Your Journey with a Bang: Exclusive Offers and Promotions …

Read More »

Best Online Casinos in Canada.947

Best Online Casinos in Canada ▶️ PLAY Содержимое Top-Rated Online Casinos in Canada Best Online Casinos with Free Bonus How to Choose the Best Online Casino for You Consider Your Budget Canada is known for its rich history of gaming and entertainment, and the online casino industry is no exception. …

Read More »

91 Club Online Casino in India Demo Mode and Practice.1118

91 Club Online Casino in India – Demo Mode and Practice ▶️ PLAY Содержимое 91 Club Online Casino in India: A Comprehensive Guide Discover the Thrill of Online Casino Gaming with 91 Club Why Choose 91 Club? Practice Your Skills in Demo Mode and Get Ready to Win Big In …

Read More »

– Официальный сайт Pinco Casino.5445

Пинко Казино – Официальный сайт Pinco Casino ▶️ ИГРАТЬ Содержимое Преимущества игры на официальном сайте Pinco Casino Как начать играть на официальном сайте Pinco Casino Конечно, безопасность и конфиденциальность игроков В наше время интернета и онлайн-игр, казино стали одним из самых популярных развлечений для многих людей. И среди них есть …

Read More »

1Win Azerbaijan – İdman Mərcləri və Casino saytı.3459

1Win Azerbaijan – İdman Mərcləri və Casino saytı ▶️ OYNA Содержимое 1Win Azerbaijan haqqında məlumatlar 1Win Azerbaijanın məqsədi Idman mərcələrindən istifadə edən məsləhətlər 1Win Casino saytı haqqında məlumatlar Idman mərcələrindən və casino saytı ilə bağlı məlumatlar Idman mərcəzlərindən məlumatlar Casino saytı ilə bağlı məlumatlar 1Win Azerbaycan – bu idman mərcəzi …

Read More »

Plinko – Online Casino Spel.921

Plinko – Online Casino Spel ▶️ SPELEN Содержимое Welkom bij het spel Winnen met de Plinko-regels Spelen met de online casino-opties Als je op zoek bent naar een online casino spel dat een beetje extra heeft, dan is Plinko zeker een spel waard om te proberen. Dit klassieke spel is …

Read More »