aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2020-12-08 04:20:29 +0000
committerNIIBE Yutaka <[email protected]>2020-12-08 04:20:29 +0000
commitcbb0e069f55bc45037bbd69d54ce23dae2af2ac6 (patch)
treea462ac78665990a0b7b9df35ecd864e365341f6d
parentgpg: Make quick-gen-key with algo "card" work for keys without keytime (diff)
downloadgnupg-cbb0e069f55bc45037bbd69d54ce23dae2af2ac6.tar.gz
gnupg-cbb0e069f55bc45037bbd69d54ce23dae2af2ac6.zip
agent: Allow pksign operation with card but no file.
* agent/pksign.c (agent_pksign_do): Add support with no file. -- GnuPG-bug-id: 5166 Signed-off-by: Ingo Klöcker <[email protected]>
-rw-r--r--agent/pksign.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/agent/pksign.c b/agent/pksign.c
index c94c1a197..d9ffe6019 100644
--- a/agent/pksign.c
+++ b/agent/pksign.c
@@ -324,8 +324,8 @@ agent_pksign_do (ctrl_t ctrl, const char *cache_nonce,
log_error ("failed to read the secret key\n");
goto leave;
}
-
- algo = get_pk_algo_from_key (s_skey);
+ else
+ algo = get_pk_algo_from_key (s_skey);
if (shadow_info || no_shadow_info)
{
@@ -374,6 +374,8 @@ agent_pksign_do (ctrl_t ctrl, const char *cache_nonce,
if (keyref)
agent_write_shadow_key (ctrl->keygrip, serialno, keyref, pkbuf, 0);
+ algo = get_pk_algo_from_key (s_pkey);
+
xfree (serialno);
xfree (pkbuf);
xfree (keyref);