diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-11-25 11:31:12 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2019-11-27 13:08:49 +0800 |
commit | 8394bfec51e0e565556101bcc4e2fe7551104cd8 (patch) | |
tree | f6500eacc0aa2e818f39286ee59f3e106a4b6578 /arch/arm/crypto/curve25519-glue.c | |
parent | crypto: vmx - Avoid weird build failures (diff) | |
download | linux-dev-8394bfec51e0e565556101bcc4e2fe7551104cd8.tar.xz linux-dev-8394bfec51e0e565556101bcc4e2fe7551104cd8.zip |
crypto: arch - conditionalize crypto api in arch glue for lib code
For glue code that's used by Zinc, the actual Crypto API functions might
not necessarily exist, and don't need to exist either. Before this
patch, there are valid build configurations that lead to a unbuildable
kernel. This fixes it to conditionalize those symbols on the existence
of the proper config entry.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm/crypto/curve25519-glue.c')
-rw-r--r-- | arch/arm/crypto/curve25519-glue.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/crypto/curve25519-glue.c b/arch/arm/crypto/curve25519-glue.c index 2e9e12d2f642..f3f42cf3b893 100644 --- a/arch/arm/crypto/curve25519-glue.c +++ b/arch/arm/crypto/curve25519-glue.c @@ -108,14 +108,15 @@ static int __init mod_init(void) { if (elf_hwcap & HWCAP_NEON) { static_branch_enable(&have_neon); - return crypto_register_kpp(&curve25519_alg); + return IS_REACHABLE(CONFIG_CRYPTO_KPP) ? + crypto_register_kpp(&curve25519_alg) : 0; } return 0; } static void __exit mod_exit(void) { - if (elf_hwcap & HWCAP_NEON) + if (IS_REACHABLE(CONFIG_CRYPTO_KPP) && elf_hwcap & HWCAP_NEON) crypto_unregister_kpp(&curve25519_alg); } |