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

Replace some 'sfree' calls of bignums with the proper 'freebn'.

[originally from svn r9979]
This commit is contained in:
Simon Tatham 2013-08-02 06:28:00 +00:00
parent 6184e9f95d
commit 2e0723e9ef
2 changed files with 9 additions and 15 deletions

View File

@ -433,11 +433,11 @@ static void *dss_openssh_createkey(unsigned char **blob, int *len)
dss->x = getmp(b, len);
if (!dss->p || !dss->q || !dss->g || !dss->y || !dss->x) {
sfree(dss->p);
sfree(dss->q);
sfree(dss->g);
sfree(dss->y);
sfree(dss->x);
freebn(dss->p);
freebn(dss->q);
freebn(dss->g);
freebn(dss->y);
freebn(dss->x);
sfree(dss);
return NULL;
}

View File

@ -415,7 +415,7 @@ int rsa_verify(struct RSAKey *key)
ed = modmul(key->exponent, key->private_exponent, pm1);
freebn(pm1);
cmp = bignum_cmp(ed, One);
sfree(ed);
freebn(ed);
if (cmp != 0)
return 0;
@ -424,7 +424,7 @@ int rsa_verify(struct RSAKey *key)
ed = modmul(key->exponent, key->private_exponent, qm1);
freebn(qm1);
cmp = bignum_cmp(ed, One);
sfree(ed);
freebn(ed);
if (cmp != 0)
return 0;
@ -450,7 +450,7 @@ int rsa_verify(struct RSAKey *key)
*/
n = modmul(key->iqmp, key->q, key->p);
cmp = bignum_cmp(n, One);
sfree(n);
freebn(n);
if (cmp != 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 ||
!rsa->iqmp || !rsa->p || !rsa->q) {
sfree(rsa->modulus);
sfree(rsa->exponent);
sfree(rsa->private_exponent);
sfree(rsa->iqmp);
sfree(rsa->p);
sfree(rsa->q);
sfree(rsa);
rsa2_freekey(rsa);
return NULL;
}