summaryrefslogtreecommitdiffstats
path: root/sshsig.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2023-03-30 05:05:01 +0200
committerDarren Tucker <dtucker@dtucker.net>2023-03-30 05:09:51 +0200
commit34ee842cdd981a759fe8f0d4a37521f9a1c63170 (patch)
tree3b6b9e32324707b361178cc1d233b11b1fb1326b /sshsig.c
parentupstream: Remove dead code from inside if block. (diff)
downloadopenssh-34ee842cdd981a759fe8f0d4a37521f9a1c63170.tar.xz
openssh-34ee842cdd981a759fe8f0d4a37521f9a1c63170.zip
upstream: return SSH_ERR_KEY_NOT_FOUND if the allowed_signers file
is empty, not SSH_ERR_INTERNAL_ERROR. Also remove some dead code spotted by Coverity; with/ok dtucker@ OpenBSD-Commit-ID: 898a1e817cda9869554b1f586a434f67bcc3b650
Diffstat (limited to 'sshsig.c')
-rw-r--r--sshsig.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sshsig.c b/sshsig.c
index eb2a931e9..8c906f525 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshsig.c,v 1.30 2022/08/19 03:06:30 djm Exp $ */
+/* $OpenBSD: sshsig.c,v 1.31 2023/03/30 03:05:01 djm Exp $ */
/*
* Copyright (c) 2019 Google LLC
*
@@ -977,7 +977,7 @@ sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key,
char *line = NULL;
size_t linesize = 0;
u_long linenum = 0;
- int r = SSH_ERR_INTERNAL_ERROR, oerrno;
+ int r = SSH_ERR_KEY_NOT_FOUND, oerrno;
/* Check key and principal against file */
if ((f = fopen(path, "r")) == NULL) {
@@ -1007,7 +1007,7 @@ sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key,
/* Either we hit an error parsing or we simply didn't find the key */
fclose(f);
free(line);
- return r == 0 ? SSH_ERR_KEY_NOT_FOUND : r;
+ return r;
}
int