From f7db6e10d3cd5c6f55e6ff300a0e2c2013ff1824 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 23 Jan 2021 02:35:40 +0300 Subject: [PATCH] Fix very strange code in AES functions --- docker/test/fasttest/run.sh | 1 + src/Functions/FunctionsAES.h | 2 +- tests/queries/0_stateless/01667_aes_args_check.reference | 0 tests/queries/0_stateless/01667_aes_args_check.sql | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 tests/queries/0_stateless/01667_aes_args_check.reference create mode 100644 tests/queries/0_stateless/01667_aes_args_check.sql diff --git a/docker/test/fasttest/run.sh b/docker/test/fasttest/run.sh index 96e14b2910d..c9707a6a995 100755 --- a/docker/test/fasttest/run.sh +++ b/docker/test/fasttest/run.sh @@ -270,6 +270,7 @@ function run_tests 01318_encrypt # Depends on OpenSSL 01318_decrypt # Depends on OpenSSL 01663_aes_msan # Depends on OpenSSL + 01667_aes_args_check # Depends on OpenSSL 01281_unsucceeded_insert_select_queries_counter 01292_create_user 01294_lazy_database_concurrent diff --git a/src/Functions/FunctionsAES.h b/src/Functions/FunctionsAES.h index fd78dfeaf58..132e94907f5 100644 --- a/src/Functions/FunctionsAES.h +++ b/src/Functions/FunctionsAES.h @@ -168,7 +168,7 @@ private: validateFunctionArgumentTypes(*this, arguments, FunctionArgumentDescriptors{ {"mode", isStringOrFixedString, isColumnConst, "encryption mode string"}, - {"input", nullptr, nullptr, "plaintext"}, + {"input", isStringOrFixedString, nullptr, "plaintext"}, {"key", isStringOrFixedString, nullptr, "encryption key binary string"}, }, optional_args diff --git a/tests/queries/0_stateless/01667_aes_args_check.reference b/tests/queries/0_stateless/01667_aes_args_check.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/01667_aes_args_check.sql b/tests/queries/0_stateless/01667_aes_args_check.sql new file mode 100644 index 00000000000..b1d7088c956 --- /dev/null +++ b/tests/queries/0_stateless/01667_aes_args_check.sql @@ -0,0 +1 @@ +SELECT encrypt('aes-128-ecb', [1, -1, 0, NULL], 'text'); -- { serverError 43 }