Bug 2570 - ssh-keygen -p will convert openssh-format keyfiles back to RFC4716 format, improperly?
Summary: ssh-keygen -p will convert openssh-format keyfiles back to RFC4716 format, im...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-keygen (show other bugs)
Version: 7.2p1
Hardware: All Linux
: P5 normal
Assignee: Oliver Ford
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-23 10:31 AEST by Noah Friedman
Modified: 2021-03-04 09:51 AEDT (History)
1 user (show)

See Also:


Attachments
shell session log (3.40 KB, text/x-log)
2016-05-23 10:31 AEST, Noah Friedman
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noah Friedman 2016-05-23 10:31:59 AEST
Created attachment 2816 [details]
shell session log

OS: Fedora 23 x86_64

In the attached session log, I created an ecdsa key in pem format with no password.  I then use "ssh-keygen -p" to change the password (but actually keep choosing to blank it) but add "-o" to convert the file to the new openssh format.  After I run ssh-keygen -p again to convert the file back to pem format, the contents of the file has changed drastically and ssh-add can no longer read it.

This behavior occurs with ssh 6.9p1 or ssh 7.2p2 whenever it runs against openssl 1.0.2 shared libs.  When run against openssl 1.0.1 shared libs, the last pem-format key file can still be loaded.

In my real usage I had a passphrase on my keys.  For the purpose of this test I used a blank password, but I get the same behavior with or without a password.

I don't know if the problem is that the openssh->pem conversion is buggy or if there is an API breakage between openssl 1.0.1 and 1.0.2.
Comment 1 Noah Friedman 2016-05-23 10:37:27 AEST
In my previous comment, wherever I said "pem", pleaes substitute "RFC4716"
Comment 2 Oliver Ford 2020-03-07 02:31:30 AEDT
Still appears to be an issue with latest build, investigating.
Comment 3 Oliver Ford 2020-03-08 03:31:49 AEDT
Fixed in latest version
Comment 4 Damien Miller 2021-03-04 09:51:41 AEDT
close bugs that were resolved in OpenSSH 8.5 release cycle