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>
This commit is contained in:
parent
8612df2ebe
commit
5590f65fac
@ -49,11 +49,7 @@ migration_tls_get_creds(MigrationState *s,
|
|||||||
s->parameters.tls_creds);
|
s->parameters.tls_creds);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (ret->endpoint != endpoint) {
|
if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) {
|
||||||
error_setg(errp,
|
|
||||||
"Expected TLS credentials for a %s endpoint",
|
|
||||||
endpoint == QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT ?
|
|
||||||
"client" : "server");
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user