diff options
| author | 2021-12-17 07:06:30 -0500 | |
|---|---|---|
| committer | 2021-12-17 07:06:30 -0500 | |
| commit | 1fdc150116cad39aae5c5da407c3312b47a59e3a (patch) | |
| tree | 123c79a4d7ad2d45781ba03ce939f7539fb428d8 /Plugins/DbSqliteCipher/dbsqlitecipher.cpp | |
| parent | feda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff) | |
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'Plugins/DbSqliteCipher/dbsqlitecipher.cpp')
| -rw-r--r-- | Plugins/DbSqliteCipher/dbsqlitecipher.cpp | 51 |
1 files changed, 6 insertions, 45 deletions
diff --git a/Plugins/DbSqliteCipher/dbsqlitecipher.cpp b/Plugins/DbSqliteCipher/dbsqlitecipher.cpp index fd6c909..fba9640 100644 --- a/Plugins/DbSqliteCipher/dbsqlitecipher.cpp +++ b/Plugins/DbSqliteCipher/dbsqlitecipher.cpp @@ -22,19 +22,6 @@ bool DbSqliteCipher::checkIfDbServedByPlugin(Db* db) const QList<DbPluginOption> DbSqliteCipher::getOptionsList() const { - static const QStringList ciphers = {"aes-128-cbc", "aes-128-cfb", "aes-128-cfb1", "aes-128-cfb8", "aes-128-ctr", "aes-128-ecb", "aes-128-gcm", "aes-128-ofb", - "aes-128-xts", "aes-192-cbc", "aes-192-cfb", "aes-192-cfb1", "aes-192-cfb8", "aes-192-ctr", "aes-192-ecb", "aes-192-gcm", - "aes-192-ofb", "aes-256-cbc", "aes-256-cfb", "aes-256-cfb1", "aes-256-cfb8", "aes-256-ctr", "aes-256-ecb", "aes-256-gcm", - "aes-256-ofb", "aes-256-xts", "aes128", "aes192", "aes256", "bf", "bf-cbc", "bf-cfb", "bf-ecb", "bf-ofb", "blowfish", - "camellia-128-cbc", "camellia-128-cfb", "camellia-128-cfb1", "camellia-128-cfb8", "camellia-128-ecb", "camellia-128-ofb", - "camellia-192-cbc", "camellia-192-cfb", "camellia-192-cfb1", "camellia-192-cfb8", "camellia-192-ecb", "camellia-192-ofb", - "camellia-256-cbc", "camellia-256-cfb", "camellia-256-cfb1", "camellia-256-cfb8", "camellia-256-ecb", "camellia-256-ofb", - "camellia128", "camellia192", "camellia256", "cast", "cast-cbc", "cast5-cbc", "cast5-cfb", "cast5-ecb", "cast5-ofb", "des", - "des-cbc", "des-cfb", "des-cfb1", "des-cfb8", "des-ecb", "des-ede", "des-ede-cbc", "des-ede-cfb", "des-ede-ofb", "des-ede3", - "des-ede3-cbc", "des-ede3-cfb", "des-ede3-cfb1", "des-ede3-cfb8", "des-ede3-ofb", "des-ofb", "des3", "desx", "desx-cbc", - "id-aes128-GCM", "id-aes192-GCM", "id-aes256-GCM", "rc2", "rc2-40-cbc", "rc2-64-cbc", "rc2-cbc", "rc2-cfb", "rc2-ecb", - "rc2-ofb", "rc4", "rc4-40", "rc4-hmac-md5", "seed", "seed-cbc", "seed-cfb", "seed-ecb", "seed-ofb"}; - QList<DbPluginOption> opts; DbPluginOption opt; @@ -45,38 +32,12 @@ QList<DbPluginOption> DbSqliteCipher::getOptionsList() const opt.placeholderText = tr("Encryption password"); opts << opt; - opt.type = DbPluginOption::CHOICE; - opt.key = CIPHER_OPT; - opt.label = tr("Cipher"); - opt.toolTip = tr("Must be the same as the one used when creating the database. %1 is the default one.").arg(DEF_CIPHER); - opt.choiceValues = ciphers; - opt.defaultValue = DEF_CIPHER; - opt.choiceReadOnly = true; - opts << opt; - - opt.type = DbPluginOption::INT; - opt.key = KDF_ITER_OPT; - opt.label = tr("KDF iterations"); - opt.defaultValue = DEF_KDF_ITER; - opt.minValue = 0; - opt.maxValue = std::numeric_limits<int>::max(); - opt.toolTip = tr("Must be the same as the one used when creating the database. %1 is the default.").arg(QString::number(DEF_KDF_ITER)); - opts << opt; - - opt.type = DbPluginOption::INT; - opt.key = CIPHER_PAGE_SIZE_OPT; - opt.label = tr("Cipher page size"); - opt.defaultValue = DEF_CIPHER_PAGE_SIZE; - opt.minValue = 0; - opt.maxValue = std::numeric_limits<int>::max(); - opt.toolTip = tr("Must be the same as the one used when creating the database. %1 is the default.").arg(QString::number(DEF_CIPHER_PAGE_SIZE)); - opts << opt; - - opt.type = DbPluginOption::BOOL; - opt.key = CIPHER_1_1_OPT; - opt.label = tr("1.1 compatibility"); - opt.defaultValue = false; - opt.toolTip = tr("Enabling this option disables HMAC checks introduced in SQLCipher 2.0, thus making the connection compatible with SQLCipher 1.1.x."); + opt.type = DbPluginOption::SQL; + opt.key = PRAGMAS_OPT; + opt.label = tr("Cipher configuration (optional)"); + opt.toolTip = tr("PRAGMA statements to customize SQLCipher configuration, such as KDF iterations, legacy mode, etc.\n" + "They will be executed upon each opening of the database.\n" + "See documentation for SQLCipher for details."); opts << opt; return opts; |
