003 File Manager
Current Path:
/usr/src/crypto/openssh/regress
usr
/
src
/
crypto
/
openssh
/
regress
/
📁
..
📄
Makefile
(6.8 KB)
📄
README.regress
(3.91 KB)
📄
addrmatch.sh
(2.06 KB)
📄
agent-getpeereid.sh
(1.13 KB)
📄
agent-pkcs11.sh
(1.86 KB)
📄
agent-ptrace.sh
(1.31 KB)
📄
agent-timeout.sh
(928 B)
📄
agent.sh
(2.96 KB)
📄
allow-deny-users.sh
(1.45 KB)
📄
authinfo.sh
(574 B)
📄
banner.sh
(1.24 KB)
📄
broken-pipe.sh
(281 B)
📄
brokenkeys.sh
(462 B)
📄
cert-file.sh
(5.25 KB)
📄
cert-hostkey.sh
(10.34 KB)
📄
cert-userkey.sh
(11.95 KB)
📄
cfginclude.sh
(4.39 KB)
📄
cfgmatch.sh
(3.5 KB)
📄
cfgmatchlisten.sh
(6.34 KB)
📄
cfgparse.sh
(2.17 KB)
📄
check-perm.c
(4.33 KB)
📄
cipher-speed.sh
(799 B)
📄
conch-ciphers.sh
(796 B)
📄
connect-privsep.sh
(1.02 KB)
📄
connect-uri.sh
(816 B)
📄
connect.sh
(222 B)
📄
dhgex.sh
(1.47 KB)
📄
dsa_ssh2.prv
(863 B)
📄
dsa_ssh2.pub
(732 B)
📄
dynamic-forward.sh
(1.48 KB)
📄
envpass.sh
(1.54 KB)
📄
exit-status.sh
(562 B)
📄
forcecommand.sh
(1.1 KB)
📄
forward-control.sh
(7.71 KB)
📄
forwarding.sh
(4.22 KB)
📄
host-expand.sh
(384 B)
📄
hostkey-agent.sh
(1.6 KB)
📄
hostkey-rotate.sh
(3.86 KB)
📄
integrity.sh
(2.33 KB)
📄
kextype.sh
(587 B)
📄
key-options.sh
(3.22 KB)
📄
keygen-change.sh
(581 B)
📄
keygen-convert.sh
(1.08 KB)
📄
keygen-knownhosts.sh
(6.42 KB)
📄
keygen-moduli.sh
(702 B)
📄
keys-command.sh
(2.39 KB)
📄
keyscan.sh
(403 B)
📄
keytype.sh
(1.84 KB)
📄
krl.sh
(6.45 KB)
📄
limit-keytype.sh
(3.65 KB)
📄
localcommand.sh
(351 B)
📄
login-timeout.sh
(588 B)
📁
misc
📄
mkdtemp.c
(1.53 KB)
📄
modpipe.c
(3.81 KB)
📄
moduli.in
(1.59 KB)
📄
multiplex.sh
(7.09 KB)
📄
multipubkey.sh
(2.31 KB)
📄
netcat.c
(39.92 KB)
📄
portnum.sh
(624 B)
📄
principals-command.sh
(5.48 KB)
📄
proto-mismatch.sh
(368 B)
📄
proto-version.sh
(527 B)
📄
proxy-connect.sh
(624 B)
📄
putty-ciphers.sh
(678 B)
📄
putty-kex.sh
(553 B)
📄
putty-transfer.sh
(1021 B)
📄
reconfigure.sh
(855 B)
📄
reexec.sh
(878 B)
📄
rekey.sh
(4.12 KB)
📄
rsa_openssh.prv
(883 B)
📄
rsa_openssh.pub
(213 B)
📄
rsa_ssh2.prv
(924 B)
📄
scp-ssh-wrapper.sh
(914 B)
📄
scp-uri.sh
(2.01 KB)
📄
scp.sh
(3.5 KB)
📄
setuid-allowed.c
(1.45 KB)
📄
sftp-badcmds.sh
(2.22 KB)
📄
sftp-batch.sh
(1.16 KB)
📄
sftp-chroot.sh
(845 B)
📄
sftp-cmds.sh
(7.29 KB)
📄
sftp-glob.sh
(2.47 KB)
📄
sftp-perm.sh
(5.23 KB)
📄
sftp-uri.sh
(1.59 KB)
📄
sftp.sh
(737 B)
📄
ssh-com-client.sh
(3.02 KB)
📄
ssh-com-keygen.sh
(1.38 KB)
📄
ssh-com-sftp.sh
(1.19 KB)
📄
ssh-com.sh
(2.71 KB)
📄
ssh2putty.sh
(693 B)
📄
sshcfgparse.sh
(3.8 KB)
📄
sshd-log-wrapper.sh
(285 B)
📄
stderr-after-eof.sh
(603 B)
📄
stderr-data.sh
(709 B)
📄
t11.ok
(51 B)
📄
t4.ok
(52 B)
📄
t5.ok
(66 B)
📄
test-exec.sh
(13.05 KB)
📄
transfer.sh
(583 B)
📄
try-ciphers.sh
(715 B)
📁
unittests
📄
valgrind-unit.sh
(610 B)
📄
yes-head.sh
(401 B)
Editing: keygen-knownhosts.sh
# $OpenBSD: keygen-knownhosts.sh,v 1.4 2018/06/01 03:52:37 djm Exp $ # Placed in the Public Domain. tid="ssh-keygen known_hosts" rm -f $OBJ/kh.* # Generate some keys for testing (just ed25519 for speed) and make a hosts file. for x in host-a host-b host-c host-d host-e host-f host-a2 host-b2; do ${SSHKEYGEN} -qt ed25519 -f $OBJ/kh.$x -C "$x" -N "" || \ fatal "ssh-keygen failed" # Add a comment that we expect should be preserved. echo "# $x" >> $OBJ/kh.hosts ( case "$x" in host-a|host-b) printf "$x " ;; host-c) printf "@cert-authority $x " ;; host-d) printf "@revoked $x " ;; host-e) printf "host-e* " ;; host-f) printf "host-f,host-g,host-h " ;; host-a2) printf "host-a " ;; host-b2) printf "host-b " ;; esac cat $OBJ/kh.${x}.pub # Blank line should be preserved. echo "" >> $OBJ/kh.hosts ) >> $OBJ/kh.hosts done # Generate a variant with an invalid line. We'll use this for most tests, # because keygen should be able to cope and it should be preserved in any # output file. cat $OBJ/kh.hosts >> $OBJ/kh.invalid echo "host-i " >> $OBJ/kh.invalid cp $OBJ/kh.invalid $OBJ/kh.invalid.orig cp $OBJ/kh.hosts $OBJ/kh.hosts.orig expect_key() { _host=$1 _hosts=$2 _key=$3 _line=$4 _mark=$5 _marker="" test "x$_mark" = "xCA" && _marker="@cert-authority " test "x$_mark" = "xREVOKED" && _marker="@revoked " test "x$_line" != "x" && echo "# Host $_host found: line $_line $_mark" >> $OBJ/kh.expect printf "${_marker}$_hosts " >> $OBJ/kh.expect cat $OBJ/kh.${_key}.pub >> $OBJ/kh.expect || fatal "${_key}.pub missing" } check_find() { _host=$1 _name=$2 shift; shift ${SSHKEYGEN} "$@" -f $OBJ/kh.invalid -F $_host > $OBJ/kh.result if ! diff -w $OBJ/kh.expect $OBJ/kh.result ; then fail "didn't find $_name" fi } check_find_exit_code() { _host=$1 _name=$2 _keygenopt=$3 _exp_exit_code=$4 ${SSHKEYGEN} $_keygenopt -f $OBJ/kh.invalid -F $_host > /dev/null if [ "$?" != "$_exp_exit_code" ] ; then fail "Unexpected exit code $_name" fi } # Find key rm -f $OBJ/kh.expect expect_key host-a host-a host-a 2 expect_key host-a host-a host-a2 20 check_find host-a "simple find" # find CA key rm -f $OBJ/kh.expect expect_key host-c host-c host-c 8 CA check_find host-c "find CA key" # find revoked key rm -f $OBJ/kh.expect expect_key host-d host-d host-d 11 REVOKED check_find host-d "find revoked key" # find key with wildcard rm -f $OBJ/kh.expect expect_key host-e.somedomain "host-e*" host-e 14 check_find host-e.somedomain "find wildcard key" # find key among multiple hosts rm -f $OBJ/kh.expect expect_key host-h "host-f,host-g,host-h " host-f 17 check_find host-h "find multiple hosts" # Check exit code, known host check_find_exit_code host-a "known host" "-q" "0" # Check exit code, unknown host check_find_exit_code host-aa "unknown host" "-q" "1" # Check exit code, the hash mode, known host check_find_exit_code host-a "known host" "-q -H" "0" # Check exit code, the hash mode, unknown host check_find_exit_code host-aa "unknown host" "-q -H" "1" check_hashed_find() { _host=$1 _name=$2 _file=$3 test "x$_file" = "x" && _file=$OBJ/kh.invalid ${SSHKEYGEN} -f $_file -HF $_host | grep '|1|' | \ sed "s/^[^ ]*/$_host/" > $OBJ/kh.result if ! diff -w $OBJ/kh.expect $OBJ/kh.result ; then fail "didn't find $_name" fi } # Find key and hash rm -f $OBJ/kh.expect expect_key host-a host-a host-a expect_key host-a host-a host-a2 check_hashed_find host-a "find simple and hash" # Find CA key and hash rm -f $OBJ/kh.expect expect_key host-c host-c host-c "" CA # CA key output is not hashed. check_find host-c "find simple and hash" -Hq # Find revoked key and hash rm -f $OBJ/kh.expect expect_key host-d host-d host-d "" REVOKED # Revoked key output is not hashed. check_find host-d "find simple and hash" -Hq # find key with wildcard and hash rm -f $OBJ/kh.expect expect_key host-e "host-e*" host-e "" # Key with wildcard hostname should not be hashed. check_find host-e "find wildcard key" -Hq # find key among multiple hosts rm -f $OBJ/kh.expect # Comma-separated hostnames should be expanded and hashed. expect_key host-f "host-h " host-f expect_key host-g "host-h " host-f expect_key host-h "host-h " host-f check_hashed_find host-h "find multiple hosts" # Attempt remove key on invalid file. cp $OBJ/kh.invalid.orig $OBJ/kh.invalid ${SSHKEYGEN} -qf $OBJ/kh.invalid -R host-a 2>/dev/null diff $OBJ/kh.invalid $OBJ/kh.invalid.orig || fail "remove on invalid succeeded" # Remove key cp $OBJ/kh.hosts.orig $OBJ/kh.hosts ${SSHKEYGEN} -qf $OBJ/kh.hosts -R host-a 2>/dev/null grep -v "^host-a " $OBJ/kh.hosts.orig > $OBJ/kh.expect diff $OBJ/kh.hosts $OBJ/kh.expect || fail "remove simple" # Remove CA key cp $OBJ/kh.hosts.orig $OBJ/kh.hosts ${SSHKEYGEN} -qf $OBJ/kh.hosts -R host-c 2>/dev/null # CA key should not be removed. diff $OBJ/kh.hosts $OBJ/kh.hosts.orig || fail "remove CA" # Remove revoked key cp $OBJ/kh.hosts.orig $OBJ/kh.hosts ${SSHKEYGEN} -qf $OBJ/kh.hosts -R host-d 2>/dev/null # revoked key should not be removed. diff $OBJ/kh.hosts $OBJ/kh.hosts.orig || fail "remove revoked" # Remove wildcard cp $OBJ/kh.hosts.orig $OBJ/kh.hosts ${SSHKEYGEN} -qf $OBJ/kh.hosts -R host-e.blahblah 2>/dev/null grep -v "^host-e[*] " $OBJ/kh.hosts.orig > $OBJ/kh.expect diff $OBJ/kh.hosts $OBJ/kh.expect || fail "remove wildcard" # Remove multiple cp $OBJ/kh.hosts.orig $OBJ/kh.hosts ${SSHKEYGEN} -qf $OBJ/kh.hosts -R host-h 2>/dev/null grep -v "^host-f," $OBJ/kh.hosts.orig > $OBJ/kh.expect diff $OBJ/kh.hosts $OBJ/kh.expect || fail "remove wildcard" # Attempt hash on invalid file cp $OBJ/kh.invalid.orig $OBJ/kh.invalid ${SSHKEYGEN} -qf $OBJ/kh.invalid -H 2>/dev/null && fail "hash invalid succeeded" diff $OBJ/kh.invalid $OBJ/kh.invalid.orig || fail "invalid file modified" # Hash valid file cp $OBJ/kh.hosts.orig $OBJ/kh.hosts ${SSHKEYGEN} -qf $OBJ/kh.hosts -H 2>/dev/null || fail "hash failed" diff $OBJ/kh.hosts.old $OBJ/kh.hosts.orig || fail "backup differs" grep "^host-[abfgh]" $OBJ/kh.hosts && fail "original hostnames persist" cp $OBJ/kh.hosts $OBJ/kh.hashed.orig # Test lookup rm -f $OBJ/kh.expect expect_key host-a host-a host-a expect_key host-a host-a host-a2 check_hashed_find host-a "find simple in hashed" $OBJ/kh.hosts # Test multiple expanded rm -f $OBJ/kh.expect expect_key host-h host-h host-f check_hashed_find host-h "find simple in hashed" $OBJ/kh.hosts # Test remove cp $OBJ/kh.hashed.orig $OBJ/kh.hashed ${SSHKEYGEN} -qf $OBJ/kh.hashed -R host-a 2>/dev/null ${SSHKEYGEN} -qf $OBJ/kh.hashed -F host-a && fail "found key after hashed remove"
Upload File
Create Folder