Browse Source

expose v3 TransformRounds for aes kdf.

pull/3/head
Herbert Poul 4 years ago
parent
commit
be9103ad91
  1. 3
      lib/src/kdbx_format.dart
  2. 3
      lib/src/kdbx_header.dart

3
lib/src/kdbx_format.dart

@ -698,8 +698,7 @@ class KdbxFormat {
static Future<Uint8List> _generateMasterKeyV3( static Future<Uint8List> _generateMasterKeyV3(
KdbxHeader header, Credentials credentials) async { KdbxHeader header, Credentials credentials) async {
final rounds = ReaderHelper.singleUint64( final rounds = header.v3KdfTransformRounds;
header.fields[HeaderFields.TransformRounds].bytes);
final seed = header.fields[HeaderFields.TransformSeed].bytes; final seed = header.fields[HeaderFields.TransformSeed].bytes;
final masterSeed = header.fields[HeaderFields.MasterSeed].bytes; final masterSeed = header.fields[HeaderFields.MasterSeed].bytes;
_logger.finer( _logger.finer(

3
lib/src/kdbx_header.dart

@ -524,6 +524,9 @@ class KdbxHeader {
VarDictionary get readKdfParameters => VarDictionary.read( VarDictionary get readKdfParameters => VarDictionary.read(
ReaderHelper(fields[HeaderFields.KdfParameters].bytes)); ReaderHelper(fields[HeaderFields.KdfParameters].bytes));
int get v3KdfTransformRounds =>
ReaderHelper.singleUint64(fields[HeaderFields.TransformRounds].bytes);
void writeKdfParameters(VarDictionary kdfParameters) => void writeKdfParameters(VarDictionary kdfParameters) =>
_setHeaderField(HeaderFields.KdfParameters, kdfParameters.write()); _setHeaderField(HeaderFields.KdfParameters, kdfParameters.write());

Loading…
Cancel
Save