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

Sanitise freeing of DSA keys.

[originally from svn r9984]
This commit is contained in:
Simon Tatham 2013-08-04 19:33:43 +00:00
parent ba49faec3d
commit 8041377799

View File

@ -111,6 +111,7 @@ static void *dss_newkey(char *data, int len)
dss->q = getmp(&data, &len);
dss->g = getmp(&data, &len);
dss->y = getmp(&data, &len);
dss->x = NULL;
return dss;
}
@ -118,10 +119,16 @@ static void *dss_newkey(char *data, int len)
static void dss_freekey(void *key)
{
struct dss_key *dss = (struct dss_key *) key;
freebn(dss->p);
freebn(dss->q);
freebn(dss->g);
freebn(dss->y);
if (dss->p)
freebn(dss->p);
if (dss->q)
freebn(dss->q);
if (dss->g)
freebn(dss->g);
if (dss->y)
freebn(dss->y);
if (dss->x)
freebn(dss->x);
sfree(dss);
}