You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
OpenSSL 3 support for Columnstore
This commit is contained in:
@ -59,7 +59,7 @@ set(joblist_LIB_SRCS
|
|||||||
${ENGINE_SRC_DIR}/tools/passwd/secrets.cpp)
|
${ENGINE_SRC_DIR}/tools/passwd/secrets.cpp)
|
||||||
|
|
||||||
add_library(joblist SHARED ${joblist_LIB_SRCS})
|
add_library(joblist SHARED ${joblist_LIB_SRCS})
|
||||||
|
target_include_directories(joblist BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR})
|
||||||
add_dependencies(joblist loggingcpp)
|
add_dependencies(joblist loggingcpp)
|
||||||
|
|
||||||
install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine)
|
install(TARGETS joblist DESTINATION ${ENGINE_LIBDIR} COMPONENT columnstore-engine)
|
||||||
|
@ -2,15 +2,16 @@
|
|||||||
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
include_directories( ${ENGINE_COMMON_INCLUDES} )
|
||||||
|
|
||||||
########### next target ###############
|
########### next target ###############
|
||||||
|
|
||||||
set(cspasswd_SRCS cspasswd.cpp secrets.cpp)
|
set(cspasswd_SRCS cspasswd.cpp secrets.cpp)
|
||||||
set(cskeys_SRCS cskeys.cpp secrets.cpp)
|
set(cskeys_SRCS cskeys.cpp secrets.cpp)
|
||||||
|
|
||||||
add_executable(cspasswd ${cspasswd_SRCS})
|
add_executable(cspasswd ${cspasswd_SRCS})
|
||||||
add_executable(cskeys ${cskeys_SRCS})
|
add_executable(cskeys ${cskeys_SRCS})
|
||||||
|
|
||||||
target_link_libraries(cspasswd ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
target_include_directories(cspasswd BEFORE PUBLIC ${OPENSSL_INCLUDE_DIR})
|
||||||
target_link_libraries(cskeys ${ENGINE_LDFLAGS} ${MARIADB_CLIENT_LIBS} ${ENGINE_EXEC_LIBS})
|
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 cspasswd DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
|
||||||
install(TARGETS cskeys 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/err.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
#include <openssl/opensslv.h>
|
||||||
|
|
||||||
#include "secrets.h"
|
#include "secrets.h"
|
||||||
#include "mcsconfig.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 std::string;
|
||||||
using ByteVec = std::vector<uint8_t>;
|
using ByteVec = std::vector<uint8_t>;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/ossl_typ.h>
|
#include <openssl/ossl_typ.h>
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
|
#include <openssl/opensslv.h>
|
||||||
|
|
||||||
#define BOOST_SPIRIT_THREADSAFE
|
#define BOOST_SPIRIT_THREADSAFE
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
@ -34,6 +35,15 @@
|
|||||||
|
|
||||||
using std::string;
|
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";
|
const char* const SECRETS_FILENAME = ".secrets";
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
@ -469,6 +479,8 @@ string decrypt_password(const string& input)
|
|||||||
* @param input Encrypted password in hex form
|
* @param input Encrypted password in hex form
|
||||||
* @return Decrypted password or empty on error
|
* @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 decrypt_password_old(const ByteVec& key, const ByteVec& iv, const std::string& input)
|
||||||
{
|
{
|
||||||
string rval;
|
string rval;
|
||||||
@ -501,6 +513,7 @@ string decrypt_password_old(const ByteVec& key, const ByteVec& iv, const std::st
|
|||||||
}
|
}
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
string decrypt_password(const ByteVec& key, const std::string& input)
|
string decrypt_password(const ByteVec& key, const std::string& input)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user