diff options
| author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2026-08-31 16:10:09 +0400 |
|---|---|---|
| committer | Daniel P. Berrangé <berrange@redhat.com> | 2026-09-07 11:31:03 +0100 |
| commit | 95d6258e79fc2c8c1eab4f2c7358bbc68d10733f (patch) | |
| tree | c0a620a28e7d890b687218a53a9139d1553460c0 | |
| parent | 94725cd531eea0c7f0d02b5d468b2eae7e8ae615 (diff) | |
| download | qemu-95d6258e79fc2c8c1eab4f2c7358bbc68d10733f.tar.gz qemu-95d6258e79fc2c8c1eab4f2c7358bbc68d10733f.zip | |
crypto/x509-utils: propagate the error
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")
Reviewed-by: Zhuoying Cai <zycai@linux.ibm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
| -rw-r--r-- | crypto/x509-utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/x509-utils.c b/crypto/x509-utils.c index 34cbfca26b..edcc44de80 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; } |
