From 6fd2d7de4b4ea3a361141cbe56f70bf70710546c Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 21 Oct 2010 15:27:14 +1100 Subject: - djm@cvs.openbsd.org 2010/08/31 12:24:09 [regress/cert-hostkey.sh regress/cert-userkey.sh] tests for ECDSA certificates --- regress/cert-userkey.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'regress/cert-userkey.sh') diff --git a/regress/cert-userkey.sh b/regress/cert-userkey.sh index a41a9a9c0..01f3b40a4 100644 --- a/regress/cert-userkey.sh +++ b/regress/cert-userkey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: cert-userkey.sh,v 1.6 2010/06/29 23:59:54 djm Exp $ +# $OpenBSD: cert-userkey.sh,v 1.7 2010/08/31 12:24:09 djm Exp $ # Placed in the Public Domain. tid="certified user keys" @@ -11,7 +11,7 @@ ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/user_ca_key ||\ fail "ssh-keygen of user_ca_key failed" # Generate and sign user keys -for ktype in rsa dsa ; do +for ktype in rsa dsa ecdsa ; do verbose "$tid: sign user ${ktype} cert" ${SSHKEYGEN} -q -N '' -t ${ktype} \ -f $OBJ/cert_user_key_${ktype} || \ @@ -20,6 +20,8 @@ for ktype in rsa dsa ; do "regress user key for $USER" \ -n ${USER},mekmitasdigoat $OBJ/cert_user_key_${ktype} || fail "couldn't sign cert_user_key_${ktype}" + # v00 ecdsa certs do not exist + test "{ktype}" = "ecdsa" && continue cp $OBJ/cert_user_key_${ktype} $OBJ/cert_user_key_${ktype}_v00 cp $OBJ/cert_user_key_${ktype}.pub $OBJ/cert_user_key_${ktype}_v00.pub ${SSHKEYGEN} -q -t v00 -s $OBJ/user_ca_key -I \ @@ -29,7 +31,7 @@ for ktype in rsa dsa ; do done # Test explicitly-specified principals -for ktype in rsa dsa rsa_v00 dsa_v00 ; do +for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do for privsep in yes no ; do _prefix="${ktype} privsep $privsep" @@ -155,7 +157,7 @@ basic_tests() { extra_sshd="TrustedUserCAKeys $OBJ/user_ca_key.pub" fi - for ktype in rsa dsa rsa_v00 dsa_v00 ; do + for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do for privsep in yes no ; do _prefix="${ktype} privsep $privsep $auth" # Simple connect @@ -230,6 +232,11 @@ test_one() { for auth in $auth_choice ; do for ktype in rsa rsa_v00 ; do + case $ktype in + *_v00) keyv="-t v00" ;; + *) keyv="" ;; + esac + cat $OBJ/sshd_proxy_bak > $OBJ/sshd_proxy if test "x$auth" = "xauthorized_keys" ; then # Add CA to authorized_keys @@ -249,7 +256,7 @@ test_one() { verbose "$tid: $ident auth $auth expect $result $ktype" ${SSHKEYGEN} -q -s $OBJ/user_ca_key \ -I "regress user key for $USER" \ - $sign_opts \ + $sign_opts $keyv \ $OBJ/cert_user_key_${ktype} || fail "couldn't sign cert_user_key_${ktype}" @@ -302,7 +309,7 @@ test_one "principals key option no principals" failure "" \ # Wrong certificate cat $OBJ/sshd_proxy_bak > $OBJ/sshd_proxy -for ktype in rsa dsa rsa_v00 dsa_v00 ; do +for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do case $ktype in *_v00) args="-t v00" ;; *) args="" ;; -- cgit v1.2.3 From d633fef4712f87324516bd7e6c0314dfb37a5820 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 24 Oct 2010 11:33:07 +1100 Subject: - (dtucker) [regress/cert-userkey.sh] Disable ECC-based tests on platforms which don't have ECC support in libcrypto. --- ChangeLog | 2 ++ regress/cert-userkey.sh | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'regress/cert-userkey.sh') diff --git a/ChangeLog b/ChangeLog index 990a7e536..6cf9897d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - (dtucker) [includes.h] Add missing ifdef GLOB_HAS_GL_STATV to fix build. - (dtucker) [regress/cert-hostkey.sh] Disable ECC-based tests on platforms which don't have ECC support in libcrypto. + - (dtucker) [regress/cert-userkey.sh] Disable ECC-based tests on platforms + which don't have ECC support in libcrypto. - (dtucker) OpenBSD CVS Sync - sthen@cvs.openbsd.org 2010/10/23 22:06:12 [sftp.c] diff --git a/regress/cert-userkey.sh b/regress/cert-userkey.sh index 01f3b40a4..a7760a2f6 100644 --- a/regress/cert-userkey.sh +++ b/regress/cert-userkey.sh @@ -3,6 +3,13 @@ tid="certified user keys" +# used to disable ECC based tests on platforms without ECC +ecdsa="" +if grep "#define.*OPENSSL_HAS_ECC" ${BUILDDIR}/config.h >/dev/null 2>&1 +then + ecdsa=ecdsa +fi + rm -f $OBJ/authorized_keys_$USER $OBJ/user_ca_key* $OBJ/cert_user_key* cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak @@ -11,7 +18,7 @@ ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/user_ca_key ||\ fail "ssh-keygen of user_ca_key failed" # Generate and sign user keys -for ktype in rsa dsa ecdsa ; do +for ktype in rsa dsa $ecdsa ; do verbose "$tid: sign user ${ktype} cert" ${SSHKEYGEN} -q -N '' -t ${ktype} \ -f $OBJ/cert_user_key_${ktype} || \ @@ -31,7 +38,7 @@ for ktype in rsa dsa ecdsa ; do done # Test explicitly-specified principals -for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do +for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do for privsep in yes no ; do _prefix="${ktype} privsep $privsep" @@ -157,7 +164,7 @@ basic_tests() { extra_sshd="TrustedUserCAKeys $OBJ/user_ca_key.pub" fi - for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do + for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do for privsep in yes no ; do _prefix="${ktype} privsep $privsep $auth" # Simple connect @@ -309,7 +316,7 @@ test_one "principals key option no principals" failure "" \ # Wrong certificate cat $OBJ/sshd_proxy_bak > $OBJ/sshd_proxy -for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do +for ktype in rsa dsa $ecdsa rsa_v00 dsa_v00 ; do case $ktype in *_v00) args="-t v00" ;; *) args="" ;; -- cgit v1.2.3 From eab5f0df90cad495ee65abdb557538dbfb625d15 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 5 Nov 2010 18:23:38 +1100 Subject: - (dtucker) [Makefile configure.ac regress/Makefile regress/keytype.sh] Import recent changes to regress/Makefile, pass a flag to enable ECC tests from configure through to regress/Makefile and use it in the tests. --- ChangeLog | 3 +++ configure.ac | 7 +++++-- regress/Makefile | 27 +++++++++++++++++++++++++++ regress/cert-hostkey.sh | 3 +-- regress/cert-userkey.sh | 3 +-- regress/kextype.sh | 4 +++- regress/keytype.sh | 5 ++++- 7 files changed, 44 insertions(+), 8 deletions(-) (limited to 'regress/cert-userkey.sh') diff --git a/ChangeLog b/ChangeLog index 2f309739d..c6dfa2403 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,9 @@ - (dtucker) [platform.c platform.h session.c] Move the Cygwin special-case check into platform.c - (dtucker) [regress/keytype.sh] Import new test. + - (dtucker) [Makefile configure.ac regress/Makefile regress/keytype.sh] + Import recent changes to regress/Makefile, pass a flag to enable ECC tests + from configure through to regress/Makefile and use it in the tests. 20101025 - (tim) [openbsd-compat/glob.h] Remove sys/cdefs.h include that came with diff --git a/configure.ac b/configure.ac index 39b68c70a..97d4e6bdb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.456 2010/11/05 01:03:05 dtucker Exp $ +# $Id: configure.ac,v 1.457 2010/11/05 07:23:38 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) -AC_REVISION($Revision: 1.456 $) +AC_REVISION($Revision: 1.457 $) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) @@ -2209,11 +2209,14 @@ int main(void) { AC_MSG_RESULT(yes) AC_DEFINE(OPENSSL_HAS_ECC, 1, [libcrypto includes complete ECC support]) + TEST_SSH_ECC=yes ], [ AC_MSG_RESULT(no) + TEST_SSH_ECC=no ] ) +AC_SUBST(TEST_SSH_ECC) saved_LIBS="$LIBS" AC_CHECK_LIB(iaf, ia_openinfo, [ diff --git a/regress/Makefile b/regress/Makefile index f51307f02..d5668f08f 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -53,12 +53,16 @@ LTESTS= connect \ localcommand \ forcecommand \ portnum \ + keytype \ + kextype \ cert-hostkey \ cert-userkey INTEROP_TESTS= putty-transfer putty-ciphers putty-kex conch-ciphers #INTEROP_TESTS+=ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp +#LTESTS= cipher-speed + USER!= id -un CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \ t8.out t8.out.pub t9.out t9.out.pub \ @@ -78,6 +82,10 @@ TEST_ENV= "MALLOC_OPTIONS=AFGJPRX" t1: ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv + tr '\n' '\r' <${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_cr.prv + ssh-keygen -if ${.OBJDIR}/rsa_ssh2_cr.prv | diff - ${.CURDIR}/rsa_openssh.prv + awk '{print $$0 "\r"}' ${.CURDIR}/rsa_ssh2.prv > ${.OBJDIR}/rsa_ssh2_crnl.prv + ssh-keygen -if ${.OBJDIR}/rsa_ssh2_crnl.prv | diff - ${.CURDIR}/rsa_openssh.prv t2: cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out @@ -110,6 +118,23 @@ t7: $(OBJ)/t7.out ssh-keygen -lf $(OBJ)/t7.out > /dev/null ssh-keygen -Bf $(OBJ)/t7.out > /dev/null +t8.out: + ssh-keygen -q -t dsa -N '' -f $@ + +t8: t8.out + ssh-keygen -lf t8.out > /dev/null + ssh-keygen -Bf t8.out > /dev/null + +t9.out: + test "${TEST_SSH_ECC}" != yes || \ + ssh-keygen -q -t ecdsa -N '' -f + +t9: t9.out + test "${TEST_SSH_ECC}" != yes || \ + ssh-keygen -lf t9.out > /dev/null + test "${TEST_SSH_ECC}" != yes || \ + ssh-keygen -Bf t9.out > /dev/null + t-exec: ${LTESTS:=.sh} @if [ "x$?" = "x" ]; then exit 0; fi; \ for TEST in ""$?; do \ @@ -124,3 +149,5 @@ t-exec-interop: ${INTEROP_TESTS:=.sh} (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ done +# Not run by default +interop: ${INTEROP_TARGETS} diff --git a/regress/cert-hostkey.sh b/regress/cert-hostkey.sh index 7461beca6..1ae5d0bda 100644 --- a/regress/cert-hostkey.sh +++ b/regress/cert-hostkey.sh @@ -5,8 +5,7 @@ tid="certified host keys" # used to disable ECC based tests on platforms without ECC ecdsa="" -if grep "#define.*OPENSSL_HAS_ECC" ${BUILDDIR}/config.h >/dev/null 2>&1 -then +if "$TEST_SSH_ECC" = "yes"; then ecdsa=ecdsa fi diff --git a/regress/cert-userkey.sh b/regress/cert-userkey.sh index a7760a2f6..a42c7f34a 100644 --- a/regress/cert-userkey.sh +++ b/regress/cert-userkey.sh @@ -5,8 +5,7 @@ tid="certified user keys" # used to disable ECC based tests on platforms without ECC ecdsa="" -if grep "#define.*OPENSSL_HAS_ECC" ${BUILDDIR}/config.h >/dev/null 2>&1 -then +if "$TEST_SSH_ECC" = "yes"; then ecdsa=ecdsa fi diff --git a/regress/kextype.sh b/regress/kextype.sh index ba6fd9509..22ceb40c9 100644 --- a/regress/kextype.sh +++ b/regress/kextype.sh @@ -7,7 +7,9 @@ TIME=/usr/bin/time cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak cp $OBJ/ssh_proxy $OBJ/ssh_proxy_bak -kextypes="ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521" +if "$TEST_SSH_ECC" = "yes"; then + kextypes="ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521" +fi kextypes="$kextypes diffie-hellman-group-exchange-sha256" kextypes="$kextypes diffie-hellman-group-exchange-sha1" kextypes="$kextypes diffie-hellman-group14-sha1" diff --git a/regress/keytype.sh b/regress/keytype.sh index 7be3cc0c8..cd9024587 100644 --- a/regress/keytype.sh +++ b/regress/keytype.sh @@ -7,7 +7,10 @@ TIME=/usr/bin/time cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak cp $OBJ/ssh_proxy $OBJ/ssh_proxy_bak -ktypes="dsa-1024 rsa-2048 ecdsa-256 rsa-3072 ecdsa-384 ecdsa-521" +ktypes="dsa-1024 rsa-2048 rsa-3072" +if test "$TEST_SSH_ECC" = "yes"; then + ktypes="$ktypes ecdsa-256 ecdsa-384 ecdsa-521" +fi for kt in $ktypes; do rm -f $OBJ/key.$kt -- cgit v1.2.3 From 322125b9603cab2c70e827ae83d332cb6575e399 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 7 Jan 2011 09:50:08 +1100 Subject: - (djm) [regress/cert-hostkey.sh regress/cert-userkey.sh] fix shell test for no-ECC case. Patch from cristian.ionescu-idbohrn AT axis.com --- ChangeLog | 4 ++++ regress/cert-hostkey.sh | 2 +- regress/cert-userkey.sh | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'regress/cert-userkey.sh') diff --git a/ChangeLog b/ChangeLog index 4e63aab5b..636524bba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20110107 + - (djm) [regress/cert-hostkey.sh regress/cert-userkey.sh] fix shell test + for no-ECC case. Patch from cristian.ionescu-idbohrn AT axis.com + 20110106 - (djm) OpenBSD CVS Sync - markus@cvs.openbsd.org 2010/12/08 22:46:03 diff --git a/regress/cert-hostkey.sh b/regress/cert-hostkey.sh index 1ae5d0bda..c23a41c68 100644 --- a/regress/cert-hostkey.sh +++ b/regress/cert-hostkey.sh @@ -5,7 +5,7 @@ tid="certified host keys" # used to disable ECC based tests on platforms without ECC ecdsa="" -if "$TEST_SSH_ECC" = "yes"; then +if test "x$TEST_SSH_ECC" = "xyes"; then ecdsa=ecdsa fi diff --git a/regress/cert-userkey.sh b/regress/cert-userkey.sh index a42c7f34a..fcca3708b 100644 --- a/regress/cert-userkey.sh +++ b/regress/cert-userkey.sh @@ -5,7 +5,7 @@ tid="certified user keys" # used to disable ECC based tests on platforms without ECC ecdsa="" -if "$TEST_SSH_ECC" = "yes"; then +if test "x$TEST_SSH_ECC" = "xyes"; then ecdsa=ecdsa fi -- cgit v1.2.3