From 567b8d69b97827da0e6e7145edb83ec0d7deff86 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 25 Jul 2011 16:18:56 +0100 Subject: [PATCH] Fix TLS context tests with expired certs commit 5283ea9b1d8a4b0f2fd6796bf60615aca7b6c3e6 changed the semantics of the 'expire_offset' field in the test case struct so that instead of being an absolute timestamp, it was a delta relative to the current time. This broke the test cases which were testing expiry of certificates, by putting the expiry time into the future, instead of in the past. Fix this by changing the expiry values to be negative, so that the delta goes into the past again. * virnettlscontexttest.c: Fix expiry tests --- tests/virnettlscontexttest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 043ccc29c8..dfc0ac4541 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -1112,7 +1112,7 @@ mymain(void) true, true, true, true, true, GNUTLS_KEY_KEY_CERT_SIGN, false, false, NULL, NULL, - 0, 1, + 0, -1, }; static struct testTLSCertReq servercertexpreq = { NULL, NULL, "servercert.pem", "UK", @@ -1120,7 +1120,7 @@ mymain(void) true, true, false, true, true, GNUTLS_KEY_DIGITAL_SIGNATURE | GNUTLS_KEY_KEY_ENCIPHERMENT, true, true, GNUTLS_KP_TLS_WWW_SERVER, NULL, - 0, 1, + 0, -1, }; static struct testTLSCertReq clientcertexpreq = { NULL, NULL, "clientcert.pem", "UK", @@ -1128,7 +1128,7 @@ mymain(void) true, true, false, true, true, GNUTLS_KEY_DIGITAL_SIGNATURE | GNUTLS_KEY_KEY_ENCIPHERMENT, true, true, GNUTLS_KP_TLS_WWW_CLIENT, NULL, - 0, 1, + 0, -1, }; DO_CTX_TEST(true, cacertexpreq, servercertreq, true);