- create a table with ENCRYPTION_KEY_ID=2 (a valid key in the keys file);
- insert data into the table;
- restart server with a different keys file, where key 2 is different or is absent at all;
- try to read the table =>
it returns the data.
I would expect that the table would not be readable.
Note: maybe I just don't understand how it meant to work, but it does not look right.
Test case
|
-- source include/have_innodb.inc
|
|
--echo
|
--echo # Start server with keys2.txt
|
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt --plugin-load-add=file_key_management --innodb-encrypt-log
|
-- source include/restart_mysqld.inc
|
|
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
|
INSERT INTO t1 VALUES ('foobar');
|
|
--echo
|
--echo # Restart server with keys3.txt
|
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt --plugin-load-add=file_key_management --innodb-encrypt-log
|
-- source include/restart_mysqld.inc
|
|
SELECT * FROM t1;
|
|
--echo
|
--echo # Old keys file
|
--cat_file $MYSQL_TEST_DIR/std_data/keys2.txt
|
--echo
|
--echo # New keys file
|
--cat_file $MYSQL_TEST_DIR/std_data/keys3.txt
|
|
--echo # KEY 2 values are different ^^^^
|
|
DROP TABLE t1;
|
Output
|
# Start server with keys2.txt
|
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
|
INSERT INTO t1 VALUES ('foobar');
|
|
# Restart server with keys3.txt
|
SELECT * FROM t1;
|
c
|
foobar
|
|
# Old keys file
|
1;593E580927F47AB530D3B1237CDEF6D6
|
2;352E42F1B9DB5CB915C3262FE745520A
|
3;CFE065600F5EB57481075C65180C3F8A
|
4;205379930183490D3BECA139BDF4DB5B
|
5;E2D944D5D837A1DCB22FF7FD397892EE
|
6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
|
|
# New keys file
|
1;593E580927F47AB530D3B1237CDEF6D6
|
2;E4B00A45BF775B4E07D634EC5CA5912B
|
3;6E35ACB162B29D1FB9E178021DAF16ED
|
4;971A664A88EE0022D408E40BFAB17E79
|
5;C4FF86FD89879380DA97EAC0BA3057B7
|
6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
|
|
# KEY 2 values are different ^^^^
|
DROP TABLE t1;
|
{"report":{"fcp":1622.2999997138977,"ttfb":895.5,"pageVisibility":"visible","entityId":52535,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"7df0c6f1-4633-4306-89ef-633950880832","navigationType":0,"readyForUser":1742.8999996185303,"redirectCount":0,"resourceLoadedEnd":1821.2999997138977,"resourceLoadedStart":904.6999998092651,"resourceTiming":[{"duration":75.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":904.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":904.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":980.5,"responseStart":0,"secureConnectionStart":0},{"duration":76,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":905,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":905,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":981,"responseStart":0,"secureConnectionStart":0},{"duration":142.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":905.1999998092651,"connectEnd":905.1999998092651,"connectStart":905.1999998092651,"domainLookupEnd":905.1999998092651,"domainLookupStart":905.1999998092651,"fetchStart":905.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":905.1999998092651,"responseEnd":1048,"responseStart":1048,"secureConnectionStart":905.1999998092651},{"duration":268.7000002861023,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":905.3999996185303,"connectEnd":905.3999996185303,"connectStart":905.3999996185303,"domainLookupEnd":905.3999996185303,"domainLookupStart":905.3999996185303,"fetchStart":905.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":905.3999996185303,"responseEnd":1174.0999999046326,"responseStart":1174.0999999046326,"secureConnectionStart":905.3999996185303},{"duration":273.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":905.5999999046326,"connectEnd":905.5999999046326,"connectStart":905.5999999046326,"domainLookupEnd":905.5999999046326,"domainLookupStart":905.5999999046326,"fetchStart":905.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":905.5999999046326,"responseEnd":1178.6999998092651,"responseStart":1178.6999998092651,"secureConnectionStart":905.5999999046326},{"duration":273.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":905.7999997138977,"connectEnd":905.7999997138977,"connectStart":905.7999997138977,"domainLookupEnd":905.7999997138977,"domainLookupStart":905.7999997138977,"fetchStart":905.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":905.7999997138977,"responseEnd":1179.2999997138977,"responseStart":1179.2999997138977,"secureConnectionStart":905.7999997138977},{"duration":273.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":906,"connectEnd":906,"connectStart":906,"domainLookupEnd":906,"domainLookupStart":906,"fetchStart":906,"redirectEnd":0,"redirectStart":0,"requestStart":906,"responseEnd":1179.5999999046326,"responseStart":1179.5999999046326,"secureConnectionStart":906},{"duration":299.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":906.0999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":906.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1206,"responseStart":0,"secureConnectionStart":0},{"duration":273.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":906.2999997138977,"connectEnd":906.2999997138977,"connectStart":906.2999997138977,"domainLookupEnd":906.2999997138977,"domainLookupStart":906.2999997138977,"fetchStart":906.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":906.2999997138977,"responseEnd":1180.0999999046326,"responseStart":1180.0999999046326,"secureConnectionStart":906.2999997138977},{"duration":299.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":906.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":906.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1206.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":274.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":906.6999998092651,"connectEnd":906.6999998092651,"connectStart":906.6999998092651,"domainLookupEnd":906.6999998092651,"domainLookupStart":906.6999998092651,"fetchStart":906.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":906.6999998092651,"responseEnd":1180.7999997138977,"responseStart":1180.7999997138977,"secureConnectionStart":906.6999998092651},{"duration":388.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":907.3999996185303,"connectEnd":907.3999996185303,"connectStart":907.3999996185303,"domainLookupEnd":907.3999996185303,"domainLookupStart":907.3999996185303,"fetchStart":907.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":907.3999996185303,"responseEnd":1295.7999997138977,"responseStart":1295.7999997138977,"secureConnectionStart":907.3999996185303},{"duration":833,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":907.3999996185303,"connectEnd":907.3999996185303,"connectStart":907.3999996185303,"domainLookupEnd":907.3999996185303,"domainLookupStart":907.3999996185303,"fetchStart":907.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":907.3999996185303,"responseEnd":1740.3999996185303,"responseStart":1740.3999996185303,"secureConnectionStart":907.3999996185303},{"duration":67,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1229.7999997138977,"connectEnd":1229.7999997138977,"connectStart":1229.7999997138977,"domainLookupEnd":1229.7999997138977,"domainLookupStart":1229.7999997138977,"fetchStart":1229.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1229.7999997138977,"responseEnd":1296.7999997138977,"responseStart":1296.7999997138977,"secureConnectionStart":1229.7999997138977},{"duration":290.7999997138977,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1530.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1530.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1821.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":397,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1531.5,"connectEnd":1531.5,"connectStart":1531.5,"domainLookupEnd":1531.5,"domainLookupStart":1531.5,"fetchStart":1531.5,"redirectEnd":0,"redirectStart":0,"requestStart":1531.5,"responseEnd":1928.5,"responseStart":1928.3999996185303,"secureConnectionStart":1531.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":735,"responseStart":896,"responseEnd":901,"domLoading":903,"domInteractive":1856,"domContentLoadedEventStart":1856,"domContentLoadedEventEnd":1914,"domComplete":2839,"loadEventStart":2839,"loadEventEnd":2842,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1826.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1827},{"name":"bigPipe.activity-panel-pipe-id.start","time":1827.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1834.1999998092651},{"name":"activityTabFullyLoaded","time":1934.6999998092651}],"measures":[],"correlationId":"bfa2430cafd748","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":94,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}