Skip to content
Permalink
Browse files
Revert "MDEV-25343 add read secret size in file key plugin"
This reverts commit cee7175.
  • Loading branch information
grooverdan committed Oct 19, 2022
1 parent cee7175 commit 3a62ff7
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 33 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -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';

0 comments on commit 3a62ff7

Please sign in to comment.