diff options
author | deraadt <> | 2014-04-21 11:23:09 +0000 |
---|---|---|
committer | deraadt <> | 2014-04-21 11:23:09 +0000 |
commit | 6a6b6afb12953d4537a41790daa6abaad39258c5 (patch) | |
tree | f41bf0198475396d7b838f0826c91f637c2cb353 | |
parent | 1173b460dd1b6683fa4ee3599d96ef0459b60058 (diff) | |
download | openbsd-6a6b6afb12953d4537a41790daa6abaad39258c5.tar.gz openbsd-6a6b6afb12953d4537a41790daa6abaad39258c5.tar.bz2 openbsd-6a6b6afb12953d4537a41790daa6abaad39258c5.zip |
Delete #if 0'd time related functions which are totally expired.
No point even seeing these when we do the 2038 audit later on...
-rw-r--r-- | src/lib/libcrypto/asn1/a_utctm.c | 71 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/asn1.h | 3 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/a_utctm.c | 71 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/asn1/asn1.h | 3 |
4 files changed, 0 insertions, 148 deletions
diff --git a/src/lib/libcrypto/asn1/a_utctm.c b/src/lib/libcrypto/asn1/a_utctm.c index 0cd0382fe9..e4db9f8a99 100644 --- a/src/lib/libcrypto/asn1/a_utctm.c +++ b/src/lib/libcrypto/asn1/a_utctm.c | |||
@@ -62,39 +62,6 @@ | |||
62 | #include "o_time.h" | 62 | #include "o_time.h" |
63 | #include <openssl/asn1.h> | 63 | #include <openssl/asn1.h> |
64 | 64 | ||
65 | #if 0 | ||
66 | int | ||
67 | i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp) | ||
68 | { | ||
69 | return(i2d_ASN1_bytes((ASN1_STRING *)a, pp, | ||
70 | V_ASN1_UTCTIME, V_ASN1_UNIVERSAL)); | ||
71 | } | ||
72 | |||
73 | ASN1_UTCTIME * | ||
74 | d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp, long length) | ||
75 | { | ||
76 | ASN1_UTCTIME *ret = NULL; | ||
77 | |||
78 | ret = (ASN1_UTCTIME *)d2i_ASN1_bytes((ASN1_STRING **)a, pp, length, | ||
79 | V_ASN1_UTCTIME, V_ASN1_UNIVERSAL); | ||
80 | if (ret == NULL) { | ||
81 | ASN1err(ASN1_F_D2I_ASN1_UTCTIME, ERR_R_NESTED_ASN1_ERROR); | ||
82 | return (NULL); | ||
83 | } | ||
84 | if (!ASN1_UTCTIME_check(ret)) { | ||
85 | ASN1err(ASN1_F_D2I_ASN1_UTCTIME, ASN1_R_INVALID_TIME_FORMAT); | ||
86 | goto err; | ||
87 | } | ||
88 | return (ret); | ||
89 | |||
90 | err: | ||
91 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) | ||
92 | M_ASN1_UTCTIME_free(ret); | ||
93 | return (NULL); | ||
94 | } | ||
95 | |||
96 | #endif | ||
97 | |||
98 | int | 65 | int |
99 | ASN1_UTCTIME_check(ASN1_UTCTIME *d) | 66 | ASN1_UTCTIME_check(ASN1_UTCTIME *d) |
100 | { | 67 | { |
@@ -263,41 +230,3 @@ ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) | |||
263 | 230 | ||
264 | return 0; | 231 | return 0; |
265 | } | 232 | } |
266 | |||
267 | #if 0 | ||
268 | time_t | ||
269 | ASN1_UTCTIME_get(const ASN1_UTCTIME *s) | ||
270 | { | ||
271 | struct tm tm; | ||
272 | int offset; | ||
273 | |||
274 | memset(&tm, '\0', sizeof tm); | ||
275 | |||
276 | #define g2(p) (((p)[0]-'0')*10+(p)[1]-'0') | ||
277 | tm.tm_year = g2(s->data); | ||
278 | if (tm.tm_year < 50) | ||
279 | tm.tm_year += 100; | ||
280 | tm.tm_mon = g2(s->data + 2) - 1; | ||
281 | tm.tm_mday = g2(s->data + 4); | ||
282 | tm.tm_hour = g2(s->data + 6); | ||
283 | tm.tm_min = g2(s->data + 8); | ||
284 | tm.tm_sec = g2(s->data + 10); | ||
285 | if (s->data[12] == 'Z') | ||
286 | offset = 0; | ||
287 | else { | ||
288 | offset = g2(s->data + 13) * 60 + g2(s->data + 15); | ||
289 | if (s->data[12] == '-') | ||
290 | offset = -offset; | ||
291 | } | ||
292 | #undef g2 | ||
293 | |||
294 | return mktime(&tm)-offset*60; /* FIXME: mktime assumes the current timezone | ||
295 | * instead of UTC, and unless we rewrite OpenSSL | ||
296 | * in Lisp we cannot locally change the timezone | ||
297 | * without possibly interfering with other parts | ||
298 | * of the program. timegm, which uses UTC, is | ||
299 | * non-standard. | ||
300 | * Also time_t is inappropriate for general | ||
301 | * UTC times because it may a 32 bit type. */ | ||
302 | } | ||
303 | #endif | ||
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h index e6c93deb2c..868f9c059f 100644 --- a/src/lib/libcrypto/asn1/asn1.h +++ b/src/lib/libcrypto/asn1/asn1.h | |||
@@ -839,9 +839,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | |||
839 | int offset_day, long offset_sec); | 839 | int offset_day, long offset_sec); |
840 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); | 840 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); |
841 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); | 841 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
842 | #if 0 | ||
843 | time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); | ||
844 | #endif | ||
845 | 842 | ||
846 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | 843 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); |
847 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); | 844 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); |
diff --git a/src/lib/libssl/src/crypto/asn1/a_utctm.c b/src/lib/libssl/src/crypto/asn1/a_utctm.c index 0cd0382fe9..e4db9f8a99 100644 --- a/src/lib/libssl/src/crypto/asn1/a_utctm.c +++ b/src/lib/libssl/src/crypto/asn1/a_utctm.c | |||
@@ -62,39 +62,6 @@ | |||
62 | #include "o_time.h" | 62 | #include "o_time.h" |
63 | #include <openssl/asn1.h> | 63 | #include <openssl/asn1.h> |
64 | 64 | ||
65 | #if 0 | ||
66 | int | ||
67 | i2d_ASN1_UTCTIME(ASN1_UTCTIME *a, unsigned char **pp) | ||
68 | { | ||
69 | return(i2d_ASN1_bytes((ASN1_STRING *)a, pp, | ||
70 | V_ASN1_UTCTIME, V_ASN1_UNIVERSAL)); | ||
71 | } | ||
72 | |||
73 | ASN1_UTCTIME * | ||
74 | d2i_ASN1_UTCTIME(ASN1_UTCTIME **a, unsigned char **pp, long length) | ||
75 | { | ||
76 | ASN1_UTCTIME *ret = NULL; | ||
77 | |||
78 | ret = (ASN1_UTCTIME *)d2i_ASN1_bytes((ASN1_STRING **)a, pp, length, | ||
79 | V_ASN1_UTCTIME, V_ASN1_UNIVERSAL); | ||
80 | if (ret == NULL) { | ||
81 | ASN1err(ASN1_F_D2I_ASN1_UTCTIME, ERR_R_NESTED_ASN1_ERROR); | ||
82 | return (NULL); | ||
83 | } | ||
84 | if (!ASN1_UTCTIME_check(ret)) { | ||
85 | ASN1err(ASN1_F_D2I_ASN1_UTCTIME, ASN1_R_INVALID_TIME_FORMAT); | ||
86 | goto err; | ||
87 | } | ||
88 | return (ret); | ||
89 | |||
90 | err: | ||
91 | if ((ret != NULL) && ((a == NULL) || (*a != ret))) | ||
92 | M_ASN1_UTCTIME_free(ret); | ||
93 | return (NULL); | ||
94 | } | ||
95 | |||
96 | #endif | ||
97 | |||
98 | int | 65 | int |
99 | ASN1_UTCTIME_check(ASN1_UTCTIME *d) | 66 | ASN1_UTCTIME_check(ASN1_UTCTIME *d) |
100 | { | 67 | { |
@@ -263,41 +230,3 @@ ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) | |||
263 | 230 | ||
264 | return 0; | 231 | return 0; |
265 | } | 232 | } |
266 | |||
267 | #if 0 | ||
268 | time_t | ||
269 | ASN1_UTCTIME_get(const ASN1_UTCTIME *s) | ||
270 | { | ||
271 | struct tm tm; | ||
272 | int offset; | ||
273 | |||
274 | memset(&tm, '\0', sizeof tm); | ||
275 | |||
276 | #define g2(p) (((p)[0]-'0')*10+(p)[1]-'0') | ||
277 | tm.tm_year = g2(s->data); | ||
278 | if (tm.tm_year < 50) | ||
279 | tm.tm_year += 100; | ||
280 | tm.tm_mon = g2(s->data + 2) - 1; | ||
281 | tm.tm_mday = g2(s->data + 4); | ||
282 | tm.tm_hour = g2(s->data + 6); | ||
283 | tm.tm_min = g2(s->data + 8); | ||
284 | tm.tm_sec = g2(s->data + 10); | ||
285 | if (s->data[12] == 'Z') | ||
286 | offset = 0; | ||
287 | else { | ||
288 | offset = g2(s->data + 13) * 60 + g2(s->data + 15); | ||
289 | if (s->data[12] == '-') | ||
290 | offset = -offset; | ||
291 | } | ||
292 | #undef g2 | ||
293 | |||
294 | return mktime(&tm)-offset*60; /* FIXME: mktime assumes the current timezone | ||
295 | * instead of UTC, and unless we rewrite OpenSSL | ||
296 | * in Lisp we cannot locally change the timezone | ||
297 | * without possibly interfering with other parts | ||
298 | * of the program. timegm, which uses UTC, is | ||
299 | * non-standard. | ||
300 | * Also time_t is inappropriate for general | ||
301 | * UTC times because it may a 32 bit type. */ | ||
302 | } | ||
303 | #endif | ||
diff --git a/src/lib/libssl/src/crypto/asn1/asn1.h b/src/lib/libssl/src/crypto/asn1/asn1.h index e6c93deb2c..868f9c059f 100644 --- a/src/lib/libssl/src/crypto/asn1/asn1.h +++ b/src/lib/libssl/src/crypto/asn1/asn1.h | |||
@@ -839,9 +839,6 @@ ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, | |||
839 | int offset_day, long offset_sec); | 839 | int offset_day, long offset_sec); |
840 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); | 840 | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); |
841 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); | 841 | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
842 | #if 0 | ||
843 | time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); | ||
844 | #endif | ||
845 | 842 | ||
846 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); | 843 | int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a); |
847 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); | 844 | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); |