[PATCH] crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting

From: m-amirpour

Date: Sat Oct 17 2026 - 17:05:33 EST


From: Muhammad Mahdi Amirpour <ampr.mhd@xxxxxxxxx>

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@xxxxxxxxx>
---
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