mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
agent: KEYTOCARD prefers to specified time.
* agent/command.c (cmd_keytocard): Timestamp at "Created:" field is only used when time is not specified. -- Fixes-commit: c795be79c14fac01b984bdc2e2041d2141f27612 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
90caa7ad59
commit
f0a1c79f60
@ -3029,21 +3029,20 @@ cmd_keytocard (assuan_context_t ctx, char *line)
|
|||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timestamp == (time_t)(-1))
|
|
||||||
{
|
|
||||||
/* Default to the creation time as stored in the private key. The
|
/* Default to the creation time as stored in the private key. The
|
||||||
* parameter is here so that gpg can make sure that the timestamp as
|
* parameter is here so that gpg can make sure that the timestamp as
|
||||||
* used for key creation (and thus the openPGP fingerprint) is
|
* used for key creation (and thus the openPGP fingerprint) is
|
||||||
* used. */
|
* used. */
|
||||||
|
if (argc > 3)
|
||||||
|
timestamp = isotime2epoch (argv[3]);
|
||||||
|
else if (timestamp == (time_t)(-1))
|
||||||
|
timestamp = isotime2epoch ("19700101T000000");
|
||||||
|
|
||||||
const char *timestamp_str= argc > 3? argv[3] : "19700101T000000";
|
if (timestamp == (time_t)(-1))
|
||||||
|
|
||||||
if ((timestamp = isotime2epoch (timestamp_str)) == (time_t)(-1))
|
|
||||||
{
|
{
|
||||||
err = gpg_error (GPG_ERR_INV_TIME);
|
err = gpg_error (GPG_ERR_INV_TIME);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Note: We can't use make_canon_sexp because we need to allocate a
|
/* Note: We can't use make_canon_sexp because we need to allocate a
|
||||||
* few extra bytes for our hack below. */
|
* few extra bytes for our hack below. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user