projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Invent a win_strerror() function which behaves as much like Unix
[u/mdw/putty]
/
sshdss.c
diff --git
a/sshdss.c
b/sshdss.c
index
6cf5830
..
532c13f
100644
(file)
--- a/
sshdss.c
+++ b/
sshdss.c
@@
-42,7
+42,9
@@
static void getstring(char **data, int *datalen, char **p, int *length)
*p = NULL;
if (*datalen < 4)
return;
*p = NULL;
if (*datalen < 4)
return;
- *length = GET_32BIT(*data);
+ *length = toint(GET_32BIT(*data));
+ if (*length < 0)
+ return;
*datalen -= 4;
*data += 4;
if (*datalen < *length)
*datalen -= 4;
*data += 4;
if (*datalen < *length)
@@
-98,7
+100,7
@@
static void *dss_newkey(char *data, int len)
}
#endif
}
#endif
- if (!p || memcmp(p, "ssh-dss", 7)) {
+ if (!p ||
slen != 7 ||
memcmp(p, "ssh-dss", 7)) {
sfree(dss);
return NULL;
}
sfree(dss);
return NULL;
}
@@
-287,6
+289,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);
@@
-402,6
+406,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);