aboutsummaryrefslogtreecommitdiffstats
path: root/package/libs
diff options
context:
space:
mode:
authorEtan Kissling <etan_kissling@apple.com>2021-01-13 01:01:24 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-01-14 00:52:49 +0000
commit02abd99f89d98344d086d95b1ec1dfa9901351aa (patch)
tree8bf043e5035c97188284d81bb6209014537c613e /package/libs
parent39add246c1e18afc1fe026b5f359a3acf8082279 (diff)
downloadupstream-02abd99f89d98344d086d95b1ec1dfa9901351aa.tar.gz
upstream-02abd99f89d98344d086d95b1ec1dfa9901351aa.tar.bz2
upstream-02abd99f89d98344d086d95b1ec1dfa9901351aa.zip
mbedtls: add config option to compile with hkdf
This adds a config option to allow compiling with HKDF algorithm support to support applications that require this feature. Signed-off-by: Etan Kissling <etan_kissling@apple.com>
Diffstat (limited to 'package/libs')
-rw-r--r--package/libs/mbedtls/Makefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile
index 27f50f8dde..79650b594a 100644
--- a/package/libs/mbedtls/Makefile
+++ b/package/libs/mbedtls/Makefile
@@ -21,7 +21,9 @@ PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=gpl-2.0.txt
PKG_CPE_ID:=cpe:/a:arm:mbed_tls
-PKG_CONFIG_DEPENDS:=CONFIG_LIBMBEDTLS_DEBUG_C
+PKG_CONFIG_DEPENDS := \
+ CONFIG_LIBMBEDTLS_DEBUG_C \
+ CONFIG_LIBMBEDTLS_HKDF_C
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@@ -57,6 +59,14 @@ config LIBMBEDTLS_DEBUG_C
by around 60 KiB (for an ARMv5 platform).
Usually, you don't need this, so don't select this if you're unsure.
+
+config LIBMBEDTLS_HKDF_C
+ depends on PACKAGE_libmbedtls
+ bool "Enable the HKDF algorithm (RFC 5869)"
+ default n
+ help
+ This option adds support for the Hashed Message Authentication Code
+ (HMAC)-based key derivation function (HKDF).
endef
define Package/mbedtls-util
@@ -97,6 +107,13 @@ define Build/Configure
END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \
>$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \
mv $(PKG_BUILD_DIR)/include/mbedtls/config.h.new $(PKG_BUILD_DIR)/include/mbedtls/config.h
+
+ awk 'BEGIN { rc = 1 } \
+ /#define MBEDTLS_HKDF_C/ { $$$$0 = "$(if $(CONFIG_LIBMBEDTLS_HKDF_C),,// )#define MBEDTLS_HKDF_C"; rc = 0 } \
+ { print } \
+ END { exit(rc) }' $(PKG_BUILD_DIR)/include/mbedtls/config.h \
+ >$(PKG_BUILD_DIR)/include/mbedtls/config.h.new && \
+ mv $(PKG_BUILD_DIR)/include/mbedtls/config.h.new $(PKG_BUILD_DIR)/include/mbedtls/config.h
endef
define Build/InstallDev