From 1fdc150116cad39aae5c5da407c3312b47a59e3a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Fri, 17 Dec 2021 07:06:30 -0500 Subject: New upstream version 3.3.3+dfsg1. --- Plugins/DbSqliteWx/dbsqlitewx.cpp | 43 ++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'Plugins/DbSqliteWx/dbsqlitewx.cpp') diff --git a/Plugins/DbSqliteWx/dbsqlitewx.cpp b/Plugins/DbSqliteWx/dbsqlitewx.cpp index 42a8347..aa04a57 100644 --- a/Plugins/DbSqliteWx/dbsqlitewx.cpp +++ b/Plugins/DbSqliteWx/dbsqlitewx.cpp @@ -1,5 +1,6 @@ #include "dbsqlitewx.h" #include "dbsqlitewxinstance.h" +#include DbSqliteWx::DbSqliteWx() { @@ -12,15 +13,43 @@ QString DbSqliteWx::getLabel() const QList DbSqliteWx::getOptionsList() const { + static const QMap ciphers = { + {"wxSQLite3: AES 128 Bit", "aes128cbc"}, + {"wxSQLite3: AES 256 Bit", "aes256cbc"}, + {"sqleet: ChaCha20-Poly1305", "chacha20"}, + {"SQLCipher: AES 256 Bit", "sqlcipher"}, + {"System.Data.SQLite: RC4", "rc4"} + }; + static_qstring(defaultCipher, "aes256cbc"); + QList opts; - DbPluginOption opt; - opt.type = DbPluginOption::PASSWORD; - opt.key = PASSWORD_OPT; - opt.label = tr("Password (key)"); - opt.toolTip = tr("Leave empty to create or connect to decrypted database."); - opt.placeholderText = tr("Encryption password"); - opts << opt; + DbPluginOption optPass; + optPass.type = DbPluginOption::PASSWORD; + optPass.key = PASSWORD_OPT; + optPass.label = tr("Password (key)"); + optPass.toolTip = tr("Leave empty to create or connect to decrypted database."); + optPass.placeholderText = tr("Encryption password"); + opts << optPass; + + DbPluginOption optCipher; + optCipher.type = DbPluginOption::CHOICE; + optCipher.key = CIPHER_OPT; + optCipher.label = tr("Cipher"); + optCipher.toolTip = tr("Cipher determines encryption algorithm used to encrypt the database."); + optCipher.choiceDataValues = ciphers; + optCipher.defaultValue = defaultCipher; + opts << optCipher; + + DbPluginOption optPragmas; + optPragmas.type = DbPluginOption::SQL; + optPragmas.key = PRAGMAS_OPT; + optPragmas.label = tr("Cipher configuration (optional)"); + optPragmas.toolTip = tr("PRAGMA statements to customize SQLite3 Multiple Ciphers configuration, such as KDF iterations, legacy mode, etc.\n" + "They will be executed upon each opening of the database.\n" + "See documentation for SQLite3 Multiple Ciphers for details."); + opts << optPragmas; + return opts; } -- cgit v1.2.3