summaryrefslogtreecommitdiffstats
path: root/checks
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-05-13 19:53:36 +0200
committerWerner Koch <wk@gnupg.org>1998-05-13 19:53:36 +0200
commit0e5a31d7be80d1dd1bcdff04dad226f0f49e0cce (patch)
treec569c8c335f811af291181d48bceb336906025a0 /checks
parentadd DSA key generation (diff)
downloadgnupg2-0e5a31d7be80d1dd1bcdff04dad226f0f49e0cce.tar.xz
gnupg2-0e5a31d7be80d1dd1bcdff04dad226f0f49e0cce.zip
can create v4 signatures
Diffstat (limited to 'checks')
-rw-r--r--checks/Makefile.am2
-rwxr-xr-xchecks/mds.test32
2 files changed, 33 insertions, 1 deletions
diff --git a/checks/Makefile.am b/checks/Makefile.am
index 8de908cca..b00dd1aab 100644
--- a/checks/Makefile.am
+++ b/checks/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to create Makefile.in
-TESTS = version.test \
+TESTS = version.test mds.test \
decrypt.test decrypt-dsa.test \
sigs.test sigs-dsa.test \
encrypt.test encrypt-dsa.test \
diff --git a/checks/mds.test b/checks/mds.test
new file mode 100755
index 000000000..fe5622c35
--- /dev/null
+++ b/checks/mds.test
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+. defs.inc || exit 3
+
+test_one () {
+ if [ "$(grep $1 y | sed -e 's/.*=[ ]\(.*\)/\1/' -e 's/ //g')" != "$2" ]; then
+ failed="$failed $1"
+ fi
+}
+
+failed=""
+
+#info Checking message digests
+echo -n "" | ./run-gpgm --print-mds >y
+test_one "MD5" "D41D8CD98F00B204E9800998ECF8427E"
+test_one "SHA1" "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
+test_one "RMD160" "9C1185A5C5E9FC54612808977EE8F548B2258D31"
+test_one "TIGER" "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A"
+
+[ "$failed" != "" ] && error "$failed failed for empty string"
+
+echo -n "abcdefghijklmnopqrstuvwxyz" | ./run-gpgm --print-mds >y
+test_one "MD5" "C3FCD3D76192E4007DFB496CCA67E13B"
+test_one "SHA1" "32D10C7B8CF96570CA04CE37F2A19D84240D3A89"
+test_one "RMD160" "F71C27109C692C1B56BBDCEB5B9D2865B3708DBC"
+test_one "TIGER" "307DE5EE72A414172A0355CCBF120404E9EE7BF32F60110B"
+
+
+[ "$failed" != "" ] && error "$failed failed for a..z"
+
+exit 0
+