diff options
author | Simon Tatham <anakin@pobox.com> | 2022-08-02 19:54:47 +0300 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2022-08-02 20:03:45 +0300 |
commit | fea08bb24499dc76e3fb58895ca0f015714a1d53 (patch) | |
tree | 30e803730da80e45967df2724e72a01339b758bb /ssh.h | |
parent | 3e7274fdad91069022994c1a3aa43c4aef6ef713 (diff) |
Windows Pageant: use nicer key-type strings.
If you load a certified key into Windows Pageant, the official SSH id
for the key type is so long that it overflows its space in the list
box and overlaps the key fingerprint hash.
This commit introduces yet another footling little ssh_keyalg method
which returns a shorter human-readable description of the key type,
and uses that in the Windows Pageant list box only.
(Not in the Unix Pageant list, though, because being output to stdout,
that seems like something people are more likely to want to
machine-read, which firstly means we shouldn't change it lightly, and
secondly, if we did change it we'd want to avoid having a variable
number of spaces in the replacement key type text.)
Diffstat (limited to 'ssh.h')
-rw-r--r-- | ssh.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -857,6 +857,7 @@ struct ssh_keyalg { int (*pubkey_bits) (const ssh_keyalg *self, ptrlen blob); unsigned (*supported_flags) (const ssh_keyalg *self); const char *(*alternate_ssh_id) (const ssh_keyalg *self, unsigned flags); + char *(*alg_desc)(const ssh_keyalg *self); /* The following methods can be NULL if !is_certificate */ const ssh_keyalg *(*related_alg)(const ssh_keyalg *self, const ssh_keyalg *base); @@ -925,6 +926,8 @@ static inline const unsigned ssh_keyalg_supported_flags(const ssh_keyalg *self) static inline const char *ssh_keyalg_alternate_ssh_id( const ssh_keyalg *self, unsigned flags) { return self->alternate_ssh_id(self, flags); } +static inline char *ssh_keyalg_desc(const ssh_keyalg *self) +{ return self->alg_desc(self); } static inline const ssh_keyalg *ssh_keyalg_related_alg( const ssh_keyalg *self, const ssh_keyalg *base) { return self->related_alg(self, base); } |