From eb39e64e190674246e472d03bcd2558635041a5a Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 3 Apr 2019 10:46:50 +0200 Subject: [PATCH] Fix -m 16800 unit test --- tools/test.sh | 5 ++++- tools/test_modules/m16800.pm | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index acebea463..e8c41d5fa 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -18,6 +18,9 @@ VC_MODES="13711 13712 13713 13721 13722 13723 13731 13732 13733 13741 13742 1374 # List of modes which either are OPTS_TYPE_PT_NEVERCRACK or produce collisions NEVER_CRACK="9720 9820 14900 18100" +# List of modes which return a different output hash format than the input hash format +NOCHECK_ENCODING="16800" + # LUKS mode has test containers LUKS_MODE="14600" @@ -2804,7 +2807,7 @@ if [ "${PACKAGE}" -eq 0 -o -z "${PACKAGE_FOLDER}" ]; then rm -rf ${OUTD}/logfull.txt && touch ${OUTD}/logfull.txt # populate array of hash types where we only should check if pass is in output (not both hash:pass) - IFS=';' read -ra PASS_ONLY <<< "${HASHFILE_ONLY}" + IFS=';' read -ra PASS_ONLY <<< "${HASHFILE_ONLY} ${NOCHECK_ENCODING}" IFS=';' read -ra TIMEOUT_ALGOS <<< "${SLOW_ALGOS}" IFS=';' read -ra NEVER_CRACK_ALGOS <<< "${NEVER_CRACK}" diff --git a/tools/test_modules/m16800.pm b/tools/test_modules/m16800.pm index 1602f8544..b3ea939a9 100644 --- a/tools/test_modules/m16800.pm +++ b/tools/test_modules/m16800.pm @@ -55,7 +55,7 @@ sub module_generate_hash my $pmkid = hmac_hex ($data, $pmk, \&sha1); - my $hash = sprintf ("%s*%s*%s*%s", substr ($pmkid, 0, 32), $macap, $macsta, $essid); + my $hash = sprintf ("%s:%s:%s:%s", substr ($pmkid, 0, 32), $macap, $macsta, $essid); return $hash; } @@ -69,7 +69,7 @@ sub module_verify_hash return unless defined $hash; return unless defined $word; - my @data = split (/\*/, $hash); + my @data = split (/\:/, $hash); return unless scalar @data == 4;