From: Charles McGarvey Date: Mon, 1 Aug 2022 02:18:24 +0000 (-0600) Subject: Fix CryptX 0.062 functionality change X-Git-Tag: v0.905~4 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=5950244f5eaeda8ec5f83b236552217ec5d480cb;p=chaz%2Fp5-File-KDBX Fix CryptX 0.062 functionality change Declare CryptX 0.055 to be the oldest supported version; that is the first version to support salsa20, so that really is the oldest we could support. Fixes #1. --- diff --git a/Changes b/Changes index 9b2787b..f129e61 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for File-KDBX. {{$NEXT}} + * Declare CryptX 0.055 as a required dependency. Thanks HIGHTOWE. 0.904 2022-07-07 21:51:17-0600 * Use expanded title, username in OTP parameters. diff --git a/dist.ini b/dist.ini index bcb8902..478e965 100644 --- a/dist.ini +++ b/dist.ini @@ -8,8 +8,18 @@ license = Perl_5 Test::CleanNamespaces.skip[0] = ::Util|::KDF::AES$ RepoReadme.type = gfm +[Prereqs / RuntimeRequires] +Crypt::Cipher::AES = 0 +Crypt::Stream::ChaCha = 0.048 +Crypt::Stream::Salsa20 = 0.055 + [Prereqs / RuntimeRecommends] -File::Spec = 0 +File::Spec = 0 + +[Prereqs / RuntimeSuggests] +; These are some non-standard ciphers which KeePass can support with plugins: +Crypt::Stream::Twofish = 0 +Crypt::Stream::Serpent = 0.055 [Prereqs / TestSuggests] POSIX::1003 = 0 diff --git a/lib/File/KDBX/Cipher/Stream.pm b/lib/File/KDBX/Cipher/Stream.pm index 367619a..7ecb396 100644 --- a/lib/File/KDBX/Cipher/Stream.pm +++ b/lib/File/KDBX/Cipher/Stream.pm @@ -122,6 +122,7 @@ sub _stream { $counter = int($offset / 64); $pos = $offset % 64; } + load $pkg; my $s = $pkg->new($self->key, $self->iv, $counter); # seek to correct position within block $s->keystream($pos) if $pos; diff --git a/t/crypt.t b/t/crypt.t index 69a52ef..abb6dc6 100644 --- a/t/crypt.t +++ b/t/crypt.t @@ -40,7 +40,7 @@ subtest 'Error handling' => sub { pipe(my $read, my $write) or die "pipe failed: $!"; $read = File::KDBX::IO::Crypt->new($read, cipher => $block_cipher); - print $write "blah blah blah!\1"; + print $write "blah blah blah!"; # should produce: FATAL: cipher text length has to be multiple of 16 (15) close($write) or die "close failed: $!"; is $read->error, '', 'Read handle starts out fine';