kernel: add kmod-crypto-ecdh
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 12 Nov 2017 21:06:38 +0000 (22:06 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 16 Dec 2017 21:13:04 +0000 (22:13 +0100)
In kernel 4.14 kmod-bluetooth depends on kmod-crypto-ecdh, add
kmod-crypto-ecdh to LEDE.
Both packages also depend on the kmod-crypto-kpp package. To build this
we have to fix the dependency of CRYPTO_ECDH which has a typo.
This patch is already accepted upstream.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
package/kernel/linux/modules/crypto.mk
package/kernel/linux/modules/other.mk
target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch [new file with mode: 0644]
target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch [new file with mode: 0644]

index a0c47634b67766f0d5abfe9d672bcf33988fa7cc..b05552006ade7cd7889d04dbfb3b16649d263d24 100644 (file)
@@ -137,6 +137,19 @@ endef
 $(eval $(call KernelPackage,crypto-rsa))
 
 
+define KernelPackage/crypto-ecdh
+  TITLE:=ECDH algorithm
+  DEPENDS:=@!(LINUX_3_18||LINUX_4_4) +kmod-crypto-kpp
+  KCONFIG:= CONFIG_CRYPTO_ECDH
+  FILES:= \
+       $(LINUX_DIR)/crypto/ecdh_generic.ko
+  AUTOLOAD:=$(call AutoLoad,10,ecdh_generic)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-ecdh))
+
+
 define KernelPackage/crypto-iv
   TITLE:=CryptoAPI initialization vectors
   DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq
@@ -348,6 +361,18 @@ endef
 $(eval $(call KernelPackage,crypto-des))
 
 
+define KernelPackage/crypto-kpp
+  TITLE:=Key-agreement Protocol Primitives
+  KCONFIG:=CONFIG_CRYPTO_KPP
+  HIDDEN:=1
+  FILES:=$(LINUX_DIR)/crypto/kpp.ko
+  AUTOLOAD:=$(call AutoLoad,09,kpp)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-kpp))
+
+
 define KernelPackage/crypto-acompress
   TITLE:=Asynchronous Compression operations
   HIDDEN:=1
index 8e2f3a012deaa7b1054d566595a1ccf59ec86111..b3ad4a051ebcd6722ed1069d5fd1cf47377125ca 100644 (file)
@@ -30,7 +30,7 @@ $(eval $(call KernelPackage,6lowpan))
 define KernelPackage/bluetooth
   SUBMENU:=$(OTHER_MENU)
   TITLE:=Bluetooth support
-  DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +!LINUX_3_18:kmod-crypto-cmac +!LINUX_3_18:kmod-regmap
+  DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +!LINUX_3_18:kmod-crypto-cmac +!LINUX_3_18:kmod-regmap +LINUX_4_14:kmod-crypto-ecdh
   KCONFIG:= \
        CONFIG_BLUEZ \
        CONFIG_BLUEZ_L2CAP \
diff --git a/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch b/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch
new file mode 100644 (file)
index 0000000..b3e2720
--- /dev/null
@@ -0,0 +1,25 @@
+From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 26 Nov 2017 00:09:45 +0100
+Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH
+
+This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH.
+
+Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support")
+Cc: <stable@vger.kernel.org> # v4.8+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ crypto/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/crypto/Kconfig
++++ b/crypto/Kconfig
+@@ -130,7 +130,7 @@ config CRYPTO_DH
+ config CRYPTO_ECDH
+       tristate "ECDH algorithm"
+-      select CRYTPO_KPP
++      select CRYPTO_KPP
+       select CRYPTO_RNG_DEFAULT
+       help
+         Generic implementation of the ECDH algorithm
diff --git a/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch b/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch
new file mode 100644 (file)
index 0000000..eaef5ca
--- /dev/null
@@ -0,0 +1,25 @@
+From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke@hauke-m.de>
+Date: Sun, 26 Nov 2017 00:09:45 +0100
+Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH
+
+This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH.
+
+Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support")
+Cc: <stable@vger.kernel.org> # v4.8+
+Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
+---
+ crypto/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/crypto/Kconfig
++++ b/crypto/Kconfig
+@@ -120,7 +120,7 @@ config CRYPTO_DH
+ config CRYPTO_ECDH
+       tristate "ECDH algorithm"
+-      select CRYTPO_KPP
++      select CRYPTO_KPP
+       help
+         Generic implementation of the ECDH algorithm