aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2017-04-26 15:52:57 +0200
committerAndy Polyakov <appro@openssl.org>2017-04-27 13:01:08 +0200
commitb12ae4a912a19cbab8d993e61114e65fce0d1834 (patch)
tree3a2f325234acf39f23dda66e3f2a12825fb95310
parent11ba87f2ff8e2455c6627a83aa458384fe7de70a (diff)
downloadopenssl-b12ae4a912a19cbab8d993e61114e65fce0d1834.tar.gz
fuzz/{client,server}.c: omit _time64 "overload method".
Approach was opportunistic in Windows context from its inception and on top of that it was proven to be error-prone at link stage. Correct answer is to introduce library-specific time function that we can control in platform-neutral manner. Meanwhile we just let be attempts to override time on Windows. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3320)
-rw-r--r--fuzz/client.c14
-rw-r--r--fuzz/server.c14
2 files changed, 12 insertions, 16 deletions
diff --git a/fuzz/client.c b/fuzz/client.c
index 92ec6c004d..104938f42d 100644
--- a/fuzz/client.c
+++ b/fuzz/client.c
@@ -31,15 +31,13 @@ static int idx;
#define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
/*
- * This might not in all cases and still get the current time
- * instead of the fixed time. This will just result in things
- * not being fully reproducible and have a slightly different
- * coverage.
+ * This might not work in all cases (and definitely not on Windows
+ * because of the way linkers are) and callees can still get the
+ * current time instead of the fixed time. This will just result
+ * in things not being fully reproducible and have a slightly
+ * different coverage.
*/
-#if defined(_WIN32) && defined(_TIME64_T_DEFINED)
-__time64_t _time64(__time64_t *t) TIME_IMPL(t)
-#endif
-#if !defined(_WIN32) || !defined(_MSC_VER)
+#if !defined(_WIN32)
time_t time(time_t *t) TIME_IMPL(t)
#endif
diff --git a/fuzz/server.c b/fuzz/server.c
index 93cdc68d3f..397867f065 100644
--- a/fuzz/server.c
+++ b/fuzz/server.c
@@ -478,15 +478,13 @@ static int idx;
#define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
/*
- * This might not in all cases and still get the current time
- * instead of the fixed time. This will just result in things
- * not being fully reproducible and have a slightly different
- * coverage.
+ * This might not work in all cases (and definitely not on Windows
+ * because of the way linkers are) and callees can still get the
+ * current time instead of the fixed time. This will just result
+ * in things not being fully reproducible and have a slightly
+ * different coverage.
*/
-#if defined(_WIN32) && defined(_TIME64_T_DEFINED)
-__time64_t _time64(__time64_t *t) TIME_IMPL(t)
-#endif
-#if !defined(_WIN32) || !defined(_MSC_VER)
+#if !defined(_WIN32)
time_t time(time_t *t) TIME_IMPL(t)
#endif