https://bugzilla.mindrot.org/show_bug.cgi?id=2234

            Bug ID: 2234
           Summary: ssh-add -l output aborts on unrecognized key, skips
                    flush when stdout not tty
           Product: Portable OpenSSH
           Version: 6.6p1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: ssh-add
          Assignee: [email protected]
          Reporter: [email protected]

Under SSH Agent Forwarding, when using an ssh-agent with keys loaded
for key-types not recognized by the remote host, running "ssh-add -l"
on the remote host will abort with fatal() when it sees the
unrecognized key-type.

If stdout is a tty, then stdio is line-buffered and the first seen SSH
keys will have their fingerprints emitted.  If stdout is not a tty,
then the stdio is never flushed and only the stderr output will be
emitted.  The fingerprints are lost.

"ssh-add -L" emits a line for every key loaded, without aborting, and
unhandled key-types can be detected by checking if the line begins with
whitespace.

The current behaviour working as well as it does is based on only one
set of keys being loaded and the most portable keys being loaded first.

The current behaviour can be made agnostic of tty/non-tty by inserting
a `setlinebuf(stdout);` call into `list_identities()`.

A more reliable approach might be to give `key_fingerprint()` a flag to
avoid calling fatal and to return an error some other way?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
[email protected]
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to