Browse Source

upgrade xml package dependency.

remove-cryptography-dependency
Herbert Poul 4 years ago
parent
commit
ecc9419075
  1. 4
      CHANGELOG.md
  2. 1
      lib/src/crypto/key_encrypter_kdf.dart
  3. 8
      lib/src/kdbx_format.dart
  4. 2
      pubspec.yaml

4
CHANGELOG.md

@ -1,3 +1,7 @@
## 0.4.0
- Upgraded xml package dependency to 4.x
## 0.3.1
- Fixed error handling nil UUIDs in recycle bin.

1
lib/src/crypto/key_encrypter_kdf.dart

@ -6,7 +6,6 @@ import 'package:crypto/crypto.dart' as crypto;
import 'package:isolate/isolate_runner.dart';
import 'package:kdbx/kdbx.dart';
import 'package:kdbx/src/internal/byte_utils.dart';
import 'package:kdbx/src/internal/crypto_utils.dart';
import 'package:kdbx/src/kdbx_var_dictionary.dart';
import 'package:logging/logging.dart';
import 'package:pointycastle/export.dart';

8
lib/src/kdbx_format.dart

@ -73,7 +73,7 @@ class KdbxReadWriteContext {
static final kdbxContext = Expando<KdbxReadWriteContext>();
static KdbxReadWriteContext kdbxContextForNode(xml.XmlParent node) {
static KdbxReadWriteContext kdbxContextForNode(xml.XmlNode node) {
final ret = kdbxContext[node.document];
if (ret == null) {
throw StateError('Unable to locate kdbx context for document.');
@ -82,7 +82,7 @@ class KdbxReadWriteContext {
}
static void setKdbxContextForNode(
xml.XmlParent node, KdbxReadWriteContext ctx) {
xml.XmlNode node, KdbxReadWriteContext ctx) {
kdbxContext[node.document] = ctx;
}
@ -141,7 +141,7 @@ class KeyFileCredentials implements CredentialsPart {
return KeyFileCredentials._(ProtectedValue.fromBinary(
convert.hex.decode(keyFileAsString) as Uint8List));
}
final xmlContent = xml.parse(keyFileAsString);
final xmlContent = xml.XmlDocument.parse(keyFileAsString);
final key = xmlContent.findAllElements('Key').single;
final dataString = key.findElements('Data').single;
final dataBytes = base64.decode(dataString.text);
@ -604,7 +604,7 @@ class KdbxFormat {
KdbxReadWriteContext ctx, KdbxHeader header, String xmlString) {
final gen = _createProtectedSaltGenerator(header);
final document = xml.parse(xmlString);
final document = xml.XmlDocument.parse(xmlString);
KdbxReadWriteContext.setKdbxContextForNode(document, ctx);
for (final el in document

2
pubspec.yaml

@ -14,7 +14,7 @@ dependencies:
crypto: '>=2.0.0 <3.0.0'
pointycastle: '>=1.0.1 <2.0.0'
cryptography: ^0.1.2
xml: '>=3.7.0 <4.0.0'
xml: '>=4.0.0 <5.0.0'
uuid: '>=2.0.0 <3.0.0'
meta: '>=1.0.0 <2.0.0'
clock: '>=1.0.0 <2.0.0'

Loading…
Cancel
Save