* defs.inc (all_cipher_algos): New function to return all ciphers we

support.  This is safer than the previous setup which could hide that
some ciphers weren't being tested.  Plus, this automatically tests any
new ciphers we may add.

* conventional.test, encrypt-test, encrypt-dsa.test,
conventional-mdc.test: Use it here.
This commit is contained in:
David Shaw 2007-05-14 23:16:05 +00:00
parent ddfaad29fd
commit 1b488760bb
6 changed files with 27 additions and 102 deletions

View File

@ -1,3 +1,13 @@
2007-05-14 David Shaw <dshaw@jabberwocky.com>
* defs.inc (all_cipher_algos): New function to return all ciphers
we support. This is safer than the previous setup which could
hide that some ciphers weren't being tested. Plus, this
automatically tests any new ciphers we may add.
* conventional.test, encrypt-test, encrypt-dsa.test,
conventional-mdc.test: Use it here.
2007-05-02 David Shaw <dshaw@jabberwocky.com>
* conventional.test, encrypt.test, encrypt-dsa.test,

View File

@ -2,31 +2,10 @@
. $srcdir/defs.inc || exit 3
algos="3des"
if have_cipher_algo "IDEA"; then
algos="$algos idea"
fi
if have_cipher_algo "CAST5"; then
algos="$algos cast5"
fi
if have_cipher_algo "BLOWFISH"; then
algos="$algos blowfish"
fi
if have_cipher_algo "AES"; then
algos="$algos aes aes192 aes256"
fi
if have_cipher_algo "TWOFISH"; then
algos="$algos twofish"
fi
#info Checking conventional encryption
for i in 0 1 2 3 9 10 11 19 20 21 22 23 39 40 41 8192 32000 ; do
for ciph in $algos; do
for ciph in `all_cipher_algos`; do
echo_n "$ciph "
for i in 0 1 2 3 9 10 11 19 20 21 22 23 39 40 41 8192 32000 ; do
# *BSD's dd can't cope with a count of 0
if test "$i" = "0"; then
: >z
@ -40,3 +19,4 @@ for i in 0 1 2 3 9 10 11 19 20 21 22 23 39 40 41 8192 32000 ; do
cmp z y || error "$ciph/$i: mismatch"
done
done
echo_n "| "

View File

@ -9,29 +9,8 @@ for i in plain-2 data-32000 ; do
cmp $i y || error "$i: mismatch"
done
algos="3des"
if have_cipher_algo "IDEA"; then
algos="$algos idea"
fi
if have_cipher_algo "CAST5"; then
algos="$algos cast5"
fi
if have_cipher_algo "BLOWFISH"; then
algos="$algos blowfish"
fi
if have_cipher_algo "AES"; then
algos="$algos aes aes192 aes256"
fi
if have_cipher_algo "TWOFISH"; then
algos="$algos twofish"
fi
for a in $algos; do
for a in `all_cipher_algos`; do
echo_n "$a "
for i in plain-1 data-80000 ; do
echo "Hier spricht HAL" | $GPG --passphrase-fd 0 \
--cipher-algo $a -c -o x --yes $i
@ -39,3 +18,4 @@ for a in $algos; do
cmp $i y || error "$i: ($a) mismatch"
done
done
echo_n "| "

View File

@ -121,15 +121,6 @@ have_pubkey_algo () {
fi
}
have_cipher_algo () {
if ../g10/gpg --homedir . --version | grep "Cipher:.*$1" >/dev/null
then
true
else
false
fi
}
have_hash_algo () {
if ../g10/gpg --homedir . --version | grep "Hash:.*$1" >/dev/null
then
@ -139,6 +130,10 @@ have_hash_algo () {
fi
}
all_cipher_algos () {
../g10/gpg --homedir . --version | grep "Cipher" | sed 's/^Cipher: //; s/,//g'
}
set -e
pgmname=`basename $0`
#trap cleanup SIGHUP SIGINT SIGQUIT

View File

@ -9,29 +9,8 @@ for i in $plain_files $data_files ; do
cmp $i y || error "$i: mismatch"
done
algos="3des"
if have_cipher_algo "IDEA"; then
algos="$algos idea"
fi
if have_cipher_algo "CAST5"; then
algos="$algos cast5"
fi
if have_cipher_algo "BLOWFISH"; then
algos="$algos blowfish"
fi
if have_cipher_algo "AES"; then
algos="$algos aes aes192 aes256"
fi
if have_cipher_algo "TWOFISH"; then
algos="$algos twofish"
fi
for ca in $algos ; do
for ca in `all_cipher_algos` ; do
echo_n "$ca "
for i in $plain_files $data_files ; do
$GPG $dsa_keyrings --always-trust --cipher-algo $ca -e \
-o x --yes -r "$dsa_usrname2" $i
@ -39,3 +18,4 @@ for ca in $algos ; do
cmp $i y || error "$i: mismatch"
done
done
echo_n "| "

View File

@ -9,32 +9,12 @@ for i in $plain_files $data_files ; do
cmp $i y || error "$i: mismatch"
done
algos="3des"
if have_cipher_algo "IDEA"; then
algos="$algos idea"
fi
if have_cipher_algo "CAST5"; then
algos="$algos cast5"
fi
if have_cipher_algo "BLOWFISH"; then
algos="$algos blowfish"
fi
if have_cipher_algo "AES"; then
algos="$algos aes aes192 aes256"
fi
if have_cipher_algo "TWOFISH"; then
algos="$algos twofish"
fi
for ca in $algos ; do
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 -o y --yes x
cmp $i y || error "$i: mismatch"
done
done
echo_n "| "