summaryrefslogtreecommitdiffstats
path: root/crypto/o_time.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-11-21 14:13:20 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-11-21 14:13:20 +0000
commit46a6cec6998b84d85240dfb99af235c8a0854a31 (patch)
tree8742de19d95907899dff2402aec9605a94686f72 /crypto/o_time.c
parent472af806ce859b6b00249550027c2c9fa149453b (diff)
Reorganise parameters for OPENSSL_gmtime_diff.
Make ASN1_UTCTIME_cmp_time_t more robust by using the new time functions.
Diffstat (limited to 'crypto/o_time.c')
-rw-r--r--crypto/o_time.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/o_time.c b/crypto/o_time.c
index 49bff49f2b..b78f5ca630 100644
--- a/crypto/o_time.c
+++ b/crypto/o_time.c
@@ -234,7 +234,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
static long date_to_julian(int y, int m, int d);
static void julian_to_date(long jd, int *y, int *m, int *d);
-static int julian_adj(struct tm *tm, int off_day, long offset_sec,
+static int julian_adj(const struct tm *tm, int off_day, long offset_sec,
long *pday, int *psec);
int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
@@ -267,7 +267,8 @@ int OPENSSL_gmtime_adj(struct tm *tm, int off_day, long offset_sec)
}
-int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
+int OPENSSL_gmtime_diff(int *pday, int *psec,
+ const struct tm *from, const struct tm *to)
{
int from_sec, to_sec, diff_sec;
long from_jd, to_jd, diff_day;
@@ -300,7 +301,7 @@ int OPENSSL_gmtime_diff(struct tm *from, struct tm *to, int *pday, int *psec)
/* Convert tm structure and offset into julian day and seconds */
-static int julian_adj(struct tm *tm, int off_day, long offset_sec,
+static int julian_adj(const struct tm *tm, int off_day, long offset_sec,
long *pday, int *psec)
{
int offset_hms, offset_day;