summaryrefslogtreecommitdiff
path: root/authfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/authfile.c b/authfile.c
index 35ccf576c..946f50ca8 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfile.c,v 1.140 2020/04/17 07:15:11 djm Exp $ */ 1/* $OpenBSD: authfile.c,v 1.141 2020/06/18 23:33:38 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved.
4 * 4 *
@@ -263,7 +263,7 @@ int
263sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp) 263sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp)
264{ 264{
265 char *pubfile = NULL; 265 char *pubfile = NULL;
266 int r; 266 int r, oerrno;
267 267
268 if (keyp != NULL) 268 if (keyp != NULL)
269 *keyp = NULL; 269 *keyp = NULL;
@@ -283,8 +283,14 @@ sshkey_load_public(const char *filename, struct sshkey **keyp, char **commentp)
283 if ((r = sshkey_load_pubkey_from_private(filename, keyp)) == 0) 283 if ((r = sshkey_load_pubkey_from_private(filename, keyp)) == 0)
284 goto out; 284 goto out;
285 285
286 /* Pretend we couldn't find the key */
287 r = SSH_ERR_SYSTEM_ERROR;
288 errno = ENOENT;
289
286 out: 290 out:
291 oerrno = errno;
287 free(pubfile); 292 free(pubfile);
293 errno = oerrno;
288 return r; 294 return r;
289} 295}
290 296