From 638526d37fee0a1febac9d29fab384b913819fc9 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 13 Feb 2020 11:45:41 +0100 Subject: agent: Allow signing with card key even without a stub key. * agent/call-scd.c (agent_card_serialno): Allow NULL for R_SERIAL. (struct readkey_status_parm_s): New. (readkey_status_cb): New. (agent_card_readkey): Add optional arg R_KEYREF and change all callers. * agent/findkey.c (key_parms_from_sexp): Allow also a "public-key". * agent/divert-scd.c (ask_for_card): Allow for SHADOW_INFO being NULL. * agent/pksign.c (agent_pksign_do): Fallback to sign with an on-card if there is no stub key yet. Create the stub key. Also fixed a misnaming between s_pkey and s_skey. -- This change allows to create OpenPGP keys directly from a card without first making sure that a stub key exists. It is also the less surprising behaviour. Signed-off-by: Werner Koch --- agent/command-ssh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'agent/command-ssh.c') diff --git a/agent/command-ssh.c b/agent/command-ssh.c index 243ce76bb..8adbe01cd 100644 --- a/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -2394,7 +2394,7 @@ card_key_available (ctrl_t ctrl, const struct card_key_info_s *keyinfo, *cardsn = NULL; /* Read the public key. */ - err = agent_card_readkey (ctrl, keyinfo->keygrip, &pkbuf); + err = agent_card_readkey (ctrl, keyinfo->keygrip, &pkbuf, NULL); if (err) { if (opt.verbose) -- cgit v1.2.3