mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Tighten up a comparison in ssh2_userauth_add_sigblob.
If a malicious SSH agent were to send an RSA signature blob _longer_ than the key modulus while BUG_SSH2_RSA_PADDING was enabled, then it could DoS the client, because the put_padding call would keep allocating memory in 'strbuf *substr' until address space ran out.
This commit is contained in:
parent
f955300576
commit
4510a622ea
@ -1788,7 +1788,7 @@ static void ssh2_userauth_add_sigblob(
|
||||
/* debug("modulus length is %d\n", len); */
|
||||
/* debug("signature length is %d\n", siglen); */
|
||||
|
||||
if (mod_mp.len != sig_mp.len) {
|
||||
if (mod_mp.len > sig_mp.len) {
|
||||
strbuf *substr = strbuf_new();
|
||||
put_data(substr, sigblob.ptr, sig_prefix_len);
|
||||
put_uint32(substr, mod_mp.len);
|
||||
|
Loading…
Reference in New Issue
Block a user