static void test_io_channel_tls(const void *opaque)

{

    struct QIOChannelTLSTestData *data =

        (struct QIOChannelTLSTestData *)opaque;

    QCryptoTLSCreds *clientCreds;

    QCryptoTLSCreds *serverCreds;

    QIOChannelTLS *clientChanTLS;

    QIOChannelTLS *serverChanTLS;

    QIOChannelSocket *clientChanSock;

    QIOChannelSocket *serverChanSock;

    qemu_acl *acl;

    const char * const *wildcards;

    int channel[2];

    struct QIOChannelTLSHandshakeData clientHandshake = { false, false };

    struct QIOChannelTLSHandshakeData serverHandshake = { false, false };

    Error *err = NULL;

    QIOChannelTest *test;

    GMainContext *mainloop;



    /* We'll use this for our fake client-server connection */

    g_assert(socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == 0);



#define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/"

#define SERVER_CERT_DIR "tests/test-io-channel-tls-server/"

    mkdir(CLIENT_CERT_DIR, 0700);

    mkdir(SERVER_CERT_DIR, 0700);



    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);



    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);



    g_assert(link(data->servercacrt,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0);

    g_assert(link(data->servercrt,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0);

    g_assert(link(KEYFILE,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0);



    g_assert(link(data->clientcacrt,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0);

    g_assert(link(data->clientcrt,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0);

    g_assert(link(KEYFILE,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0);



    clientCreds = test_tls_creds_create(

        QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT,

        CLIENT_CERT_DIR,

        &err);

    g_assert(clientCreds != NULL);



    serverCreds = test_tls_creds_create(

        QCRYPTO_TLS_CREDS_ENDPOINT_SERVER,

        SERVER_CERT_DIR,

        &err);

    g_assert(serverCreds != NULL);



    acl = qemu_acl_init("channeltlsacl");

    qemu_acl_reset(acl);

    wildcards = data->wildcards;

    while (wildcards && *wildcards) {

        qemu_acl_append(acl, 0, *wildcards);

        wildcards++;

    }



    clientChanSock = qio_channel_socket_new_fd(

        channel[0], &err);

    g_assert(clientChanSock != NULL);

    serverChanSock = qio_channel_socket_new_fd(

        channel[1], &err);

    g_assert(serverChanSock != NULL);



    /*

     * We have an evil loop to do the handshake in a single

     * thread, so we need these non-blocking to avoid deadlock

     * of ourselves

     */

    qio_channel_set_blocking(QIO_CHANNEL(clientChanSock), false, NULL);

    qio_channel_set_blocking(QIO_CHANNEL(serverChanSock), false, NULL);



    /* Now the real part of the test, setup the sessions */

    clientChanTLS = qio_channel_tls_new_client(

        QIO_CHANNEL(clientChanSock), clientCreds,

        data->hostname, &err);

    g_assert(clientChanTLS != NULL);



    serverChanTLS = qio_channel_tls_new_server(

        QIO_CHANNEL(serverChanSock), serverCreds,

        "channeltlsacl", &err);

    g_assert(serverChanTLS != NULL);



    qio_channel_tls_handshake(clientChanTLS,

                              test_tls_handshake_done,

                              &clientHandshake,

                              NULL);

    qio_channel_tls_handshake(serverChanTLS,

                              test_tls_handshake_done,

                              &serverHandshake,

                              NULL);



    /*

     * Finally we loop around & around doing handshake on each

     * session until we get an error, or the handshake completes.

     * This relies on the socketpair being nonblocking to avoid

     * deadlocking ourselves upon handshake

     */

    mainloop = g_main_context_default();

    do {

        g_main_context_iteration(mainloop, TRUE);

    } while (!clientHandshake.finished &&

             !serverHandshake.finished);



    g_assert(clientHandshake.failed == data->expectClientFail);

    g_assert(serverHandshake.failed == data->expectServerFail);



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, false,

                                 QIO_CHANNEL(clientChanTLS),

                                 QIO_CHANNEL(serverChanTLS));

    qio_channel_test_validate(test);



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, true,

                                 QIO_CHANNEL(clientChanTLS),

                                 QIO_CHANNEL(serverChanTLS));

    qio_channel_test_validate(test);



    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);



    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);



    rmdir(CLIENT_CERT_DIR);

    rmdir(SERVER_CERT_DIR);



    object_unparent(OBJECT(serverCreds));

    object_unparent(OBJECT(clientCreds));



    object_unref(OBJECT(serverChanTLS));

    object_unref(OBJECT(clientChanTLS));



    object_unref(OBJECT(serverChanSock));

    object_unref(OBJECT(clientChanSock));



    close(channel[0]);

    close(channel[1]);

}

static void test_io_channel_tls(const void *opaque)

{

    struct QIOChannelTLSTestData *data =

        (struct QIOChannelTLSTestData *)opaque;

    QCryptoTLSCreds *clientCreds;

    QCryptoTLSCreds *serverCreds;

    QIOChannelTLS *clientChanTLS;

    QIOChannelTLS *serverChanTLS;

    QIOChannelSocket *clientChanSock;

    QIOChannelSocket *serverChanSock;

    qemu_acl *acl;

    const char * const *wildcards;

    int channel[2];

    struct QIOChannelTLSHandshakeData clientHandshake = { false, false };

    struct QIOChannelTLSHandshakeData serverHandshake = { false, false };

    Error *err = NULL;

    QIOChannelTest *test;

    GMainContext *mainloop;



    

    g_assert(socketpair(AF_UNIX, SOCK_STREAM, 0, channel) == 0);



#define CLIENT_CERT_DIR "tests/test-io-channel-tls-client/"

#define SERVER_CERT_DIR "tests/test-io-channel-tls-server/"

    mkdir(CLIENT_CERT_DIR, 0700);

    mkdir(SERVER_CERT_DIR, 0700);



    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);



    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);



    g_assert(link(data->servercacrt,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0);

    g_assert(link(data->servercrt,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0);

    g_assert(link(KEYFILE,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0);



    g_assert(link(data->clientcacrt,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0);

    g_assert(link(data->clientcrt,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0);

    g_assert(link(KEYFILE,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0);



    clientCreds = test_tls_creds_create(

        QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT,

        CLIENT_CERT_DIR,

        &err);

    g_assert(clientCreds != NULL);



    serverCreds = test_tls_creds_create(

        QCRYPTO_TLS_CREDS_ENDPOINT_SERVER,

        SERVER_CERT_DIR,

        &err);

    g_assert(serverCreds != NULL);



    acl = qemu_acl_init("channeltlsacl");

    qemu_acl_reset(acl);

    wildcards = data->wildcards;

    while (wildcards && *wildcards) {

        qemu_acl_append(acl, 0, *wildcards);

        wildcards++;

    }



    clientChanSock = qio_channel_socket_new_fd(

        channel[0], &err);

    g_assert(clientChanSock != NULL);

    serverChanSock = qio_channel_socket_new_fd(

        channel[1], &err);

    g_assert(serverChanSock != NULL);



    









    qio_channel_set_blocking(QIO_CHANNEL(clientChanSock), false, NULL);

    qio_channel_set_blocking(QIO_CHANNEL(serverChanSock), false, NULL);



    

    clientChanTLS = qio_channel_tls_new_client(

        QIO_CHANNEL(clientChanSock), clientCreds,

        data->hostname, &err);

    g_assert(clientChanTLS != NULL);



    serverChanTLS = qio_channel_tls_new_server(

        QIO_CHANNEL(serverChanSock), serverCreds,

        "channeltlsacl", &err);

    g_assert(serverChanTLS != NULL);



    qio_channel_tls_handshake(clientChanTLS,

                              test_tls_handshake_done,

                              &clientHandshake,

                              NULL);

    qio_channel_tls_handshake(serverChanTLS,

                              test_tls_handshake_done,

                              &serverHandshake,

                              NULL);



    











    mainloop = g_main_context_default();

    do {

        g_main_context_iteration(mainloop, TRUE);

    } while (!clientHandshake.finished &&

             !serverHandshake.finished);



    g_assert(clientHandshake.failed == data->expectClientFail);

    g_assert(serverHandshake.failed == data->expectServerFail);



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, false,

                                 QIO_CHANNEL(clientChanTLS),

                                 QIO_CHANNEL(serverChanTLS));

    qio_channel_test_validate(test);



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, true,

                                 QIO_CHANNEL(clientChanTLS),

                                 QIO_CHANNEL(serverChanTLS));

    qio_channel_test_validate(test);



    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);



    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);



    rmdir(CLIENT_CERT_DIR);

    rmdir(SERVER_CERT_DIR);



    object_unparent(OBJECT(serverCreds));

    object_unparent(OBJECT(clientCreds));



    object_unref(OBJECT(serverChanTLS));

    object_unref(OBJECT(clientChanTLS));



    object_unref(OBJECT(serverChanSock));

    object_unref(OBJECT(clientChanSock));



    close(channel[0]);

    close(channel[1]);

}

    } while (!clientHandshake.finished &&
static void FUNC_0(const void *VAR_0)

{

    struct QIOChannelTLSTestData *VAR_1 =

        (struct QIOChannelTLSTestData *)VAR_0;

    QCryptoTLSCreds *clientCreds;

    QCryptoTLSCreds *serverCreds;

    QIOChannelTLS *clientChanTLS;

    QIOChannelTLS *serverChanTLS;

    QIOChannelSocket *clientChanSock;

    QIOChannelSocket *serverChanSock;

    qemu_acl *acl;

    const char * const *VAR_2;

    int VAR_3[2];

    struct QIOChannelTLSHandshakeData VAR_4 = { false, false };

    struct QIOChannelTLSHandshakeData VAR_5 = { false, false };

    Error *err = NULL;

    QIOChannelTest *test;

    GMainContext *mainloop;



    

    g_assert(socketpair(AF_UNIX, SOCK_STREAM, 0, VAR_3) == 0);



#define CLIENT_CERT_DIR "tests/test-io-VAR_3-tls-client/"

#define SERVER_CERT_DIR "tests/test-io-VAR_3-tls-server/"

    mkdir(CLIENT_CERT_DIR, 0700);

    mkdir(SERVER_CERT_DIR, 0700);



    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);



    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);



    g_assert(link(VAR_1->servercacrt,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0);

    g_assert(link(VAR_1->servercrt,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0);

    g_assert(link(KEYFILE,

                  SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0);



    g_assert(link(VAR_1->clientcacrt,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0);

    g_assert(link(VAR_1->clientcrt,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0);

    g_assert(link(KEYFILE,

                  CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0);



    clientCreds = test_tls_creds_create(

        QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT,

        CLIENT_CERT_DIR,

        &err);

    g_assert(clientCreds != NULL);



    serverCreds = test_tls_creds_create(

        QCRYPTO_TLS_CREDS_ENDPOINT_SERVER,

        SERVER_CERT_DIR,

        &err);

    g_assert(serverCreds != NULL);



    acl = qemu_acl_init("channeltlsacl");

    qemu_acl_reset(acl);

    VAR_2 = VAR_1->VAR_2;

    while (VAR_2 && *VAR_2) {

        qemu_acl_append(acl, 0, *VAR_2);

        VAR_2++;

    }



    clientChanSock = qio_channel_socket_new_fd(

        VAR_3[0], &err);

    g_assert(clientChanSock != NULL);

    serverChanSock = qio_channel_socket_new_fd(

        VAR_3[1], &err);

    g_assert(serverChanSock != NULL);



    









    qio_channel_set_blocking(QIO_CHANNEL(clientChanSock), false, NULL);

    qio_channel_set_blocking(QIO_CHANNEL(serverChanSock), false, NULL);



    

    clientChanTLS = qio_channel_tls_new_client(

        QIO_CHANNEL(clientChanSock), clientCreds,

        VAR_1->hostname, &err);

    g_assert(clientChanTLS != NULL);



    serverChanTLS = qio_channel_tls_new_server(

        QIO_CHANNEL(serverChanSock), serverCreds,

        "channeltlsacl", &err);

    g_assert(serverChanTLS != NULL);



    qio_channel_tls_handshake(clientChanTLS,

                              test_tls_handshake_done,

                              &VAR_4,

                              NULL);

    qio_channel_tls_handshake(serverChanTLS,

                              test_tls_handshake_done,

                              &VAR_5,

                              NULL);



    











    mainloop = g_main_context_default();

    do {

        g_main_context_iteration(mainloop, TRUE);

    } while (!VAR_4.finished &&

             !VAR_5.finished);



    g_assert(VAR_4.failed == VAR_1->expectClientFail);

    g_assert(VAR_5.failed == VAR_1->expectServerFail);



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, false,

                                 QIO_CHANNEL(clientChanTLS),

                                 QIO_CHANNEL(serverChanTLS));

    qio_channel_test_validate(test);



    test = qio_channel_test_new();

    qio_channel_test_run_threads(test, true,

                                 QIO_CHANNEL(clientChanTLS),

                                 QIO_CHANNEL(serverChanTLS));

    qio_channel_test_validate(test);



    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT);

    unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY);



    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);

    unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);



    rmdir(CLIENT_CERT_DIR);

    rmdir(SERVER_CERT_DIR);



    object_unparent(OBJECT(serverCreds));

    object_unparent(OBJECT(clientCreds));



    object_unref(OBJECT(serverChanTLS));

    object_unref(OBJECT(clientChanTLS));



    object_unref(OBJECT(serverChanSock));

    object_unref(OBJECT(clientChanSock));



    close(VAR_3[0]);

    close(VAR_3[1]);

}

static void FUNC_0(const void *VAR_0)
{ struct QIOChannelTLSTestData *VAR_1 =
(struct QIOChannelTLSTestData *)VAR_0; QCryptoTLSCreds *clientCreds; QCryptoTLSCreds *serverCreds; QIOChannelTLS *clientChanTLS; QIOChannelTLS *serverChanTLS; QIOChannelSocket *clientChanSock; QIOChannelSocket *serverChanSock; qemu_acl *acl; const char * const *VAR_2; int VAR_3[2]; struct QIOChannelTLSHandshakeData VAR_4 = { false, false }; struct QIOChannelTLSHandshakeData VAR_5 = { false, false }; Error *err = NULL; QIOChannelTest *test; GMainContext *mainloop; g_assert(socketpair(AF_UNIX, SOCK_STREAM, 0, VAR_3) == 0); #define CLIENT_CERT_DIR "tests/test-io-VAR_3-tls-client/"
#define SERVER_CERT_DIR "tests/test-io-VAR_3-tls-server/"
mkdir(CLIENT_CERT_DIR, 0700); mkdir(SERVER_CERT_DIR, 0700); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); g_assert(link(VAR_1->servercacrt,
SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); g_assert(link(VAR_1->servercrt,
SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT) == 0); g_assert(link(KEYFILE,
SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY) == 0); g_assert(link(VAR_1->clientcacrt,
CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT) == 0); g_assert(link(VAR_1->clientcrt,
CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT) == 0); g_assert(link(KEYFILE,
CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY) == 0); clientCreds = test_tls_creds_create(
QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT,
CLIENT_CERT_DIR,
&err); g_assert(clientCreds != NULL); serverCreds = test_tls_creds_create(
QCRYPTO_TLS_CREDS_ENDPOINT_SERVER,
SERVER_CERT_DIR,
&err); g_assert(serverCreds != NULL); acl = qemu_acl_init("channeltlsacl"); qemu_acl_reset(acl); VAR_2 = VAR_1->VAR_2; while (VAR_2 && *VAR_2) { qemu_acl_append(acl, 0, *VAR_2); VAR_2++; } clientChanSock = qio_channel_socket_new_fd(
VAR_3[0], &err); g_assert(clientChanSock != NULL); serverChanSock = qio_channel_socket_new_fd(
VAR_3[1], &err); g_assert(serverChanSock != NULL); qio_channel_set_blocking(QIO_CHANNEL(clientChanSock), false, NULL); qio_channel_set_blocking(QIO_CHANNEL(serverChanSock), false, NULL); clientChanTLS = qio_channel_tls_new_client(
QIO_CHANNEL(clientChanSock), clientCreds,
VAR_1->hostname, &err); g_assert(clientChanTLS != NULL); serverChanTLS = qio_channel_tls_new_server(
QIO_CHANNEL(serverChanSock), serverCreds,
"channeltlsacl", &err); g_assert(serverChanTLS != NULL); qio_channel_tls_handshake(clientChanTLS,
test_tls_handshake_done,
&VAR_4,
NULL); qio_channel_tls_handshake(serverChanTLS,
test_tls_handshake_done,
&VAR_5,
NULL); mainloop = g_main_context_default(); do { g_main_context_iteration(mainloop, TRUE); } while (!VAR_4.finished && !VAR_5.finished); g_assert(VAR_4.failed == VAR_1->expectClientFail); g_assert(VAR_5.failed == VAR_1->expectServerFail); test = qio_channel_test_new(); qio_channel_test_run_threads(test, false,
QIO_CHANNEL(clientChanTLS),
QIO_CHANNEL(serverChanTLS)); qio_channel_test_validate(test); test = qio_channel_test_new(); qio_channel_test_run_threads(test, true,
QIO_CHANNEL(clientChanTLS),
QIO_CHANNEL(serverChanTLS)); qio_channel_test_validate(test); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_CERT); unlink(SERVER_CERT_DIR QCRYPTO_TLS_CREDS_X509_SERVER_KEY); unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CA_CERT); unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); unlink(CLIENT_CERT_DIR QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); rmdir(CLIENT_CERT_DIR); rmdir(SERVER_CERT_DIR); object_unparent(OBJECT(serverCreds)); object_unparent(OBJECT(clientCreds)); object_unref(OBJECT(serverChanTLS)); object_unref(OBJECT(clientChanTLS)); object_unref(OBJECT(serverChanSock)); object_unref(OBJECT(clientChanSock)); close(VAR_3[0]); close(VAR_3[1]); }