diff options
author | Andre Heinecke <aheinecke@gnupg.org> | 2023-07-19 11:27:08 +0200 |
---|---|---|
committer | Andre Heinecke <aheinecke@gnupg.org> | 2023-07-21 10:26:44 +0200 |
commit | 083a16ae08eb0226f55783d6f7b65a35e7724067 (patch) | |
tree | 420b6942bf09cf5d1d26b68a31daef20ea11a23a /dirmngr | |
parent | common:w32: Fix gnupg_w32_set_errno. (diff) | |
download | gnupg2-083a16ae08eb0226f55783d6f7b65a35e7724067.tar.xz gnupg2-083a16ae08eb0226f55783d6f7b65a35e7724067.zip |
dirmngr: Add doc for faked-system-time
* dirmngr/dirmngr.c (gpgrt_opt_t): Use string for oFakedSystemTime.
(oFakedSystemTime): Use similar conversion as gpgsm has.
* dirmngr/dirmngr.texi (faked-system-time): Document it.
--
For testing X509 certificates this is usually required and
then confusing that the example from the gpgsm man page
does not work for dirmngr.
Diffstat (limited to 'dirmngr')
-rw-r--r-- | dirmngr/dirmngr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index b460ed3b3..97c2dc490 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -221,7 +221,7 @@ static gpgrt_opt_t opts[] = { ARGPARSE_s_i (oListenBacklog, "listen-backlog", "@"), ARGPARSE_s_i (oMaxReplies, "max-replies", N_("|N|do not return more than N items in one query")), - ARGPARSE_s_u (oFakedSystemTime, "faked-system-time", "@"), /*(epoch time)*/ + ARGPARSE_s_s (oFakedSystemTime, "faked-system-time", "@"), ARGPARSE_s_n (oDisableCheckOwnSocket, "disable-check-own-socket", "@"), ARGPARSE_s_s (oIgnoreCert,"ignore-cert", "@"), ARGPARSE_s_s (oIgnoreCertExtension,"ignore-cert-extension", "@"), @@ -1176,7 +1176,12 @@ main (int argc, char **argv) case oLDAPAddServers: opt.add_new_ldapservers = 1; break; case oFakedSystemTime: - gnupg_set_time ((time_t)pargs.r.ret_ulong, 0); + { + time_t faked_time = isotime2epoch (pargs.r.ret_str); + if (faked_time == (time_t)(-1)) + faked_time = (time_t)strtoul (pargs.r.ret_str, NULL, 10); + gnupg_set_time (faked_time, 0); + } break; case oForce: opt.force = 1; break; |