~ubuntu-branches/ubuntu/precise/gnupg2/precise-proposed

« back to all changes in this revision

Viewing changes to checks/mds.test

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
 
 
4
. $srcdir/defs.inc || exit 3
 
5
 
 
6
 
 
7
test_one () {
 
8
   if [ "`grep $1 y | sed -e 's/.*=[ ]\(.*\)/\1/' -e 's/ //g'`" != "$2" ]; then
 
9
        failed="$failed $1"
 
10
   fi
 
11
}
 
12
 
 
13
failed=""
 
14
 
 
15
#info Checking message digests
 
16
cat /dev/null | $GPG -v --print-mds >y
 
17
test_one "MD5"    "D41D8CD98F00B204E9800998ECF8427E"
 
18
test_one "SHA1"   "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
 
19
test_one "RMD160" "9C1185A5C5E9FC54612808977EE8F548B2258D31"
 
20
if have_hash_algo "TIGER"; then
 
21
  test_one "TIGER"  "24F0130C63AC933216166E76B1BB925FF373DE2D49584E7A"
 
22
else
 
23
  echo "Hash algorithm TIGER/192 is not installed"
 
24
fi
 
25
 
 
26
[ "$failed" != "" ] && error "$failed failed for empty string"
 
27
 
 
28
echo_n "abcdefghijklmnopqrstuvwxyz" | $GPG --print-mds >y
 
29
test_one "MD5"    "C3FCD3D76192E4007DFB496CCA67E13B"
 
30
test_one "SHA1"   "32D10C7B8CF96570CA04CE37F2A19D84240D3A89"
 
31
test_one "RMD160" "F71C27109C692C1B56BBDCEB5B9D2865B3708DBC"
 
32
if have_hash_algo "TIGER"; then
 
33
  test_one "TIGER"  "307DE5EE72A414172A0355CCBF120404E9EE7BF32F60110B"
 
34
fi
 
35
 
 
36
 
 
37
[ "$failed" != "" ] && error "$failed failed for a..z"
 
38
 
 
39
exit 0
 
40