1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

When manually initialising a 'struct RSAKey' due to loading an SSH1

public key but not the private half, NULL out all the CRT-optimisation
fields as well as the private exponent pointer. Otherwise segfaults -
security-harmless, but annoying - can happen in freersakey() when we
notice they aren't null and try to free them.

[originally from svn r9705]
This commit is contained in:
Simon Tatham 2012-11-13 21:34:12 +00:00
parent 69113b16b1
commit 06b51312c1

View File

@ -763,6 +763,9 @@ int main(int argc, char **argv)
}
ssh1key->comment = dupstr(origcomment);
ssh1key->private_exponent = NULL;
ssh1key->p = NULL;
ssh1key->q = NULL;
ssh1key->iqmp = NULL;
} else {
ret = loadrsakey(infilename, ssh1key, passphrase, &error);
}