X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FDumper%2FV3.pm;h=22ddf57bf83537752f3beb82f4ceac9ec0603981;hb=16c035abaa2ff6c53076f4ff6ae3215130acb56f;hp=b8cf01c1f056ca3f2c0020d448752f4ce72834a9;hpb=37b09e0f2832514b33de4499a83f22d5ffe7c0a3;p=chaz%2Fp5-File-KDBX diff --git a/lib/File/KDBX/Dumper/V3.pm b/lib/File/KDBX/Dumper/V3.pm index b8cf01c..22ddf57 100644 --- a/lib/File/KDBX/Dumper/V3.pm +++ b/lib/File/KDBX/Dumper/V3.pm @@ -10,7 +10,7 @@ use File::KDBX::Constants qw(:header :compression); use File::KDBX::Error; use File::KDBX::IO::Crypt; use File::KDBX::IO::HashBlock; -use File::KDBX::Util qw(:class :empty :load assert_64bit erase_scoped); +use File::KDBX::Util qw(:class :empty :int :load erase_scoped); use IO::Handle; use namespace::clean; @@ -59,7 +59,7 @@ sub _write_header { my $type = shift; my $val = shift // ''; - $type = kdbx_header($type); + $type = to_header_constant($type); if ($type == HEADER_END) { $val = "\r\n\r\n"; } @@ -81,8 +81,7 @@ sub _write_header { # nothing } elsif ($type == HEADER_TRANSFORM_ROUNDS) { - assert_64bit; - $val = pack('Q<', $val); + $val = pack_Ql($val); } elsif ($type == HEADER_ENCRYPTION_IV) { # nothing @@ -152,7 +151,6 @@ sub _write_body { $fh->print($kdbx->headers->{+HEADER_STREAM_START_BYTES}) or throw 'Failed to write start bytes'; - $fh->flush; $kdbx->key($key);