From: Simon Josefsson Date: Mon, 2 Nov 2009 10:25:27 +0000 (+0100) Subject: Fix time bomb in chainverify self-test. X-Git-Tag: gnutls_2_9_8~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=293d9ba46f66a2d80f13cf87fe31db4eda9c61a7;p=thirdparty%2Fgnutls.git Fix time bomb in chainverify self-test. Reported by Andreas Metzler in . --- diff --git a/tests/chainverify.c b/tests/chainverify.c index 19b27eb82c..13d47103b7 100644 --- a/tests/chainverify.c +++ b/tests/chainverify.c @@ -32,6 +32,21 @@ #include #include +/* GnuTLS internally calls time() to find out the current time when + verifying certificates. To avoid a time bomb, we hard code the + current time. This should work fine on systems where the library + call to time is resolved at run-time. */ +time_t +time (time_t *t) +{ + time_t then = 1256803113; + + if (t) + *t = then; + + return then; +} + /* *INDENT-OFF* */ /* Triggers incorrect verification success on older versions */