MySQL 8.4.2
Source Code Documentation
password.h File Reference
#include "config.h"
#include <stddef.h>
#include <sys/types.h>
#include "my_macros.h"

Go to the source code of this file.

Functions

void my_make_scrambled_password_sha1 (char *to, const char *password, size_t pass_len)
 
void make_scrambled_password (char *to, const char *password)
 
void scramble (char *to, const char *message, const char *password)
 Produce an obscure octet sequence from password and random string, received from the server. More...
 
bool check_scramble (const unsigned char *reply, const char *message, const unsigned char *hash_stage2)
 
void get_salt_from_password (unsigned char *res, const char *password)
 
void make_password_from_salt (char *to, const unsigned char *hash_stage2)
 

Function Documentation

◆ check_scramble()

bool check_scramble ( const unsigned char *  reply,
const char *  message,
const unsigned char *  hash_stage2 
)

◆ get_salt_from_password()

void get_salt_from_password ( unsigned char *  res,
const char *  password 
)

◆ make_password_from_salt()

void make_password_from_salt ( char *  to,
const unsigned char *  hash_stage2 
)

◆ make_scrambled_password()

void make_scrambled_password ( char *  to,
const char *  password 
)

◆ my_make_scrambled_password_sha1()

void my_make_scrambled_password_sha1 ( char *  to,
const char *  password,
size_t  pass_len 
)

◆ scramble()

void scramble ( char *  to,
const char *  message,
const char *  password 
)

Produce an obscure octet sequence from password and random string, received from the server.

This sequence corresponds to the password, but password can not be easily restored from it. The sequence is then sent to the server for validation. Trailing zero is not stored in the buf as it is not needed. This function is used by client to create authenticated reply to the server's greeting.

Parameters
[out]tostore scrambled string here. The buf must be at least SHA1_HASH_SIZE bytes long.
messagerandom message, must be exactly SCRAMBLE_LENGTH long and NULL-terminated.
passwordusers' password, NULL-terminated