mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
Sanitise freeing of DSA keys.
[originally from svn r9984]
This commit is contained in:
parent
ba49faec3d
commit
8041377799
15
sshdss.c
15
sshdss.c
@ -111,6 +111,7 @@ static void *dss_newkey(char *data, int len)
|
|||||||
dss->q = getmp(&data, &len);
|
dss->q = getmp(&data, &len);
|
||||||
dss->g = getmp(&data, &len);
|
dss->g = getmp(&data, &len);
|
||||||
dss->y = getmp(&data, &len);
|
dss->y = getmp(&data, &len);
|
||||||
|
dss->x = NULL;
|
||||||
|
|
||||||
return dss;
|
return dss;
|
||||||
}
|
}
|
||||||
@ -118,10 +119,16 @@ static void *dss_newkey(char *data, int len)
|
|||||||
static void dss_freekey(void *key)
|
static void dss_freekey(void *key)
|
||||||
{
|
{
|
||||||
struct dss_key *dss = (struct dss_key *) key;
|
struct dss_key *dss = (struct dss_key *) key;
|
||||||
freebn(dss->p);
|
if (dss->p)
|
||||||
freebn(dss->q);
|
freebn(dss->p);
|
||||||
freebn(dss->g);
|
if (dss->q)
|
||||||
freebn(dss->y);
|
freebn(dss->q);
|
||||||
|
if (dss->g)
|
||||||
|
freebn(dss->g);
|
||||||
|
if (dss->y)
|
||||||
|
freebn(dss->y);
|
||||||
|
if (dss->x)
|
||||||
|
freebn(dss->x);
|
||||||
sfree(dss);
|
sfree(dss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user