Skip to content

Commit

Permalink
upstream: avoid spurious "Unable to load host key" message when
Browse files Browse the repository at this point in the history
sshd can load a private key but no public counterpart; with & ok markus@

OpenBSD-Commit-ID: 0713cbdf9aa1ff8ac7b1f78b09ac911af510f81b
  • Loading branch information
djmdjm authored and daztucker committed Jun 19, 2020
1 parent 7fafaeb commit c514f3c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions authfile.c
@@ -1,4 +1,4 @@
/* $OpenBSD: authfile.c,v 1.140 2020/04/17 07:15:11 djm Exp $ */
/* $OpenBSD: authfile.c,v 1.141 2020/06/18 23:33:38 djm Exp $ */
/*
* Copyright (c) 2000, 2013 Markus Friedl. All rights reserved.
*
Expand Down Expand Up @@ -263,7 +263,7 @@ int
sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp)
{
char *pubfile = NULL;
int r;
int r, oerrno;

if (keyp != NULL)
*keyp = NULL;
Expand All @@ -283,8 +283,14 @@ sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp)
if ((r = sshkey_load_pubkey_from_private(filename, keyp)) == 0)
goto out;

/* Pretend we couldn't find the key */
r = SSH_ERR_SYSTEM_ERROR;
errno = ENOENT;

out:
oerrno = errno;
free(pubfile);
errno = oerrno;
return r;
}

Expand Down

0 comments on commit c514f3c

Please sign in to comment.