From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 5/7] crypto: remove extraneous pointer usage in gnutls certs
Date: Tue, 15 Jul 2025 10:29:30 +0100 [thread overview]
Message-ID: <20250715092932.1395271-6-berrange@redhat.com> (raw)
In-Reply-To: <20250715092932.1395271-1-berrange@redhat.com>
The 'gnutls_x509_crt_t' type is already a pointer, not a struct,
so the extra level of pointer indirection is not needed.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
crypto/tlscredsx509.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/crypto/tlscredsx509.c b/crypto/tlscredsx509.c
index ec6ff43af2..95ddfe2f98 100644
--- a/crypto/tlscredsx509.c
+++ b/crypto/tlscredsx509.c
@@ -317,25 +317,25 @@ qcrypto_tls_creds_check_authority_chain(QCryptoTLSCredsX509 *creds,
bool isCA,
Error **errp)
{
- gnutls_x509_crt_t *cert_to_check = &cert;
+ gnutls_x509_crt_t cert_to_check = cert;
int checking_issuer = 1;
int retval = 0;
while (checking_issuer) {
checking_issuer = 0;
- if (gnutls_x509_crt_check_issuer(*cert_to_check,
- *cert_to_check)) {
+ if (gnutls_x509_crt_check_issuer(cert_to_check,
+ cert_to_check)) {
/*
* The cert is self-signed indicating we have
* reached the root of trust.
*/
return qcrypto_tls_creds_check_cert(
- creds, *cert_to_check, cacertFile,
+ creds, cert_to_check, cacertFile,
isServer, isCA, errp);
}
for (int i = 0; i < ncacerts; i++) {
- if (gnutls_x509_crt_check_issuer(*cert_to_check,
+ if (gnutls_x509_crt_check_issuer(cert_to_check,
cacerts[i])) {
retval = qcrypto_tls_creds_check_cert(
creds, cacerts[i], cacertFile,
@@ -343,7 +343,7 @@ qcrypto_tls_creds_check_authority_chain(QCryptoTLSCredsX509 *creds,
if (retval < 0) {
return retval;
}
- cert_to_check = &cacerts[i];
+ cert_to_check = cacerts[i];
checking_issuer = 1;
break;
}
--
2.49.0
next prev parent reply other threads:[~2025-07-15 9:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-15 9:29 [PATCH 0/7] crypto: misc fixes and improvements to cert handling Daniel P. Berrangé
2025-07-15 9:29 ` [PATCH 1/7] crypto: stop requiring "key encipherment" usage in x509 certs Daniel P. Berrangé
2025-07-15 9:29 ` [PATCH 2/7] crypto: switch to newer gnutls API for distinguished name Daniel P. Berrangé
2025-07-15 9:29 ` [PATCH 3/7] crypto: load all certificates in X509 CA file Daniel P. Berrangé
2025-07-15 9:29 ` [PATCH 4/7] crypto: only verify CA certs in chain of trust Daniel P. Berrangé
2025-07-15 9:29 ` Daniel P. Berrangé [this message]
2025-07-15 9:35 ` [PATCH 5/7] crypto: remove extraneous pointer usage in gnutls certs Philippe Mathieu-Daudé
2025-07-15 9:29 ` [PATCH 6/7] crypto: fix error reporting in cert chain checks Daniel P. Berrangé
2025-07-15 9:29 ` [PATCH 7/7] crypto: allow client/server cert chains Daniel P. Berrangé
2025-07-15 9:46 ` Philippe Mathieu-Daudé
2025-07-15 16:09 ` Daniel P. Berrangé
2025-07-15 17:26 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250715092932.1395271-6-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.