public blob, and return a proper error in that situation rather than a
struct with unhelpful NULLs in.
git-svn-id: http://svn.tartarus.org/sgt/putty@9991
cda61777-01e9-0310-a592-
d414129be87e
return b;
}
+static void rsa2_freekey(void *key); /* forward reference */
+
static void *rsa2_newkey(char *data, int len)
{
char *p;
rsa->p = rsa->q = rsa->iqmp = NULL;
rsa->comment = NULL;
+ if (!rsa->exponent || !rsa->modulus) {
+ rsa2_freekey(rsa);
+ return NULL;
+ }
+
return rsa;
}