]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
KEYS: Create static version of public_key_verify_signature
authorEric Snowberg <eric.snowberg@oracle.com>
Thu, 2 Mar 2023 16:46:47 +0000 (11:46 -0500)
committerJarkko Sakkinen <jarkko@kernel.org>
Mon, 24 Apr 2023 13:15:52 +0000 (16:15 +0300)
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 <lkp@intel.com>
Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
include/crypto/public_key.h

index 68f7aa2a7e55cc9cbdb382cb608af619544983e6..6d61695e1cdeb10ec7af0bc22a3d39efc40dd546 100644 (file)
@@ -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 */