Lines Matching +full:data +full:- +full:channel

23 #include "crypto-tls-x509-helpers.h"
24 #include "crypto-tls-psk-helpers.h"
34 #define WORKDIR "tests/test-crypto-tlssession-work/"
36 #define KEYFILE WORKDIR "key-ctx.pem"
50 return -1; in testWrite()
68 return -1; in testRead()
101 int channel[2]; in test_crypto_tls_session_psk() local
106 /* We'll use this for our fake client-server connection */ in test_crypto_tls_session_psk()
107 ret = qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel); in test_crypto_tls_session_psk()
112 * thread, so we need these non-blocking to avoid deadlock in test_crypto_tls_session_psk()
115 qemu_socket_set_nonblock(channel[0]); in test_crypto_tls_session_psk()
116 qemu_socket_set_nonblock(channel[1]); in test_crypto_tls_session_psk()
144 &channel[0]); in test_crypto_tls_session_psk()
147 &channel[1]); in test_crypto_tls_session_psk()
188 close(channel[0]); in test_crypto_tls_session_psk()
189 close(channel[1]); in test_crypto_tls_session_psk()
218 "verify-peer", "yes", in test_tls_creds_x509_create()
223 * and the test-crypto-tlscreds test already in test_tls_creds_x509_create()
226 "sanity-check", "no", in test_tls_creds_x509_create()
245 struct QCryptoTLSSessionTestData *data = in test_crypto_tls_session_x509() local
253 int channel[2]; in test_crypto_tls_session_x509() local
258 /* We'll use this for our fake client-server connection */ in test_crypto_tls_session_x509()
259 ret = qemu_socketpair(AF_UNIX, SOCK_STREAM, 0, channel); in test_crypto_tls_session_x509()
264 * thread, so we need these non-blocking to avoid deadlock in test_crypto_tls_session_x509()
267 qemu_socket_set_nonblock(channel[0]); in test_crypto_tls_session_x509()
268 qemu_socket_set_nonblock(channel[1]); in test_crypto_tls_session_x509()
270 #define CLIENT_CERT_DIR "tests/test-crypto-tlssession-client/" in test_crypto_tls_session_x509()
271 #define SERVER_CERT_DIR "tests/test-crypto-tlssession-server/" in test_crypto_tls_session_x509()
283 g_assert(link(data->servercacrt, in test_crypto_tls_session_x509()
285 g_assert(link(data->servercrt, in test_crypto_tls_session_x509()
290 g_assert(link(data->clientcacrt, in test_crypto_tls_session_x509()
292 g_assert(link(data->clientcrt, in test_crypto_tls_session_x509()
310 wildcards = data->wildcards; in test_crypto_tls_session_x509()
321 clientCreds, data->hostname, NULL, in test_crypto_tls_session_x509()
327 data->wildcards ? "tlssessionacl" : NULL, in test_crypto_tls_session_x509()
336 &channel[0]); in test_crypto_tls_session_x509()
339 &channel[1]); in test_crypto_tls_session_x509()
372 serverSess, data->expectServerFail ? NULL : &error_abort) < 0) { in test_crypto_tls_session_x509()
373 g_assert(data->expectServerFail); in test_crypto_tls_session_x509()
375 g_assert(!data->expectServerFail); in test_crypto_tls_session_x509()
382 clientSess, data->expectClientFail ? NULL : &error_abort) < 0) { in test_crypto_tls_session_x509()
383 g_assert(data->expectClientFail); in test_crypto_tls_session_x509()
385 g_assert(!data->expectClientFail); in test_crypto_tls_session_x509()
406 close(channel[0]); in test_crypto_tls_session_x509()
407 close(channel[1]); in test_crypto_tls_session_x509()
424 /* Simple initial test using Pre-Shared Keys. */ in main()
640 test_tls_write_cert_chain(WORKDIR "cacertchain-sess.pem", in main()
644 TEST_SESS_REG(cachain, WORKDIR "cacertchain-sess.pem", in main()
666 unlink(WORKDIR "cacertchain-sess.pem"); in main()