diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/openpgp/armencrypt.test | 2 | ||||
-rwxr-xr-x | tests/openpgp/armencryptp.test | 2 | ||||
-rwxr-xr-x | tests/openpgp/armsignencrypt.test | 2 | ||||
-rwxr-xr-x | tests/openpgp/defs.inc | 13 | ||||
-rwxr-xr-x | tests/openpgp/ecc.test | 2 | ||||
-rwxr-xr-x | tests/openpgp/encrypt-dsa.test | 4 | ||||
-rwxr-xr-x | tests/openpgp/encrypt.test | 4 | ||||
-rwxr-xr-x | tests/openpgp/encryptp.test | 2 | ||||
-rw-r--r-- | tests/openpgp/gpg.conf.tmpl | 1 | ||||
-rwxr-xr-x | tests/openpgp/seat.test | 2 | ||||
-rwxr-xr-x | tests/openpgp/signencrypt-dsa.test | 4 | ||||
-rwxr-xr-x | tests/openpgp/signencrypt.test | 2 |
12 files changed, 25 insertions, 15 deletions
diff --git a/tests/openpgp/armencrypt.test b/tests/openpgp/armencrypt.test index df3729410..ce1067e6b 100755 --- a/tests/openpgp/armencrypt.test +++ b/tests/openpgp/armencrypt.test @@ -12,7 +12,7 @@ #info Checking armored encryption for i in $plain_files $data_files ; do - $GPG --always-trust -ea -o x --yes -r "$usrname2" $i + $GPG ${opt_always} -ea -o x --yes -r "$usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/armencryptp.test b/tests/openpgp/armencryptp.test index 9246b6d27..dfebb4827 100755 --- a/tests/openpgp/armencryptp.test +++ b/tests/openpgp/armencryptp.test @@ -12,7 +12,7 @@ #info Checking armored encryption with a pipe for i in $plain_files $data_files ; do - $GPG --always-trust -ea --yes -r "$usrname2" < $i | tee x | $GPG -o y --yes + $GPG ${opt_always} -ea --yes -r "$usrname2" < $i | tee x | $GPG -o y --yes cmp $i y || error "$i: mismatch" $GPG --yes < x > y cmp $i y || error "$i: mismatch" diff --git a/tests/openpgp/armsignencrypt.test b/tests/openpgp/armsignencrypt.test index 5b392df27..c50a12dc1 100755 --- a/tests/openpgp/armsignencrypt.test +++ b/tests/openpgp/armsignencrypt.test @@ -13,7 +13,7 @@ #info Checking armored signing and encryption for i in $plain_files $data_files ; do - echo "$usrpass1" | $GPG --passphrase-fd 0 --always-trust \ + echo "$usrpass1" | $GPG --passphrase-fd 0 ${opt_always} \ -sae -o x --yes -r "$usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" diff --git a/tests/openpgp/defs.inc b/tests/openpgp/defs.inc index 49e085e8a..008d32a43 100755 --- a/tests/openpgp/defs.inc +++ b/tests/openpgp/defs.inc @@ -226,6 +226,15 @@ PINENTRY="$(cd $srcdir && /bin/pwd)/pinentry.sh" # Default to empty passphrase for pinentry.sh PINENTRY_USER_DATA= +# If --check-trustdb is not an option, GPG has been build without +# trust model support. Thus we can't use --always-trust and some +# other options. +if $GPG --dump-options | grep '^--check-trustdb$' >/dev/null ; then + opt_always="--always-trust" +else + opt_always= +fi + # Make sure we have a valid option files even with VPATH builds. for f in gpg.conf gpg-agent.conf ; do if [ -f ./$f ]; then @@ -234,8 +243,10 @@ for f in gpg.conf gpg-agent.conf ; do cat $srcdir/$f.tmpl >$f case "$f" in gpg.conf) + [ -n "${opt_always}" ] && echo "no-auto-check-trustdb" >>"$f" echo "agent-program $GPG_AGENT" >>"$f" - ;; + + ;; gpg-agent.conf) echo "pinentry-program $PINENTRY" >>"$f" ;; diff --git a/tests/openpgp/ecc.test b/tests/openpgp/ecc.test index 01e1e0617..062a1ae0f 100755 --- a/tests/openpgp/ecc.test +++ b/tests/openpgp/ecc.test @@ -203,7 +203,7 @@ info "Checking ECC encryption and decryption." for i in $plain_files $data_files ; do for k in $mainkeyids ; do info "file: $i key: $k" - $GPG --always-trust -e -o x --yes -r $k $i + $GPG ${opt_always} -e -o x --yes -r $k $i $GPG -o y --yes x cmp $i y || error "$i,$k: mismatch" done diff --git a/tests/openpgp/encrypt-dsa.test b/tests/openpgp/encrypt-dsa.test index 8ae93d817..7ce670ee0 100755 --- a/tests/openpgp/encrypt-dsa.test +++ b/tests/openpgp/encrypt-dsa.test @@ -12,7 +12,7 @@ #info Checking encryption for i in $plain_files $data_files ; do - $GPG --always-trust -e -o x --yes -r "$dsa_usrname2" $i + $GPG ${opt_always} -e -o x --yes -r "$dsa_usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" done @@ -20,7 +20,7 @@ done for ca in `all_cipher_algos` ; do progress "$ca" for i in $plain_files $data_files ; do - $GPG --always-trust --cipher-algo $ca -e \ + $GPG ${opt_always} --cipher-algo $ca -e \ -o x --yes -r "$dsa_usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" diff --git a/tests/openpgp/encrypt.test b/tests/openpgp/encrypt.test index 5ef5196d8..295a6c3a9 100755 --- a/tests/openpgp/encrypt.test +++ b/tests/openpgp/encrypt.test @@ -12,7 +12,7 @@ #info Checking encryption for i in $plain_files $data_files ; do - $GPG --always-trust -e -o x --yes -r "$usrname2" $i + $GPG ${opt_always} -e -o x --yes -r "$usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" done @@ -21,7 +21,7 @@ echo_n " > " for ca in `all_cipher_algos` ; do echo_n "$ca " for i in $plain_files $data_files ; do - $GPG --always-trust -e -o x --yes -r "$usrname2" --cipher-algo $ca $i + $GPG ${opt_always} -e -o x --yes -r "$usrname2" --cipher-algo $ca $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/encryptp.test b/tests/openpgp/encryptp.test index 984f56ab8..3ad7119dd 100755 --- a/tests/openpgp/encryptp.test +++ b/tests/openpgp/encryptp.test @@ -12,7 +12,7 @@ #info Checking encryption with a pipe for i in $plain_files $data_files ; do - $GPG --always-trust -e --yes -r "$usrname2" <$i | $GPG --yes > y + $GPG ${opt_always} -e --yes -r "$usrname2" <$i | $GPG --yes > y cmp $i y || error "$i: mismatch" done diff --git a/tests/openpgp/gpg.conf.tmpl b/tests/openpgp/gpg.conf.tmpl index 7060a6610..19f31808a 100644 --- a/tests/openpgp/gpg.conf.tmpl +++ b/tests/openpgp/gpg.conf.tmpl @@ -2,4 +2,3 @@ no-greeting no-secmem-warning no-permission-warning batch -no-auto-check-trustdb diff --git a/tests/openpgp/seat.test b/tests/openpgp/seat.test index 8a5f39904..b400e72dc 100755 --- a/tests/openpgp/seat.test +++ b/tests/openpgp/seat.test @@ -11,7 +11,7 @@ . $srcdir/defs.inc || exit 3 for i in $plain_files ; do - echo "$usrpass1" | $GPG --passphrase-fd 0 --always-trust -seat \ + echo "$usrpass1" | $GPG --passphrase-fd 0 ${opt_always} -seat \ -r [email protected] -o x --yes $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" diff --git a/tests/openpgp/signencrypt-dsa.test b/tests/openpgp/signencrypt-dsa.test index dd724c97e..2fb2bb1aa 100755 --- a/tests/openpgp/signencrypt-dsa.test +++ b/tests/openpgp/signencrypt-dsa.test @@ -12,7 +12,7 @@ #info Checking signing and encryption for DSA for i in $plain_files $data_files ; do - $GPG --always-trust -se -o x --yes \ + $GPG ${opt_always} -se -o x --yes \ -u "$dsa_usrname1" -r "$dsa_usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" @@ -27,7 +27,7 @@ fi for da in $algos; do for i in $plain_files; do - $GPG --always-trust -se -o x --yes --digest-algo $da \ + $GPG ${opt_always} -se -o x --yes --digest-algo $da \ -u "$dsa_usrname1" -r "$dsa_usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" diff --git a/tests/openpgp/signencrypt.test b/tests/openpgp/signencrypt.test index 8ccbaf7ca..5644befa7 100755 --- a/tests/openpgp/signencrypt.test +++ b/tests/openpgp/signencrypt.test @@ -13,7 +13,7 @@ info "Checking signing and encryption" for i in $plain_files $data_files ; do - echo "$usrpass1" | $GPG --passphrase-fd 0 --always-trust \ + echo "$usrpass1" | $GPG --passphrase-fd 0 ${opt_always} \ -se -o x --yes -r "$usrname2" $i $GPG -o y --yes x cmp $i y || error "$i: mismatch" |