From b9125b7e3e080caa2c5f233a22f62136322eb077 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Fri, 21 Feb 2020 20:48:57 +0100 Subject: [PATCH] Enable secure_delete PRAGMA on SQLite databases (#370) It is especially important for OMEMO database, as it stores *ephemeral* keys --- libdino/src/service/database.vala | 3 +++ plugins/omemo/src/logic/database.vala | 3 +++ 2 files changed, 6 insertions(+) diff --git a/libdino/src/service/database.vala b/libdino/src/service/database.vala index 8b32c107..39dcf234 100644 --- a/libdino/src/service/database.vala +++ b/libdino/src/service/database.vala @@ -246,6 +246,9 @@ public class Database : Qlite.Database { try { exec("PRAGMA synchronous=0"); } catch (Error e) { } + try { + exec("PRAGMA secure_delete=1"); + } catch (Error e) { } } public override void migrate(long oldVersion) { diff --git a/plugins/omemo/src/logic/database.vala b/plugins/omemo/src/logic/database.vala index 6243569f..7a320696 100644 --- a/plugins/omemo/src/logic/database.vala +++ b/plugins/omemo/src/logic/database.vala @@ -233,6 +233,9 @@ public class Database : Qlite.Database { try { exec("PRAGMA synchronous=0"); } catch (Error e) { } + try { + exec("PRAGMA secure_delete=1"); + } catch (Error e) { } } public override void migrate(long oldVersion) {