[svn] GnuPG - r4501 - branches/STABLE-BRANCH-1-4/checks
svn author dshaw
cvs at cvs.gnupg.org
Tue May 15 01:16:34 CEST 2007
Author: dshaw
Date: 2007-05-15 01:16:05 +0200 (Tue, 15 May 2007)
New Revision: 4501
Modified:
branches/STABLE-BRANCH-1-4/checks/ChangeLog
branches/STABLE-BRANCH-1-4/checks/conventional-mdc.test
branches/STABLE-BRANCH-1-4/checks/conventional.test
branches/STABLE-BRANCH-1-4/checks/defs.inc
branches/STABLE-BRANCH-1-4/checks/encrypt-dsa.test
branches/STABLE-BRANCH-1-4/checks/encrypt.test
Log:
* 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.
Modified: branches/STABLE-BRANCH-1-4/checks/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/checks/ChangeLog 2007-05-09 11:33:57 UTC (rev 4500)
+++ branches/STABLE-BRANCH-1-4/checks/ChangeLog 2007-05-14 23:16:05 UTC (rev 4501)
@@ -1,3 +1,13 @@
+2007-05-14 David Shaw <dshaw at 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 at jabberwocky.com>
* conventional.test, encrypt.test, encrypt-dsa.test,
Modified: branches/STABLE-BRANCH-1-4/checks/conventional-mdc.test
===================================================================
--- branches/STABLE-BRANCH-1-4/checks/conventional-mdc.test 2007-05-09 11:33:57 UTC (rev 4500)
+++ branches/STABLE-BRANCH-1-4/checks/conventional-mdc.test 2007-05-14 23:16:05 UTC (rev 4501)
@@ -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 @@
cmp z y || error "$ciph/$i: mismatch"
done
done
+echo_n "| "
Modified: branches/STABLE-BRANCH-1-4/checks/conventional.test
===================================================================
--- branches/STABLE-BRANCH-1-4/checks/conventional.test 2007-05-09 11:33:57 UTC (rev 4500)
+++ branches/STABLE-BRANCH-1-4/checks/conventional.test 2007-05-14 23:16:05 UTC (rev 4501)
@@ -9,29 +9,8 @@
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 @@
cmp $i y || error "$i: ($a) mismatch"
done
done
+echo_n "| "
Modified: branches/STABLE-BRANCH-1-4/checks/defs.inc
===================================================================
--- branches/STABLE-BRANCH-1-4/checks/defs.inc 2007-05-09 11:33:57 UTC (rev 4500)
+++ branches/STABLE-BRANCH-1-4/checks/defs.inc 2007-05-14 23:16:05 UTC (rev 4501)
@@ -121,15 +121,6 @@
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 @@
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
Modified: branches/STABLE-BRANCH-1-4/checks/encrypt-dsa.test
===================================================================
--- branches/STABLE-BRANCH-1-4/checks/encrypt-dsa.test 2007-05-09 11:33:57 UTC (rev 4500)
+++ branches/STABLE-BRANCH-1-4/checks/encrypt-dsa.test 2007-05-14 23:16:05 UTC (rev 4501)
@@ -9,29 +9,8 @@
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 @@
cmp $i y || error "$i: mismatch"
done
done
+echo_n "| "
Modified: branches/STABLE-BRANCH-1-4/checks/encrypt.test
===================================================================
--- branches/STABLE-BRANCH-1-4/checks/encrypt.test 2007-05-09 11:33:57 UTC (rev 4500)
+++ branches/STABLE-BRANCH-1-4/checks/encrypt.test 2007-05-14 23:16:05 UTC (rev 4501)
@@ -9,32 +9,12 @@
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 "| "
More information about the Gnupg-commits
mailing list