* [PATCH] crypto/x509-utils: propagate the error
@ 2026-08-31 12:10 marcandre.lureau
2026-08-31 14:09 ` Zhuoying Cai
2026-09-01 17:16 ` Daniel P. Berrangé
0 siblings, 2 replies; 3+ messages in thread
From: marcandre.lureau @ 2026-08-31 12:10 UTC (permalink / raw)
To: qemu-devel; +Cc: zycai, berrange, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Propagate the error when qcrypto_x509_get_pk_algorithm fails, instead of
falling through to return 0 (success) with *errp set.
Fixes: e8317c4c9f68 ("crypto/x509-utils: Add helper functions for DIAG 320 subcode 2")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
crypto/x509-utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/crypto/x509-utils.c b/crypto/x509-utils.c
index 34cbfca26bff..edcc44de80d3 100644
--- a/crypto/x509-utils.c
+++ b/crypto/x509-utils.c
@@ -319,6 +319,9 @@ int qcrypto_x509_check_ecc_curve_p521(uint8_t *cert, size_t size, Error **errp)
int curve_id;
algo = qcrypto_x509_get_pk_algorithm(cert, size, errp);
+ if (algo < 0) {
+ return -1;
+ }
if (algo != GNUTLS_PK_ECDSA) {
return 0;
}
--
2.55.0.543.g5ebe2ebe4ea8
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto/x509-utils: propagate the error
2026-08-31 12:10 [PATCH] crypto/x509-utils: propagate the error marcandre.lureau
@ 2026-08-31 14:09 ` Zhuoying Cai
2026-09-01 17:16 ` Daniel P. Berrangé
1 sibling, 0 replies; 3+ messages in thread
From: Zhuoying Cai @ 2026-08-31 14:09 UTC (permalink / raw)
To: marcandre.lureau, qemu-devel; +Cc: berrange
Reviewed-by: Zhuoying Cai <zycai@linux.ibm.com>
On 8/31/26 8:10 AM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Propagate the error when qcrypto_x509_get_pk_algorithm fails, instead of
> falling through to return 0 (success) with *errp set.
>
> Fixes: e8317c4c9f68 ("crypto/x509-utils: Add helper functions for DIAG 320 subcode 2")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> crypto/x509-utils.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/crypto/x509-utils.c b/crypto/x509-utils.c
> index 34cbfca26bff..edcc44de80d3 100644
> --- a/crypto/x509-utils.c
> +++ b/crypto/x509-utils.c
> @@ -319,6 +319,9 @@ int qcrypto_x509_check_ecc_curve_p521(uint8_t *cert, size_t size, Error **errp)
> int curve_id;
>
> algo = qcrypto_x509_get_pk_algorithm(cert, size, errp);
> + if (algo < 0) {
> + return -1;
> + }
> if (algo != GNUTLS_PK_ECDSA) {
> return 0;
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] crypto/x509-utils: propagate the error
2026-08-31 12:10 [PATCH] crypto/x509-utils: propagate the error marcandre.lureau
2026-08-31 14:09 ` Zhuoying Cai
@ 2026-09-01 17:16 ` Daniel P. Berrangé
1 sibling, 0 replies; 3+ messages in thread
From: Daniel P. Berrangé @ 2026-09-01 17:16 UTC (permalink / raw)
To: marcandre.lureau; +Cc: qemu-devel, zycai
On Mon, Aug 31, 2026 at 04:10:09PM +0400, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Propagate the error when qcrypto_x509_get_pk_algorithm fails, instead of
> falling through to return 0 (success) with *errp set.
>
> Fixes: e8317c4c9f68 ("crypto/x509-utils: Add helper functions for DIAG 320 subcode 2")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> crypto/x509-utils.c | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
and queued.
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-01 17:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 12:10 [PATCH] crypto/x509-utils: propagate the error marcandre.lureau
2026-08-31 14:09 ` Zhuoying Cai
2026-09-01 17:16 ` Daniel P. Berrangé
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.