diff options
author | deraadt <> | 2014-04-18 23:42:00 +0000 |
---|---|---|
committer | deraadt <> | 2014-04-18 23:42:00 +0000 |
commit | 4855ea84e69fe2edcf4d523233d15c950bd77e4d (patch) | |
tree | d34f0513fa7ea1f0d59700feaf05db49838ca750 /src | |
parent | 8b311d691c1644d610b65caacf0e7589a47eee84 (diff) | |
download | openbsd-4855ea84e69fe2edcf4d523233d15c950bd77e4d.tar.gz openbsd-4855ea84e69fe2edcf4d523233d15c950bd77e4d.tar.bz2 openbsd-4855ea84e69fe2edcf4d523233d15c950bd77e4d.zip |
OPENSSL_gmtime() is really just gmtime_r(); ok guenther
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/asn1/a_gentm.c | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_time.c | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_utctm.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/o_time.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/o_time.h | 1 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_gentm.c | 2 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_time.c | 2 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_utctm.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/o_time.c | 10 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/o_time.h | 1 |
10 files changed, 12 insertions, 26 deletions
diff --git a/src/lib/libcrypto/asn1/a_gentm.c b/src/lib/libcrypto/asn1/a_gentm.c index 56f8992424..856aaf0c77 100644 --- a/src/lib/libcrypto/asn1/a_gentm.c +++ b/src/lib/libcrypto/asn1/a_gentm.c | |||
@@ -222,7 +222,7 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, | |||
222 | if (s == NULL) | 222 | if (s == NULL) |
223 | return (NULL); | 223 | return (NULL); |
224 | 224 | ||
225 | ts = OPENSSL_gmtime(&t, &data); | 225 | ts = gmtime_r(&t, &data); |
226 | if (ts == NULL) | 226 | if (ts == NULL) |
227 | return (NULL); | 227 | return (NULL); |
228 | 228 | ||
diff --git a/src/lib/libcrypto/asn1/a_time.c b/src/lib/libcrypto/asn1/a_time.c index 13fd324517..f3f28369f4 100644 --- a/src/lib/libcrypto/asn1/a_time.c +++ b/src/lib/libcrypto/asn1/a_time.c | |||
@@ -94,7 +94,7 @@ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, | |||
94 | struct tm *ts; | 94 | struct tm *ts; |
95 | struct tm data; | 95 | struct tm data; |
96 | 96 | ||
97 | ts=OPENSSL_gmtime(&t,&data); | 97 | ts=gmtime_r(&t,&data); |
98 | if (ts == NULL) { | 98 | if (ts == NULL) { |
99 | ASN1err(ASN1_F_ASN1_TIME_ADJ, ASN1_R_ERROR_GETTING_TIME); | 99 | ASN1err(ASN1_F_ASN1_TIME_ADJ, ASN1_R_ERROR_GETTING_TIME); |
100 | return NULL; | 100 | return NULL; |
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c index d8135d0457..a2325f2525 100644 --- a/src/lib/libcrypto/asn1/a_utctm.c +++ b/src/lib/libcrypto/asn1/a_utctm.c | |||
@@ -181,7 +181,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | |||
181 | if (s == NULL) | 181 | if (s == NULL) |
182 | return(NULL); | 182 | return(NULL); |
183 | 183 | ||
184 | ts=OPENSSL_gmtime(&t, &data); | 184 | ts=gmtime_r(&t, &data); |
185 | if (ts == NULL) | 185 | if (ts == NULL) |
186 | return(NULL); | 186 | return(NULL); |
187 | 187 | ||
@@ -232,7 +232,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) | |||
232 | 232 | ||
233 | t -= offset*60; /* FIXME: may overflow in extreme cases */ | 233 | t -= offset*60; /* FIXME: may overflow in extreme cases */ |
234 | 234 | ||
235 | tm = OPENSSL_gmtime(&t, &data); | 235 | tm = gmtime_r(&t, &data); |
236 | 236 | ||
237 | #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 | 237 | #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 |
238 | year = g2(s->data); | 238 | year = g2(s->data); |
diff --git a/src/lib/libcrypto/o_time.c b/src/lib/libcrypto/o_time.c index 83028356b9..000372d35b 100644 --- a/src/lib/libcrypto/o_time.c +++ b/src/lib/libcrypto/o_time.c | |||
@@ -63,12 +63,6 @@ | |||
63 | #include <string.h> | 63 | #include <string.h> |
64 | #include "o_time.h" | 64 | #include "o_time.h" |
65 | 65 | ||
66 | struct tm * | ||
67 | OPENSSL_gmtime(const time_t *timer, struct tm *result) | ||
68 | { | ||
69 | return gmtime_r(timer, result); | ||
70 | } | ||
71 | |||
72 | /* Take a tm structure and add an offset to it. This avoids any OS issues | 66 | /* Take a tm structure and add an offset to it. This avoids any OS issues |
73 | * with restricted date types and overflows which cause the year 2038 | 67 | * with restricted date types and overflows which cause the year 2038 |
74 | * problem. | 68 | * problem. |
@@ -194,8 +188,8 @@ check_time(long offset) | |||
194 | time_t t1, t2; | 188 | time_t t1, t2; |
195 | time(&t1); | 189 | time(&t1); |
196 | t2 = t1 + offset; | 190 | t2 = t1 + offset; |
197 | OPENSSL_gmtime(&t2, &tm2); | 191 | gmtime_r(&t2, &tm2); |
198 | OPENSSL_gmtime(&t1, &tm1); | 192 | gmtime_r(&t1, &tm1); |
199 | OPENSSL_gmtime_adj(&tm1, 0, offset); | 193 | OPENSSL_gmtime_adj(&tm1, 0, offset); |
200 | if ((tm1.tm_year == tm2.tm_year) && | 194 | if ((tm1.tm_year == tm2.tm_year) && |
201 | (tm1.tm_mon == tm2.tm_mon) && | 195 | (tm1.tm_mon == tm2.tm_mon) && |
diff --git a/src/lib/libcrypto/o_time.h b/src/lib/libcrypto/o_time.h index e391da7508..4f8288f5d5 100644 --- a/src/lib/libcrypto/o_time.h +++ b/src/lib/libcrypto/o_time.h | |||
@@ -61,7 +61,6 @@ | |||
61 | 61 | ||
62 | #include <time.h> | 62 | #include <time.h> |
63 | 63 | ||
64 | struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result); | ||
65 | int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); | 64 | int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); |
66 | 65 | ||
67 | #endif | 66 | #endif |
diff --git a/src/lib/libssl/src/crypto/asn1/a_gentm.c b/src/lib/libssl/src/crypto/asn1/a_gentm.c index 56f8992424..856aaf0c77 100644 --- a/src/lib/libssl/src/crypto/asn1/a_gentm.c +++ b/src/lib/libssl/src/crypto/asn1/a_gentm.c | |||
@@ -222,7 +222,7 @@ ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, | |||
222 | if (s == NULL) | 222 | if (s == NULL) |
223 | return (NULL); | 223 | return (NULL); |
224 | 224 | ||
225 | ts = OPENSSL_gmtime(&t, &data); | 225 | ts = gmtime_r(&t, &data); |
226 | if (ts == NULL) | 226 | if (ts == NULL) |
227 | return (NULL); | 227 | return (NULL); |
228 | 228 | ||
diff --git a/src/lib/libssl/src/crypto/asn1/a_time.c b/src/lib/libssl/src/crypto/asn1/a_time.c index 13fd324517..f3f28369f4 100644 --- a/src/lib/libssl/src/crypto/asn1/a_time.c +++ b/src/lib/libssl/src/crypto/asn1/a_time.c | |||
@@ -94,7 +94,7 @@ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, | |||
94 | struct tm *ts; | 94 | struct tm *ts; |
95 | struct tm data; | 95 | struct tm data; |
96 | 96 | ||
97 | ts=OPENSSL_gmtime(&t,&data); | 97 | ts=gmtime_r(&t,&data); |
98 | if (ts == NULL) { | 98 | if (ts == NULL) { |
99 | ASN1err(ASN1_F_ASN1_TIME_ADJ, ASN1_R_ERROR_GETTING_TIME); | 99 | ASN1err(ASN1_F_ASN1_TIME_ADJ, ASN1_R_ERROR_GETTING_TIME); |
100 | return NULL; | 100 | return NULL; |
diff --git a/src/lib/libssl/src/crypto/asn1/a_utctm.c b/src/lib/libssl/src/crypto/asn1/a_utctm.c index d8135d0457..a2325f2525 100644 --- a/src/lib/libssl/src/crypto/asn1/a_utctm.c +++ b/src/lib/libssl/src/crypto/asn1/a_utctm.c | |||
@@ -181,7 +181,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | |||
181 | if (s == NULL) | 181 | if (s == NULL) |
182 | return(NULL); | 182 | return(NULL); |
183 | 183 | ||
184 | ts=OPENSSL_gmtime(&t, &data); | 184 | ts=gmtime_r(&t, &data); |
185 | if (ts == NULL) | 185 | if (ts == NULL) |
186 | return(NULL); | 186 | return(NULL); |
187 | 187 | ||
@@ -232,7 +232,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) | |||
232 | 232 | ||
233 | t -= offset*60; /* FIXME: may overflow in extreme cases */ | 233 | t -= offset*60; /* FIXME: may overflow in extreme cases */ |
234 | 234 | ||
235 | tm = OPENSSL_gmtime(&t, &data); | 235 | tm = gmtime_r(&t, &data); |
236 | 236 | ||
237 | #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 | 237 | #define return_cmp(a,b) if ((a)<(b)) return -1; else if ((a)>(b)) return 1 |
238 | year = g2(s->data); | 238 | year = g2(s->data); |
diff --git a/src/lib/libssl/src/crypto/o_time.c b/src/lib/libssl/src/crypto/o_time.c index 83028356b9..000372d35b 100644 --- a/src/lib/libssl/src/crypto/o_time.c +++ b/src/lib/libssl/src/crypto/o_time.c | |||
@@ -63,12 +63,6 @@ | |||
63 | #include <string.h> | 63 | #include <string.h> |
64 | #include "o_time.h" | 64 | #include "o_time.h" |
65 | 65 | ||
66 | struct tm * | ||
67 | OPENSSL_gmtime(const time_t *timer, struct tm *result) | ||
68 | { | ||
69 | return gmtime_r(timer, result); | ||
70 | } | ||
71 | |||
72 | /* Take a tm structure and add an offset to it. This avoids any OS issues | 66 | /* Take a tm structure and add an offset to it. This avoids any OS issues |
73 | * with restricted date types and overflows which cause the year 2038 | 67 | * with restricted date types and overflows which cause the year 2038 |
74 | * problem. | 68 | * problem. |
@@ -194,8 +188,8 @@ check_time(long offset) | |||
194 | time_t t1, t2; | 188 | time_t t1, t2; |
195 | time(&t1); | 189 | time(&t1); |
196 | t2 = t1 + offset; | 190 | t2 = t1 + offset; |
197 | OPENSSL_gmtime(&t2, &tm2); | 191 | gmtime_r(&t2, &tm2); |
198 | OPENSSL_gmtime(&t1, &tm1); | 192 | gmtime_r(&t1, &tm1); |
199 | OPENSSL_gmtime_adj(&tm1, 0, offset); | 193 | OPENSSL_gmtime_adj(&tm1, 0, offset); |
200 | if ((tm1.tm_year == tm2.tm_year) && | 194 | if ((tm1.tm_year == tm2.tm_year) && |
201 | (tm1.tm_mon == tm2.tm_mon) && | 195 | (tm1.tm_mon == tm2.tm_mon) && |
diff --git a/src/lib/libssl/src/crypto/o_time.h b/src/lib/libssl/src/crypto/o_time.h index e391da7508..4f8288f5d5 100644 --- a/src/lib/libssl/src/crypto/o_time.h +++ b/src/lib/libssl/src/crypto/o_time.h | |||
@@ -61,7 +61,6 @@ | |||
61 | 61 | ||
62 | #include <time.h> | 62 | #include <time.h> |
63 | 63 | ||
64 | struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result); | ||
65 | int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); | 64 | int OPENSSL_gmtime_adj(struct tm *tm, int offset_day, long offset_sec); |
66 | 65 | ||
67 | #endif | 66 | #endif |