2022-09-23 11:10:02

by Zeng Heng

[permalink] [raw]
Subject: [PATCH -next] crypto: KEYS: fix undefined reference errors in fips_signature_selftest

When the menuconfig set as below:

CONFIG_FIPS_SIGNATURE_SELFTEST = y
CONFIG_PKCS7_MESSAGE_PARSER = m

it would raise below compile errors:
ld: crypto/asymmetric_keys/selftest.o: in function `fips_signature_selftest':
.../crypto/asymmetric_keys/selftest.c:205: undefined reference to `pkcs7_parse_message'
ld: .../crypto/asymmetric_keys/selftest.c:209: undefined reference to `pkcs7_supply_detached_data'
ld: .../crypto/asymmetric_keys/selftest.c:211: undefined reference to `pkcs7_verify'
ld: .../crypto/asymmetric_keys/selftest.c:215: undefined reference to `pkcs7_validate_trust'
ld: .../crypto/asymmetric_keys/selftest.c:219: undefined reference to `pkcs7_free_message'

FIPS_SIGNATURE_SELFTEST needs pkcs7_parser.o compiled
into kernel indeed, so select PKCS7_MESSAGE_PARSER
when enable FIPS_SIGNATURE_SELFTEST.

Signed-off-by: Zeng Heng <[email protected]>
---
crypto/asymmetric_keys/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/asymmetric_keys/Kconfig b/crypto/asymmetric_keys/Kconfig
index 3df3fe4ed95f..9d74bf5fbb63 100644
--- a/crypto/asymmetric_keys/Kconfig
+++ b/crypto/asymmetric_keys/Kconfig
@@ -83,6 +83,6 @@ config FIPS_SIGNATURE_SELFTEST
for FIPS.
depends on KEYS
depends on ASYMMETRIC_KEY_TYPE
- depends on PKCS7_MESSAGE_PARSER
+ select PKCS7_MESSAGE_PARSER

endif # ASYMMETRIC_KEY_TYPE
--
2.25.1