mirror of
https://github.com/qemu/qemu.git
synced 2024-12-04 09:13:39 +08:00
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 3c52bf0c60
)
Signed-off-by: Michael Roth <michael.roth@amd.com>
This commit is contained in:
parent
a1c966bdf4
commit
43844c2fb2
7
ui/vnc.c
7
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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user