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
This commit is contained in:
parent
0b813436bb
commit
022ce92fa0
|
@ -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@cs.hut.fi>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
|
@ -1406,8 +1406,8 @@ ssh_local_cmd(const char *args)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
maybe_add_key_to_agent(char *authfile, struct sshkey *private,
|
maybe_add_key_to_agent(const char *authfile, struct sshkey *private,
|
||||||
char *comment, char *passphrase)
|
const char *comment, const char *passphrase)
|
||||||
{
|
{
|
||||||
int auth_sock = -1, r;
|
int auth_sock = -1, r;
|
||||||
const char *skprovider = NULL;
|
const char *skprovider = NULL;
|
||||||
|
@ -1428,7 +1428,8 @@ maybe_add_key_to_agent(char *authfile, struct sshkey *private,
|
||||||
}
|
}
|
||||||
if (sshkey_is_sk(private))
|
if (sshkey_is_sk(private))
|
||||||
skprovider = options.sk_provider;
|
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)
|
(options.add_keys_to_agent == 3), 0, skprovider)) == 0)
|
||||||
debug("identity added to agent: %s", authfile);
|
debug("identity added to agent: %s", authfile);
|
||||||
else
|
else
|
||||||
|
|
|
@ -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.
|
* 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 *);
|
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 *);
|
||||||
|
|
Loading…
Reference in New Issue