summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-10-21 15:27:14 +1100
committerDamien Miller <djm@mindrot.org>2010-10-21 15:27:14 +1100
commit6fd2d7de4b4ea3a361141cbe56f70bf70710546c (patch)
treeaceb98e9f0cda79fd151429555a8a7fd1e163ba3
parent68512c034140611e9df7a52e12ac5e4cd19f2db1 (diff)
- djm@cvs.openbsd.org 2010/08/31 12:24:09
[regress/cert-hostkey.sh regress/cert-userkey.sh] tests for ECDSA certificates
-rw-r--r--ChangeLog3
-rw-r--r--regress/cert-hostkey.sh23
-rw-r--r--regress/cert-userkey.sh19
3 files changed, 32 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index c0e3d3bf..de3fb011 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
[mux.c]
Typo in confirmation message. bz#1827, patch from imorgan at
nas nasa gov
+ - djm@cvs.openbsd.org 2010/08/31 12:24:09
+ [regress/cert-hostkey.sh regress/cert-userkey.sh]
+ tests for ECDSA certificates
20101011
- (djm) [canohost.c] Zero a4 instead of addr to better match type.
diff --git a/regress/cert-hostkey.sh b/regress/cert-hostkey.sh
index 0265e8f6..22ae4999 100644
--- a/regress/cert-hostkey.sh
+++ b/regress/cert-hostkey.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: cert-hostkey.sh,v 1.4 2010/04/16 01:58:45 djm Exp $
+# $OpenBSD: cert-hostkey.sh,v 1.5 2010/08/31 12:24:09 djm Exp $
# Placed in the Public Domain.
tid="certified host keys"
@@ -18,7 +18,7 @@ ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/host_ca_key ||\
) > $OBJ/known_hosts-cert
# Generate and sign host keys
-for ktype in rsa dsa ; do
+for ktype in rsa dsa ecdsa ; do
verbose "$tid: sign host ${ktype} cert"
# Generate and sign a host key
${SSHKEYGEN} -q -N '' -t ${ktype} \
@@ -28,6 +28,8 @@ for ktype in rsa dsa ; do
-I "regress host key for $USER" \
-n $HOSTS $OBJ/cert_host_key_${ktype} ||
fail "couldn't sign cert_host_key_${ktype}"
+ # v00 ecdsa certs do not exist
+ test "{ktype}" = "ecdsa" && continue
cp $OBJ/cert_host_key_${ktype} $OBJ/cert_host_key_${ktype}_v00
cp $OBJ/cert_host_key_${ktype}.pub $OBJ/cert_host_key_${ktype}_v00.pub
${SSHKEYGEN} -t v00 -h -q -s $OBJ/host_ca_key \
@@ -38,7 +40,7 @@ done
# Basic connect tests
for privsep in yes no ; do
- for ktype in rsa dsa rsa_v00 dsa_v00; do
+ for ktype in rsa dsa ecdsa rsa_v00 dsa_v00; do
verbose "$tid: host ${ktype} cert connect privsep $privsep"
(
cat $OBJ/sshd_proxy_bak
@@ -66,6 +68,9 @@ done
cat $OBJ/cert_host_key_rsa.pub
echon '@revoked '
echon "* "
+ cat $OBJ/cert_host_key_ecdsa.pub
+ echon '@revoked '
+ echon "* "
cat $OBJ/cert_host_key_dsa.pub
echon '@revoked '
echon "* "
@@ -75,7 +80,7 @@ done
cat $OBJ/cert_host_key_dsa_v00.pub
) > $OBJ/known_hosts-cert
for privsep in yes no ; do
- for ktype in rsa dsa rsa_v00 dsa_v00; do
+ for ktype in rsa dsa ecdsa rsa_v00 dsa_v00; do
verbose "$tid: host ${ktype} revoked cert privsep $privsep"
(
cat $OBJ/sshd_proxy_bak
@@ -102,7 +107,7 @@ done
echon "* "
cat $OBJ/host_ca_key.pub
) > $OBJ/known_hosts-cert
-for ktype in rsa dsa rsa_v00 dsa_v00 ; do
+for ktype in rsa dsa ecdsa rsa_v00 dsa_v00 ; do
verbose "$tid: host ${ktype} revoked cert"
(
cat $OBJ/sshd_proxy_bak
@@ -173,7 +178,9 @@ test_one "cert has constraints" failure "-h -Oforce-command=false"
# Check downgrade of cert to raw key when no CA found
for v in v01 v00 ; do
- for ktype in rsa dsa ; do
+ for ktype in rsa dsa ecdsa ; do
+ # v00 ecdsa certs do not exist.
+ test "${v}${ktype}" = "v00ecdsa" && continue
rm -f $OBJ/known_hosts-cert $OBJ/cert_host_key*
verbose "$tid: host ${ktype} ${v} cert downgrade to raw key"
# Generate and sign a host key
@@ -210,7 +217,9 @@ done
cat $OBJ/host_ca_key.pub
) > $OBJ/known_hosts-cert
for v in v01 v00 ; do
- for kt in rsa dsa ; do
+ for kt in rsa dsa ecdsa ; do
+ # v00 ecdsa certs do not exist.
+ test "${v}${ktype}" = "v00ecdsa" && continue
rm -f $OBJ/cert_host_key*
# Self-sign key
${SSHKEYGEN} -q -N '' -t ${kt} \
diff --git a/regress/cert-userkey.sh b/regress/cert-userkey.sh
index a41a9a9c..01f3b40a 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="" ;;