[MDEV-17228] Encrypted temporary tables are not encrypted Created: 2018-09-18  Updated: 2020-07-28  Resolved: 2019-06-28

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Temporary, Encryption, Storage Engine - InnoDB
Affects Version/s: 10.2.2, 10.3.0, 10.4.0
Fix Version/s: 10.2.26, 10.3.17, 10.4.7

Type: Bug Priority: Critical
Reporter: Robert Golebiowski Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-20142 encryption.innodb_encrypt_temporary_t... Closed
causes MDEV-20340 Encrypted temporary tables cannot be ... Closed

 Description   

Although it is possible to CREATE TEMPORARY TABLE ... ENCRYPTED=yes temporary tablespace will contain data in plaintext (check file ibtmp1).



 Comments   
Comment by Marko Mäkelä [ 2018-11-20 ]

I think that we must fix the code so that the InnoDB temporary tablespace file is encrypted if and only if innodb_encrypt_tables is set. All pages of the tablespace can and should be encrypted; there is no reason to disable encryption on page 0, because we do not care about the contents of the temporary tablespace after InnoDB has been killed or shut down.

Also, the table option ENCRYPTED should cause a warning to be issued if it contradicts with the encryption status of the tablespace.

Comment by Thirunarayanan Balathandayuthapani [ 2019-06-24 ]

The patch is in 10.2 version (bb-10.2-MDEV-17228) and 10.4 version (bb-10.4-MDEV-17228).

Comment by Marko Mäkelä [ 2019-06-25 ]

I sent some comments for the 10.2 version, mostly about structuring the code. I think that we can use hard-wired encryption key identifier 1, like we do for the redo log and the temporary files of ALTER TABLE. In this way, it can be a Boolean parameter.

Generated at Thu Feb 08 08:34:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.