]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Wed, 30 Nov 2016 03:01:33 +0000 (03:01 +0000)
committerDamien Miller <djm@mindrot.org>
Wed, 30 Nov 2016 08:44:50 +0000 (19:44 +1100)
test new behaviour of cert force-command restriction vs.
authorized_key/ principals

Upstream-Regress-ID: 399efa7469d40c404c0b0a295064ce75d495387c

regress/cert-userkey.sh

index 31974639591f76536a74023eb85fbcaafd68b55e..7005fd55eb6fccfa27e289e8073cabd21dec5d48 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: cert-userkey.sh,v 1.16 2016/05/03 12:15:49 dtucker Exp $
+#      $OpenBSD: cert-userkey.sh,v 1.17 2016/11/30 03:01:33 djm Exp $
 #      Placed in the Public Domain.
 
 tid="certified user keys"
@@ -354,6 +354,20 @@ test_one "principals key option principals" success "-n mekmitasdigoat" \
 test_one "principals key option no principals" failure "" \
     authorized_keys ',principals="mekmitasdigoat"'
 
+# command= options vs. force-command in key
+test_one "force-command match true" success \
+    "-n ${USER} -Oforce-command=true" \
+    authorized_keys ',command="true"'
+test_one "force-command match true" failure \
+    "-n ${USER} -Oforce-command=false" \
+    authorized_keys ',command="false"'
+test_one "force-command mismatch 1" failure \
+    "-n ${USER} -Oforce-command=false" \
+    authorized_keys ',command="true"'
+test_one "force-command mismatch 2" failure \
+    "-n ${USER} -Oforce-command=true" \
+    authorized_keys ',command="false"'
+
 # Wrong certificate
 cat $OBJ/sshd_proxy_bak > $OBJ/sshd_proxy
 for ktype in $PLAIN_TYPES ; do