mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Boeckel <me@benboeckel.net>
To: m-amirpour <ampr.mhd@gmail.com>
Cc: keyrings@vger.kernel.org, dhowells@redhat.com, lukas@wunner.de,
	ignat@linux.win, herbert@gondor.apana.org.au,
	davem@davemloft.net, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting
Date: Tue, 20 Oct 2026 22:50:42 -0400	[thread overview]
Message-ID: <atgogp7ea-UCQLbO@rotor.dev.benboeckel.internal> (raw)
In-Reply-To: <20261017210513.135540-1-ampr.mhd@gmail.com>

On Sun, Oct 18, 2026 at 00:35:13 +0330, m-amirpour wrote:
> From: Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
> 
> pkcs7_parse_message() returns an error pointer on failure, but the
> selftest prints ret, which still contains the result of the previous
> x509_load_certificate_list() call.
> 
> Print the parser's error pointer with %pe so that a failure reports
> the actual parsing error.
> 
> Signed-off-by: Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
> ---
>  crypto/asymmetric_keys/selftest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypto/asymmetric_keys/selftest.c b/crypto/asymmetric_keys/selftest.c
> index 98dc5cdfdeb..42857b02258 100644
> --- a/crypto/asymmetric_keys/selftest.c
> +++ b/crypto/asymmetric_keys/selftest.c
> @@ -41,7 +41,7 @@ void fips_signature_selftest(const char *name,
>  
>  	pkcs7 = pkcs7_parse_message(sig, sig_len);
>  	if (IS_ERR(pkcs7))
> -		panic("Certs %s selftest: pkcs7_parse_message() = %d\n", name, ret);
> +		panic("Certs %s selftest: pkcs7_parse_message() = %pe\n", name, pkcs7);
>  
>  	pkcs7_supply_detached_data(pkcs7, data, data_len);

Reviewed-by: Ben Boeckel <mathstuf@gmail.com>

--Ben

      reply	other threads:[~2026-10-21  2:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 21:05 m-amirpour
2026-10-21  2:50 ` Ben Boeckel [this message]

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=atgogp7ea-UCQLbO@rotor.dev.benboeckel.internal \
    --to=me@benboeckel.net \
    --cc=ampr.mhd@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=ignat@linux.win \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=list.lkml.keyrings@me.benboeckel.net \
    --cc=lukas@wunner.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®