Skip to content

Commit 8514f78

Browse files
authored
change default keygen key type (#760)
* change default keygen key type * increase DEFAULT_BITS_ECDSA to 384 * change default key path to ECDSA
1 parent 41734eb commit 8514f78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ssh-keygen.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@
6767
#include "sk-api.h" /* XXX for SSH_SK_USER_PRESENCE_REQD; remove */
6868
#include "cipher.h"
6969

70+
#ifdef WINDOWS
71+
#define DEFAULT_KEY_TYPE_NAME "ecdsa"
72+
#else
7073
#define DEFAULT_KEY_TYPE_NAME "ed25519"
74+
#endif /* WINDOWS */
7175

7276
/*
7377
* Default number of bits in the RSA, DSA and ECDSA keys. These value can be
@@ -82,7 +86,11 @@
8286
*/
8387
#define DEFAULT_BITS 3072
8488
#define DEFAULT_BITS_DSA 1024
89+
#ifdef WINDOWS
90+
#define DEFAULT_BITS_ECDSA 384
91+
#else
8592
#define DEFAULT_BITS_ECDSA 256
93+
#endif /* WINDOWS */
8694

8795
static int quiet = 0;
8896

@@ -259,7 +267,11 @@ ask_filename(struct passwd *pw, const char *prompt)
259267
char *name = NULL;
260268

261269
if (key_type_name == NULL)
270+
#ifdef WINDOWS
271+
name = _PATH_SSH_CLIENT_ID_ECDSA;
272+
#else
262273
name = _PATH_SSH_CLIENT_ID_ED25519;
274+
#endif /* WINDOWS */
263275
else {
264276
switch (sshkey_type_from_name(key_type_name)) {
265277
#ifdef WITH_DSA

0 commit comments

Comments
 (0)