aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-05-26 09:59:46 +0000
committerWerner Koch <[email protected]>2023-05-26 09:59:46 +0000
commit13013ec1c0d308b5d22f176f3850840cbbf21f05 (patch)
treec4758ca5e39b1f5ab3d82917cad82ffee0e43f7d /agent/command-ssh.c
parentcommon: New function nve_set (diff)
downloadgnupg-13013ec1c0d308b5d22f176f3850840cbbf21f05.tar.gz
gnupg-13013ec1c0d308b5d22f176f3850840cbbf21f05.zip
agent: Create and use Token entries to track the display s/n.
* agent/findkey.c (agent_write_private_key): Add arg dispserialno and update the token. (agent_write_shadow_key): Add arg dispserialno and adjust all callers. -- GnuPG-bug-id: 6135 Note that this has been forward ported from 2.2
Diffstat (limited to 'agent/command-ssh.c')
-rw-r--r--agent/command-ssh.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 51111a60d..ca3993321 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -2432,9 +2432,14 @@ card_key_available (ctrl_t ctrl, const struct card_key_info_s *keyinfo,
hex2bin (keyinfo->keygrip, grip, sizeof (grip));
if ( agent_key_available (grip) )
{
+ char *dispserialno;
+
/* (Shadow)-key is not available in our key storage. */
+ agent_card_getattr (ctrl, "$DISPSERIALNO", &dispserialno,
+ keyinfo->keygrip);
err = agent_write_shadow_key (grip, keyinfo->serialno,
- keyinfo->idstr, pkbuf, 0);
+ keyinfo->idstr, pkbuf, 0, dispserialno);
+ xfree (dispserialno);
if (err)
{
xfree (pkbuf);
@@ -3282,7 +3287,7 @@ ssh_identity_register (ctrl_t ctrl, ssh_key_type_spec_t *spec,
/* Store this key to our key storage. We do not store a creation
* timestamp because we simply do not know. */
err = agent_write_private_key (key_grip_raw, buffer, buffer_n, 0,
- NULL, NULL, 0);
+ NULL, NULL, NULL, 0);
if (err)
goto out;