]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - cmdgen.c
Update docs for Ed25519 and ChaCha20-Poly1305.
[PuTTY.git] / cmdgen.c
index c1f3a8cb96e03d29bd1a4c85351cf4981545c7bf..12e1ac9e19e31822e5d16f8095e982c21f37990b 100644 (file)
--- 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);