1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Merge branch 'bb-10.1-jan-encryption' into bb-10.1-serg

With changes:

* update tests to pass (new encryption/encryption_key_id syntax).
* not merged the code that makes engine aware of the encryption mode
  (CRYPT_SCHEME_1_CBC, CRYPT_SCHEME_1_CTR, storing it on disk, etc),
  because now the encryption plugin is handling it.
* compression+encryption did not work in either branch before the
  merge - and it does not work after the merge. it might be more
  broken after the merge though - some of that code was not merged.
* page checksumming code was not moved (moving of page checksumming
  from fil_space_encrypt() to fil_space_decrypt was not merged).
* restored deleted lines in buf_page_get_frame(), otherwise
  innodb_scrub test failed.
This commit is contained in:
Sergei Golubchik
2015-04-09 19:27:40 +02:00
108 changed files with 3383 additions and 4891 deletions

View File

@@ -1,38 +1,38 @@
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' encryption_key_id=1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=1
insert t1 values (12345, repeat('1234567890', 20));
alter table t1 page_encryption_key=2;
alter table t1 encryption_key_id=2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=2
alter table t1 page_encryption_key=3;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=2
alter table t1 encryption_key_id=3;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=2
alter table t1 page_encryption_key=33;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=2
alter table t1 encryption_key_id=33;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=33
alter table t1 page_encryption_key=4;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=33
alter table t1 encryption_key_id=4;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=4
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=4
drop table t1;

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("File 'bad' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';

View File

@@ -1,38 +1,38 @@
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' encryption_key_id=1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=1
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=1
insert t1 values (12345, repeat('1234567890', 20));
alter table t1 page_encryption_key=2;
alter table t1 encryption_key_id=2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=2
alter table t1 page_encryption_key=3;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=2
alter table t1 encryption_key_id=3;
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=2
alter table t1 page_encryption_key=33;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=2
alter table t1 encryption_key_id=33;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=33
alter table t1 page_encryption_key=4;
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=33
alter table t1 encryption_key_id=4;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) NOT NULL,
`b` char(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_encryption`=1 `page_encryption_key`=4
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encryption`='on' `encryption_key_id`=4
drop table t1;

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("File '' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("File '.*keys.txt' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -11,7 +11,7 @@ ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 2
call mtr.add_suppression("File '.*keys.txt' not found");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -19,7 +19,7 @@ plugin_status
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -29,7 +29,7 @@ ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 11
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -37,7 +37,7 @@ plugin_status
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -47,7 +47,7 @@ ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 47
call mtr.add_suppression("Invalid key id");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -55,7 +55,7 @@ plugin_status
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -65,7 +65,7 @@ ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 33
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -73,7 +73,7 @@ plugin_status
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -83,7 +83,7 @@ ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 2
call mtr.add_suppression("Invalid key");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -91,7 +91,7 @@ plugin_status
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");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -101,7 +101,7 @@ ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, 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");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';
@@ -109,7 +109,7 @@ plugin_status
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");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';

View File

@@ -1,7 +1,7 @@
call mtr.add_suppression("Cannot decrypt .*keys.txt. Not encrypted");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' 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';

View File

@@ -11,7 +11,7 @@ call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
--source include/search_pattern_in_file.inc
--error ER_CANT_CREATE_TABLE
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' encryption_key_id=1;
select plugin_status from information_schema.plugins
where plugin_name = 'file_key_management';

View File

@@ -1,19 +1,19 @@
-- source include/have_xtradb.inc
-- source filekeys_plugin.inc
create table t1(c1 bigint not null, b char(200)) engine=innodb page_encryption=1 page_encryption_key=1;
create table t1(c1 bigint not null, b char(200)) engine=innodb encryption='on' encryption_key_id=1;
show create table t1;
insert t1 values (12345, repeat('1234567890', 20));
alter table t1 page_encryption_key=2;
alter table t1 encryption_key_id=2;
show create table t1;
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
--error ER_CANT_CREATE_TABLE
alter table t1 page_encryption_key=3;
alter table t1 encryption_key_id=3;
show create table t1;
alter table t1 page_encryption_key=33;
alter table t1 encryption_key_id=33;
show create table t1;
alter table t1 page_encryption_key=4;
alter table t1 encryption_key_id=4;
show create table t1;
drop table t1;