summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2020-01-24 00:00:31 +0000
committerDamien Miller <djm@mindrot.org>2020-01-25 11:27:29 +1100
commit8dfb6a202c96cdf037c8ce05e53e32e0e0b7b454 (patch)
tree8975fc68cd5c685fcf03102781859f8676aac57e /ssh-keygen.c
parent72a8bea2d748c8bd7f076a8b39a52082c79ae95f (diff)
upstream: allow PEM export of DSA and ECDSA keys; bz3091, patch
from Jakub Jelen ok markus@ OpenBSD-Commit-ID: a58edec8b9f07acab4b962a71a5125830d321b51
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 363da70db..564c3c481 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.388 2020/01/23 23:31:52 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.389 2020/01/24 00:00:31 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -402,6 +402,14 @@ do_convert_to_pem(struct sshkey *k)
402 if (!PEM_write_RSAPublicKey(stdout, k->rsa)) 402 if (!PEM_write_RSAPublicKey(stdout, k->rsa))
403 fatal("PEM_write_RSAPublicKey failed"); 403 fatal("PEM_write_RSAPublicKey failed");
404 break; 404 break;
405 case KEY_DSA:
406 if (!PEM_write_DSA_PUBKEY(stdout, k->dsa))
407 fatal("PEM_write_DSA_PUBKEY failed");
408 break;
409 case KEY_ECDSA:
410 if (!PEM_write_EC_PUBKEY(stdout, k->ecdsa))
411 fatal("PEM_write_EC_PUBKEY failed");
412 break;
405 default: 413 default:
406 fatal("%s: unsupported key type %s", __func__, sshkey_type(k)); 414 fatal("%s: unsupported key type %s", __func__, sshkey_type(k));
407 } 415 }