summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--regress/cipher-speed.sh11
-rw-r--r--regress/integrity.sh14
-rw-r--r--regress/try-ciphers.sh11
4 files changed, 32 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 3be438c75..dd847610f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
3 - djm@cvs.openbsd.org 2013/01/12 11:22:04 3 - djm@cvs.openbsd.org 2013/01/12 11:22:04
4 [cipher.c] 4 [cipher.c]
5 improve error message for integrity failure in AES-GCM modes; ok markus@ 5 improve error message for integrity failure in AES-GCM modes; ok markus@
6 - djm@cvs.openbsd.org 2013/01/12 11:23:53
7 [regress/cipher-speed.sh regress/integrity.sh regress/try-ciphers.sh]
8 test AES-GCM modes; feedback markus@
6 9
720130109 1020130109
8 - (djm) OpenBSD CVS Sync 11 - (djm) OpenBSD CVS Sync
diff --git a/regress/cipher-speed.sh b/regress/cipher-speed.sh
index 4f26f7e96..ed7c6f320 100644
--- a/regress/cipher-speed.sh
+++ b/regress/cipher-speed.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: cipher-speed.sh,v 1.6 2012/10/05 02:20:48 dtucker Exp $ 1# $OpenBSD: cipher-speed.sh,v 1.7 2013/01/12 11:23:53 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="cipher speed" 4tid="cipher speed"
@@ -16,12 +16,14 @@ ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
16 arcfour128 arcfour256 arcfour 16 arcfour128 arcfour256 arcfour
17 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se 17 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se
18 aes128-ctr aes192-ctr aes256-ctr" 18 aes128-ctr aes192-ctr aes256-ctr"
19config_defined OPENSSL_HAVE_EVPGCM &&
20 ciphers="$ciphers aes128-gcm@openssh.com aes256-gcm@openssh.com"
19macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com 21macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com
20 hmac-sha1-96 hmac-md5-96" 22 hmac-sha1-96 hmac-md5-96"
21config_defined HAVE_EVP_SHA256 && 23config_defined HAVE_EVP_SHA256 &&
22 macs="$macs hmac-sha2-256 hmac-sha2-512" 24 macs="$macs hmac-sha2-256 hmac-sha2-512"
23 25
24for c in $ciphers; do for m in $macs; do 26for c in $ciphers; do n=0; for m in $macs; do
25 trace "proto 2 cipher $c mac $m" 27 trace "proto 2 cipher $c mac $m"
26 for x in $tries; do 28 for x in $tries; do
27 echon "$c/$m:\t" 29 echon "$c/$m:\t"
@@ -34,6 +36,11 @@ for c in $ciphers; do for m in $macs; do
34 fail "ssh -2 failed with mac $m cipher $c" 36 fail "ssh -2 failed with mac $m cipher $c"
35 fi 37 fi
36 done 38 done
39 # No point trying all MACs for GCM since they are ignored.
40 case $c in
41 aes*-gcm@openssh.com) test $n -gt 0 && break;;
42 esac
43 n=$(($n + 1))
37done; done 44done; done
38 45
39ciphers="3des blowfish" 46ciphers="3des blowfish"
diff --git a/regress/integrity.sh b/regress/integrity.sh
index 0185490c1..608cde0fe 100644
--- a/regress/integrity.sh
+++ b/regress/integrity.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: integrity.sh,v 1.1 2012/12/11 22:42:11 markus Exp $ 1# $OpenBSD: integrity.sh,v 1.2 2013/01/12 11:23:53 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="integrity" 4tid="integrity"
@@ -14,6 +14,10 @@ macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com
14 umac-64-etm@openssh.com umac-128-etm@openssh.com 14 umac-64-etm@openssh.com umac-128-etm@openssh.com
15 hmac-sha1-96-etm@openssh.com hmac-md5-96-etm@openssh.com 15 hmac-sha1-96-etm@openssh.com hmac-md5-96-etm@openssh.com
16 hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com" 16 hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com"
17# The following are not MACs, but ciphers with integrated integrity. They are
18# handled specially below.
19config_defined OPENSSL_HAVE_EVPGCM &&
20 macs="$macs aes128-gcm@openssh.com aes256-gcm@openssh.com"
17 21
18# sshd-command for proxy (see test-exec.sh) 22# sshd-command for proxy (see test-exec.sh)
19cmd="sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" 23cmd="sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy"
@@ -37,7 +41,11 @@ for m in $macs; do
37 fi 41 fi
38 # modify output from sshd at offset $off 42 # modify output from sshd at offset $off
39 pxy="proxycommand=$cmd | $OBJ/modpipe -m xor:$off:1" 43 pxy="proxycommand=$cmd | $OBJ/modpipe -m xor:$off:1"
40 output=$(${SSH} -m $m -2F $OBJ/ssh_proxy -o "$pxy" \ 44 case $m in
45 aes*gcm*) macopt="-c $m";;
46 *) macopt="-m $m";;
47 esac
48 output=$(${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \
41 999.999.999.999 true 2>&1) 49 999.999.999.999 true 2>&1)
42 if [ $? -eq 0 ]; then 50 if [ $? -eq 0 ]; then
43 fail "ssh -m $m succeeds with bit-flip at $off" 51 fail "ssh -m $m succeeds with bit-flip at $off"
@@ -47,7 +55,7 @@ for m in $macs; do
47 verbose "test $tid: $m @$off $output" 55 verbose "test $tid: $m @$off $output"
48 case "$output" in 56 case "$output" in
49 Bad?packet*) elen=$((elen+1)); skip=3;; 57 Bad?packet*) elen=$((elen+1)); skip=3;;
50 Corrupted?MAC*) emac=$((emac+1)); skip=0;; 58 Corrupted?MAC* | Decryption?integrity?check?failed*)
51 padding*) epad=$((epad+1)); skip=0;; 59 padding*) epad=$((epad+1)); skip=0;;
52 *) fail "unexpected error mac $m at $off";; 60 *) fail "unexpected error mac $m at $off";;
53 esac 61 esac
diff --git a/regress/try-ciphers.sh b/regress/try-ciphers.sh
index 2b11b59ea..ca2851713 100644
--- a/regress/try-ciphers.sh
+++ b/regress/try-ciphers.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: try-ciphers.sh,v 1.17 2012/12/11 23:12:13 markus Exp $ 1# $OpenBSD: try-ciphers.sh,v 1.18 2013/01/12 11:23:53 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="try ciphers" 4tid="try ciphers"
@@ -6,7 +6,8 @@ tid="try ciphers"
6ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc 6ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc
7 arcfour128 arcfour256 arcfour 7 arcfour128 arcfour256 arcfour
8 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se 8 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se
9 aes128-ctr aes192-ctr aes256-ctr" 9 aes128-ctr aes192-ctr aes256-ctr
10 aes128-gcm@openssh.com aes256-gcm@openssh.com"
10macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com 11macs="hmac-sha1 hmac-md5 umac-64@openssh.com umac-128@openssh.com
11 hmac-sha1-96 hmac-md5-96 12 hmac-sha1-96 hmac-md5-96
12 hmac-sha1-etm@openssh.com hmac-md5-etm@openssh.com 13 hmac-sha1-etm@openssh.com hmac-md5-etm@openssh.com
@@ -18,6 +19,7 @@ config_defined HAVE_EVP_SHA256 &&
18 hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com" 19 hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com"
19 20
20for c in $ciphers; do 21for c in $ciphers; do
22 n=0
21 for m in $macs; do 23 for m in $macs; do
22 trace "proto 2 cipher $c mac $m" 24 trace "proto 2 cipher $c mac $m"
23 verbose "test $tid: proto 2 cipher $c mac $m" 25 verbose "test $tid: proto 2 cipher $c mac $m"
@@ -25,6 +27,11 @@ for c in $ciphers; do
25 if [ $? -ne 0 ]; then 27 if [ $? -ne 0 ]; then
26 fail "ssh -2 failed with mac $m cipher $c" 28 fail "ssh -2 failed with mac $m cipher $c"
27 fi 29 fi
30 # No point trying all MACs for GCM since they are ignored.
31 case $c in
32 aes*-gcm@openssh.com) test $n -gt 0 && break;;
33 esac
34 n=$(($n + 1))
28 done 35 done
29done 36done
30 37