summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c34
1 files changed, 19 insertions, 15 deletions
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);