aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/nbd.c6
-rw-r--r--blockdev-nbd.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/block/nbd.c b/block/nbd.c
index 3cbee76..601fccc 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);
diff --git a/blockdev-nbd.c b/blockdev-nbd.c
index b264620..bdfa7ed 100644
--- a/blockdev-nbd.c
+++ b/blockdev-nbd.c
@@ -108,9 +108,9 @@ static QCryptoTLSCreds *nbd_get_tls_creds(const char *id, Error **errp)
return NULL;
}
- if (creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_SERVER) {
- error_setg(errp,
- "Expecting TLS credentials with a server endpoint");
+ if (!qcrypto_tls_creds_check_endpoint(creds,
+ QCRYPTO_TLS_CREDS_ENDPOINT_SERVER,
+ errp)) {
return NULL;
}
object_ref(obj);