int vnc_tls_set_x509_creds_dir(VncDisplay *vd,

                               const char *certdir)

{

    if (vnc_set_x509_credential(vd, certdir, X509_CA_CERT_FILE, &vd->tls.x509cacert, 0) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(vd, certdir, X509_CA_CRL_FILE, &vd->tls.x509cacrl, 1) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(vd, certdir, X509_SERVER_CERT_FILE, &vd->tls.x509cert, 0) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(vd, certdir, X509_SERVER_KEY_FILE, &vd->tls.x509key, 0) < 0)

        goto cleanup;



    return 0;



 cleanup:

    g_free(vd->tls.x509cacert);

    g_free(vd->tls.x509cacrl);

    g_free(vd->tls.x509cert);

    g_free(vd->tls.x509key);

    vd->tls.x509cacert = vd->tls.x509cacrl = vd->tls.x509cert = vd->tls.x509key = NULL;

    return -1;

}

int vnc_tls_set_x509_creds_dir(VncDisplay *vd,

                               const char *certdir)

{

    if (vnc_set_x509_credential(vd, certdir, X509_CA_CERT_FILE, &vd->tls.x509cacert, 0) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(vd, certdir, X509_CA_CRL_FILE, &vd->tls.x509cacrl, 1) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(vd, certdir, X509_SERVER_CERT_FILE, &vd->tls.x509cert, 0) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(vd, certdir, X509_SERVER_KEY_FILE, &vd->tls.x509key, 0) < 0)

        goto cleanup;



    return 0;



 cleanup:

    g_free(vd->tls.x509cacert);

    g_free(vd->tls.x509cacrl);

    g_free(vd->tls.x509cert);

    g_free(vd->tls.x509key);

    vd->tls.x509cacert = vd->tls.x509cacrl = vd->tls.x509cert = vd->tls.x509key = NULL;

    return -1;

}

    return 0;     return 0;     return 0;     return 0;     return 0; int vnc_tls_set_x509_creds_dir(VncDisplay *vd,                                const char *certdir)     if (vnc_set_x509_credential(vd, certdir, X509_CA_CERT_FILE, &vd->tls.x509cacert, 0) < 0)         goto cleanup;     if (vnc_set_x509_credential(vd, certdir, X509_CA_CRL_FILE, &vd->tls.x509cacrl, 1) < 0)         goto cleanup;     if (vnc_set_x509_credential(vd, certdir, X509_SERVER_CERT_FILE, &vd->tls.x509cert, 0) < 0)         goto cleanup;     if (vnc_set_x509_credential(vd, certdir, X509_SERVER_KEY_FILE, &vd->tls.x509key, 0) < 0)         goto cleanup;     return 0;  cleanup:     g_free(vd->tls.x509cacert);     g_free(vd->tls.x509cacrl);     g_free(vd->tls.x509cert);     g_free(vd->tls.x509key);     vd->tls.x509cacert = vd->tls.x509cacrl = vd->tls.x509cert = vd->tls.x509key = NULL;     return -1; int vnc_tls_set_x509_creds_dir(VncDisplay *vd,
int FUNC_0(VncDisplay *VAR_0,

                               const char *VAR_1)

{

    if (vnc_set_x509_credential(VAR_0, VAR_1, X509_CA_CERT_FILE, &VAR_0->tls.x509cacert, 0) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(VAR_0, VAR_1, X509_CA_CRL_FILE, &VAR_0->tls.x509cacrl, 1) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(VAR_0, VAR_1, X509_SERVER_CERT_FILE, &VAR_0->tls.x509cert, 0) < 0)

        goto cleanup;

    if (vnc_set_x509_credential(VAR_0, VAR_1, X509_SERVER_KEY_FILE, &VAR_0->tls.x509key, 0) < 0)

        goto cleanup;



    return 0;



 cleanup:

    g_free(VAR_0->tls.x509cacert);

    g_free(VAR_0->tls.x509cacrl);

    g_free(VAR_0->tls.x509cert);

    g_free(VAR_0->tls.x509key);

    VAR_0->tls.x509cacert = VAR_0->tls.x509cacrl = VAR_0->tls.x509cert = VAR_0->tls.x509key = NULL;

    return -1;

}

int FUNC_0(VncDisplay *VAR_0,
const char *VAR_1)
{ if (vnc_set_x509_credential(VAR_0, VAR_1, X509_CA_CERT_FILE, &VAR_0->tls.x509cacert, 0) < 0)
goto cleanup; if (vnc_set_x509_credential(VAR_0, VAR_1, X509_CA_CRL_FILE, &VAR_0->tls.x509cacrl, 1) < 0)
goto cleanup; if (vnc_set_x509_credential(VAR_0, VAR_1, X509_SERVER_CERT_FILE, &VAR_0->tls.x509cert, 0) < 0)
goto cleanup; if (vnc_set_x509_credential(VAR_0, VAR_1, X509_SERVER_KEY_FILE, &VAR_0->tls.x509key, 0) < 0)
goto cleanup; return 0; cleanup:
g_free(VAR_0->tls.x509cacert); g_free(VAR_0->tls.x509cacrl); g_free(VAR_0->tls.x509cert); g_free(VAR_0->tls.x509key); VAR_0->tls.x509cacert = VAR_0->tls.x509cacrl = VAR_0->tls.x509cert = VAR_0->tls.x509key = NULL; return -1; }