MySQL 8.4.2
Source Code Documentation
common.h File Reference
#include <cstring>
#include <iostream>
#include <sstream>
#include "my_byteorder.h"
#include "my_inttypes.h"

Go to the source code of this file.

Macros

#define BASE64_CHALLENGE_LENGTH   45
 

Typedefs

typedef void(* plugin_messages_callback) (const char *msg)
 
typedef int(* plugin_messages_callback_get_uint) (unsigned int *val)
 
typedef int(* plugin_messages_callback_get_password) (char *buffer, const unsigned int buffer_len)
 

Enumerations

enum class  message_type { INFO , ERROR }
 
enum class  input_type { UINT , PASSWORD }
 

Functions

void get_plugin_messages (const std::string &msg, message_type type)
 
int get_user_input (const std::string &msg, input_type type, void *arg, const unsigned int *optional_arg_size=nullptr)
 
void url_compatible_base64 (char *url_compatible_str, size_t len, char *base64_str)
 Helper method to convert base64 string to url safe base64. More...
 
bool generate_sha256 (const unsigned char *in_key, unsigned int in_key_length, unsigned char *hash, unsigned int &hash_length)
 

Variables

plugin_messages_callback mc
 
plugin_messages_callback_get_uint mc_get_uint
 
plugin_messages_callback_get_password mc_get_password
 

Macro Definition Documentation

◆ BASE64_CHALLENGE_LENGTH

#define BASE64_CHALLENGE_LENGTH   45

Typedef Documentation

◆ plugin_messages_callback

typedef void(* plugin_messages_callback) (const char *msg)

◆ plugin_messages_callback_get_password

typedef int(* plugin_messages_callback_get_password) (char *buffer, const unsigned int buffer_len)

◆ plugin_messages_callback_get_uint

typedef int(* plugin_messages_callback_get_uint) (unsigned int *val)

Enumeration Type Documentation

◆ input_type

enum class input_type
strong
Enumerator
UINT 
PASSWORD 

◆ message_type

enum class message_type
strong
Enumerator
INFO 
ERROR 

Function Documentation

◆ generate_sha256()

bool generate_sha256 ( const unsigned char *  in_key,
unsigned int  in_key_length,
unsigned char *  hash,
unsigned int &  hash_length 
)

◆ get_plugin_messages()

void get_plugin_messages ( const std::string &  msg,
message_type  type 
)

◆ get_user_input()

int get_user_input ( const std::string &  msg,
input_type  type,
void *  arg,
const unsigned int *  optional_arg_size = nullptr 
)

◆ url_compatible_base64()

void url_compatible_base64 ( char *  url_compatible_str,
size_t  len,
char *  base64_str 
)

Helper method to convert base64 string to url safe base64.

Using standard Base64 in URL requires replacing of '+', '/' and '=' characters. '+' will be replaced with '-' '/' will be replaced with '_' '=' is used for padding which will be removed.

Parameters
[out]url_compatible_strurl safe base64 string
[in]lenlength of base64 string
[in]base64_strbase64 string

Variable Documentation

◆ mc

◆ mc_get_password

plugin_messages_callback_get_password mc_get_password
extern

◆ mc_get_uint