X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=cmdgen.c;h=12e1ac9e19e31822e5d16f8095e982c21f37990b;hb=2eb952ca31aa13d1f6f429305fbb6f43a9a28c56;hp=c1f3a8cb96e03d29bd1a4c85351cf4981545c7bf;hpb=870ad6ab0780c68e0e71d1a14d394aa543a8b89e;p=PuTTY.git diff --git a/cmdgen.c b/cmdgen.c index c1f3a8cb..12e1ac9e 100644 --- a/cmdgen.c +++ b/cmdgen.c @@ -91,7 +91,7 @@ static void no_progress(void *param, int action, int phase, int iprogress) { } -void modalfatalbox(char *p, ...) +void modalfatalbox(const char *p, ...) { va_list ap; fprintf(stderr, "FATAL ERROR: "); @@ -102,7 +102,7 @@ void modalfatalbox(char *p, ...) cleanup_exit(1); } -void nonfatal(char *p, ...) +void nonfatal(const char *p, ...) { va_list ap; fprintf(stderr, "ERROR: "); @@ -152,7 +152,8 @@ void help(void) showversion(); usage(FALSE); fprintf(stderr, - " -t specify key type when generating (rsa, dsa, rsa1)\n" + " -t specify key type when generating (ed25519, ecdsa, rsa, " + "dsa, rsa1)\n" " -b specify number of bits when generating key\n" " -C change or specify key comment\n" " -P change key passphrase\n" @@ -659,13 +660,7 @@ int main(int argc, char **argv) ec_generate(ec, bits, progressfn, &prog); ssh2key = snew(struct ssh2_userkey); ssh2key->data = ec; - if (bits == 256) { - ssh2key->alg = &ssh_ecdsa_nistp256; - } else if (bits == 384) { - ssh2key->alg = &ssh_ecdsa_nistp384; - } else { - ssh2key->alg = &ssh_ecdsa_nistp521; - } + ssh2key->alg = ec->signalg; ssh1key = NULL; } else if (keytype == ED25519) { struct ec_key *ec = snew(struct ec_key);