summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2012-04-22 11:07:28 +1000
committerDamien Miller <djm@mindrot.org>2012-04-22 11:07:28 +1000
commita563cced062d0d74843c0ee56a82faa860f10855 (patch)
tree84fe5ca40a6f535fdcb73562a4733258245a4e48
parentd5dacb43fa30c2f6d7eebbd4c5fcf906c3b5d5d8 (diff)
- 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@
-rw-r--r--ChangeLog6
-rw-r--r--ssh-keygen.c12
2 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5df76186..179d3b50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 5fcd3a15..c5130c86 100644
--- a/ssh-keygen.c
+++ b/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: