1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-13 18:43:52 -05:00
Simon Tatham f133abe521 Give a sensible error when using a too-short RSA key.
The ssh_signkey vtable has grown a new method ssh_key_invalid(), which
checks whether the key is going to be usable for constructing a
signature at all. Currently the only way this can fail is if it's an
RSA key so short that there isn't room to put all the PKCS#1
formatting in the signature preimage integer, but the return value is
an arbitrary error message just in case more reasons are needed later.

This is tested separately rather than at key-creation time because of
the signature flags system: an RSA key of intermediate length could be
valid for SHA-1 signing but not for SHA-512. So really this method
should be called at the point where you've decided what sig flags you
want to use, and you're checking if _those flags_ are OK.

On the verification side, there's no need for a separate check. If
someone presents us with an RSA key so short that it's impossible to
encode a valid signature using it, then we simply regard all
signatures as invalid.
2019-02-10 09:05:47 +00:00
..
2018-12-01 17:04:44 +00:00
2018-12-01 17:04:44 +00:00
2019-02-06 21:46:10 +00:00
2019-02-06 21:46:10 +00:00
2019-02-06 21:46:10 +00:00
2019-02-06 21:46:10 +00:00
2018-11-03 13:45:00 +00:00