[openssh-commits] [openssh] 17/22: upstream: principalsp is optional, pubkey required; ok djm

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 13 13:18:54 AEDT 2020


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

djm pushed a commit to branch master
in repository openssh.

commit 31c39e7840893f1bfdcbe4f813b20d1d7e69ec3e
Author: markus at openbsd.org <markus at openbsd.org>
Date:   Fri Mar 6 18:27:15 2020 +0000

    upstream: principalsp is optional, pubkey required; ok djm
    
    OpenBSD-Commit-ID: 2cc3ea5018c28ed97edaccd7f17d2cc796f01024
---
 sshsig.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sshsig.c b/sshsig.c
index 77df4db8..ef6c4e52 100644
--- a/sshsig.c
+++ b/sshsig.c
@@ -963,7 +963,7 @@ get_matching_principals_from_line(const char *path, u_long linenum, char *line,
 		goto done;
 	}
  done:
-	if (found) {
+	if (found && principalsp != NULL) {
 		*principalsp = principals;
 		principals = NULL; /* transferred */
 	}
@@ -1026,8 +1026,8 @@ sshsig_get_pubkey(struct sshbuf *signature, struct sshkey **pubkey)
 	struct sshkey *pk = NULL;
 	int r = SSH_ERR_SIGNATURE_INVALID;
 
-	if (pubkey != NULL)
-		*pubkey = NULL;
+	if (pubkey == NULL)
+		return SSH_ERR_INTERNAL_ERROR;
 	if ((r = sshsig_parse_preamble(signature)) != 0)
 		return r;
 	if ((r = sshkey_froms(signature, &pk)) != 0)

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


More information about the openssh-commits mailing list