diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2020-01-24 00:00:32 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2020-01-24 00:00:32 +0000 |
commit | 587aaff1c740a2285a9c32a9165266e678300eb1 (patch) | |
tree | f662e3e26dab489866e63cfbead173bd52624f3d /usr.bin/ssh/ssh-keygen.c | |
parent | dda975ab70c6afd5b4406a72f736283b62b0633f (diff) |
allow PEM export of DSA and ECDSA keys; bz3091, patch from Jakub Jelen
ok markus@
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r-- | usr.bin/ssh/ssh-keygen.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c index 412b3031591..25ca9973d60 100644 --- a/usr.bin/ssh/ssh-keygen.c +++ b/usr.bin/ssh/ssh-keygen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-keygen.c,v 1.388 2020/01/23 23:31:52 djm Exp $ */ +/* $OpenBSD: ssh-keygen.c,v 1.389 2020/01/24 00:00:31 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -388,6 +388,14 @@ do_convert_to_pem(struct sshkey *k) if (!PEM_write_RSAPublicKey(stdout, k->rsa)) fatal("PEM_write_RSAPublicKey failed"); break; + case KEY_DSA: + if (!PEM_write_DSA_PUBKEY(stdout, k->dsa)) + fatal("PEM_write_DSA_PUBKEY failed"); + break; + case KEY_ECDSA: + if (!PEM_write_EC_PUBKEY(stdout, k->ecdsa)) + fatal("PEM_write_EC_PUBKEY failed"); + break; default: fatal("%s: unsupported key type %s", __func__, sshkey_type(k)); } |