From 7827a791c98dbf14f7e5dfd1c9ea14365cac6272 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Fri, 20 Nov 2020 16:24:37 +0100 Subject: [PATCH] genprotimg: add missing return MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This should be no problem (if OpenSSL works correctly), because `crls_download_cb` is only called out of the verification context of OpenSSL. It's used to look up a CRL and therefore X509_STORE_CTX_get_current_cert should always return a certificate since X509_STORE_CTX_get_current_cert returns NULL only if an error has occurred during the verification (see https://www.openssl.org/docs/man1.1.0/man3/X509_STORE_CTX_get_current_cert.html). Fixes: 074de1e14ed7 ("genprotimg: add host-key document verification support") Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- genprotimg/src/utils/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genprotimg/src/utils/crypto.c b/genprotimg/src/utils/crypto.c index 0f774ebe..44facc28 100644 --- a/genprotimg/src/utils/crypto.c +++ b/genprotimg/src/utils/crypto.c @@ -1475,7 +1475,7 @@ static STACK_OF_X509_CRL *crls_download_cb(X509_STORE_CTX *ctx, X509_NAME *nm) g_abort(); cert = X509_STORE_CTX_get_current_cert(ctx); if (!cert) - g_steal_pointer(&crls); + return g_steal_pointer(&crls); g_assert(X509_NAME_cmp(X509_get_issuer_name(cert), nm) == 0); crl = lookup_crl(nm); if (!crl) {