Exemplo n.º 1
0
// newAuthKey returns string from an ssh.PublicKey used to index the key in our lookup.
func newAuthKey(key ssh.PublicKey) string {
	if key == nil {
		return ""
	}
	// FIXME: Is there a way to index pubkeys without marshal'ing them into strings?
	return sshd.Fingerprint(key)
}
Exemplo n.º 2
0
func (i Identity) Whois() string {
	ip, _, _ := net.SplitHostPort(i.RemoteAddr().String())
	fingerprint := "(no public key)"
	if i.PublicKey() != nil {
		fingerprint = sshd.Fingerprint(i.PublicKey())
	}
	return fmt.Sprintf("name: %s"+message.Newline+
		" > ip: %s"+message.Newline+
		" > fingerprint: %s", i.Name(), ip, fingerprint)
}