Skip to content

Commit 6ce019f

Browse files
committed
certs: include certs/signing_key.x509 unconditionally
I do not see much sense in the #if conditional in system_certificates.S; even if the condition is true, there exists no signing key when CONFIG_MODULE_SIG_KEY="". So, certs/Makefile generates empty certs/signing_key.x509 in such a case. We can always do this, irrespective of CONFIG_MODULE_SIG or (CONFIG_IMA_APPRAISE_MODSIG && CONFIG_MODULES). We only need to check CONFIG_MODULE_SIG_KEY, then both *.S and Makefile will become much simpler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent d4c8586 commit 6ce019f

2 files changed

Lines changed: 0 additions & 19 deletions

File tree

certs/Makefile

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,10 @@ $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert
2222

2323
targets += x509_certificate_list
2424

25-
ifeq ($(CONFIG_MODULE_SIG),y)
26-
SIGN_KEY = y
27-
endif
28-
29-
ifeq ($(CONFIG_IMA_APPRAISE_MODSIG),y)
30-
ifeq ($(CONFIG_MODULES),y)
31-
SIGN_KEY = y
32-
endif
33-
endif
34-
35-
ifdef SIGN_KEY
36-
###############################################################################
37-
#
3825
# If module signing is requested, say by allyesconfig, but a key has not been
3926
# supplied, then one will need to be generated to make sure the build does not
4027
# fail and that the kernel may be used afterwards.
4128
#
42-
###############################################################################
43-
4429
# We do it this way rather than having a boolean option for enabling an
4530
# external private key, because 'make randconfig' might enable such a
4631
# boolean option and we unfortunately can't make it depend on !RANDCONFIG.
@@ -76,7 +61,6 @@ $(obj)/system_certificates.o: $(obj)/signing_key.x509
7661

7762
$(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE
7863
$(call if_changed,extract_certs,$(if $(CONFIG_MODULE_SIG_KEY),$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY)),""))
79-
endif # CONFIG_MODULE_SIG
8064

8165
targets += signing_key.x509
8266

certs/system_certificates.S

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
system_certificate_list:
1010
__cert_list_start:
1111
__module_cert_start:
12-
#if defined(CONFIG_MODULE_SIG) || (defined(CONFIG_IMA_APPRAISE_MODSIG) \
13-
&& defined(CONFIG_MODULES))
1412
.incbin "certs/signing_key.x509"
15-
#endif
1613
__module_cert_end:
1714
.incbin "certs/x509_certificate_list"
1815
__cert_list_end:

0 commit comments

Comments
 (0)