]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix TLS context tests with expired certs
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 25 Jul 2011 15:18:56 +0000 (16:18 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 25 Jul 2011 15:21:19 +0000 (16:21 +0100)
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

index 043ccc29c866ec47e5eae0c593016af91cb3dd13..dfc0ac454169394a624d05970ffb877204c4b18e 100644 (file)
@@ -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);