From 3b300c4263ad641788016e30159388f3bcd4f5d4 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 24 Mar 2012 01:18:02 +0100 Subject: [PATCH] Fixes for win32 and time. OCSP test now sets a fixed time to avoid expiration errors. --- tests/ocsp.c | 14 +++++++++++++- tests/openpgp-auth2.c | 2 ++ tests/resume-dtls.c | 13 ++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/tests/ocsp.c b/tests/ocsp.c index a707671ce..8449923cb 100644 --- a/tests/ocsp.c +++ b/tests/ocsp.c @@ -33,6 +33,16 @@ #include "utils.h" +static time_t mytime (time_t * t) +{ + time_t then = 1332548220; + + if (t) + *t = then; + + return then; +} + /* sample request */ static void @@ -1449,8 +1459,10 @@ doit (void) exit (1); } + gnutls_global_set_time_function (mytime); gnutls_global_set_log_function (tls_log_func); - gnutls_global_set_log_level (0); + if (debug) + gnutls_global_set_log_level (99); ocsp_invalid_calls (); req_parse (); diff --git a/tests/openpgp-auth2.c b/tests/openpgp-auth2.c index d87f79f94..b1db9f279 100644 --- a/tests/openpgp-auth2.c +++ b/tests/openpgp-auth2.c @@ -253,6 +253,8 @@ doit () gnutls_global_deinit (); } #else +#include + void doit () { diff --git a/tests/resume-dtls.c b/tests/resume-dtls.c index acdb8b582..03f606ce1 100644 --- a/tests/resume-dtls.c +++ b/tests/resume-dtls.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2004-2012 Free Software Foundation, Inc. * - * Author: Simon Josefsson + * Author: Nikos Mavrogiannopoulos * * This file is part of GnuTLS. * @@ -39,6 +39,15 @@ #include #include +#if defined(_WIN32) + +int main() +{ + exit(77); +} + +#else + #include "tcp.c" #include "utils.h" @@ -665,3 +674,5 @@ wrap_db_delete (void *dbf, gnutls_datum_t key) return -1; } + +#endif /* WIN32 */ -- 2.11.4.GIT