Skip to content

Commit

Permalink
Use the correct number of key encryption rounds on KDBX <4
Browse files Browse the repository at this point in the history
  • Loading branch information
bpellin committed Nov 25, 2017
1 parent c564253 commit da1370e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public class PwDatabaseV4 extends PwDatabase {
public UUID dataCipher = AesEngine.CIPHER_UUID;
public CipherEngine dataEngine = new AesEngine();
public PwCompressionAlgorithm compressionAlgorithm = PwCompressionAlgorithm.Gzip;
// TODO: Refactor me away to get directly from kdfParameters
public long numKeyEncRounds = 6000;
public Date nameChanged = DEFAULT_NOW;
public Date settingsChanged = DEFAULT_NOW;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ private boolean readHeaderField(LEDataInputStream dis) throws IOException {
if (!db.kdfParameters.kdfUUID.equals(kdfR.uuid)) {
db.kdfParameters = kdfR.getDefaultParameters();
}
db.kdfParameters.setUInt64(AesKdf.ParamRounds, LEDataInputStream.readLong(fieldData, 0));
long rounds = LEDataInputStream.readLong(fieldData, 0);
db.kdfParameters.setUInt64(AesKdf.ParamRounds, rounds);
db.numKeyEncRounds = rounds;
break;

case PwDbHeaderV4Fields.EncryptionIV:
Expand Down

0 comments on commit da1370e

Please sign in to comment.