- stevesk@cvs.openbsd.org 2002/02/16 20:40:08
[ssh-keygen.c] default to rsa keyfile path for non key generation operations where keyfile not specified. fixes core dump in those cases. ok markus@
This commit is contained in:
parent
55fafa09f2
commit
993dd55094
|
@ -20,6 +20,10 @@
|
||||||
- stevesk@cvs.openbsd.org 2002/02/16 14:53:37
|
- stevesk@cvs.openbsd.org 2002/02/16 14:53:37
|
||||||
[ssh-keygen.1]
|
[ssh-keygen.1]
|
||||||
-t required now for key generation
|
-t required now for key generation
|
||||||
|
- stevesk@cvs.openbsd.org 2002/02/16 20:40:08
|
||||||
|
[ssh-keygen.c]
|
||||||
|
default to rsa keyfile path for non key generation operations where
|
||||||
|
keyfile not specified. fixes core dump in those cases. ok markus@
|
||||||
|
|
||||||
20020218
|
20020218
|
||||||
- (tim) newer config.guess from ftp://ftp.gnu.org/gnu/config/config.guess
|
- (tim) newer config.guess from ftp://ftp.gnu.org/gnu/config/config.guess
|
||||||
|
@ -7617,4 +7621,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1859 2002/02/19 04:22:07 djm Exp $
|
$Id: ChangeLog,v 1.1860 2002/02/19 04:22:47 djm Exp $
|
||||||
|
|
34
ssh-keygen.c
34
ssh-keygen.c
|
@ -12,7 +12,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: ssh-keygen.c,v 1.91 2002/01/18 18:14:17 stevesk Exp $");
|
RCSID("$OpenBSD: ssh-keygen.c,v 1.92 2002/02/16 20:40:08 stevesk Exp $");
|
||||||
|
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/pem.h>
|
#include <openssl/pem.h>
|
||||||
|
@ -90,21 +90,25 @@ ask_filename(struct passwd *pw, const char *prompt)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char *name = NULL;
|
char *name = NULL;
|
||||||
|
|
||||||
switch (key_type_from_name(key_type_name)) {
|
if (key_type_name == NULL)
|
||||||
case KEY_RSA1:
|
|
||||||
name = _PATH_SSH_CLIENT_IDENTITY;
|
|
||||||
break;
|
|
||||||
case KEY_DSA:
|
|
||||||
name = _PATH_SSH_CLIENT_ID_DSA;
|
|
||||||
break;
|
|
||||||
case KEY_RSA:
|
|
||||||
name = _PATH_SSH_CLIENT_ID_RSA;
|
name = _PATH_SSH_CLIENT_ID_RSA;
|
||||||
break;
|
else
|
||||||
default:
|
switch (key_type_from_name(key_type_name)) {
|
||||||
fprintf(stderr, "bad key type");
|
case KEY_RSA1:
|
||||||
exit(1);
|
name = _PATH_SSH_CLIENT_IDENTITY;
|
||||||
break;
|
break;
|
||||||
}
|
case KEY_DSA:
|
||||||
|
name = _PATH_SSH_CLIENT_ID_DSA;
|
||||||
|
break;
|
||||||
|
case KEY_RSA:
|
||||||
|
name = _PATH_SSH_CLIENT_ID_RSA;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fprintf(stderr, "bad key type");
|
||||||
|
exit(1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir, name);
|
snprintf(identity_file, sizeof(identity_file), "%s/%s", pw->pw_dir, name);
|
||||||
fprintf(stderr, "%s (%s): ", prompt, identity_file);
|
fprintf(stderr, "%s (%s): ", prompt, identity_file);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
Loading…
Reference in New Issue