static int vnc_set_x509_credential_dir(VncDisplay *vs,

				       const char *certdir)

{

    if (vnc_set_x509_credential(vs, certdir, X509_CA_CERT_FILE, &vs->x509cacert, 0) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_CA_CRL_FILE, &vs->x509cacrl, 1) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_SERVER_CERT_FILE, &vs->x509cert, 0) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_SERVER_KEY_FILE, &vs->x509key, 0) < 0)

	goto cleanup;



    return 0;



 cleanup:

    qemu_free(vs->x509cacert);

    qemu_free(vs->x509cacrl);

    qemu_free(vs->x509cert);

    qemu_free(vs->x509key);

    vs->x509cacert = vs->x509cacrl = vs->x509cert = vs->x509key = NULL;

    return -1;

}

static int vnc_set_x509_credential_dir(VncDisplay *vs,

				       const char *certdir)

{

    if (vnc_set_x509_credential(vs, certdir, X509_CA_CERT_FILE, &vs->x509cacert, 0) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_CA_CRL_FILE, &vs->x509cacrl, 1) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_SERVER_CERT_FILE, &vs->x509cert, 0) < 0)

	goto cleanup;

    if (vnc_set_x509_credential(vs, certdir, X509_SERVER_KEY_FILE, &vs->x509key, 0) < 0)

	goto cleanup;



    return 0;



 cleanup:

    qemu_free(vs->x509cacert);

    qemu_free(vs->x509cacrl);

    qemu_free(vs->x509cert);

    qemu_free(vs->x509key);

    vs->x509cacert = vs->x509cacrl = vs->x509cert = vs->x509key = NULL;

    return -1;

}

static 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->x509cacert, 0) < 0)

	goto cleanup;

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

	goto cleanup;

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

	goto cleanup;

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

	goto cleanup;



    return 0;



 cleanup:

    qemu_free(VAR_0->x509cacert);

    qemu_free(VAR_0->x509cacrl);

    qemu_free(VAR_0->x509cert);

    qemu_free(VAR_0->x509key);

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

    return -1;

}

static 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->x509cacert, 0) < 0)
goto cleanup; if (vnc_set_x509_credential(VAR_0, VAR_1, X509_CA_CRL_FILE, &VAR_0->x509cacrl, 1) < 0)
goto cleanup; if (vnc_set_x509_credential(VAR_0, VAR_1, X509_SERVER_CERT_FILE, &VAR_0->x509cert, 0) < 0)
goto cleanup; if (vnc_set_x509_credential(VAR_0, VAR_1, X509_SERVER_KEY_FILE, &VAR_0->x509key, 0) < 0)
goto cleanup; return 0; cleanup:
qemu_free(VAR_0->x509cacert); qemu_free(VAR_0->x509cacrl); qemu_free(VAR_0->x509cert); qemu_free(VAR_0->x509key); VAR_0->x509cacert = VAR_0->x509cacrl = VAR_0->x509cert = VAR_0->x509key = NULL; return -1; }