Enable secure_delete PRAGMA on SQLite databases (#370)

It is especially important for OMEMO database, as it stores *ephemeral* keys
This commit is contained in:
Alexander Krotov 2020-02-21 20:48:57 +01:00 committed by fiaxh
parent 65039b4c23
commit b9125b7e3e
2 changed files with 6 additions and 0 deletions

View file

@ -246,6 +246,9 @@ public class Database : Qlite.Database {
try { try {
exec("PRAGMA synchronous=0"); exec("PRAGMA synchronous=0");
} catch (Error e) { } } catch (Error e) { }
try {
exec("PRAGMA secure_delete=1");
} catch (Error e) { }
} }
public override void migrate(long oldVersion) { public override void migrate(long oldVersion) {

View file

@ -233,6 +233,9 @@ public class Database : Qlite.Database {
try { try {
exec("PRAGMA synchronous=0"); exec("PRAGMA synchronous=0");
} catch (Error e) { } } catch (Error e) { }
try {
exec("PRAGMA secure_delete=1");
} catch (Error e) { }
} }
public override void migrate(long oldVersion) { public override void migrate(long oldVersion) {