[ssh_x509] [PATCH] fix segfault reading known_hosts file with X509 key

ssh_x509 at roumenpetrov.info ssh_x509 at roumenpetrov.info
Fri Sep 16 08:55:38 EEST 2016

Many thanks for note!

New variable ep is used also for protocol2 keys after commit "improve 
sshkey_read() semantics; only update *cpp when a key is successfully 
read;" . This improvements is part of OpenSSH v 7.2.

Work-around in known host instead "distinguished name" (as recommended) 
to be used certificate, i.e. pub-key.

ssh_x509 at roumenpetrov.info wrote:
> Apparently the attachment got stripped?
> Here is a link to the relevant patch.
> https://gitweb.gentoo.org/repo/gentoo.git/diff/net-misc/openssh/files/openssh-7.3_p1-fix-segfault-with-x509.patch

The patch show correction in method sshkey_read and lines 1237.||
In PKIX_SSH method is renamed to sshkey_read_pkalg and line should be 
1525, i.e. expected diff is to start with line 1521(1522).

Path avoid crash but is not functionally correct - new variable "ep" 
should point to end of parsed part of line.

Very soon is will provide new release.

> On Mon, Sep 12, 2016 at 8:30 PM,<ssh_x509 at roumenpetrov.info>  wrote:
>> When an X509 host key existed in known_hosts, and one connected to the
>> host, ssh segfaults due to and uninitialized variable. This fixes the
>> problem by initializing the variable.

I wonder why does not fail in my builds.


Get SSH with X.509 certificate support

More information about the ssh_x509 mailing list