Skip to content

Commit

Permalink
upstream: return SSH_ERR_KEY_NOT_FOUND if the allowed_signers file
Browse files Browse the repository at this point in the history
is empty, not SSH_ERR_INTERNAL_ERROR. Also remove some dead code spotted
by Coverity; with/ok dtucker@

OpenBSD-Commit-ID: 898a1e817cda9869554b1f586a434f67bcc3b650
  • Loading branch information
djmdjm authored and daztucker committed Mar 30, 2023
1 parent f108e77 commit 34ee842
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sshsig.c
Original file line number Diff line number Diff line change
@@ -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
*
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 34ee842

Please sign in to comment.