2023-02-07 03:00:38

by Eric Snowberg

[permalink] [raw]
Subject: [PATCH v4 1/6] KEYS: Create static version of public_key_verify_signature

The kernel test robot reports undefined reference to
public_key_verify_signature when CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is
not defined. Create a static version in this case and return -EINVAL.

Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Eric Snowberg <[email protected]>
Reviewed-by: Mimi Zohar <[email protected]>
Reviewed-by: Petr Vorel <[email protected]>
---
include/crypto/public_key.h | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
index 68f7aa2a7e55..6d61695e1cde 100644
--- a/include/crypto/public_key.h
+++ b/include/crypto/public_key.h
@@ -80,7 +80,16 @@ extern int create_signature(struct kernel_pkey_params *, const void *, void *);
extern int verify_signature(const struct key *,
const struct public_key_signature *);

+#if IS_REACHABLE(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE)
int public_key_verify_signature(const struct public_key *pkey,
const struct public_key_signature *sig);
+#else
+static inline
+int public_key_verify_signature(const struct public_key *pkey,
+ const struct public_key_signature *sig)
+{
+ return -EINVAL;
+}
+#endif

#endif /* _LINUX_PUBLIC_KEY_H */
--
2.27.0



2023-02-10 03:39:37

by Jarkko Sakkinen

[permalink] [raw]
Subject: Re: [PATCH v4 1/6] KEYS: Create static version of public_key_verify_signature

On Mon, Feb 06, 2023 at 09:59:53PM -0500, Eric Snowberg wrote:
> The kernel test robot reports undefined reference to
> public_key_verify_signature when CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is
> not defined. Create a static version in this case and return -EINVAL.
>
> Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api")
> Reported-by: kernel test robot <[email protected]>

What is this reported-by is good for?

> Signed-off-by: Eric Snowberg <[email protected]>
> Reviewed-by: Mimi Zohar <[email protected]>
> Reviewed-by: Petr Vorel <[email protected]>
> ---
> include/crypto/public_key.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
> index 68f7aa2a7e55..6d61695e1cde 100644
> --- a/include/crypto/public_key.h
> +++ b/include/crypto/public_key.h
> @@ -80,7 +80,16 @@ extern int create_signature(struct kernel_pkey_params *, const void *, void *);
> extern int verify_signature(const struct key *,
> const struct public_key_signature *);
>
> +#if IS_REACHABLE(CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE)
> int public_key_verify_signature(const struct public_key *pkey,
> const struct public_key_signature *sig);
> +#else
> +static inline
> +int public_key_verify_signature(const struct public_key *pkey,
> + const struct public_key_signature *sig)
> +{
> + return -EINVAL;
> +}
> +#endif
>
> #endif /* _LINUX_PUBLIC_KEY_H */
> --
> 2.27.0
>

BR, Jarkko

2023-02-10 22:38:55

by Eric Snowberg

[permalink] [raw]
Subject: Re: [PATCH v4 1/6] KEYS: Create static version of public_key_verify_signature



> On Feb 9, 2023, at 8:39 PM, Jarkko Sakkinen <[email protected]> wrote:
>
> On Mon, Feb 06, 2023 at 09:59:53PM -0500, Eric Snowberg wrote:
>> The kernel test robot reports undefined reference to
>> public_key_verify_signature when CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is
>> not defined. Create a static version in this case and return -EINVAL.
>>
>> Fixes: db6c43bd2132 ("crypto: KEYS: convert public key and digsig asym to the akcipher api")
>> Reported-by: kernel test robot <[email protected]>
>
> What is this reported-by is good for?

Back in September of 2021, I received the following message from the test robot [1].
Within the message it asks that I add the Reported-by tag. To prevent the test robot
from generating this error again, I have included this patch at the beginning of the
series for the last year and a half. It would be great if someone would apply the first
two patches.

1. https://lore.kernel.org/all/[email protected]/