~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace some 'sfree' calls of bignums with the proper 'freebn'.
[sgt/putty]
/
sshdss.c
diff --git
a/sshdss.c
b/sshdss.c
index
0484c44
..
6487d75
100644
(file)
--- a/
sshdss.c
+++ b/
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);
*data += 20;
*datalen -= 20;
b = bignum_from_bytes((unsigned char *)*data, 20);
*data += 20;
*datalen -= 20;
@@
-289,6
+292,8
@@
static int dss_verifysig(void *key, char *sig, int siglen,
freebn(w);
freebn(sha);
freebn(w);
freebn(sha);
+ freebn(u1);
+ freebn(u2);
freebn(gu1p);
freebn(yu2p);
freebn(gu1yu2p);
freebn(gu1p);
freebn(yu2p);
freebn(gu1yu2p);
@@
-404,6
+409,7
@@
static void *dss_createkey(unsigned char *pub_blob, int pub_len,
ytest = modpow(dss->g, dss->x, dss->p);
if (0 != bignum_cmp(ytest, dss->y)) {
dss_freekey(dss);
ytest = modpow(dss->g, dss->x, dss->p);
if (0 != bignum_cmp(ytest, dss->y)) {
dss_freekey(dss);
+ freebn(ytest);
return NULL;
}
freebn(ytest);
return NULL;
}
freebn(ytest);
@@
-427,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) {
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;
}
sfree(dss);
return NULL;
}