1998-05-13 17:53:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
1998-10-25 19:00:01 +00:00
|
|
|
|
1998-09-14 10:33:57 +00:00
|
|
|
. $srcdir/defs.inc || exit 3
|
1998-05-13 17:53:36 +00:00
|
|
|
|
1998-10-25 19:00:01 +00:00
|
|
|
|
1998-05-13 17:53:36 +00:00
|
|
|
test_one () {
|
1998-09-28 19:25:31 +00:00
|
|
|
if [ "`grep $1 y | sed -e 's/.*=[ ]\(.*\)/\1/' -e 's/ //g'`" != "$2" ]; then
|
1998-05-13 17:53:36 +00:00
|
|
|
failed="$failed $1"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
failed=""
|
|
|
|
|
|
|
|
#info Checking message digests
|
1998-10-25 19:00:01 +00:00
|
|
|
echo -n "" | $srcdir/run-gpgm -v --print-mds >y
|
1998-05-13 17:53:36 +00:00
|
|
|
test_one "MD5" "D41D8CD98F00B204E9800998ECF8427E"
|
|
|
|
test_one "SHA1" "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
|
|
|
|
test_one "RMD160" "9C1185A5C5E9FC54612808977EE8F548B2258D31"
|
1998-10-25 19:00:01 +00:00
|
|
|
if have_hash_algo "TIGER"; then
|
|
|
|
test_one "TIGER" "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A"
|
|
|
|
else
|
|
|
|
echo "Hash algorithm TIGER/192 is not installed"
|
|
|
|
fi
|
1998-05-13 17:53:36 +00:00
|
|
|
|
|
|
|
[ "$failed" != "" ] && error "$failed failed for empty string"
|
|
|
|
|
1998-09-14 15:49:56 +00:00
|
|
|
echo -n "abcdefghijklmnopqrstuvwxyz" | $srcdir/run-gpgm --print-mds >y
|
1998-05-13 17:53:36 +00:00
|
|
|
test_one "MD5" "C3FCD3D76192E4007DFB496CCA67E13B"
|
|
|
|
test_one "SHA1" "32D10C7B8CF96570CA04CE37F2A19D84240D3A89"
|
|
|
|
test_one "RMD160" "F71C27109C692C1B56BBDCEB5B9D2865B3708DBC"
|
1998-10-25 19:00:01 +00:00
|
|
|
if have_hash_algo "TIGER"; then
|
|
|
|
test_one "TIGER" "307DE5EE72A414172A0355CCBF120404E9EE7BF32F60110B"
|
|
|
|
fi
|
1998-05-13 17:53:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
[ "$failed" != "" ] && error "$failed failed for a..z"
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|