diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2021-06-28 18:09:12 +0200 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2021-06-29 18:30:20 +0100 |
commit | 5590f65facc508fbc38575f19a0ab2fdcdcf18a4 (patch) | |
tree | 16f257496b59a21556d941c0fc128106fa20be45 | |
parent | 8612df2ebef9ff1f880fe76d223a3369b9c98db2 (diff) |
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>
-rw-r--r-- | migration/tls.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/migration/tls.c b/migration/tls.c index abb149d832..ca1ea3bbdd 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; } |