diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-10-29 08:05:17 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-10-29 19:07:20 +1100 |
commit | b67e2e76fcf1ae7c802eb27ca927e16c91a513ff (patch) | |
tree | 1890c1d4af670fb83f29551c23534fe069124f1a /regress/limit-keytype.sh | |
parent | abd9dbc3c0d8c8c7561347cfa22166156e78c077 (diff) |
upstream commit
regress test for "PubkeyAcceptedKeyTypes +..." inside a
Match block
Upstream-Regress-ID: 246c37ed64a2e5704d4c158ccdca1ff700e10647
Diffstat (limited to 'regress/limit-keytype.sh')
-rw-r--r-- | regress/limit-keytype.sh | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/regress/limit-keytype.sh b/regress/limit-keytype.sh index 71781b26e..c0cf2fed6 100644 --- a/regress/limit-keytype.sh +++ b/regress/limit-keytype.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: limit-keytype.sh,v 1.3 2015/10/26 02:50:58 dtucker Exp $ | 1 | # $OpenBSD: limit-keytype.sh,v 1.4 2015/10/29 08:05:17 djm Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="restrict pubkey type" | 4 | tid="restrict pubkey type" |
@@ -20,6 +20,8 @@ ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/user_key2 || \ | |||
20 | fatal "ssh-keygen failed" | 20 | fatal "ssh-keygen failed" |
21 | ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/user_key3 || \ | 21 | ${SSHKEYGEN} -q -N '' -t rsa -f $OBJ/user_key3 || \ |
22 | fatal "ssh-keygen failed" | 22 | fatal "ssh-keygen failed" |
23 | ${SSHKEYGEN} -q -N '' -t dsa -f $OBJ/user_key4 || \ | ||
24 | fatal "ssh-keygen failed" | ||
23 | ${SSHKEYGEN} -q -s $OBJ/user_ca_key -I "regress user key for $USER" \ | 25 | ${SSHKEYGEN} -q -s $OBJ/user_ca_key -I "regress user key for $USER" \ |
24 | -z $$ -n ${USER},mekmitasdigoat $OBJ/user_key3 || | 26 | -z $$ -n ${USER},mekmitasdigoat $OBJ/user_key3 || |
25 | fatal "couldn't sign user_key1" | 27 | fatal "couldn't sign user_key1" |
@@ -77,3 +79,19 @@ ${SSH} $certopts proxy true || fatal "cert failed" | |||
77 | ${SSH} $opts -i $OBJ/user_key1 proxy true && fatal "key1 succeeded" | 79 | ${SSH} $opts -i $OBJ/user_key1 proxy true && fatal "key1 succeeded" |
78 | ${SSH} $opts -i $OBJ/user_key2 proxy true && fatal "key2 succeeded" | 80 | ${SSH} $opts -i $OBJ/user_key2 proxy true && fatal "key2 succeeded" |
79 | 81 | ||
82 | # Allow RSA in main config, Ed25519 for non-existent user. | ||
83 | verbose "match w/ no match" | ||
84 | prepare_config "PubkeyAcceptedKeyTypes ssh-rsa" \ | ||
85 | "Match user x$USER" "PubkeyAcceptedKeyTypes +ssh-ed25519" | ||
86 | ${SSH} $certopts proxy true && fatal "cert succeeded" | ||
87 | ${SSH} $opts -i $OBJ/user_key1 proxy true && fatal "key1 succeeded" | ||
88 | ${SSH} $opts -i $OBJ/user_key2 proxy true || fatal "key2 failed" | ||
89 | |||
90 | # Allow only DSA in main config, Ed25519 for user. | ||
91 | verbose "match w/ matching" | ||
92 | prepare_config "PubkeyAcceptedKeyTypes ssh-dss" \ | ||
93 | "Match user $USER" "PubkeyAcceptedKeyTypes +ssh-ed25519" | ||
94 | ${SSH} $certopts proxy true || fatal "cert failed" | ||
95 | ${SSH} $opts -i $OBJ/user_key1 proxy true || fatal "key1 failed" | ||
96 | ${SSH} $opts -i $OBJ/user_key4 proxy true && fatal "key4 succeeded" | ||
97 | |||