blob: 73d1350c223a8c757dff74a3ce1dbc5d6a9e9a11 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
David Howellscfc411e2015-08-14 15:20:41 +01002menu "Certificates for signature checking"
3
4config MODULE_SIG_KEY
5 string "File name or PKCS#11 URI of module signing key"
6 default "certs/signing_key.pem"
Nayna Jain781a5732021-04-22 21:16:02 -04007 depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
David Howellscfc411e2015-08-14 15:20:41 +01008 help
9 Provide the file name of a private key/certificate in PEM format,
10 or a PKCS#11 URI according to RFC7512. The file should contain, or
11 the URI should identify, both the certificate and its corresponding
12 private key.
13
14 If this option is unchanged from its default "certs/signing_key.pem",
15 then the kernel will automatically generate the private key and
Mauro Carvalho Chehab5fb94e92018-05-08 15:14:57 -030016 certificate as described in Documentation/admin-guide/module-signing.rst
David Howellscfc411e2015-08-14 15:20:41 +010017
Stefan Bergera4aed362021-06-29 17:34:21 -040018choice
19 prompt "Type of module signing key to be generated"
Masahiro Yamadabe0d5fa72021-10-01 13:01:26 +090020 depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
Stefan Bergera4aed362021-06-29 17:34:21 -040021 help
22 The type of module signing key type to generate. This option
23 does not apply if a #PKCS11 URI is used.
24
25config MODULE_SIG_KEY_TYPE_RSA
26 bool "RSA"
Stefan Bergera4aed362021-06-29 17:34:21 -040027 help
28 Use an RSA key for module signing.
29
30config MODULE_SIG_KEY_TYPE_ECDSA
31 bool "ECDSA"
32 select CRYPTO_ECDSA
Stefan Bergera4aed362021-06-29 17:34:21 -040033 help
34 Use an elliptic curve key (NIST P384) for module signing. Consider
35 using a strong hash like sha256 or sha384 for hashing modules.
36
37 Note: Remove all ECDSA signing keys, e.g. certs/signing_key.pem,
38 when falling back to building Linux 5.14 and older kernels.
39
40endchoice
41
David Howellscfc411e2015-08-14 15:20:41 +010042config SYSTEM_TRUSTED_KEYRING
43 bool "Provide system-wide ring of trusted keys"
44 depends on KEYS
David Howells99716b72016-04-06 16:14:26 +010045 depends on ASYMMETRIC_KEY_TYPE
David Howellscfc411e2015-08-14 15:20:41 +010046 help
47 Provide a system keyring to which trusted keys can be added. Keys in
48 the keyring are considered to be trusted. Keys may be added at will
49 by the kernel from compiled-in data and from hardware key stores, but
50 userspace may only add extra keys if those keys can be verified by
51 keys already in the keyring.
52
53 Keys in this keyring are used by module signature checking.
54
55config SYSTEM_TRUSTED_KEYS
56 string "Additional X.509 keys for default system keyring"
57 depends on SYSTEM_TRUSTED_KEYRING
58 help
59 If set, this option should be the filename of a PEM-formatted file
60 containing trusted X.509 certificates to be included in the default
61 system keyring. Any certificate used for module signing is implicitly
62 also trusted.
63
64 NOTE: If you previously provided keys for the system keyring in the
65 form of DER-encoded *.x509 files in the top-level build directory,
66 those are no longer used. You will need to set this option instead.
67
Mehmet Kayaalpc4c36102015-11-24 16:18:05 -050068config SYSTEM_EXTRA_CERTIFICATE
69 bool "Reserve area for inserting a certificate without recompiling"
70 depends on SYSTEM_TRUSTED_KEYRING
71 help
72 If set, space for an extra certificate will be reserved in the kernel
73 image. This allows introducing a trusted certificate to the default
74 system keyring without recompiling the kernel.
75
76config SYSTEM_EXTRA_CERTIFICATE_SIZE
77 int "Number of bytes to reserve for the extra certificate"
78 depends on SYSTEM_EXTRA_CERTIFICATE
79 default 4096
80 help
81 This is the number of bytes reserved in the kernel image for a
82 certificate to be inserted.
83
David Howellsd3bfe842016-04-06 16:14:27 +010084config SECONDARY_TRUSTED_KEYRING
85 bool "Provide a keyring to which extra trustable keys may be added"
86 depends on SYSTEM_TRUSTED_KEYRING
87 help
88 If set, provide a keyring to which extra keys may be added, provided
89 those keys are not blacklisted and are vouched for by a key built
90 into the kernel or already in the secondary trusted keyring.
91
David Howells734114f2017-04-03 16:07:24 +010092config SYSTEM_BLACKLIST_KEYRING
93 bool "Provide system-wide ring of blacklisted keys"
94 depends on KEYS
95 help
96 Provide a system keyring to which blacklisted keys can be added.
97 Keys in the keyring are considered entirely untrusted. Keys in this
98 keyring are used by the module signature checking to reject loading
99 of modules signed with a blacklisted key.
100
101config SYSTEM_BLACKLIST_HASH_LIST
102 string "Hashes to be preloaded into the system blacklist keyring"
103 depends on SYSTEM_BLACKLIST_KEYRING
104 help
105 If set, this option should be the filename of a list of hashes in the
106 form "<hash>", "<hash>", ... . This will be included into a C
107 wrapper to incorporate the list into the kernel. Each <hash> should
108 be a string of hex digits.
109
Eric Snowberg56c58122021-01-22 13:10:51 -0500110config SYSTEM_REVOCATION_LIST
111 bool "Provide system-wide ring of revocation certificates"
112 depends on SYSTEM_BLACKLIST_KEYRING
113 depends on PKCS7_MESSAGE_PARSER=y
114 help
115 If set, this allows revocation certificates to be stored in the
116 blacklist keyring and implements a hook whereby a PKCS#7 message can
117 be checked to see if it matches such a certificate.
118
Eric Snowbergd1f04412021-01-22 13:10:53 -0500119config SYSTEM_REVOCATION_KEYS
120 string "X.509 certificates to be preloaded into the system blacklist keyring"
121 depends on SYSTEM_REVOCATION_LIST
122 help
123 If set, this option should be the filename of a PEM-formatted file
124 containing X.509 certificates to be included in the default blacklist
125 keyring.
126
David Howellscfc411e2015-08-14 15:20:41 +0100127endmenu