aboutsummaryrefslogtreecommitdiffstats
path: root/common/gettime.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2017-11-01common: Accept the Z-suffix for yymmddThhmmssZ format.NIIBE Yutaka1-3/+6
* common/gettime.c (isotime_p): Accept the Z suffix. -- The intention is use for human interface. GnuPG-bug-id: 3278 Signed-off-by: NIIBE Yutaka <[email protected]> (cherry picked from commit ba8afc4966cca1f6aaf9b2a9bfc3220782306c2b)
2017-01-19gpg: Allow to freeze faked system time.Damien Goutte-Gattat1-1/+1
* g10/gpg.c (main): If the parameter for --faked-system-time ends with a '!', freeze time at the specified point. * common/gettime.c (gnupg_set_time): Allow to freeze the time at an arbitrary time instead of only the current time. * doc/gpg.texi: Update documentation for --faked-system-time. -- This patch allows the user to modify the behavior of the --faked-system-time option: by appending a '!' to the parameter, time in GnuPG will be frozen at the specified time, instead of advancing normally from that time onward. Signed-off-by: Damien Goutte-Gattat <[email protected]>
2016-11-05Change all http://www.gnu.org in license notices to https://Werner Koch1-1/+1
--
2016-10-06common: Avoid pointer arithmetic on string literals.Justus Winter1-3/+3
* common/gettime.c (rfctimestamp): Use indexing instead. * common/signal.c (got_fatal_signal): Likewise.
2016-08-24common: Guarantee that gnupg_get_time does not return an error.Werner Koch1-16/+10
* common/gettime.c (gnupg_get_time): Abor if time() failed. (gnupg_get_isotime): Remove now useless check. (make_timestamp): Remove check becuase we already checked this modulo the faked time thing. -- In reality a call foo = time (NULL) can never fail because the only defined error is EFAULT, but we don't provide a buffer. Signed-off-by: Werner Koch <[email protected]>
2016-06-28common: New function rfctimestamp.Werner Koch1-0/+33
* common/gettime.c (rfctimestamp): New. -- It is surprisingly hard to create an RFC-2822 compliant Date value. The problem is that strftime uses the current locale but the RFC requires that the English names are used. This code is pretty simply and avoid the extra problem of figuring out the correct timezone; instead UTC is used. For the planned use case this is anyway better. Signed-off-by: Werner Koch <[email protected]>
2015-04-10common: Add new function gnupg_gmtime.Werner Koch1-8/+30
* common/gettime.c (gnupg_gmtime): New. (gnupg_get_isotime): Use it. Also take care of an gmtime_t returning an error. -- The fix in gnupg_get_isotime is only to cover up a theoretical broken time (e.g. a value of (time_t)(-2) which is not mapped beyond 2038 on 32 bit systems). Signed-off-by: Werner Koch <[email protected]>
2015-04-10common: Add new function isodate_human_to_tmWerner Koch1-3/+37
* common/gettime.c (isotime_human_p): Add arg date_only. (isodate_human_to_tm): New. * common/t-gettime.c (test_isodate_human_to_tm): New. (main): Call new test. -- This function in intended as replacement for strptime (foo, "%Y-%m-%d", &bar) which is not available under Windows.
2015-03-23Import _gpgme_parse_timestamp from gpgme as parse_timestamp.Neal H. Walfield1-0/+102
* common/gettime.h (parse_timestamp): New declaration. * common/gettime.c (_win32_timegm): New function imported from gpgme/src/conversion.c:_gpgme_timegm. (parse_timestamp): New function imported from gpgme/src/conversion.c:_gpgme_parse_timestamp. -- Signed-off-by: Neal H. Walfield <[email protected]>
2014-03-18common: New function elapsed_time_string.Werner Koch1-0/+39
* common/gettime.c (elapsed_time_string): New.
2012-04-20Change license for some files in common to LGPLv3+/GPLv2+.Werner Koch1-5/+15
Having the LGPL on the common GnuPG code helps to share code between GnuPG and related projects (like GPGME and Libassuan). This is good for interoperability and to reduces bugs. * common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c * common/b64enc.c, common/convert.c, common/dns-cert.c * common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c * common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c * common/helpfile.c, common/homedir.c, common/http.c, common/http.h * common/i18n.c, common/init.c, common/init.h, common/iobuf.c * common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h * common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h * common/percent.c, common/pka.c, common/pka.h, common/session-env.c * common/session-env.h, common/sexp-parse.h, common/sexputil.c * common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c * common/ssh-utils.h, common/sysutils.c, common/sysutils.h * common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h * common/userids.c, common/userids.h, common/xasprintf.c: Change license to LGPLv3+/GPLv2+/
2011-03-01Add new functions to convert iso time strings.Werner Koch1-13/+146
2011-02-04Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch1-24/+24
We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
2010-10-27Better support unsigned time_tWerner Koch1-17/+27
2010-10-04[w32ce] Do not print the faulty timezone infoWerner Koch1-26/+31
Switch FAQ sources to org-mode
2010-06-08W32CE fix.Werner Koch1-0/+1
Typo fixes
2010-04-20Add a separate header for time related fucntions.Werner Koch1-0/+18
2010-03-02First steps towards the W32CE portWerner Koch1-1/+1
2009-03-16Remove duplicated code.Werner Koch1-0/+11
2008-06-05As a failsafe measure use memcpy instead of strcpy in gnupg_copy_time.Werner Koch1-1/+1
Typo fix.
2007-08-28Add more passphrase policy rules.Werner Koch1-0/+205
(--max-passphrase-days).
2007-08-10Implemented the chain model for X.509 validation.Werner Koch1-3/+3
2007-07-05Fixed card key generation of gpg2.Werner Koch1-4/+77
Reveal less information about timings while generating a key.
2007-07-04Changed to GPLv3.Werner Koch1-4/+2
Removed intl/.
2006-06-20Updated FSF's address.Werner Koch1-1/+2
2006-05-23g10/ does build again.Werner Koch1-1/+27
2005-07-27Removed directories which are only used by the 1.9 branchWerner Koch1-250/+0
2003-12-17* gettime.c (asctimestamp): Add a note on a non-avoidable gcc warning.Werner Koch1-2/+4
* util.h [!HAVE_VASPRINTF]: Add printf format attribute to the replacement function. * miscellaneous.c (xasprintf): New.
2003-10-31* util.h (gnupg_isotime_t): New.Werner Koch1-0/+26
(gnupg_copy_time): New. * gettime.c (gnupg_get_isotime): New.
2003-08-05This commit was manufactured by cvs2svn to create branchRepo Admin1-0/+250
'GNUPG-1-9-BRANCH'.
2003-06-18Finished the bulk of changes for gnupg 1.9. This included switchingWerner Koch1-1/+164
to libgcrypt functions, using shared error codes from libgpg-error, replacing the old functions we used to have in ../util by those in ../jnlib and ../common, renaming the malloc functions and a couple of types. Note, that not all changes are listed below becuause they are too similar and done at far too many places. As of today the code builds using the current libgcrypt from CVS but it is very unlikely that it actually works.
2002-10-19This commit was manufactured by cvs2svn to create branchRepo Admin1-87/+0
'GNUPG-1-9-BRANCH'.
2002-05-14sm/Werner Koch1-0/+87
* gpgsm.c: New option --faked-system-time * sign.c (gpgsm_sign): And use it here. * certpath.c (gpgsm_validate_path): Ditto. common/ * gettime.c: New. agent/ * cache.c (housekeeping, agent_put_cache): Use our time() wrapper. / * doc/: New * configure.ac, Makefile.am: Added doc/