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

cmdgen: refuse to generate RSA/DSA keys under 256 bits.

This replicates the existing error message in Windows PuTTYgen, on the
basis that keys smaller than that will actually fail to work with our
signing code.
This commit is contained in:
Simon Tatham 2016-03-30 11:41:11 +01:00
parent 2a47ac3ac5
commit 7f3c956ed1

View File

@ -515,6 +515,14 @@ int main(int argc, char **argv)
errs = TRUE;
}
if (keytype == RSA2 || keytype == RSA1 || keytype == DSA) {
if (bits < 256) {
fprintf(stderr, "puttygen: cannot generate %s keys shorter than"
" 256 bits\n", (keytype == DSA ? "DSA" : "RSA"));
errs = TRUE;
}
}
if (errs)
return 1;