MySQL 9.6.0
Source Code Documentation
classic_hashing.cc File Reference
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/md5.h>
#include <openssl/opensslv.h>
#include <cassert>
#include <cstdio>
#include "my_compiler.h"
#include "mysql/components/component_implementation.h"
#include "mysql/components/my_service.h"
#include "mysql/components/service_implementation.h"
#include "mysql/components/services/bits/my_err_bits.h"
#include "mysql/components/services/udf_metadata.h"
#include "mysql/components/services/udf_registration.h"
#include <openssl/ec.h>
#include <openssl/crypto.h>

Namespaces

namespace  fips
 
namespace  sha
 
namespace  md5
 

Macros

#define SHA1_HASH_SIZE   20 /* Hash size in bytes */
 
#define MD5_HASH_SIZE   16
 

Functions

static REQUIRES_SERVICE_PLACEHOLDER (mysql_udf_metadata)
 classic_hashing component exposes the MD5, SHA1 and SHA UDFs that generates the respective hashes. More...
 
static REQUIRES_SERVICE_PLACEHOLDER (udf_registration)
 
static bool check_init_common (UDF_INIT *initd, UDF_ARGS *args, char *message)
 
static void local_array_to_hex (char *to, const unsigned char *str, unsigned len)
 
static void fips::read_mode ()
 
static const EVP_MD * sha::my_EVP_sha1 ()
 
static void sha::init ()
 
static void sha::deinit ()
 
static void sha::compute_sha1_hash (unsigned char *digest, const char *buf, size_t len)
 Wrapper function to compute SHA1 message digest. More...
 
static bool sha::check_init (UDF_INIT *initd, UDF_ARGS *args, char *message)
 
static char * sha::udf (UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, unsigned char *null_value, unsigned char *error)
 
static int md5::md5_hash (unsigned char *digest, const char *buf, size_t len)
 
static char * md5::udf (UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, unsigned char *null_value, unsigned char *error)
 
static bool md5::check_init (UDF_INIT *initd, UDF_ARGS *args, char *message)
 
static mysql_service_status_t init ()
 Component initialization. More...
 
static mysql_service_status_t deinit ()
 Component deinitialization. More...
 
 END_COMPONENT_PROVIDES ()
 
 REQUIRES_SERVICE (udf_registration)
 
 REQUIRES_SERVICE (mysql_udf_metadata)
 
 END_COMPONENT_REQUIRES ()
 
 METADATA ("mysql.author", "Oracle Corporation")
 
 METADATA ("mysql.license", "GPL")
 
 END_COMPONENT_METADATA ()
 

Variables

static int fips::fips_mode = 0
 
static mysql_component_t mysql_component_classic_hashing
 

Macro Definition Documentation

◆ MD5_HASH_SIZE

#define MD5_HASH_SIZE   16

◆ SHA1_HASH_SIZE

#define SHA1_HASH_SIZE   20 /* Hash size in bytes */

Function Documentation

◆ check_init_common()

static bool check_init_common ( UDF_INIT initd,
UDF_ARGS args,
char *  message 
)
static

◆ deinit()

static mysql_service_status_t deinit ( )
static

Component deinitialization.

◆ END_COMPONENT_METADATA()

END_COMPONENT_METADATA ( )

◆ END_COMPONENT_PROVIDES()

END_COMPONENT_PROVIDES ( )

◆ END_COMPONENT_REQUIRES()

END_COMPONENT_REQUIRES ( )

◆ init()

static mysql_service_status_t init ( )
static

Component initialization.

◆ local_array_to_hex()

static void local_array_to_hex ( char *  to,
const unsigned char *  str,
unsigned  len 
)
inlinestatic

◆ METADATA() [1/2]

METADATA ( "mysql.author"  ,
"Oracle Corporation"   
)

◆ METADATA() [2/2]

METADATA ( "mysql.license"  ,
"GPL"   
)

◆ REQUIRES_SERVICE() [1/2]

REQUIRES_SERVICE ( mysql_udf_metadata  )

◆ REQUIRES_SERVICE() [2/2]

REQUIRES_SERVICE ( udf_registration  )

◆ REQUIRES_SERVICE_PLACEHOLDER() [1/2]

static REQUIRES_SERVICE_PLACEHOLDER ( mysql_udf_metadata  )
static

classic_hashing component exposes the MD5, SHA1 and SHA UDFs that generates the respective hashes.

◆ REQUIRES_SERVICE_PLACEHOLDER() [2/2]

static REQUIRES_SERVICE_PLACEHOLDER ( udf_registration  )
static

Variable Documentation

◆ mysql_component_classic_hashing

mysql_component_t mysql_component_classic_hashing
static
Initial value:
= { "classic_hashing" , __classic_hashing_provides, __classic_hashing_requires, __classic_hashing_metadata, init, deinit
}
static mysql_service_status_t deinit()
Component deinitialization.
Definition: classic_hashing.cc:263
static mysql_service_status_t init()
Component initialization.
Definition: classic_hashing.cc:244