aboutsummaryrefslogtreecommitdiffstats
path: root/g10/import.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2020-08-19 11:43:16 +0000
committerWerner Koch <[email protected]>2020-08-19 11:43:16 +0000
commit4031c42bfd0135874a5b362df175de93a19f1b51 (patch)
treea339aa48a270d358f7264b5bb36e64a326d427f3 /g10/import.c
parentgpg: Fix condition of string_to_aead_algo. (diff)
downloadgnupg-4031c42bfd0135874a5b362df175de93a19f1b51.tar.gz
gnupg-4031c42bfd0135874a5b362df175de93a19f1b51.zip
gpg,gpgsm: Record the creation time of a private key.
* sm/call-agent.c (gpgsm_agent_genkey): Pass --timestamp option. (gpgsm_agent_import_key): Ditto. * g10/call-agent.c (agent_genkey): Add arg timestamp and pass it on. (agent_import_key): Ditto. * g10/import.c (transfer_secret_keys): Pass the creation date to the agent. * g10/keygen.c (common_gen): Ditto. -- Having the creation time in the private key file makes it a lot easier to re-create an OpenPGP public keyblock in case it was accidentally lost. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'g10/import.c')
-rw-r--r--g10/import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/import.c b/g10/import.c
index b7101a9bf..1e9532d38 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -2667,7 +2667,8 @@ transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats,
char *desc = gpg_format_keydesc (ctrl, pk, FORMAT_KEYDESC_IMPORT, 1);
err = agent_import_key (ctrl, desc, &cache_nonce,
wrappedkey, wrappedkeylen, batch, force,
- pk->keyid, pk->main_keyid, pk->pubkey_algo);
+ pk->keyid, pk->main_keyid, pk->pubkey_algo,
+ pk->timestamp);
xfree (desc);
}
if (!err)