Bug 1722285 - ssh-keygen does not generate PEM formatted keys
Summary: ssh-keygen does not generate PEM formatted keys
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 30
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-19 22:03 UTC by Sam Doran
Modified: 2019-07-27 01:39 UTC (History)
8 users (show)

Fixed In Version: openssh-8.0p1-5.fc30
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-27 01:39:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Sam Doran 2019-06-19 22:03:55 UTC
Description of problem:
Running ssh-keygen with -m PEM does not generate a key in PEM format.


Version-Release number of selected component (if applicable):
openssh-8.0p1-4


How reproducible:
Every time


Steps to Reproduce:
1. Run ssh-keygen -t rsa -N '' -m PEM -q -f ~/.ssh/format_pem
2. Inspect the ASN.1 structure of the key


Actual results:
The generated key is not PEM formatted.


Expected results:
The generated key to be PEM formatted


Additional info:
Here are some example keys generated on different versions of Fedora and openssh.

https://gist.github.com/samdoran/0386c19d50aab9886d72f7844fce2494

Comment 1 Jakub Jelen 2019-06-20 07:55:53 UTC
It is not the "traditional" legacy PEM format (requiring the use of MD5 and other ancient stuff), but the standard PKCS #8 PEM format. This is not a bug, but feature.

Comment 2 Luigi Toscano 2019-07-22 17:16:57 UTC
But then this change broke paramiko, which does not support yet the new format:

https://github.com/paramiko/paramiko/issues/602
https://github.com/paramiko/paramiko/blob/master/paramiko/pkey.py#L285

I know that it is annoying and newer security standard are better, but can you please reconsider this decision?

Comment 3 Jakub Jelen 2019-07-23 07:07:14 UTC
The upstream modified my proposed patch to support both formats [1], which is probably even better. I will change this to match upstream behavior:

https://bugzilla.mindrot.org/show_bug.cgi?id=3013

I am sorry for an inconvenience.

Comment 4 Fedora Update System 2019-07-23 09:03:36 UTC
FEDORA-2019-d3dfcbf0f0 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-d3dfcbf0f0

Comment 5 Fedora Update System 2019-07-24 01:44:24 UTC
openssh-8.0p1-5.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-d3dfcbf0f0

Comment 6 Fedora Update System 2019-07-27 01:39:44 UTC
openssh-8.0p1-5.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.