mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Replace some 'sfree' calls of bignums with the proper 'freebn'.
[originally from svn r9979]
This commit is contained in:
parent
6184e9f95d
commit
2e0723e9ef
10
sshdss.c
10
sshdss.c
@ -433,11 +433,11 @@ static void *dss_openssh_createkey(unsigned char **blob, int *len)
|
|||||||
dss->x = getmp(b, len);
|
dss->x = getmp(b, len);
|
||||||
|
|
||||||
if (!dss->p || !dss->q || !dss->g || !dss->y || !dss->x) {
|
if (!dss->p || !dss->q || !dss->g || !dss->y || !dss->x) {
|
||||||
sfree(dss->p);
|
freebn(dss->p);
|
||||||
sfree(dss->q);
|
freebn(dss->q);
|
||||||
sfree(dss->g);
|
freebn(dss->g);
|
||||||
sfree(dss->y);
|
freebn(dss->y);
|
||||||
sfree(dss->x);
|
freebn(dss->x);
|
||||||
sfree(dss);
|
sfree(dss);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
14
sshrsa.c
14
sshrsa.c
@ -415,7 +415,7 @@ int rsa_verify(struct RSAKey *key)
|
|||||||
ed = modmul(key->exponent, key->private_exponent, pm1);
|
ed = modmul(key->exponent, key->private_exponent, pm1);
|
||||||
freebn(pm1);
|
freebn(pm1);
|
||||||
cmp = bignum_cmp(ed, One);
|
cmp = bignum_cmp(ed, One);
|
||||||
sfree(ed);
|
freebn(ed);
|
||||||
if (cmp != 0)
|
if (cmp != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ int rsa_verify(struct RSAKey *key)
|
|||||||
ed = modmul(key->exponent, key->private_exponent, qm1);
|
ed = modmul(key->exponent, key->private_exponent, qm1);
|
||||||
freebn(qm1);
|
freebn(qm1);
|
||||||
cmp = bignum_cmp(ed, One);
|
cmp = bignum_cmp(ed, One);
|
||||||
sfree(ed);
|
freebn(ed);
|
||||||
if (cmp != 0)
|
if (cmp != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -450,7 +450,7 @@ int rsa_verify(struct RSAKey *key)
|
|||||||
*/
|
*/
|
||||||
n = modmul(key->iqmp, key->q, key->p);
|
n = modmul(key->iqmp, key->q, key->p);
|
||||||
cmp = bignum_cmp(n, One);
|
cmp = bignum_cmp(n, One);
|
||||||
sfree(n);
|
freebn(n);
|
||||||
if (cmp != 0)
|
if (cmp != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -707,13 +707,7 @@ static void *rsa2_openssh_createkey(unsigned char **blob, int *len)
|
|||||||
|
|
||||||
if (!rsa->modulus || !rsa->exponent || !rsa->private_exponent ||
|
if (!rsa->modulus || !rsa->exponent || !rsa->private_exponent ||
|
||||||
!rsa->iqmp || !rsa->p || !rsa->q) {
|
!rsa->iqmp || !rsa->p || !rsa->q) {
|
||||||
sfree(rsa->modulus);
|
rsa2_freekey(rsa);
|
||||||
sfree(rsa->exponent);
|
|
||||||
sfree(rsa->private_exponent);
|
|
||||||
sfree(rsa->iqmp);
|
|
||||||
sfree(rsa->p);
|
|
||||||
sfree(rsa->q);
|
|
||||||
sfree(rsa);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user