diff options
author | Bernhard Reiter <[email protected]> | 2002-06-28 14:51:12 +0000 |
---|---|---|
committer | Bernhard Reiter <[email protected]> | 2002-06-28 14:51:12 +0000 |
commit | e866179ce688d8f2df9c6ade0dd22a6e81210098 (patch) | |
tree | 81f643485655df4b0564607fae93044d3ed3c9ce | |
parent | internal AEgypten bugfix #1131: get full list of emails stored in certificate... (diff) | |
download | gpgme-e866179ce688d8f2df9c6ade0dd22a6e81210098.tar.gz gpgme-e866179ce688d8f2df9c6ade0dd22a6e81210098.zip |
* gpgmeplug.c: new macro days_to_seconds().
this also fixes the dividing factor.
(signatureCertificateDaysLeftToExpiry)
(preceiverCertificateDaysLeftToExpiry): using the new macro
(caCertificateDaysLeftToExpiry)
(rootCertificateDaysLeftToExpiry): using new macro in deactivated code.
Diffstat (limited to '')
-rw-r--r-- | gpgmeplug/ChangeLog | 11 | ||||
-rw-r--r-- | gpgmeplug/gpgmeplug.c | 19 |
2 files changed, 18 insertions, 12 deletions
diff --git a/gpgmeplug/ChangeLog b/gpgmeplug/ChangeLog index 86a8d88e..3ff7ce1a 100644 --- a/gpgmeplug/ChangeLog +++ b/gpgmeplug/ChangeLog @@ -1,3 +1,14 @@ +2002-06-28 Bernhard Reiter <[email protected]> + + * gpgmeplug.c: new macro days_to_seconds(). + this also fixes the dividing factor. + (signatureCertificateDaysLeftToExpiry) + (preceiverCertificateDaysLeftToExpiry): using the new macro + + (caCertificateDaysLeftToExpiry) + (rootCertificateDaysLeftToExpiry): using new macro in deactivated code. + + 2002-06-27 Steffen Hansen <[email protected]> * gpgmeplug.c: Fixed pattern related bug. diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c index c30f4518..56284cc5 100644 --- a/gpgmeplug/gpgmeplug.c +++ b/gpgmeplug/gpgmeplug.c @@ -154,6 +154,9 @@ #include "cryptplug.h" +#define days_from_seconds(x) ((x)/86400) + + typedef struct { const char* bugURL; const char* signatureKeyCertificate; @@ -512,9 +515,7 @@ int signatureCertificateDaysLeftToExpiry( const char* certificate ) time_t expire_time = gpgme_key_get_ulong_attr( rKey,GPGME_ATTR_EXPIRE, NULL, 0 ); time_t cur_time = time (NULL); - daysLeft = expire_time - cur_time; - // convert seconds into days - daysLeft /= 43200; + daysLeft = days_from_seconds(expire_time - cur_time); gpgme_key_release( rKey ); } } @@ -576,9 +577,7 @@ int caCertificateDaysLeftToExpiry( const char* certificate ) NULL, 0 ); time_t cur_time = time (NULL); - daysLeft = expire_time - cur_time; - // convert seconds into days - daysLeft /= 43200; + daysLeft = days_from_seconds(expire_time - cur_time); gpgme_key_release( rKey ); } } @@ -640,9 +639,7 @@ int rootCertificateDaysLeftToExpiry( const char* certificate ) NULL, 0 ); time_t cur_time = time (NULL); - daysLeft = expire_time - cur_time; - // convert seconds into days - daysLeft /= 43200; + daysLeft = days_from_seconds(expire_time - cur_time); gpgme_key_release( rKey ); } } @@ -803,9 +800,7 @@ int receiverCertificateDaysLeftToExpiry( const char* certificate ) time_t expire_time = gpgme_key_get_ulong_attr( rKey,GPGME_ATTR_EXPIRE, NULL, 0 ); time_t cur_time = time (NULL); - daysLeft = expire_time - cur_time; - // convert seconds into days - daysLeft /= 43200; + daysLeft = days_from_seconds(expire_time - cur_time); gpgme_key_release( rKey ); } } |