summaryrefslogtreecommitdiff
path: root/tests/chainverify.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/chainverify.c')
-rw-r--r--tests/chainverify.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/chainverify.c b/tests/chainverify.c
index 85cf690730..1630d32d2f 100644
--- a/tests/chainverify.c
+++ b/tests/chainverify.c
@@ -34,14 +34,15 @@
#include "utils.h"
#include "test-chains.h"
+#define DEFAULT_THEN 1256803113
+static time_t then = DEFAULT_THEN;
+
/* 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. */
static time_t mytime(time_t * t)
{
- time_t then = 1256803113;
-
if (t)
*t = then;
@@ -156,6 +157,11 @@ void doit(void)
if (debug)
printf("\tVerifying...");
+ if (chains[i].expected_time != 0)
+ then = chains[i].expected_time;
+ else
+ then = DEFAULT_THEN;
+
if (chains[i].purpose == NULL) {
ret = gnutls_x509_crt_list_verify(certs, j,
&ca, 1, NULL, 0,