Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
487e5f45
Commit
487e5f45
authored
May 27, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file_key_management plugin: complain if key id 1 is not found
and don't recommend aes_ctr if it's unavailable
parent
432b78c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
2 deletions
+46
-2
mysql-test/suite/encryption/r/filekeys_syntax.result
mysql-test/suite/encryption/r/filekeys_syntax.result
+20
-0
mysql-test/suite/encryption/t/filekeys_syntax.test
mysql-test/suite/encryption/t/filekeys_syntax.test
+13
-0
plugin/file_key_management/file_key_management_plugin.cc
plugin/file_key_management/file_key_management_plugin.cc
+6
-1
plugin/file_key_management/parser.cc
plugin/file_key_management/parser.cc
+7
-1
No files found.
mysql-test/suite/encryption/r/filekeys_syntax.result
View file @
487e5f45
...
...
@@ -127,3 +127,23 @@ ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
install soname 'file_key_management';
ERROR HY000: System key id 1 is missing at MYSQL_TMP_DIR/keys.txt line 1, column 1
call mtr.add_suppression("Syntax error");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /Syntax error/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
call mtr.add_suppression("System key id 1");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
FOUND /System key id 1/ in mysqld.1.err
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';
plugin_status
mysql-test/suite/encryption/t/filekeys_syntax.test
View file @
487e5f45
...
...
@@ -94,3 +94,16 @@ install soname 'file_key_management';
source
filekeys_badtest
.
inc
;
let
SEARCH_PATTERN
=
Syntax
error
;
source
filekeys_badtest
.
inc
;
#
# no key id 1
#
remove_file
$MYSQL_TMP_DIR
/
keys
.
txt
;
write_file
$MYSQL_TMP_DIR
/
keys
.
txt
;
3
;
22222222222222222222222222222222
EOF
--
replace_result
$MYSQL_TMP_DIR
MYSQL_TMP_DIR
--
error
2
install
soname
'file_key_management'
;
source
filekeys_badtest
.
inc
;
let
SEARCH_PATTERN
=
System
key
id
1
;
source
filekeys_badtest
.
inc
;
plugin/file_key_management/file_key_management_plugin.cc
View file @
487e5f45
...
...
@@ -48,9 +48,14 @@ static MYSQL_SYSVAR_STR(filekey, filekey,
"Key to encrypt / decrypt the keyfile."
,
NULL
,
NULL
,
""
);
#ifdef HAVE_EncryptAes128Ctr
#define recommendation ", aes_ctr is the recommended one"
#else
#define recommendation ""
#endif
static
MYSQL_SYSVAR_ENUM
(
encryption_algorithm
,
encryption_algorithm
,
PLUGIN_VAR_RQCMDARG
|
PLUGIN_VAR_READONLY
,
"Encryption algorithm to use
, aes_ctr is the recommended one
."
,
"Encryption algorithm to use
"
recommendation
"
."
,
NULL
,
NULL
,
0
,
&
encryption_algorithm_typelib
);
static
struct
st_mysql_sys_var
*
settings
[]
=
{
...
...
plugin/file_key_management/parser.cc
View file @
487e5f45
...
...
@@ -218,8 +218,14 @@ bool Parser::parse_file(Dynamic_array<keyentry> *keys, const char *secret)
}
keys
->
sort
(
sort_keys
);
my_free
(
buffer
);
if
(
keys
->
at
(
0
).
id
!=
1
)
{
report_error
(
"System key id 1 is missing"
,
0
);
return
1
;
}
return
0
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment