|
|
|
@ -385,7 +385,7 @@ class KdbxHeader {
|
|
|
|
|
final sig1 = reader.readUint32(); |
|
|
|
|
final sig2 = reader.readUint32(); |
|
|
|
|
if (!(sig1 == Consts.FileMagic && sig2 == Consts.Sig2Kdbx)) { |
|
|
|
|
throw UnsupportedError( |
|
|
|
|
throw KdbxInvalidFileStructure( |
|
|
|
|
'Unsupported file structure. ${ByteUtils.toHex(sig1)}, ' |
|
|
|
|
'${ByteUtils.toHex(sig2)}'); |
|
|
|
|
} |
|
|
|
@ -583,6 +583,17 @@ class KdbxUnsupportedException implements KdbxException {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class KdbxInvalidFileStructure implements KdbxException { |
|
|
|
|
KdbxInvalidFileStructure(this.message); |
|
|
|
|
|
|
|
|
|
final String message; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
String toString() { |
|
|
|
|
return 'KdbxInvalidFileStructure{$message}'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class HashedBlockReader { |
|
|
|
|
static const BLOCK_SIZE = 1024 * 1024; |
|
|
|
|
static const HASH_SIZE = 32; |
|
|
|
|