mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix algorithm and kdf function for database V3 and add small trad
This commit is contained in:
@@ -360,11 +360,14 @@ public class Database {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean allowEncryptionAlgorithmModification() {
|
||||
return getAvailableEncryptionAlgorithms().size() > 1;
|
||||
}
|
||||
|
||||
public void assignEncryptionAlgorithm(PwEncryptionAlgorithm algorithm) {
|
||||
switch (getPwDatabase().getVersion()) {
|
||||
case V4:
|
||||
((PwDatabaseV4) getPwDatabase()).setEncryptionAlgorithm(algorithm);
|
||||
// TODO Simplify
|
||||
((PwDatabaseV4) getPwDatabase()).setDataEngine(algorithm.getCipherEngine());
|
||||
((PwDatabaseV4) getPwDatabase()).setDataCipher(algorithm.getDataCipher());
|
||||
}
|
||||
@@ -384,6 +387,10 @@ public class Database {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean allowKdfModification() {
|
||||
return getAvailableKdfEngines().size() > 1;
|
||||
}
|
||||
|
||||
public KdfEngine getKdfEngine() {
|
||||
return getPwDatabase().getKdfEngine();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,8 @@ public class DatabaseEncryptionAlgorithmPreferenceDialogFragmentCompat extends D
|
||||
|
||||
@Override
|
||||
public void onDialogClosed(boolean positiveResult) {
|
||||
if ( positiveResult ) {
|
||||
if ( positiveResult
|
||||
&& database.allowEncryptionAlgorithmModification()) {
|
||||
assert getContext() != null;
|
||||
|
||||
if (algorithmSelected != null) {
|
||||
|
||||
@@ -70,7 +70,8 @@ public class DatabaseKeyDerivationPreferenceDialogFragmentCompat extends Databas
|
||||
|
||||
@Override
|
||||
public void onDialogClosed(boolean positiveResult) {
|
||||
if ( positiveResult ) {
|
||||
if ( positiveResult
|
||||
&& database.allowKdfModification()) {
|
||||
assert getContext() != null;
|
||||
|
||||
if (kdfEngineSelected != null) {
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
<string name="add_entry">Ajouter une entrée</string>
|
||||
<string name="add_group">Ajouter un groupe</string>
|
||||
<string name="add_string">Ajouter une chaîne</string>
|
||||
<string name="encryption_algorithm">Algorithme</string>
|
||||
<string name="encryption">Chiffrement</string>
|
||||
<string name="encryption_algorithm">Algorithme de Chiffrement</string>
|
||||
<string name="key_derivation_function">Fonction de dérivation de clé</string>
|
||||
<string name="app_timeout">Application timeout</string>
|
||||
<string name="app_timeout_summary">Temps avant le verrouillage de la base de données lorsque l\'application est inactive.</string>
|
||||
<string name="application">Application</string>
|
||||
|
||||
Reference in New Issue
Block a user