aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/keygen.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 80954527c..e25ecc389 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -4510,6 +4510,19 @@ gen_card_key (int algo, int keyno, int is_primary, kbnode_t pub_root,
return err;
}
+ /* Send the learn command so that the agent creates a shadow key for
+ card key. We need to do that now so that we are able to create
+ the self-signatures. */
+ err = agent_learn ();
+ if (err)
+ {
+ /* Oops: Card removed during generation. */
+ log_error (_("OpenPGP card not available: %s\n"), gpg_strerror (err));
+ xfree (pkt);
+ xfree (pk);
+ return err;
+ }
+
if (*timestamp != info.created_at)
log_info ("NOTE: the key does not use the suggested creation date\n");
*timestamp = info.created_at;