summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--ssh-keygen.c34
2 files changed, 24 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 869efec65..cd3193ae3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,10 @@
20 - stevesk@cvs.openbsd.org 2002/02/16 14:53:37 20 - stevesk@cvs.openbsd.org 2002/02/16 14:53:37
21 [ssh-keygen.1] 21 [ssh-keygen.1]
22 -t required now for key generation 22 -t required now for key generation
23 - stevesk@cvs.openbsd.org 2002/02/16 20:40:08
24 [ssh-keygen.c]
25 default to rsa keyfile path for non key generation operations where
26 keyfile not specified. fixes core dump in those cases. ok markus@
23 27
2420020218 2820020218
25 - (tim) newer config.guess from ftp://ftp.gnu.org/gnu/config/config.guess 29 - (tim) newer config.guess from ftp://ftp.gnu.org/gnu/config/config.guess
@@ -7617,4 +7621,4 @@
7617 - Wrote replacements for strlcpy and mkdtemp 7621 - Wrote replacements for strlcpy and mkdtemp
7618 - Released 1.0pre1 7622 - Released 1.0pre1
7619 7623
7620$Id: ChangeLog,v 1.1859 2002/02/19 04:22:07 djm Exp $ 7624$Id: ChangeLog,v 1.1860 2002/02/19 04:22:47 djm Exp $
diff --git a/ssh-keygen.c b/ssh-keygen.c
index def487eea..ddd03ff5d 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: ssh-keygen.c,v 1.91 2002/01/18 18:14:17 stevesk Exp $"); 15RCSID("$OpenBSD: ssh-keygen.c,v 1.92 2002/02/16 20:40:08 stevesk Exp $");
16 16
17#include <openssl/evp.h> 17#include <openssl/evp.h>
18#include <openssl/pem.h> 18#include <openssl/pem.h>
@@ -90,21 +90,25 @@ ask_filename(struct passwd *pw, const char *prompt)
90 char buf[1024]; 90 char buf[1024];
91 char *name = NULL; 91 char *name = NULL;
92 92
93 switch (key_type_from_name(key_type_name)) { 93 if (key_type_name == NULL)
94 case KEY_RSA1:
95 name = _PATH_SSH_CLIENT_IDENTITY;
96 break;
97 case KEY_DSA:
98 name = _PATH_SSH_CLIENT_ID_DSA;
99 break;
100 case KEY_RSA:
101 name = _PATH_SSH_CLIENT_ID_RSA; 94 name = _PATH_SSH_CLIENT_ID_RSA;
102 break; 95 else
103 default: 96 switch (key_type_from_name(key_type_name)) {
104 fprintf(stderr, "bad key type"); 97 case KEY_RSA1:
105 exit(1); 98 name = _PATH_SSH_CLIENT_IDENTITY;
106 break; 99 break;
107 } 100 case KEY_DSA:
101 name = _PATH_SSH_CLIENT_ID_DSA;
102 break;
103 case KEY_RSA:
104 name = _PATH_SSH_CLIENT_ID_RSA;
105 break;
106 default:
107 fprintf(stderr, "bad key type");
108 exit(1);
109 break;
110 }
111
108 snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir, name); 112 snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir, name);
109 fprintf(stderr, "%s (%s): ", prompt, identity_file); 113 fprintf(stderr, "%s (%s): ", prompt, identity_file);
110 fflush(stderr); 114 fflush(stderr);