From eca544425e9453bc1e09322220fee28819f31bda Mon Sep 17 00:00:00 2001 From: philsmd Date: Wed, 8 Mar 2017 12:19:29 +0100 Subject: [PATCH] tests: -m 13300 = AxCrypt in memory SHA1 output length fix --- tools/test.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/test.pl b/tools/test.pl index d1838956b..30e6db97b 100755 --- a/tools/test.pl +++ b/tools/test.pl @@ -2305,7 +2305,7 @@ sub verify my $signature = shift @data; my $digest = shift @data; - my $param = length ($digest); + $param = length ($digest); next unless ($signature eq 'axcrypt_sha1'); next unless (($param == 32) || ($param == 40)); @@ -7477,9 +7477,16 @@ END_CODE } elsif ($mode == 13300) { + my $length = 32; + + if ($additional_param) + { + $length = $additional_param; + } + $hash_buf = sha1_hex ($word_buf); - $tmp_hash = sprintf ('$axcrypt_sha1$%s', substr ($hash_buf, 0, 32)); + $tmp_hash = sprintf ('$axcrypt_sha1$%s', substr ($hash_buf, 0, $length)); } elsif ($mode == 13400) {