mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 18:32:29 +00:00
33 lines
626 B
C++
33 lines
626 B
C++
|
#include <Common/Documentation.h>
|
||
|
#include <Common/config.h>
|
||
|
|
||
|
#if USE_SSL
|
||
|
|
||
|
# include <Functions/FunctionFactory.h>
|
||
|
# include <Functions/FunctionsAES.h>
|
||
|
|
||
|
namespace
|
||
|
{
|
||
|
|
||
|
struct TryDecryptImpl
|
||
|
{
|
||
|
static constexpr auto name = "tryDecrypt";
|
||
|
static constexpr auto compatibility_mode = OpenSSLDetails::CompatibilityMode::OpenSSL;
|
||
|
static constexpr bool use_null_when_decrypt_fail = true;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
namespace DB
|
||
|
{
|
||
|
|
||
|
REGISTER_FUNCTION(Decrypt)
|
||
|
{
|
||
|
factory.registerFunction<FunctionDecrypt<TryDecryptImpl>>(
|
||
|
"Similar to `decrypt`, but returns NULL if decryption fails because of using the wrong key.");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|