projects
/
u
/
mdw
/
putty
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de81309
)
Spot when we didn't successfully create an RSA public key from a
author
simon
<simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 4 Aug 2013 19:34:10 +0000
(19:34 +0000)
committer
simon
<simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 4 Aug 2013 19:34:10 +0000
(19:34 +0000)
public blob, and return a proper error in that situation rather than a
struct with unhelpful NULLs in.
git-svn-id: svn://svn.tartarus.org/sgt/putty@9991
cda61777
-01e9-0310-a592-
d414129be87e
sshrsa.c
patch
|
blob
|
blame
|
history
diff --git
a/sshrsa.c
b/sshrsa.c
index
fb0bcaa
..
4ec95f2
100644
(file)
--- a/
sshrsa.c
+++ b/
sshrsa.c
@@
-561,6
+561,8
@@
static Bignum getmp(char **data, int *datalen)
return b;
}
+static void rsa2_freekey(void *key); /* forward reference */
+
static void *rsa2_newkey(char *data, int len)
{
char *p;
@@
-580,6
+582,11
@@
static void *rsa2_newkey(char *data, int len)
rsa->p = rsa->q = rsa->iqmp = NULL;
rsa->comment = NULL;
+ if (!rsa->exponent || !rsa->modulus) {
+ rsa2_freekey(rsa);
+ return NULL;
+ }
+
return rsa;
}