aboutsummaryrefslogtreecommitdiff
path: root/block/nbd.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2021-06-28 18:09:09 +0200
committerDaniel P. Berrangé <berrange@redhat.com>2021-06-29 18:29:47 +0100
commit7b3b616838c30830c004b746e7b1209297118318 (patch)
treeb606d1e24f7278a3f80d2ea46a70b8dded38955f /block/nbd.c
parente9ac68083f26759b85ef0d871ca2bbe897218f64 (diff)
block/nbd: 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>
Diffstat (limited to 'block/nbd.c')
-rw-r--r--block/nbd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 3cbee762de..601fccc5ba 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -1839,9 +1839,9 @@ static QCryptoTLSCreds *nbd_get_tls_creds(const char *id, Error **errp)
return NULL;
}
- if (creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT) {
- error_setg(errp,
- "Expecting TLS credentials with a client endpoint");
+ if (!qcrypto_tls_creds_check_endpoint(creds,
+ QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT,
+ errp)) {
return NULL;
}
object_ref(obj);