1 # SPDX-License-Identifier: GPL-2.0 1 # SPDX-License-Identifier: GPL-2.0 2 menu "Certificates for signature checking" 2 menu "Certificates for signature checking" 3 3 4 config MODULE_SIG_KEY 4 config MODULE_SIG_KEY 5 string "File name or PKCS#11 URI of mo 5 string "File name or PKCS#11 URI of module signing key" 6 default "certs/signing_key.pem" 6 default "certs/signing_key.pem" 7 depends on MODULE_SIG || (IMA_APPRAISE 7 depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES) 8 help 8 help 9 Provide the file name of a private ke 9 Provide the file name of a private key/certificate in PEM format, 10 or a PKCS#11 URI according to RFC7512 10 or a PKCS#11 URI according to RFC7512. The file should contain, or 11 the URI should identify, both the cer 11 the URI should identify, both the certificate and its corresponding 12 private key. 12 private key. 13 13 14 If this option is unchanged from its 14 If this option is unchanged from its default "certs/signing_key.pem", 15 then the kernel will automatically ge 15 then the kernel will automatically generate the private key and 16 certificate as described in Documenta 16 certificate as described in Documentation/admin-guide/module-signing.rst 17 17 18 choice 18 choice 19 prompt "Type of module signing key to 19 prompt "Type of module signing key to be generated" 20 depends on MODULE_SIG || (IMA_APPRAISE !! 20 default MODULE_SIG_KEY_TYPE_RSA 21 help 21 help 22 The type of module signing key type t 22 The type of module signing key type to generate. This option 23 does not apply if a #PKCS11 URI is us 23 does not apply if a #PKCS11 URI is used. 24 24 25 config MODULE_SIG_KEY_TYPE_RSA 25 config MODULE_SIG_KEY_TYPE_RSA 26 bool "RSA" 26 bool "RSA" >> 27 depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES) 27 help 28 help 28 Use an RSA key for module signing. 29 Use an RSA key for module signing. 29 30 30 config MODULE_SIG_KEY_TYPE_ECDSA 31 config MODULE_SIG_KEY_TYPE_ECDSA 31 bool "ECDSA" 32 bool "ECDSA" 32 select CRYPTO_ECDSA 33 select CRYPTO_ECDSA 33 depends on !(MODULE_SIG_SHA256 || MODU !! 34 depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES) 34 help 35 help 35 Use an elliptic curve key (NIST P384) !! 36 Use an elliptic curve key (NIST P384) for module signing. Consider 36 a strong hash of same or higher bit l !! 37 using a strong hash like sha256 or sha384 for hashing modules. 37 sha512 for hashing modules. << 38 38 39 Note: Remove all ECDSA signing keys, 39 Note: Remove all ECDSA signing keys, e.g. certs/signing_key.pem, 40 when falling back to building Linux 5 40 when falling back to building Linux 5.14 and older kernels. 41 41 42 endchoice 42 endchoice 43 43 44 config SYSTEM_TRUSTED_KEYRING 44 config SYSTEM_TRUSTED_KEYRING 45 bool "Provide system-wide ring of trus 45 bool "Provide system-wide ring of trusted keys" 46 depends on KEYS 46 depends on KEYS 47 depends on ASYMMETRIC_KEY_TYPE 47 depends on ASYMMETRIC_KEY_TYPE 48 depends on X509_CERTIFICATE_PARSER = y << 49 help 48 help 50 Provide a system keyring to which tr 49 Provide a system keyring to which trusted keys can be added. Keys in 51 the keyring are considered to be tru 50 the keyring are considered to be trusted. Keys may be added at will 52 by the kernel from compiled-in data 51 by the kernel from compiled-in data and from hardware key stores, but 53 userspace may only add extra keys if 52 userspace may only add extra keys if those keys can be verified by 54 keys already in the keyring. 53 keys already in the keyring. 55 54 56 Keys in this keyring are used by mod 55 Keys in this keyring are used by module signature checking. 57 56 58 config SYSTEM_TRUSTED_KEYS 57 config SYSTEM_TRUSTED_KEYS 59 string "Additional X.509 keys for defa 58 string "Additional X.509 keys for default system keyring" 60 depends on SYSTEM_TRUSTED_KEYRING 59 depends on SYSTEM_TRUSTED_KEYRING 61 help 60 help 62 If set, this option should be the fi 61 If set, this option should be the filename of a PEM-formatted file 63 containing trusted X.509 certificate 62 containing trusted X.509 certificates to be included in the default 64 system keyring. Any certificate used 63 system keyring. Any certificate used for module signing is implicitly 65 also trusted. 64 also trusted. 66 65 67 NOTE: If you previously provided key 66 NOTE: If you previously provided keys for the system keyring in the 68 form of DER-encoded *.x509 files in 67 form of DER-encoded *.x509 files in the top-level build directory, 69 those are no longer used. You will n 68 those are no longer used. You will need to set this option instead. 70 69 71 config SYSTEM_EXTRA_CERTIFICATE 70 config SYSTEM_EXTRA_CERTIFICATE 72 bool "Reserve area for inserting a cer 71 bool "Reserve area for inserting a certificate without recompiling" 73 depends on SYSTEM_TRUSTED_KEYRING 72 depends on SYSTEM_TRUSTED_KEYRING 74 help 73 help 75 If set, space for an extra certifica 74 If set, space for an extra certificate will be reserved in the kernel 76 image. This allows introducing a tru 75 image. This allows introducing a trusted certificate to the default 77 system keyring without recompiling t 76 system keyring without recompiling the kernel. 78 77 79 config SYSTEM_EXTRA_CERTIFICATE_SIZE 78 config SYSTEM_EXTRA_CERTIFICATE_SIZE 80 int "Number of bytes to reserve for th 79 int "Number of bytes to reserve for the extra certificate" 81 depends on SYSTEM_EXTRA_CERTIFICATE 80 depends on SYSTEM_EXTRA_CERTIFICATE 82 default 4096 81 default 4096 83 help 82 help 84 This is the number of bytes reserved 83 This is the number of bytes reserved in the kernel image for a 85 certificate to be inserted. 84 certificate to be inserted. 86 85 87 config SECONDARY_TRUSTED_KEYRING 86 config SECONDARY_TRUSTED_KEYRING 88 bool "Provide a keyring to which extra 87 bool "Provide a keyring to which extra trustable keys may be added" 89 depends on SYSTEM_TRUSTED_KEYRING 88 depends on SYSTEM_TRUSTED_KEYRING 90 help 89 help 91 If set, provide a keyring to which e 90 If set, provide a keyring to which extra keys may be added, provided 92 those keys are not blacklisted and a 91 those keys are not blacklisted and are vouched for by a key built 93 into the kernel, machine keyring (if !! 92 into the kernel or already in the secondary trusted keyring. 94 secondary trusted keyring. << 95 << 96 config SECONDARY_TRUSTED_KEYRING_SIGNED_BY_BUI << 97 bool "Only allow additional certs sign << 98 depends on SECONDARY_TRUSTED_KEYRING << 99 help << 100 If set, only certificates signed by << 101 keyring may be loaded onto the secon << 102 << 103 Note: The machine keyring, if config << 104 secondary keyring. When enabling th << 105 to also configure INTEGRITY_CA_MACHI << 106 linking code signing keys with imput << 107 trusted keyring. << 108 93 109 config SYSTEM_BLACKLIST_KEYRING 94 config SYSTEM_BLACKLIST_KEYRING 110 bool "Provide system-wide ring of blac 95 bool "Provide system-wide ring of blacklisted keys" 111 depends on KEYS 96 depends on KEYS 112 help 97 help 113 Provide a system keyring to which bl 98 Provide a system keyring to which blacklisted keys can be added. 114 Keys in the keyring are considered e 99 Keys in the keyring are considered entirely untrusted. Keys in this 115 keyring are used by the module signa 100 keyring are used by the module signature checking to reject loading 116 of modules signed with a blacklisted 101 of modules signed with a blacklisted key. 117 102 118 config SYSTEM_BLACKLIST_HASH_LIST 103 config SYSTEM_BLACKLIST_HASH_LIST 119 string "Hashes to be preloaded into th 104 string "Hashes to be preloaded into the system blacklist keyring" 120 depends on SYSTEM_BLACKLIST_KEYRING 105 depends on SYSTEM_BLACKLIST_KEYRING 121 help 106 help 122 If set, this option should be the fi 107 If set, this option should be the filename of a list of hashes in the 123 form "<hash>", "<hash>", ... . This 108 form "<hash>", "<hash>", ... . This will be included into a C 124 wrapper to incorporate the list into !! 109 wrapper to incorporate the list into the kernel. Each <hash> should 125 string starting with a prefix ("tbs" !! 110 be a string of hex digits. 126 finally an even number of hexadecima << 127 Certificate hashes can be generated << 128 tools/certs/print-cert-tbs-hash.sh . << 129 111 130 config SYSTEM_REVOCATION_LIST 112 config SYSTEM_REVOCATION_LIST 131 bool "Provide system-wide ring of revo 113 bool "Provide system-wide ring of revocation certificates" 132 depends on SYSTEM_BLACKLIST_KEYRING 114 depends on SYSTEM_BLACKLIST_KEYRING 133 depends on PKCS7_MESSAGE_PARSER=y 115 depends on PKCS7_MESSAGE_PARSER=y 134 help 116 help 135 If set, this allows revocation certi 117 If set, this allows revocation certificates to be stored in the 136 blacklist keyring and implements a h 118 blacklist keyring and implements a hook whereby a PKCS#7 message can 137 be checked to see if it matches such 119 be checked to see if it matches such a certificate. 138 120 139 config SYSTEM_REVOCATION_KEYS 121 config SYSTEM_REVOCATION_KEYS 140 string "X.509 certificates to be prelo 122 string "X.509 certificates to be preloaded into the system blacklist keyring" 141 depends on SYSTEM_REVOCATION_LIST 123 depends on SYSTEM_REVOCATION_LIST 142 help 124 help 143 If set, this option should be the fi 125 If set, this option should be the filename of a PEM-formatted file 144 containing X.509 certificates to be 126 containing X.509 certificates to be included in the default blacklist 145 keyring. 127 keyring. 146 << 147 config SYSTEM_BLACKLIST_AUTH_UPDATE << 148 bool "Allow root to add signed blackli << 149 depends on SYSTEM_BLACKLIST_KEYRING << 150 depends on SYSTEM_DATA_VERIFICATION << 151 help << 152 If set, provide the ability to load << 153 they are signed and vouched by a cer << 154 keyring. The PKCS#7 signature of th << 155 payload. Blacklist keys cannot be r << 156 128 157 endmenu 129 endmenu
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.