=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/authfile.c,v retrieving revision 1.140 retrieving revision 1.141 diff -u -r1.140 -r1.141 --- src/usr.bin/ssh/authfile.c 2020/04/17 07:15:11 1.140 +++ src/usr.bin/ssh/authfile.c 2020/06/18 23:33:38 1.141 @@ -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. * @@ -258,7 +258,7 @@ sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp) { char *pubfile = NULL; - int r; + int r, oerrno; if (keyp != NULL) *keyp = NULL; @@ -278,8 +278,14 @@ 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; }