Skip to content

Commit

Permalink
ui/vnc: Use qcrypto_tls_creds_check_endpoint()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
philmd authored and berrange committed Jun 29, 2021
1 parent 5590f65 commit 3c52bf0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/vnc.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 3c52bf0

Please sign in to comment.