[openssh-commits] [openssh] 01/01: upstream: simplify sshsig_find_principals() similar to what happened to

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Apr 6 13:57:35 AEST 2023


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 484c5e6168fdb22cbcd73c4ff987cf9ca47989ca
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Thu Apr 6 03:56:02 2023 +0000

    upstream: simplify sshsig_find_principals() similar to what happened to
    
    sshsig_check_allowed_keys() in r1.31, removing some dead code
    
    OpenBSD-Commit-ID: a493e628d4d6c08f878c276d998f4313ba61702d
---
 sshsig.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/sshsig.c b/sshsig.c
index 8c906f52..854d6732 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshsig.c,v 1.31 2023/03/30 03:05:01 djm Exp $ */
+/* $OpenBSD: sshsig.c,v 1.32 2023/04/06 03:56:02 djm Exp $ */
 /*
  * Copyright (c) 2019 Google LLC
  *
@@ -1018,7 +1018,7 @@ sshsig_find_principals(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;
 
 	if ((f = fopen(path, "r")) == NULL) {
 		oerrno = errno;
@@ -1028,7 +1028,6 @@ sshsig_find_principals(const char *path, const struct sshkey *sign_key,
 		return SSH_ERR_SYSTEM_ERROR;
 	}
 
-	r = SSH_ERR_KEY_NOT_FOUND;
 	while (getline(&line, &linesize, f) != -1) {
 		linenum++;
 		r = check_allowed_keys_line(path, linenum, line,
@@ -1056,7 +1055,7 @@ sshsig_find_principals(const char *path, const struct sshkey *sign_key,
 		return SSH_ERR_SYSTEM_ERROR;
 	}
 	fclose(f);
-	return r == 0 ? SSH_ERR_KEY_NOT_FOUND : r;
+	return r;
 }
 
 int

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list