aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--NEWS5
-rw-r--r--doc/gpgme.texi24
-rw-r--r--src/gpgme.h.in10
3 files changed, 23 insertions, 16 deletions
diff --git a/NEWS b/NEWS
index 4e081683..9c4d9390 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,11 @@ Noteworthy changes in version 2.0.0 (unreleased)
for signing. This reflects the behaviour of gpg but is a minor
semantic change. [T3325]
+ * The timestamp and expires fields in gpgme_subkey_t, gpgme_key_sig,
+ and gpgme_new_signature_t are changed from signed long to unsigned
+ long to better cope with 32bit time_t implementations. These
+ fields should in reality never see an error value (-1).
+
* Removed the gpgme_attr_t enums and their functions which were
deprecated since 2003. [rMd54d6eaa64]
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index aadf9654..ad120465 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -3693,11 +3693,12 @@ hexadecimal digits, if available.
The keygrip of the subkey in hex digit form or @code{NULL} if not
available.
-@item long int timestamp
-This is the creation timestamp of the subkey. This is -1 if the
-timestamp is invalid, and 0 if it is not available.
+@item unsigned long int timestamp
+This is the creation timestamp of the subkey. This is @code{(unsigned
+long)(-1)} if the timestamp is invalid, and 0 if it is not available.
+Note that an invalid timestamp indicates a bug in the engine.
-@item long int expires
+@item unsigned long int expires
This is the expiration timestamp of the subkey, or 0 if the subkey
does not expire.
@@ -3906,11 +3907,12 @@ This is the public key algorithm used to create the signature.
This is the key ID of the key (in hexadecimal digits) used to create
the signature.
-@item long int timestamp
-This is the creation timestamp of the key signature. This is -1 if
-the timestamp is invalid, and 0 if it is not available.
+@item unsigned long int timestamp
+This is the creation timestamp of the key signature. This is
+@code{(unsigned long)(-1)} if the timestamp is invalid, and 0 if it is
+not available.
-@item long int expires
+@item unsigned long int expires
This is the expiration timestamp of the key signature, or 0 if the key
signature does not expire.
@@ -4271,8 +4273,8 @@ The common case is to use 0 to not set an expiration time.
Note that this parameter takes an unsigned long value and not
a @code{time_t} to avoid problems on systems which use a signed
32 bit @code{time_t}. Note further that the OpenPGP protocol
-uses 32 bit values for timestamps and thus can
-only encode dates up to the year 2106.
+uses 32 bit values for timestamps and thus can only encode dates
+up to the year 2106.
@var{subfprs} selects the subkey(s) for which the expiration time
should be set. If @var{subfprs} is set to @code{NULL}, then the
@@ -6616,7 +6618,7 @@ The hash algorithm used to create this signature.
The signature class of this signature. Note that only the values 0,
1, and 2 are well-defined.
-@item long int timestamp
+@item unsigned long int timestamp
The creation timestamp of this signature.
@item char *fpr
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index e56c293d..d870b4eb 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -612,10 +612,10 @@ struct _gpgme_subkey
char *fpr;
/* The creation timestamp, -1 if invalid, 0 if not available. */
- long int timestamp;
+ unsigned long int timestamp;
/* The expiration timestamp, 0 if the subkey does not expire. */
- long int expires;
+ unsigned long int expires;
/* The serial number of a smart card holding this key or NULL. */
char *card_number;
@@ -671,10 +671,10 @@ struct _gpgme_key_sig
char _keyid[16 + 1];
/* The creation timestamp, -1 if invalid, 0 if not available. */
- long int timestamp;
+ unsigned long int timestamp;
/* The expiration timestamp, 0 if the subkey does not expire. */
- long int expires;
+ unsigned long int expires;
/* Same as in gpgme_signature_t. */
gpgme_error_t status;
@@ -1554,7 +1554,7 @@ struct _gpgme_new_signature
unsigned long _obsolete_class;
/* Signature creation time. */
- long int timestamp;
+ unsigned long int timestamp;
/* The fingerprint of the signature. */
char *fpr;