MySQL 8.4.2
Source Code Documentation
|
#include "mysql/harness/tls_cipher.h"
#include <array>
#include <memory>
#include <system_error>
#include <openssl/evp.h>
#include "mysql/harness/stdx/expected.h"
Classes | |
class | Deleter< EVP_CIPHER_CTX > |
Typedefs | |
using | TlsCipherCtx = std::unique_ptr< EVP_CIPHER_CTX, Deleter< EVP_CIPHER_CTX > > |
Functions | |
static void | create_key (const uint8_t *key_begin, const uint8_t *key_end, uint8_t *rkey_begin, uint8_t *rkey_end) |
Transforms an arbitrary long key into a fixed length AES key. More... | |
using TlsCipherCtx = std::unique_ptr<EVP_CIPHER_CTX, Deleter<EVP_CIPHER_CTX> > |
|
static |
Transforms an arbitrary long key into a fixed length AES key.
AES keys are of fixed length. This routine takes an arbitrary long key iterates over it in AES key length increment and XORs the bytes with the AES key buffer being prepared. The bytes from the last incomplete iteration are XORed to the start of the key until their depletion. Needed since crypto function routines expect a fixed length key.
[in] | key_begin | pointer to start of they key |
[in] | key_end | pointer to one past the end of the key |
[out] | rkey_begin | pointer to start of the real key |
[out] | rkey_end | pointer to one past the end of the real key |