aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-07-25 22:27:42 +0200
committerSven Gothel <[email protected]>2022-07-25 22:27:42 +0200
commit38e60434380091010ae8a09918b5dcf8162f1e5d (patch)
treed438e5d5355fe3bbe9f0dfd70fc2c4396dfb6d31 /scripts
parent0287381a82bdd0d6e67e68044a0a12d1109f1c86 (diff)
Adding hash algo to cipherpack:hash_util::append_to_file() signature line, allowing automated validation using different hash algo and future proof documentation of files
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test_cipherpack_cmdline.sh18
1 files changed, 14 insertions, 4 deletions
diff --git a/scripts/test_cipherpack_cmdline.sh b/scripts/test_cipherpack_cmdline.sh
index e43aa8d..ea8f21c 100755
--- a/scripts/test_cipherpack_cmdline.sh
+++ b/scripts/test_cipherpack_cmdline.sh
@@ -18,10 +18,20 @@ rm -rf ${data_dir_out}
mkdir -p ${data_dir_out}
cmp_hash_value() {
- hash1=`awk ' { print $1 } ' $1`
- hash2=`awk ' { print $1 } ' $2`
- if [ "$hash1" != "$hash2" ] ; then
- echo "Hash mismatch $1 $2"
+ hash1_algo=`awk ' { print $1 } ' $1`
+ hash1_value=`awk ' { print $2 } ' $1`
+ hash2_algo=`awk ' { print $1 } ' $2`
+ hash2_value=`awk ' { print $2 } ' $2`
+ if [ "$hash1_algo" != "$hash2_algo" ] ; then
+ echo "Hash algo mismatch"
+ echo "- 1: algo $hash1_algo in $1"
+ echo "- 2: algo $hash2_algo in $2"
+ return 1
+ fi
+ if [ "$hash1_value" != "$hash2_value" ] ; then
+ echo "Hash value mismatch"
+ echo "- 1: value $hash1_value in $1"
+ echo "- 2: value $hash2_value in $2"
return 1
fi
return 0