opscode/ohai — pull request #134 by faizk (2013-04-01 06:52:17+00:00)
Title: Correct defaults for host_#{type}_public (HostKey)

The ssh_host_key plugin must set one or more of the
`host_rsa_public`, `host_dsa_public`, and/or the `host_ecdsa_public`
attributes, based on the following logic:

- If `HostKey` is explicitly set in `sshd_config`,
each of the specified public key files must be read,
the key type detected, and the corresponding attribute
must be set.
- If either `HostKey` was not explicitly set in `sshd_config`,
or the file itself does not exist, then use the OpenSSH
(protocol version 2) defaults:
- `/etc/ssh/ssh_host_dsa_key`, `/etc/ssh/ssh_host_ecdsa_key`,
and `/etc/ssh/ssh_host_rsa_key`.
- for all the default files that were found on disk, set
the corresponding Ohai attribute.
- OpenSSH 5.7 and later support ECDSA (RFC5656), so this
must be supported as well, without breaking earlier versions
of OpenSSH.