You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
OpenSSL 3 support for Columnstore
This commit is contained in:
@ -2,15 +2,16 @@
|
||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set(cspasswd_SRCS cspasswd.cpp secrets.cpp)
|
||||
set(cskeys_SRCS cskeys.cpp secrets.cpp)
|
||||
|
||||
add_executable(cspasswd ${cspasswd_SRCS})
|
||||
add_executable(cskeys ${cskeys_SRCS})
|
||||
|
||||
target_link_libraries(cspasswd ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||
target_link_libraries(cskeys ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
||||
target_include_directories(cspasswd BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR})
|
||||
target_include_directories(cskeys BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR})
|
||||
target_link_libraries(cspasswd ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS} ${SSL_LIBRARIES})
|
||||
target_link_libraries(cskeys ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS} ${SSL_LIBRARIES})
|
||||
|
||||
install(TARGETS cspasswd DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
install(TARGETS cskeys DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||
|
@ -18,10 +18,17 @@
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/opensslv.h>
|
||||
|
||||
#include "secrets.h"
|
||||
#include "mcsconfig.h"
|
||||
|
||||
#ifdef OPENSSL_VERSION_PREREQ
|
||||
#if OPENSSL_VERSION_PREREQ(3,0)
|
||||
#define EVP_CIPHER_key_length EVP_CIPHER_get_key_length
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using std::string;
|
||||
using ByteVec = std::vector<uint8_t>;
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/ossl_typ.h>
|
||||
#include <openssl/rand.h>
|
||||
#include <openssl/opensslv.h>
|
||||
|
||||
#define BOOST_SPIRIT_THREADSAFE
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
@ -34,6 +35,15 @@
|
||||
|
||||
using std::string;
|
||||
|
||||
|
||||
#ifdef OPENSSL_VERSION_PREREQ
|
||||
#if OPENSSL_VERSION_PREREQ(3,0)
|
||||
#define EVP_CIPHER_key_length EVP_CIPHER_get_key_length
|
||||
#define EVP_CIPHER_iv_length EVP_CIPHER_get_iv_length
|
||||
#define EVP_CIPHER_blocksize EVP_CIPHER_get_blocksize
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const char* const SECRETS_FILENAME = ".secrets";
|
||||
|
||||
namespace
|
||||
@ -469,6 +479,8 @@ string decrypt_password(const string& input)
|
||||
* @param input Encrypted password in hex form
|
||||
* @return Decrypted password or empty on error
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
string decrypt_password_old(const ByteVec& key, const ByteVec& iv, const std::string& input)
|
||||
{
|
||||
string rval;
|
||||
@ -501,6 +513,7 @@ string decrypt_password_old(const ByteVec& key, const ByteVec& iv, const std::st
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
string decrypt_password(const ByteVec& key, const std::string& input)
|
||||
{
|
||||
|
Reference in New Issue
Block a user