aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2021-06-28 18:09:13 +0200
committerMichael Roth <michael.roth@amd.com>2021-10-14 16:27:33 -0500
commit43844c2fb2fffd0f710071259453714acb804c07 (patch)
tree904827157c426b2d60ee46e4982b72017d04e98e
parenta1c966bdf4174f238077784016854231033034cf (diff)
downloadqemu-43844c2fb2fffd0f710071259453714acb804c07.zip
qemu-43844c2fb2fffd0f710071259453714acb804c07.tar.gz
qemu-43844c2fb2fffd0f710071259453714acb804c07.tar.bz2
ui/vnc: Use qcrypto_tls_creds_check_endpoint()
Avoid accessing QCryptoTLSCreds internals by using the qcrypto_tls_creds_check_endpoint() helper. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> (cherry picked from commit 3c52bf0c608419d7892fea95f2a0af8f2e99633e) Signed-off-by: Michael Roth <michael.roth@amd.com>
-rw-r--r--ui/vnc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 456db47..36fe1ff 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -45,6 +45,7 @@
#include "qapi/qapi-commands-ui.h"
#include "ui/input.h"
#include "crypto/hash.h"
+#include "crypto/tlscreds.h"
#include "crypto/tlscredsanon.h"
#include "crypto/tlscredsx509.h"
#include "crypto/random.h"
@@ -4071,9 +4072,9 @@ void vnc_display_open(const char *id, Error **errp)
}
object_ref(OBJECT(vd->tlscreds));
- if (vd->tlscreds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_SERVER) {
- error_setg(errp,
- "Expecting TLS credentials with a server endpoint");
+ if (!qcrypto_tls_creds_check_endpoint(vd->tlscreds,
+ QCRYPTO_TLS_CREDS_ENDPOINT_SERVER,
+ errp)) {
goto fail;
}
}