Linux Audio

Check our new training course

Loading...
v5.4
 1# SPDX-License-Identifier: GPL-2.0
 2menu "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"
 7	depends on MODULE_SIG
 8	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
16         certificate as described in Documentation/admin-guide/module-signing.rst
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18config SYSTEM_TRUSTED_KEYRING
19	bool "Provide system-wide ring of trusted keys"
20	depends on KEYS
21	depends on ASYMMETRIC_KEY_TYPE
 
22	help
23	  Provide a system keyring to which trusted keys can be added.  Keys in
24	  the keyring are considered to be trusted.  Keys may be added at will
25	  by the kernel from compiled-in data and from hardware key stores, but
26	  userspace may only add extra keys if those keys can be verified by
27	  keys already in the keyring.
28
29	  Keys in this keyring are used by module signature checking.
30
31config SYSTEM_TRUSTED_KEYS
32	string "Additional X.509 keys for default system keyring"
33	depends on SYSTEM_TRUSTED_KEYRING
34	help
35	  If set, this option should be the filename of a PEM-formatted file
36	  containing trusted X.509 certificates to be included in the default
37	  system keyring. Any certificate used for module signing is implicitly
38	  also trusted.
39
40	  NOTE: If you previously provided keys for the system keyring in the
41	  form of DER-encoded *.x509 files in the top-level build directory,
42	  those are no longer used. You will need to set this option instead.
43
44config SYSTEM_EXTRA_CERTIFICATE
45	bool "Reserve area for inserting a certificate without recompiling"
46	depends on SYSTEM_TRUSTED_KEYRING
47	help
48	  If set, space for an extra certificate will be reserved in the kernel
49	  image. This allows introducing a trusted certificate to the default
50	  system keyring without recompiling the kernel.
51
52config SYSTEM_EXTRA_CERTIFICATE_SIZE
53	int "Number of bytes to reserve for the extra certificate"
54	depends on SYSTEM_EXTRA_CERTIFICATE
55	default 4096
56	help
57	  This is the number of bytes reserved in the kernel image for a
58	  certificate to be inserted.
59
60config SECONDARY_TRUSTED_KEYRING
61	bool "Provide a keyring to which extra trustable keys may be added"
62	depends on SYSTEM_TRUSTED_KEYRING
63	help
64	  If set, provide a keyring to which extra keys may be added, provided
65	  those keys are not blacklisted and are vouched for by a key built
66	  into the kernel or already in the secondary trusted keyring.
67
68config SYSTEM_BLACKLIST_KEYRING
69	bool "Provide system-wide ring of blacklisted keys"
70	depends on KEYS
71	help
72	  Provide a system keyring to which blacklisted keys can be added.
73	  Keys in the keyring are considered entirely untrusted.  Keys in this
74	  keyring are used by the module signature checking to reject loading
75	  of modules signed with a blacklisted key.
76
77config SYSTEM_BLACKLIST_HASH_LIST
78	string "Hashes to be preloaded into the system blacklist keyring"
79	depends on SYSTEM_BLACKLIST_KEYRING
80	help
81	  If set, this option should be the filename of a list of hashes in the
82	  form "<hash>", "<hash>", ... .  This will be included into a C
83	  wrapper to incorporate the list into the kernel.  Each <hash> should
84	  be a string of hex digits.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
86endmenu
v6.2
  1# SPDX-License-Identifier: GPL-2.0
  2menu "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"
  7	depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
  8	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
 16         certificate as described in Documentation/admin-guide/module-signing.rst
 17
 18choice
 19	prompt "Type of module signing key to be generated"
 20	depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
 21	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"
 27	help
 28	 Use an RSA key for module signing.
 29
 30config MODULE_SIG_KEY_TYPE_ECDSA
 31	bool "ECDSA"
 32	select CRYPTO_ECDSA
 33	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
 42config SYSTEM_TRUSTED_KEYRING
 43	bool "Provide system-wide ring of trusted keys"
 44	depends on KEYS
 45	depends on ASYMMETRIC_KEY_TYPE
 46	depends on X509_CERTIFICATE_PARSER = y
 47	help
 48	  Provide a system keyring to which trusted keys can be added.  Keys in
 49	  the keyring are considered to be trusted.  Keys may be added at will
 50	  by the kernel from compiled-in data and from hardware key stores, but
 51	  userspace may only add extra keys if those keys can be verified by
 52	  keys already in the keyring.
 53
 54	  Keys in this keyring are used by module signature checking.
 55
 56config SYSTEM_TRUSTED_KEYS
 57	string "Additional X.509 keys for default system keyring"
 58	depends on SYSTEM_TRUSTED_KEYRING
 59	help
 60	  If set, this option should be the filename of a PEM-formatted file
 61	  containing trusted X.509 certificates to be included in the default
 62	  system keyring. Any certificate used for module signing is implicitly
 63	  also trusted.
 64
 65	  NOTE: If you previously provided keys for the system keyring in the
 66	  form of DER-encoded *.x509 files in the top-level build directory,
 67	  those are no longer used. You will need to set this option instead.
 68
 69config SYSTEM_EXTRA_CERTIFICATE
 70	bool "Reserve area for inserting a certificate without recompiling"
 71	depends on SYSTEM_TRUSTED_KEYRING
 72	help
 73	  If set, space for an extra certificate will be reserved in the kernel
 74	  image. This allows introducing a trusted certificate to the default
 75	  system keyring without recompiling the kernel.
 76
 77config SYSTEM_EXTRA_CERTIFICATE_SIZE
 78	int "Number of bytes to reserve for the extra certificate"
 79	depends on SYSTEM_EXTRA_CERTIFICATE
 80	default 4096
 81	help
 82	  This is the number of bytes reserved in the kernel image for a
 83	  certificate to be inserted.
 84
 85config SECONDARY_TRUSTED_KEYRING
 86	bool "Provide a keyring to which extra trustable keys may be added"
 87	depends on SYSTEM_TRUSTED_KEYRING
 88	help
 89	  If set, provide a keyring to which extra keys may be added, provided
 90	  those keys are not blacklisted and are vouched for by a key built
 91	  into the kernel or already in the secondary trusted keyring.
 92
 93config SYSTEM_BLACKLIST_KEYRING
 94	bool "Provide system-wide ring of blacklisted keys"
 95	depends on KEYS
 96	help
 97	  Provide a system keyring to which blacklisted keys can be added.
 98	  Keys in the keyring are considered entirely untrusted.  Keys in this
 99	  keyring are used by the module signature checking to reject loading
100	  of modules signed with a blacklisted key.
101
102config SYSTEM_BLACKLIST_HASH_LIST
103	string "Hashes to be preloaded into the system blacklist keyring"
104	depends on SYSTEM_BLACKLIST_KEYRING
105	help
106	  If set, this option should be the filename of a list of hashes in the
107	  form "<hash>", "<hash>", ... .  This will be included into a C
108	  wrapper to incorporate the list into the kernel.  Each <hash> must be a
109	  string starting with a prefix ("tbs" or "bin"), then a colon (":"), and
110	  finally an even number of hexadecimal lowercase characters (up to 128).
111	  Certificate hashes can be generated with
112	  tools/certs/print-cert-tbs-hash.sh .
113
114config SYSTEM_REVOCATION_LIST
115	bool "Provide system-wide ring of revocation certificates"
116	depends on SYSTEM_BLACKLIST_KEYRING
117	depends on PKCS7_MESSAGE_PARSER=y
118	help
119	  If set, this allows revocation certificates to be stored in the
120	  blacklist keyring and implements a hook whereby a PKCS#7 message can
121	  be checked to see if it matches such a certificate.
122
123config SYSTEM_REVOCATION_KEYS
124	string "X.509 certificates to be preloaded into the system blacklist keyring"
125	depends on SYSTEM_REVOCATION_LIST
126	help
127	  If set, this option should be the filename of a PEM-formatted file
128	  containing X.509 certificates to be included in the default blacklist
129	  keyring.
130
131config SYSTEM_BLACKLIST_AUTH_UPDATE
132	bool "Allow root to add signed blacklist keys"
133	depends on SYSTEM_BLACKLIST_KEYRING
134	depends on SYSTEM_DATA_VERIFICATION
135	help
136	  If set, provide the ability to load new blacklist keys at run time if
137	  they are signed and vouched by a certificate from the builtin trusted
138	  keyring.  The PKCS#7 signature of the description is set in the key
139	  payload.  Blacklist keys cannot be removed.
140
141endmenu