[openssh-commits] [openssh] 05/05: upstream: when AddKeysToAgent=yes is set and the key contains no

git+noreply at mindrot.org git+noreply at mindrot.org
Sat Jan 25 18:20:14 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 022ce92fa0daa9d78830baeb2bd2dc3f83c724ba
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Sat Jan 25 07:17:18 2020 +0000

    upstream: when AddKeysToAgent=yes is set and the key contains no
    
    comment, add the key to the agent with the key's path as the comment. bz2564
    
    OpenBSD-Commit-ID: 8dd8ca9340d7017631a27f4ed5358a4cfddec16f
---
 sshconnect.c | 9 +++++----
 sshconnect.h | 5 +++--
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/sshconnect.c b/sshconnect.c
index 69024071..4711af78 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.327 2020/01/23 07:10:22 dtucker Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.328 2020/01/25 07:17:18 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1406,8 +1406,8 @@ ssh_local_cmd(const char *args)
 }
 
 void
-maybe_add_key_to_agent(char *authfile, struct sshkey *private,
-    char *comment, char *passphrase)
+maybe_add_key_to_agent(const char *authfile, struct sshkey *private,
+    const char *comment, const char *passphrase)
 {
 	int auth_sock = -1, r;
 	const char *skprovider = NULL;
@@ -1428,7 +1428,8 @@ maybe_add_key_to_agent(char *authfile, struct sshkey *private,
 	}
 	if (sshkey_is_sk(private))
 		skprovider = options.sk_provider;
-	if ((r = ssh_add_identity_constrained(auth_sock, private, comment, 0,
+	if ((r = ssh_add_identity_constrained(auth_sock, private,
+	    comment == NULL ? authfile : comment, 0,
 	    (options.add_keys_to_agent == 3), 0, skprovider)) == 0)
 		debug("identity added to agent: %s", authfile);
 	else
diff --git a/sshconnect.h b/sshconnect.h
index 2e84b8bc..7c091e2b 100644
--- a/sshconnect.h
+++ b/sshconnect.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.h,v 1.39 2019/09/13 04:27:35 djm Exp $ */
+/* $OpenBSD: sshconnect.h,v 1.40 2020/01/25 07:17:18 djm Exp $ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -53,4 +53,5 @@ void	 ssh_userauth2(struct ssh *ssh, const char *, const char *,
 
 int	 ssh_local_cmd(const char *);
 
-void	 maybe_add_key_to_agent(char *, struct sshkey *, char *, char *);
+void	 maybe_add_key_to_agent(const char *, struct sshkey *,
+    const char *, const char *);

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


More information about the openssh-commits mailing list