crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting
Subsystems (3)
PATCH 1/1 crypto: asymmetric_keys: Fix PKCS#7 selftest error reporting
From: Muhammad Mahdi Amirpour <[email protected]>
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.
--- crypto/asymmetric_keys/selftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/asymmetric_keys/selftest.c +1 -1
@@ -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);
Signature · 1 line
2.55.0
Quoted 19 lines · m-amirpour
From: Muhammad Mahdi Amirpour <[email protected]>
pkcs7_parse_message()returns an error pointer on failure, but the selftest prints ret, which still contains the result of the previousx509_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 <[email protected]>--- crypto/asymmetric_keys/selftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)crypto/asymmetric_keys/selftest.c +0
-0
crypto/asymmetric_keys/selftest.c void fips_signature_selftest(const char *name, · line 46
Quoted 7 lines
crypto/asymmetric_keys/selftest.c +1
-1@@ -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);
--Ben
Herbert Xu
maintainerQuoted 6 lines · m-amirpour
From: Muhammad Mahdi Amirpour <[email protected]>
pkcs7_parse_message()returns an error pointer on failure, but the selftest prints ret, which still contains the result of the previousx509_load_certificate_list()call.
Quoted 7 lines
Print the parser's error pointer with %pe so that a failure reports the actual parsing error.
Signed-off-by Muhammad Mahdi Amirpour <[email protected]>--- crypto/asymmetric_keys/selftest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt