diff options
author | David Howells <dhowells@redhat.com> | 2013-08-30 11:07:30 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2013-09-25 12:17:01 -0400 |
commit | b56e5a17b6b9acd16997960504b9940d0d7984e7 (patch) | |
tree | 3041aadaf0eb3e79c0a5d1e7f9715489340f868a /kernel/Makefile | |
parent | 0fbd39cf7ffe3b6a787b66b672d21b84e4675352 (diff) |
KEYS: Separate the kernel signature checking keyring from module signing
Separate the kernel signature checking keyring from module signing so that it
can be used by code other than the module-signing code.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'kernel/Makefile')
-rw-r--r-- | kernel/Makefile | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 2c24195249d5..63136989c132 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -54,8 +54,9 @@ obj-$(CONFIG_SMP) += spinlock.o | |||
54 | obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o | 54 | obj-$(CONFIG_DEBUG_SPINLOCK) += spinlock.o |
55 | obj-$(CONFIG_PROVE_LOCKING) += spinlock.o | 55 | obj-$(CONFIG_PROVE_LOCKING) += spinlock.o |
56 | obj-$(CONFIG_UID16) += uid16.o | 56 | obj-$(CONFIG_UID16) += uid16.o |
57 | obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o | ||
57 | obj-$(CONFIG_MODULES) += module.o | 58 | obj-$(CONFIG_MODULES) += module.o |
58 | obj-$(CONFIG_MODULE_SIG) += module_signing.o modsign_pubkey.o modsign_certificate.o | 59 | obj-$(CONFIG_MODULE_SIG) += module_signing.o |
59 | obj-$(CONFIG_KALLSYMS) += kallsyms.o | 60 | obj-$(CONFIG_KALLSYMS) += kallsyms.o |
60 | obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o | 61 | obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o |
61 | obj-$(CONFIG_KEXEC) += kexec.o | 62 | obj-$(CONFIG_KEXEC) += kexec.o |
@@ -141,11 +142,11 @@ targets += timeconst.h | |||
141 | $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE | 142 | $(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE |
142 | $(call if_changed,bc) | 143 | $(call if_changed,bc) |
143 | 144 | ||
144 | ifeq ($(CONFIG_MODULE_SIG),y) | ||
145 | ############################################################################### | 145 | ############################################################################### |
146 | # | 146 | # |
147 | # Roll all the X.509 certificates that we can find together and pull them into | 147 | # Roll all the X.509 certificates that we can find together and pull them into |
148 | # the kernel. | 148 | # the kernel so that they get loaded into the system trusted keyring during |
149 | # boot. | ||
149 | # | 150 | # |
150 | # We look in the source root and the build root for all files whose name ends | 151 | # We look in the source root and the build root for all files whose name ends |
151 | # in ".x509". Unfortunately, this will generate duplicate filenames, so we | 152 | # in ".x509". Unfortunately, this will generate duplicate filenames, so we |
@@ -153,6 +154,7 @@ ifeq ($(CONFIG_MODULE_SIG),y) | |||
153 | # duplicates. | 154 | # duplicates. |
154 | # | 155 | # |
155 | ############################################################################### | 156 | ############################################################################### |
157 | ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y) | ||
156 | X509_CERTIFICATES-y := $(wildcard *.x509) $(wildcard $(srctree)/*.x509) | 158 | X509_CERTIFICATES-y := $(wildcard *.x509) $(wildcard $(srctree)/*.x509) |
157 | X509_CERTIFICATES-$(CONFIG_MODULE_SIG) += signing_key.x509 | 159 | X509_CERTIFICATES-$(CONFIG_MODULE_SIG) += signing_key.x509 |
158 | X509_CERTIFICATES := $(sort $(foreach CERT,$(X509_CERTIFICATES-y), \ | 160 | X509_CERTIFICATES := $(sort $(foreach CERT,$(X509_CERTIFICATES-y), \ |
@@ -169,10 +171,11 @@ $(shell rm $(obj)/.x509.list) | |||
169 | endif | 171 | endif |
170 | endif | 172 | endif |
171 | 173 | ||
172 | kernel/modsign_certificate.o: $(obj)/x509_certificate_list | 174 | kernel/system_certificates.o: $(obj)/x509_certificate_list |
173 | 175 | ||
174 | quiet_cmd_x509certs = CERTS $@ | 176 | quiet_cmd_x509certs = CERTS $@ |
175 | cmd_x509certs = cat $(X509_CERTIFICATES) /dev/null >$@ | 177 | cmd_x509certs = cat $(X509_CERTIFICATES) /dev/null >$@ $(foreach X509,$(X509_CERTIFICATES),; echo " - Including cert $(X509)") |
178 | |||
176 | targets += $(obj)/x509_certificate_list | 179 | targets += $(obj)/x509_certificate_list |
177 | $(obj)/x509_certificate_list: $(X509_CERTIFICATES) $(obj)/.x509.list | 180 | $(obj)/x509_certificate_list: $(X509_CERTIFICATES) $(obj)/.x509.list |
178 | $(call if_changed,x509certs) | 181 | $(call if_changed,x509certs) |
@@ -182,7 +185,9 @@ $(obj)/.x509.list: | |||
182 | @echo $(X509_CERTIFICATES) >$@ | 185 | @echo $(X509_CERTIFICATES) >$@ |
183 | 186 | ||
184 | clean-files := x509_certificate_list .x509.list | 187 | clean-files := x509_certificate_list .x509.list |
188 | endif | ||
185 | 189 | ||
190 | ifeq ($(CONFIG_MODULE_SIG),y) | ||
186 | ############################################################################### | 191 | ############################################################################### |
187 | # | 192 | # |
188 | # If module signing is requested, say by allyesconfig, but a key has not been | 193 | # If module signing is requested, say by allyesconfig, but a key has not been |