aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keygen.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g10/keygen.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/g10/keygen.c b/g10/keygen.c
index 349149b8a..1f4388f39 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -1263,6 +1263,7 @@ append_all_default_adsks (ctrl_t ctrl, kbnode_t keyblock)
struct para_data_s *para;
byte adskfpr[MAX_FINGERPRINT_LEN];
size_t adskfprlen;
+ u32 sigtimestamp = make_timestamp ();
keygen_prepare_new_key_adsks ();
for (sl = opt.def_new_key_adsks; sl && !err; sl = sl->next)
@@ -1275,7 +1276,10 @@ append_all_default_adsks (ctrl_t ctrl, kbnode_t keyblock)
fingerprint_from_pk (para->u.adsk, adskfpr, &adskfprlen);
if (!has_key_with_fingerprint (keyblock, adskfpr, adskfprlen))
{
- err = append_adsk_to_key (ctrl, keyblock, para->u.adsk, NULL);
+ /* Fixme: We should use a cache nonce so that only one
+ * pinentry pops up. */
+ err = append_adsk_to_key (ctrl, keyblock, para->u.adsk,
+ sigtimestamp, NULL);
if (!err)
any_done = 1;
}
@@ -6629,7 +6633,8 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
for (idx=0; (adsk = get_parameter_adsk (para, idx)); idx++)
{
- err = append_adsk_to_key (ctrl, pub_root, adsk, cache_nonce);
+ err = append_adsk_to_key (ctrl, pub_root, adsk,
+ signtimestamp, cache_nonce);
if (err)
break;
any_adsk++;
@@ -6740,6 +6745,16 @@ do_generate_keypair (ctrl_t ctrl, struct para_data_s *para,
es_fflush (es_stdout);
if (any_adsk)
log_info (_("Note: The key has been created with one or more ADSK!\n"));
+
+ if (opt.flags.auto_key_upload)
+ {
+ unsigned int saved_options = opt.keyserver_options.options;
+
+ opt.keyserver_options.options |= KEYSERVER_LDAP_ONLY;
+ opt.keyserver_options.options |= KEYSERVER_WARN_ONLY;
+ keyserver_export_pubkey (ctrl, pk, 1/*Assume new key*/);
+ opt.keyserver_options.options = saved_options;
+ }
}
release_kbnode (pub_root);