diff options
author | Simon Josefsson <simon@josefsson.org> | 2009-11-02 11:25:27 +0100 |
---|---|---|
committer | Simon Josefsson <simon@josefsson.org> | 2009-11-02 11:25:27 +0100 |
commit | 293d9ba46f66a2d80f13cf87fe31db4eda9c61a7 (patch) | |
tree | b13381266b9984324a88e2bee3a91ac302d92c3a | |
parent | 1d8288977316750e97b706ee537abe15bf94bd2b (diff) | |
download | gnutls-293d9ba46f66a2d80f13cf87fe31db4eda9c61a7.tar.gz |
Fix time bomb in chainverify self-test.
Reported by Andreas Metzler <ametzler@downhill.at.eu.org>
in <http://thread.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/3925>.
-rw-r--r-- | tests/chainverify.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 <gnutls/gnutls.h> #include <gnutls/x509.h> +/* 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 */ |