Skip to contentSkip to conversation

certs: move the 'depends on' to the choice of module signing keys

PATCH In review Masahiro Yamada 1 participant 2 messages Oct 1, 2021 – Dec 11, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 certs: move the 'depends on' to the choice of module signing keys

When the condition "MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)" is unmet, you cannot choose anything in the choice, but the choice menu is still displayed in the menuconfig etc.

Move the 'depends on' to the choice to hide the meaningless menu.

Also delete the redundant 'default'. In a choice, the first entry is the default.

---

 certs/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
certs/Kconfig +1 -3
index ae7f2e876a31..73d1350c223a 100644
@@ -17,21 +17,19 @@ config MODULE_SIG_KEY
 
 choice
 	prompt "Type of module signing key to be generated"
-	default MODULE_SIG_KEY_TYPE_RSA
+	depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
 	help
 	 The type of module signing key type to generate. This option
 	 does not apply if a #PKCS11 URI is used.
 
 config MODULE_SIG_KEY_TYPE_RSA
 	bool "RSA"
-	depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
 	help
 	 Use an RSA key for module signing.
 
 config MODULE_SIG_KEY_TYPE_ECDSA
 	bool "ECDSA"
 	select CRYPTO_ECDSA
-	depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
 	help
 	 Use an elliptic curve key (NIST P384) for module signing. Consider
 	 using a strong hash like sha256 or sha384 for hashing modules.
Signature · 1 line
2.30.2
#1 lore raw
Quoted 5 lines · Masahiro Yamada

When the condition "MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)" is unmet, you cannot choose anything in the choice, but the choice menu is still displayed in the menuconfig etc.

Quoted 7 lines

Move the 'depends on' to the choice to hide the meaningless menu.

Also delete the redundant 'default'. In a choice, the first entry is the default.

---

Applied to linux-kbuild.

Quoted 34 lines
 certs/Kconfig | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
certs/Kconfig +1 -4
index ae7f2e876a31..73d1350c223a 100644
@@ -17,21 +17,19 @@ config MODULE_SIG_KEY
 
 choice
        prompt "Type of module signing key to be generated"
-       default MODULE_SIG_KEY_TYPE_RSA
+       depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
        help
         The type of module signing key type to generate. This option
         does not apply if a #PKCS11 URI is used.
 
 config MODULE_SIG_KEY_TYPE_RSA
        bool "RSA"
-       depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
        help
         Use an RSA key for module signing.
 
 config MODULE_SIG_KEY_TYPE_ECDSA
        bool "ECDSA"
        select CRYPTO_ECDSA
-       depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)
        help
         Use an elliptic curve key (NIST P384) for module signing. Consider
         using a strong hash like sha256 or sha384 for hashing modules.
--

2.30.2

Signature · 2 lines
Best Regards
Masahiro Yamada