bugzilla-daemon at bugzilla.mindrot.org
2017-Aug-29 13:11 UTC
[Bug 2772] New: ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772
Bug ID: 2772
Summary: ssh-keygen invoked with options -H -F always returns 1
Product: Portable OpenSSH
Version: 7.5p1
Hardware: amd64
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: ssh-keygen
Assignee: unassigned-bugs at mindrot.org
Reporter: akremenetsky at dev.rtsoft.ru
Created attachment 3043
--> https://bugzilla.mindrot.org/attachment.cgi?id=3043&action=edit
ssh-keygen find hash modes exit code patch
The ssh-keygen utility invoked with options -H -F always returns 1 even
though a host was found. To reproduce the bug use the latest version of
ssh-keygen. I tested it on Ubuntu (Ubuntu 16.04.2 LTS) with version
1:7.2p2-4ubuntu2.2 or clone it from the Github repo(master branch) and
build it manually.
ssh-keygen -f ~/.ssh/known_hosts -H -F <HOST> ; echo $?
The exit code will be 1 for known and unknown hosts.
I think a reason is that the ctx.found_key field does not set to 1.
https://github.com/openssh/openssh-portable/blob/master/ssh-keygen.c#L1324
The field can be set only in the function known_hosts_find_delete
https://github.com/openssh/openssh-portable/blob/master/ssh-keygen.c#L1174
but if the hash_mode is specified, the function is not used.
https://github.com/openssh/openssh-portable/blob/master/ssh-keygen.c#L1277
Although it contains logic for the hash mode
https://github.com/openssh/openssh-portable/blob/master/ssh-keygen.c#L1209
Please confider my patch to fix this issue. The patch in the
attachment.
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Aug-29 13:13 UTC
[Bug 2772] ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772
Anton Kremenetsky <akremenetsky at dev.rtsoft.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned-bugs at mindrot.org |akremenetsky at
dev.rtsoft.ru
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Sep-05 12:32 UTC
[Bug 2772] ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772
Anton Kremenetsky <akremenetsky at dev.rtsoft.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|akremenetsky at dev.rtsoft.ru |unassigned-bugs at
mindrot.org
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jun-01 03:39 UTC
[Bug 2772] ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |djm at mindrot.org
Blocks| |2852
Referenced Bugs:
https://bugzilla.mindrot.org/show_bug.cgi?id=2852
[Bug 2852] Tracking bug for OpenSSH 7.8 release
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jun-01 03:52 UTC
[Bug 2772] ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772 --- Comment #1 from Damien Miller <djm at mindrot.org> --- Thanks for the report, patch and especially for writing a regression test to go with them. These have been committed (with a couple of tweaks) and will be in OpenSSH 7.8. -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jun-01 03:53 UTC
[Bug 2772] ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Oct-19 06:17 UTC
[Bug 2772] ssh-keygen invoked with options -H -F always returns 1
https://bugzilla.mindrot.org/show_bug.cgi?id=2772
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #2 from Damien Miller <djm at mindrot.org> ---
Close RESOLVED bugs with the release of openssh-8.0
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.