Skip to content
Snippets Groups Projects
Commit 8612df2e authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Daniel P. Berrangé
Browse files

chardev/socket: Use qcrypto_tls_creds_check_endpoint()


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

Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
parent 0279cd95
No related branches found
No related tags found
No related merge requests found
......@@ -1402,18 +1402,12 @@ static void qmp_chardev_open_socket(Chardev *chr,
return;
}
object_ref(OBJECT(s->tls_creds));
if (is_listen) {
if (s->tls_creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_SERVER) {
error_setg(errp, "%s",
"Expected TLS credentials for server endpoint");
return;
}
} else {
if (s->tls_creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT) {
error_setg(errp, "%s",
"Expected TLS credentials for client endpoint");
return;
}
if (!qcrypto_tls_creds_check_endpoint(s->tls_creds,
is_listen
? QCRYPTO_TLS_CREDS_ENDPOINT_SERVER
: QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT,
errp)) {
return;
}
}
s->tls_authz = g_strdup(sock->tls_authz);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment