]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration/tls: Use qcrypto_tls_creds_check_endpoint()
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 28 Jun 2021 16:09:12 +0000 (18:09 +0200)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 29 Jun 2021 17:30:20 +0000 (18:30 +0100)
Avoid accessing QCryptoTLSCreds internals by using
the qcrypto_tls_creds_check_endpoint() helper.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
migration/tls.c

index abb149d8325304ba36b1910dd06255af1128ce2a..ca1ea3bbdd4522ba6989871b724d90fb1c4a9afd 100644 (file)
@@ -49,11 +49,7 @@ migration_tls_get_creds(MigrationState *s,
                    s->parameters.tls_creds);
         return NULL;
     }
-    if (ret->endpoint != endpoint) {
-        error_setg(errp,
-                   "Expected TLS credentials for a %s endpoint",
-                   endpoint == QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT ?
-                   "client" : "server");
+    if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) {
         return NULL;
     }