Kconfig 5.4 KB

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