[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 29/64] block/nbd: Use qcrypto_tls_creds_check_endpoint()
From: |
Michael Roth |
Subject: |
[PATCH 29/64] block/nbd: Use qcrypto_tls_creds_check_endpoint() |
Date: |
Tue, 19 Oct 2021 09:09:09 -0500 |
From: Philippe Mathieu-Daudé <philmd@redhat.com>
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>
(cherry picked from commit 7b3b616838c30830c004b746e7b1209297118318)
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
block/nbd.c | 6 +++---
blockdev-nbd.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index 1d4668d42d..add03cfa03 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -2163,9 +2163,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 b264620b98..bdfa7ed3a5 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);
--
2.25.1
- [PATCH 20/64] esp: only set ESP_RSEQ at the start of the select sequence, (continued)
- [PATCH 20/64] esp: only set ESP_RSEQ at the start of the select sequence, Michael Roth, 2021/10/19
- [PATCH 01/64] multi-process: Initialize variables declared with g_auto*, Michael Roth, 2021/10/19
- [PATCH 21/64] runstate: Initialize Error * to NULL, Michael Roth, 2021/10/19
- [PATCH 22/64] vfio: Fix unregister SaveVMHandler in vfio_migration_finalize, Michael Roth, 2021/10/19
- [PATCH 23/64] vl: Fix an assert failure in error path, Michael Roth, 2021/10/19
- [PATCH 24/64] tcg/sparc: Fix temp_allocate_frame vs sparc stack bias, Michael Roth, 2021/10/19
- [PATCH 25/64] tcg: Allocate sufficient storage in temp_allocate_frame, Michael Roth, 2021/10/19
- [PATCH 26/64] hw/pci-host/q35: Ignore write of reserved PCIEXBAR LENGTH field, Michael Roth, 2021/10/19
- [PATCH 27/64] block/nvme: Fix VFIO_MAP_DMA failed: No space left on device, Michael Roth, 2021/10/19
- [PATCH 28/64] crypto/tlscreds: Introduce qcrypto_tls_creds_check_endpoint() helper, Michael Roth, 2021/10/19
- [PATCH 29/64] block/nbd: Use qcrypto_tls_creds_check_endpoint(),
Michael Roth <=
- [PATCH 30/64] qemu-nbd: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 02/64] linux-user/aarch64: Enable hwcap for RND, BTI, and MTE, Michael Roth, 2021/10/19
- [PATCH 31/64] chardev/socket: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 32/64] migration/tls: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 33/64] ui/vnc: Use qcrypto_tls_creds_check_endpoint(), Michael Roth, 2021/10/19
- [PATCH 34/64] crypto: Make QCryptoTLSCreds* structures private, Michael Roth, 2021/10/19
- [PATCH 35/64] yank: Unregister function when using TLS migration, Michael Roth, 2021/10/19
- [PATCH 36/64] tests: acpi: prepare for changing DSDT tables, Michael Roth, 2021/10/19
- [PATCH 37/64] acpi: pc: revert back to v5.2 PCI slot enumeration, Michael Roth, 2021/10/19
- [PATCH 38/64] tests: acpi: pc: update expected DSDT blobs, Michael Roth, 2021/10/19