mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-19 03:51:02 -05:00
Windows Pageant: display RSA/DSA cert bit counts.
The test in the Pageant list box code for whether we should display the bit count of a key was done by checking specifically for ssh_rsa or ssh_dsa, which of course meant that it didn't catch the certified versions of those keys. Now there's yet another footling ssh_keyalg method that asks the question 'is it worth displaying the bit count?', to which RSA and DSA answer yes, and the opensshcert family delegates to its base key type, so that RSA and DSA certified keys also answer yes. (This isn't the same as ssh_key_public_bits(alg, blob) >= 0. All supported public key algorithms _can_ display a bit count if called on. But only in RSA and DSA is it configurable, and therefore worth bothering to print in the list box.) Also in this commit, I've fixed a bug in the certificate implementation of public_bits, which was passing a wrongly formatted public blob to the underlying key. (Done by factoring out the code from opensshcert_new_shared which constructed the _correct_ public blob, and reusing it in public_bits to do the same job.)
This commit is contained in:
5
ssh.h
5
ssh.h
@ -858,6 +858,7 @@ struct ssh_keyalg {
|
||||
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);
|
||||
bool (*variable_size)(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);
|
||||
@ -928,6 +929,8 @@ static inline const char *ssh_keyalg_alternate_ssh_id(
|
||||
{ return self->alternate_ssh_id(self, flags); }
|
||||
static inline char *ssh_keyalg_desc(const ssh_keyalg *self)
|
||||
{ return self->alg_desc(self); }
|
||||
static inline bool ssh_keyalg_variable_size(const ssh_keyalg *self)
|
||||
{ return self->variable_size(self); }
|
||||
static inline const ssh_keyalg *ssh_keyalg_related_alg(
|
||||
const ssh_keyalg *self, const ssh_keyalg *base)
|
||||
{ return self->related_alg(self, base); }
|
||||
@ -936,6 +939,8 @@ static inline const ssh_keyalg *ssh_keyalg_related_alg(
|
||||
unsigned nullkey_supported_flags(const ssh_keyalg *self);
|
||||
const char *nullkey_alternate_ssh_id(const ssh_keyalg *self, unsigned flags);
|
||||
ssh_key *nullkey_base_key(ssh_key *key);
|
||||
bool nullkey_variable_size_no(const ssh_keyalg *self);
|
||||
bool nullkey_variable_size_yes(const ssh_keyalg *self);
|
||||
|
||||
/* Utility functions implemented centrally */
|
||||
ssh_key *ssh_key_clone(ssh_key *key);
|
||||
|
Reference in New Issue
Block a user