summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
diff options
context:
space:
mode:
authorHai-May Chao <Hai-May.Chao@Sun.COM>2010-03-29 13:52:47 -0700
committerHai-May Chao <Hai-May.Chao@Sun.COM>2010-03-29 13:52:47 -0700
commite7b3b5cf9440e185b31e8fa6a8226e2bb510af5e (patch)
tree2e5d4e2210baf2d735a19801ca770a2b5ae70b53 /usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
parentfcdeb91bbce674703e2d1423c81e7155f4f13089 (diff)
downloadillumos-joyent-e7b3b5cf9440e185b31e8fa6a8226e2bb510af5e.tar.gz
6935239 ssh-keygen should generate 2048 bit RSA keys by default
Diffstat (limited to 'usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c')
-rw-r--r--usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c b/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
index 5d49c7fceb..ebad79b0f8 100644
--- a/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
+++ b/usr/src/cmd/ssh/ssh-keygen/ssh-keygen.c
@@ -34,7 +34,9 @@
#include "tildexpand.h"
/* Number of bits in the RSA/DSA key. This value can be set on the command line. */
-u_int32_t bits = 1024;
+#define DEFAULT_BITS_RSA 2048
+#define DEFAULT_BITS_DSA 1024
+u_int32_t bits = 0;
/*
* Flag indicating that we just want to change the passphrase. This can be
@@ -1081,6 +1083,9 @@ main(int argc, char **argv)
key_type_name);
exit(1);
}
+ if (bits == 0)
+ bits = (type == KEY_DSA) ? DEFAULT_BITS_DSA : DEFAULT_BITS_RSA;
+
if (!quiet)
printf(gettext("Generating public/private %s key pair.\n"),
key_type_name);