Bugzilla – Attachment 3043 Details for
Bug 2772
ssh-keygen invoked with options -H -F always returns 1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
ssh-keygen find hash modes exit code patch
0001-ssh-keygen-find-hash-modes-exit-code.patch (text/plain), 2.51 KB, created by
Anton Kremenetsky
on 2017-08-29 23:11:10 AEST
(
hide
)
Description:
ssh-keygen find hash modes exit code patch
Filename:
MIME Type:
Creator:
Anton Kremenetsky
Created:
2017-08-29 23:11:10 AEST
Size:
2.51 KB
patch
obsolete
>diff -ur a/openssh/regress/keygen-knownhosts.sh b/openssh/regress/keygen-knownhosts.sh >--- a/openssh/regress/keygen-knownhosts.sh 2017-08-29 15:35:37.466158102 +0300 >+++ b/openssh/regress/keygen-knownhosts.sh 2017-08-29 15:34:50.446570022 +0300 >@@ -62,6 +62,17 @@ > 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 >@@ -88,6 +99,18 @@ > 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 >@@ -110,19 +133,19 @@ > 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" -H >+check_find host-c "find simple and hash" "-q -H" > > # 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" -H >+check_find host-d "find simple and hash" "-q -H" > > # 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" -H >+check_find host-e "find wildcard key" "-q -H" > > # find key among multiple hosts > rm -f $OBJ/kh.expect >diff -ur a/openssh/ssh-keygen.c b/openssh/ssh-keygen.c >--- a/openssh/ssh-keygen.c 2017-08-29 15:35:37.466158102 +0300 >+++ b/openssh/ssh-keygen.c 2017-08-29 15:34:50.590568766 +0300 >@@ -1274,8 +1274,8 @@ > foreach_options = find_host ? HKF_WANT_MATCH : 0; > foreach_options |= print_fingerprint ? HKF_WANT_PARSE_KEY : 0; > if ((r = hostkeys_foreach(identity_file, >- hash_hosts ? known_hosts_hash : known_hosts_find_delete, &ctx, >- name, NULL, foreach_options)) != 0) { >+ hash_hosts && !find_host ? known_hosts_hash : known_hosts_find_delete, >+ &ctx, name, NULL, foreach_options)) != 0) { > if (inplace) > unlink(tmp); > fatal("%s: hostkeys_foreach failed: %s", __func__, ssh_err(r));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2772
: 3043