summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorDaniel Black <daniel@mariadb.org>2022-10-19 19:25:48 +1100
committerDaniel Black <daniel@mariadb.org>2022-10-19 20:05:59 +1100
commit3a62ff7e8980239a39e85393c6a797bb7acf97ed (patch)
treebc1a1e65367b5d6e81a4d5e02eb4887b231100a2 /plugin
parentcee7175b79a22c29a82ef328aba208f90afcea86 (diff)
downloadmariadb-git-3a62ff7e8980239a39e85393c6a797bb7acf97ed.tar.gz
Revert "MDEV-25343 add read secret size in file key plugin"
This reverts commit cee7175b79a22c29a82ef328aba208f90afcea86.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/file_key_management/parser.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/plugin/file_key_management/parser.cc b/plugin/file_key_management/parser.cc
index 8e78e230964..5a9e5e55d63 100644
--- a/plugin/file_key_management/parser.cc
+++ b/plugin/file_key_management/parser.cc
@@ -174,24 +174,13 @@ bool Parser::read_filekey(const char *filekey, char *secret)
return 1;
}
- int len= read(f, secret, MAX_SECRET_SIZE + 1);
+ int len= read(f, secret, MAX_SECRET_SIZE);
if (len <= 0)
{
my_error(EE_READ,ME_ERROR_LOG, filekey, errno);
close(f);
return 1;
}
-
- if (len > MAX_SECRET_SIZE)
- {
- my_printf_error(EE_READ,
- "Cannot decrypt %s, the secret file has incorrect length, "
- "max secret size is %dB ",
- ME_ERROR_LOG, filekey, MAX_SECRET_SIZE);
- close(f);
- return 1;
- }
-
close(f);
while (secret[len - 1] == '\r' || secret[len - 1] == '\n') len--;
secret[len]= '\0';