26#ifndef ROUTING_CLASSIC_AUTH_INCLUDED
27#define ROUTING_CLASSIC_AUTH_INCLUDED
31#include <system_error>
33#include <openssl/ssl.h>
46using EvpPkey = std::unique_ptr<EVP_PKEY, OsslDeleter<EVP_PKEY>>;
54 std::string_view pubkey);
57 std::string plaintext, EVP_PKEY *pkey);
60 std::string_view ciphertext, EVP_PKEY *priv);
63 SSL_CTX *ssl_ctx, std::string_view encrypted, std::string_view nonce);
66 const EvpPkey &pkey, std::string_view
password, std::string_view nonce);
Definition: classic_auth.h:48
static stdx::expected< std::string, std::error_code > public_key_encrypt(std::string plaintext, EVP_PKEY *pkey)
Definition: classic_auth.cc:125
static stdx::expected< std::string, std::error_code > private_key_decrypt(std::string_view ciphertext, EVP_PKEY *priv)
Definition: classic_auth.cc:166
static stdx::expected< std::string, std::error_code > rsa_encrypt_password(const EvpPkey &pkey, std::string_view password, std::string_view nonce)
Definition: classic_auth.cc:273
static stdx::expected< std::string, std::error_code > public_key_from_ssl_ctx_as_pem(SSL_CTX *ssl_ctx)
Definition: classic_auth.cc:86
static bool connection_has_public_key(MysqlRoutingClassicConnectionBase *connection)
Definition: classic_auth.cc:290
static std::string_view strip_trailing_null(std::string_view s)
remove trailing \0 in a string_view.
Definition: classic_auth.cc:45
static stdx::expected< std::string, std::error_code > rsa_decrypt_password(SSL_CTX *ssl_ctx, std::string_view encrypted, std::string_view nonce)
Definition: classic_auth.cc:244
static stdx::expected< EvpPkey, std::error_code > public_key_from_pem(std::string_view pubkey)
Definition: classic_auth.cc:112
Definition: classic_connection_base.h:56
std::unique_ptr< EVP_PKEY, OsslDeleter< EVP_PKEY > > EvpPkey
Definition: classic_auth.cc:76
Definition: expected.h:286
static char * password
Definition: mysql_secure_installation.cc:58
void operator()(EVP_PKEY *k)
Definition: classic_auth.h:43
Definition: classic_auth.h:39