mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-12-24 19:02:06 +00:00
- djm@cvs.openbsd.org 2012/02/29 11:21:26
[ssh-keygen.c] allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@
This commit is contained in:
parent
d5dacb43fa
commit
a563cced06
@ -1,3 +1,9 @@
|
||||
20120422
|
||||
- OpenBSD CVS Sync
|
||||
- djm@cvs.openbsd.org 2012/02/29 11:21:26
|
||||
[ssh-keygen.c]
|
||||
allow conversion of RSA1 keys to public PEM and PKCS8; "nice" markus@
|
||||
|
||||
20120420
|
||||
- (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
|
||||
[contrib/suse/openssh.spec] Update for release 6.0
|
||||
|
12
ssh-keygen.c
12
ssh-keygen.c
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ssh-keygen.c,v 1.212 2011/10/16 15:02:41 jmc Exp $ */
|
||||
/* $OpenBSD: ssh-keygen.c,v 1.213 2012/02/29 11:21:26 djm Exp $ */
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||
@ -265,6 +265,10 @@ do_convert_to_ssh2(struct passwd *pw, Key *k)
|
||||
u_char *blob;
|
||||
char comment[61];
|
||||
|
||||
if (k->type == KEY_RSA1) {
|
||||
fprintf(stderr, "version 1 keys are not supported\n");
|
||||
exit(1);
|
||||
}
|
||||
if (key_to_blob(k, &blob, &len) <= 0) {
|
||||
fprintf(stderr, "key_to_blob failed\n");
|
||||
exit(1);
|
||||
@ -288,6 +292,7 @@ static void
|
||||
do_convert_to_pkcs8(Key *k)
|
||||
{
|
||||
switch (key_type_plain(k->type)) {
|
||||
case KEY_RSA1:
|
||||
case KEY_RSA:
|
||||
if (!PEM_write_RSA_PUBKEY(stdout, k->rsa))
|
||||
fatal("PEM_write_RSA_PUBKEY failed");
|
||||
@ -312,6 +317,7 @@ static void
|
||||
do_convert_to_pem(Key *k)
|
||||
{
|
||||
switch (key_type_plain(k->type)) {
|
||||
case KEY_RSA1:
|
||||
case KEY_RSA:
|
||||
if (!PEM_write_RSAPublicKey(stdout, k->rsa))
|
||||
fatal("PEM_write_RSAPublicKey failed");
|
||||
@ -345,10 +351,6 @@ do_convert_to(struct passwd *pw)
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
if (k->type == KEY_RSA1) {
|
||||
fprintf(stderr, "version 1 keys are not supported\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
switch (convert_format) {
|
||||
case FMT_RFC4716:
|
||||
|
Loading…
Reference in New Issue
Block a user