aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2021-06-28 18:09:12 +0200
committerMichael Roth <michael.roth@amd.com>2021-10-14 16:27:29 -0500
commita1c966bdf4174f238077784016854231033034cf (patch)
treef20efe4418202c88624f69531869f4e68f0ab76f
parent0a7e2c99f9cbe6c64e0e7ba002d362d0e4b6dc5c (diff)
downloadqemu-a1c966bdf4174f238077784016854231033034cf.zip
qemu-a1c966bdf4174f238077784016854231033034cf.tar.gz
qemu-a1c966bdf4174f238077784016854231033034cf.tar.bz2
migration/tls: Use qcrypto_tls_creds_check_endpoint()
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> (cherry picked from commit 5590f65facc508fbc38575f19a0ab2fdcdcf18a4) Signed-off-by: Michael Roth <michael.roth@amd.com>
-rw-r--r--migration/tls.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/migration/tls.c b/migration/tls.c
index abb149d..ca1ea3b 100644
--- a/migration/tls.c
+++ b/migration/tls.c
@@ -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;
}