1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-05 21:42:47 -05:00

More sensible error handling when we receive an SSH1 public key

modulus of zero (!!), and also a robustness fix in ssh1_rdpkt which
I happened to notice while debugging that.

[originally from svn r4516]
This commit is contained in:
Simon Tatham
2004-08-28 16:51:26 +00:00
parent 60b9bfe3fe
commit e2cd7e404e
2 changed files with 8 additions and 2 deletions

View File

@ -54,7 +54,7 @@ int makekey(unsigned char *data, int len, struct RSAKey *result,
}
n = ssh1_read_bignum(p, len, result ? &result->modulus : NULL);
if (n < 0) return -1;
if (n < 0 || bignum_bitcount(result->modulus) == 0) return -1;
if (result)
result->bytes = n - 2;
if (keystr)