diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2023-04-06 03:56:03 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2023-04-06 03:56:03 +0000 |
commit | ce03c7c54d3287fba454f6d7b97ebe0335a462a8 (patch) | |
tree | a0a384efc89f1c5e8809926e326e5c806be0e8b6 /usr.bin/ssh | |
parent | 10f5bed2f61216ea9a89f38d499f34c26fa136b8 (diff) |
simplify sshsig_find_principals() similar to what happened to
sshsig_check_allowed_keys() in r1.31, removing some dead code
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/sshsig.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshsig.c b/usr.bin/ssh/sshsig.c index 4a359b8d483..3f02c90b1cf 100644 --- a/usr.bin/ssh/sshsig.c +++ b/usr.bin/ssh/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 * @@ -1016,7 +1016,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; @@ -1026,7 +1026,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, @@ -1054,7 +1053,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 |