1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

Fix TLS context tests with expired certs

commit 5283ea9b1d 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
This commit is contained in:
Daniel P. Berrange 2011-07-25 16:18:56 +01:00
parent 2a667c34cb
commit 567b8d69b9

View 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);