* [PATCH] crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting
@ 2026-10-17 21:05 m-amirpour
2026-10-21 2:50 ` Ben Boeckel
0 siblings, 1 reply; 2+ messages in thread
From: m-amirpour @ 2026-10-17 21:05 UTC (permalink / raw)
To: keyrings
Cc: dhowells, lukas, ignat, herbert, davem, linux-crypto,
linux-kernel, Muhammad Mahdi Amirpour
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);
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting
2026-10-17 21:05 [PATCH] crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting m-amirpour
@ 2026-10-21 2:50 ` Ben Boeckel
0 siblings, 0 replies; 2+ messages in thread
From: Ben Boeckel @ 2026-10-21 2:50 UTC (permalink / raw)
To: m-amirpour
Cc: keyrings, dhowells, lukas, ignat, herbert, davem, linux-crypto,
linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-21 2:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-17 21:05 [PATCH] crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting m-amirpour
2026-10-21 2:50 ` Ben Boeckel
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®