Browse Source

removed logging, fixed null passwords.

remove-cryptography-dependency
Herbert Poul 5 years ago
parent
commit
1a11057811
  1. 5
      lib/src/kdbx_format.dart
  2. 6
      lib/src/kdbx_header.dart

5
lib/src/kdbx_format.dart

@ -535,9 +535,7 @@ class KdbxFormat {
}
final credentialHash = credentials.getHash();
_logger.finest('credentialHash: ${ByteUtils.toHexList(credentialHash)}');
final key = KeyEncrypterKdf(argon2).encrypt(credentialHash, kdfParameters);
_logger.finest('key: ${ByteUtils.toHexList(key)}');
// final keyWithSeed = Uint8List(65);
// keyWithSeed.replaceRange(0, masterSeed.length, masterSeed);
@ -574,6 +572,9 @@ class KdbxFormat {
.findAllElements('Value')
.where((el) => el.getAttribute('Protected')?.toLowerCase() == 'true')) {
final pw = gen.decryptBase64(el.text.trim());
if (pw == null) {
continue;
}
KdbxFile.protectedValues[el] = ProtectedValue.fromString(pw);
}

6
lib/src/kdbx_header.dart

@ -353,10 +353,10 @@ class KdbxHeader {
final headerId = reader.readUint8();
final int bodySize =
versionMajor >= 4 ? reader.readUint32() : reader.readUint16();
_logger.fine('Reading header with id $headerId (size: $bodySize)}');
// _logger.fine('Reading header with id $headerId (size: $bodySize)}');
final bodyBytes = bodySize > 0 ? reader.readBytes(bodySize) : null;
_logger.finer(
'Read header ${fields[headerId]}: ${ByteUtils.toHexList(bodyBytes)}');
// _logger.finer(
// 'Read header ${fields[headerId]}: ${ByteUtils.toHexList(bodyBytes)}');
if (headerId > 0) {
final TE field = fields[headerId];
yield createField(field, bodyBytes);

Loading…
Cancel
Save