On Wed, May 26, 2021 at 10:26:00AM +1000, Damien Miller wrote:
> 
> On Sat, 22 May 2021, James Cook wrote:
> 
> > >Synopsis:  ssh segfault: hostkeys_check_old passes NULL to sshkey_ssh_name
> > >Category:  user
> > >Environment:
> >     System      : OpenBSD 6.9
> >     Details     : OpenBSD 6.9-current (GENERIC.MP) #28: Wed May 19 16:59:40 
> > MDT 2021
> >                      
> > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > 
> >     Architecture: OpenBSD.amd64
> >     Machine     : amd64
> > >Description:
> >     I see a segfault ssh-ing to one of my computers:
> > 
> >     falsifian moth ~ $ ssh james@angel 
> >     no such identity: /home/falsifian/.ssh/unencrypted_id_rsa: No such file 
> > or directory
> >     (james@angel) Password: 
> >     Segmentation fault (core dumped)
> 
> Thanks for the very detailed report. Please try this:
> 
> diff --git a/clientloop.c b/clientloop.c
> index 33a43ba..3716dc0 100644
> --- a/clientloop.c
> +++ b/clientloop.c
> @@ -1938,7 +1938,7 @@ hostkeys_check_old(struct hostkey_foreach_line *l, void 
> *_ctx)
>               if (!sshkey_equal(l->key, ctx->old_keys[i]))
>                       continue;
>               debug3_f("found deprecated %s key at %s:%ld as %s",
> -                 sshkey_ssh_name(ctx->keys[i]), l->path, l->linenum,
> +                 sshkey_ssh_name(ctx->old_keys[i]), l->path, l->linenum,
>                   hashed ? "[HASHED]" : l->hosts);
>               ctx->old_key_seen = 1;
>               break;

I've been running with exactly that change since I filed the report,
and I haven't had any trouble. In particular I was able to successfully
connect to the host that caused the problem in the first place.

-- 
James

Reply via email to