@@ -19,7 +19,6 @@
#include "qemu/uuid.h"
#include "crypto/secret.h"
#include "crypto/tlscredsx509.h"
-#include "crypto/tlscredspriv.h"
#define VXHS_OPT_FILENAME "filename"
#define VXHS_OPT_VDISK_ID "vdisk-id"
@@ -288,17 +287,17 @@ static void vxhs_get_tls_creds(const char *id,
char **cacert,
/*
* Get the cacert, client_cert and client_key file names.
*/
- if (qcrypto_tls_creds_get_path(creds, QCRYPTO_TLS_CREDS_X509_CA_CERT,
- true, cacert, errp) < 0 ||
- qcrypto_tls_creds_get_path(&creds_x509->parent_obj,
- QCRYPTO_TLS_CREDS_X509_CLIENT_CERT,
- false, cert, errp) < 0 ||
- qcrypto_tls_creds_get_path(&creds_x509->parent_obj,
- QCRYPTO_TLS_CREDS_X509_CLIENT_KEY,
- false, key, errp) < 0) {
- error_setg(errp,
- "Error retrieving information from TLS object");
+ if (!creds->dir) {
+ error_setg(errp, "TLS object missing 'dir' property value");
+ return;
}
+
+ *cacert = g_strdup_printf("%s/%s", creds->dir,
+ QCRYPTO_TLS_CREDS_X509_CA_CERT);
+ *cert = g_strdup_printf("%s/%s", creds->dir,
+ QCRYPTO_TLS_CREDS_X509_CLIENT_CERT);
+ *key = g_strdup_printf("%s/%s", creds->dir,
+ QCRYPTO_TLS_CREDS_X509_CLIENT_KEY);
}