~ubuntu-branches/ubuntu/natty/gnupg/natty

« back to all changes in this revision

Viewing changes to checks/sigs.test

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2008-07-21 02:02:14 UTC
  • mfrom: (1.1.9 lenny)
  • Revision ID: james.westby@ubuntu.com-20080721020214-uh0hl0rfbog71as4
Tags: 1.4.9-3ubuntu1
* Merge from debian unstable (lp: #225005), remaining changes:
  - Add 'debian/patches/50_disable_mlock_test.dpatch': Disable mlock() test
    since it fails with ulimit 0 (on buildds).
  - Add 'debian/patches/61_use_agent_default.dpatch': Patch to set gpg
    (or gpg2) and gpgsm to use a passphrase agent by default (lp: 15485)
  - Add libcurl4-gnutls-dev to Build-Depends to fix gpg running into a
    timeout updating the keyring (lp: 62864)
* Dropped Ubuntu patches, applied upstream:
  - 50_show_primary_only.dpatch
  - 60_install_options_skel.dpatch
* Add 'debian/patches/55_curl_typefix.dpatch': Fix a build error with recent
  curl and gcc 4.3 (lp: #247679). Patch taken from upstream:
  http://lists.gnupg.org/pipermail/gnupg-devel/2008-April/024344.html

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
. $srcdir/defs.inc || exit 3
4
4
 
5
 
#info Checking signatures
6
5
for i in $plain_files $data_files; do
7
6
    echo "$usrpass1" | $GPG --passphrase-fd 0 -s -o x --yes $i
8
7
    $GPG -o y --yes x
9
8
    cmp $i y || error "$i: mismatch"
10
9
done
11
10
 
12
 
# Using the DSA sig key - only 160 bit hashes
13
 
for da in ripemd160 sha1 ; do
14
 
    for i in $plain_files; do
15
 
        echo "$usrpass1" | $GPG --passphrase-fd 0 --digest-algo $da \
16
 
                                -s -o x --yes $i
17
 
        $GPG -o y --yes x
18
 
        cmp $i y || error "$i: mismatch"
19
 
        # process only the first one
20
 
        break
21
 
    done
22
 
done
23
 
 
24
 
# TODO: add the new SHAs here once we allow them to be used in new
25
 
# documents.
26
 
 
27
 
if have_pubkey_algo "RSA"; then
28
 
    # Using the RSA sig key - all hashes
29
 
    hash_algo_list="ripemd160 sha1 md5"
30
 
    if have_hash_algo "SHA224"; then
31
 
        hash_algo_list="$hash_algo_list sha224"
32
 
    fi
33
 
    if have_hash_algo "SHA256"; then
34
 
        hash_algo_list="$hash_algo_list sha256"
35
 
    fi
36
 
    if have_hash_algo "SHA384"; then
37
 
        hash_algo_list="$hash_algo_list sha384"
38
 
    fi
39
 
    if have_hash_algo "SHA512"; then
40
 
        hash_algo_list="$hash_algo_list sha512"
41
 
    fi
42
 
 
43
 
    for da in $hash_algo_list ; do
 
11
for da in `all_hash_algos` ; do
 
12
    echo_n "$da "
 
13
 
 
14
    # RSA key, so any hash is okay
 
15
    if have_pubkey_algo "RSA"; then
44
16
        for i in $plain_files; do
45
17
            $GPG -u $usrname3 --digest-algo $da -s -o x --yes $i
46
18
            $GPG -o y --yes x
48
20
            # process only the first one
49
21
            break
50
22
        done
51
 
    done
52
 
fi
 
23
    fi
 
24
 
 
25
    # Using the DSA sig key - only 160 bit or larger hashes
 
26
    if test $da != "MD5"; then
 
27
        for i in $plain_files; do
 
28
            echo "$usrpass1" | $GPG --passphrase-fd 0 --digest-algo $da \
 
29
                                -s -o x --yes $i
 
30
            $GPG -o y --yes x
 
31
            cmp $i y || error "$i: mismatch"
 
32
            # process only the first one
 
33
            break
 
34
        done
 
35
    fi
 
36
done
 
37
echo_n "| "