summaryrefslogtreecommitdiffstats
path: root/agent/protect-tool.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2020-08-17 14:21:00 +0200
committerWerner Koch <wk@gnupg.org>2020-08-17 15:05:49 +0200
commit0da923a1240ac78d60c92cdd8488c4e405c3243b (patch)
tree106ce6faa60a206478752cb21096cc29b4e90d15 /agent/protect-tool.c
parentAdd --chuid to gpg, gpg-card, and gpg-connect-agent. (diff)
downloadgnupg2-0da923a1240ac78d60c92cdd8488c4e405c3243b.tar.xz
gnupg2-0da923a1240ac78d60c92cdd8488c4e405c3243b.zip
agent: Allow to pass a timestamp to genkey and import.
* agent/command.c (cmd_genkey): Add option --timestamp. (cmd_import_key): Ditto. * agent/genkey.c (store_key): Add arg timestamp and change callers. (agent_genkey): Ditto. * agent/findkey.c (write_extended_private_key): Add args timestamp and new key to write a Created line. (agent_write_private_key): Add arg timestamp. (agent_write_shadow_key): Ditto. agent/protect-tool.c (agent_write_private_key): Ditto as dummy arg. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'agent/protect-tool.c')
-rw-r--r--agent/protect-tool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/agent/protect-tool.c b/agent/protect-tool.c
index a95f418e6..8325f2564 100644
--- a/agent/protect-tool.c
+++ b/agent/protect-tool.c
@@ -816,7 +816,8 @@ agent_askpin (ctrl_t ctrl,
int
agent_write_private_key (const unsigned char *grip,
const void *buffer, size_t length, int force,
- const char *serialno, const char *keyref)
+ const char *serialno, const char *keyref,
+ time_t timestamp)
{
char hexgrip[40+4+1];
char *p;
@@ -824,6 +825,7 @@ agent_write_private_key (const unsigned char *grip,
(void)force;
(void)serialno;
(void)keyref;
+ (void)timestamp;
bin2hex (grip, 20, hexgrip);
strcpy (hexgrip+40, ".key");