mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Add some missing bounds checks in signature verification routines.
[originally from svn r9978]
This commit is contained in:
parent
e01104f899
commit
6184e9f95d
3
sshdss.c
3
sshdss.c
@ -72,6 +72,9 @@ static Bignum get160(char **data, int *datalen)
|
|||||||
{
|
{
|
||||||
Bignum b;
|
Bignum b;
|
||||||
|
|
||||||
|
if (*datalen < 20)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
b = bignum_from_bytes((unsigned char *)*data, 20);
|
b = bignum_from_bytes((unsigned char *)*data, 20);
|
||||||
*data += 20;
|
*data += 20;
|
||||||
*datalen -= 20;
|
*datalen -= 20;
|
||||||
|
2
sshrsa.c
2
sshrsa.c
@ -842,6 +842,8 @@ static int rsa2_verifysig(void *key, char *sig, int siglen,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
in = getmp(&sig, &siglen);
|
in = getmp(&sig, &siglen);
|
||||||
|
if (!in)
|
||||||
|
return 0;
|
||||||
out = modpow(in, rsa->exponent, rsa->modulus);
|
out = modpow(in, rsa->exponent, rsa->modulus);
|
||||||
freebn(in);
|
freebn(in);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user