qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 6/7] ui/vnc: Use qcrypto_tls_session_check_role()


From: Philippe Mathieu-Daudé
Subject: [PATCH v2 6/7] ui/vnc: Use qcrypto_tls_session_check_role()
Date: Tue, 15 Jun 2021 18:47:50 +0200

Avoid accessing QCryptoTLSCreds internals by using
the qcrypto_tls_session_check_role() helper.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 ui/vnc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index b3d4d7b9a5f..ad68f9b639f 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -4080,7 +4080,8 @@ void vnc_display_open(const char *id, Error **errp)
         }
         object_ref(OBJECT(vd->tlscreds));
 
-        if (vd->tlscreds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_SERVER) {
+        if (!qcrypto_tls_session_check_role(vd->tlscreds,
+                                            
QCRYPTO_TLS_CREDS_ENDPOINT_SERVER)) {
             error_setg(errp,
                        "Expecting TLS credentials with a server endpoint");
             goto fail;
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]