diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2021-06-28 18:09:13 +0200 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2021-06-29 18:30:22 +0100 |
commit | 3c52bf0c608419d7892fea95f2a0af8f2e99633e (patch) | |
tree | ce708a32e3d66884e4a93fd47080a87df7c6e655 /ui | |
parent | 5590f65facc508fbc38575f19a0ab2fdcdcf18a4 (diff) |
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>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/vnc.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -46,6 +46,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" @@ -4080,9 +4081,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; } } |