Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] keys: TURRIS_SIGNING_KEY Kconfig options still depend on
  ASYMMETRIC_KEY_TYPE
--

commit f2c536390b5f9f7464b1b59aadb07824b873665b
Author: Jarkko Sakkinen <[email protected]>

KEYS: Factor out opt-in KEYCTL_PKEY

This commit separates CONFIG_KEYCTL_PKEY from CONFIG_ASYMMETRIC_KEY_TYPE
as an off-by-default option controlling compilation of keyctl_pkey.o.

> diff --git a/security/keys/Kconfig b/security/keys/Kconfig
> index 3f64d60d0f8a6..75cc4043ca642 100644
> --- a/security/keys/Kconfig
> +++ b/security/keys/Kconfig
> @@ -22,6 +22,15 @@ menuconfig KEYS
>  
>  if KEYS
>  
> +config KEYCTL_PKEY
> +     bool "Public-key operations on retained keys"
> +     help
> +       This option provides support for querying, encrypting, decrypting,
> +       signing, and verifying signatures via keyctl using public or
> +       asymmetric keys retained in the kernel.
> +
> +       If you are unsure as to whether this is required, answer N.
> +
>  config KEYS_REQUEST_CACHE
>       bool "Enable temporary caching of the last request_key() result"
>       help
> diff --git a/security/keys/Makefile b/security/keys/Makefile
> index 5f40807f05b3d..aafd28f7ee2fe 100644
> --- a/security/keys/Makefile
> +++ b/security/keys/Makefile
> @@ -22,7 +22,7 @@ obj-$(CONFIG_PROC_FS) += proc.o
>  obj-$(CONFIG_SYSCTL) += sysctl.o
>  obj-$(CONFIG_PERSISTENT_KEYRINGS) += persistent.o
>  obj-$(CONFIG_KEY_DH_OPERATIONS) += dh.o
> -obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += keyctl_pkey.o
> +obj-$(CONFIG_KEYCTL_PKEY) += keyctl_pkey.o

[Severity: Medium]
Should TURRIS_SIGNING_KEY, TURRIS_OMNIA_MCU_KEYCTL and
TURRIS_MOX_RWTM_KEYCTL be updated to depend on KEYCTL_PKEY instead of
ASYMMETRIC_KEY_TYPE?

turris_signing_key_type implements .asym_query and .asym_eds_op for
keyctl_pkey.c without using crypto/asymmetric_keys:

drivers/platform/cznic/Kconfig:
config TURRIS_OMNIA_MCU_KEYCTL
        bool "Turris Omnia MCU ECDSA message signing"
        default y
        depends on KEYS
        depends on ASYMMETRIC_KEY_TYPE
...
config TURRIS_SIGNING_KEY
        tristate
        depends on KEYS
        depends on ASYMMETRIC_KEY_TYPE

With CONFIG_ASYMMETRIC_KEY_TYPE=y and CONFIG_KEYCTL_PKEY=n (the new
default), those drivers still default to y and register hardware signing
keys whose KEYCTL_PKEY_QUERY and KEYCTL_PKEY_SIGN calls now fail with
-EOPNOTSUPP.  Conversely, CONFIG_KEYCTL_PKEY=y with
CONFIG_ASYMMETRIC_KEY_TYPE=n cannot enable them at all.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to