1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Add some missing bounds checks in signature verification routines.

[originally from svn r9978]
This commit is contained in:
Simon Tatham 2013-08-02 06:27:56 +00:00
parent e01104f899
commit 6184e9f95d
2 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,9 @@ static Bignum get160(char **data, int *datalen)
{
Bignum b;
if (*datalen < 20)
return NULL;
b = bignum_from_bytes((unsigned char *)*data, 20);
*data += 20;
*datalen -= 20;

View File

@ -842,6 +842,8 @@ static int rsa2_verifysig(void *key, char *sig, int siglen,
return 0;
}
in = getmp(&sig, &siglen);
if (!in)
return 0;
out = modpow(in, rsa->exponent, rsa->modulus);
freebn(in);