curl: add support for mbedtls
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 1 Feb 2016 22:37:41 +0000 (22:37 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 1 Feb 2016 22:37:41 +0000 (22:37 +0000)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 48615

package/network/utils/curl/Config.in
package/network/utils/curl/Makefile
package/network/utils/curl/patches/310-polarssl-disable-runtime-version-check.patch

index 11cfa39e95d0139217c8ad6c6cc4b9431cd155d4..f41307a97042381adbcb5ea7294a98cde05f7dda 100644 (file)
@@ -9,6 +9,9 @@ choice
        config LIBCURL_POLARSSL
                bool "PolarSSL"
 
+       config LIBCURL_MBEDTLS
+               bool "mbed TLS"
+
        config LIBCURL_CYASSL
                bool "CyaSSL"
 
index 56dcb6b60d2991934688db6215fa1e82dd752000..bc85da3a0ab7b5fc28be5a71821e5065e4fa972a 100644 (file)
@@ -34,6 +34,7 @@ PKG_CONFIG_DEPENDS:= \
   CONFIG_LIBCURL_GNUTLS \
   CONFIG_LIBCURL_OPENSSL \
   CONFIG_LIBCURL_POLARSSL \
+  CONFIG_LIBCURL_MBEDTLS \
   CONFIG_LIBCURL_NOSSL \
   \
   CONFIG_LIBCURL_LIBIDN \
@@ -86,7 +87,7 @@ define Package/libcurl
   $(call Package/curl/Default)
   SECTION:=libs
   CATEGORY:=Libraries
-  DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_CYASSL:libcyassl +LIBCURL_AXTLS:libaxtls +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls 
+  DEPENDS:=+LIBCURL_POLARSSL:libpolarssl +LIBCURL_CYASSL:libcyassl +LIBCURL_AXTLS:libaxtls +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls
   DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2
   TITLE:=A client-side URL transfer library
   MENU:=1
@@ -117,6 +118,7 @@ CONFIGURE_ARGS += \
        $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --with-ca-path=/etc/ssl/certs,--without-gnutls) \
        $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --with-ca-path=/etc/ssl/certs,--without-ssl) \
        $(if $(CONFIG_LIBCURL_POLARSSL),--with-polarssl="$(STAGING_DIR)/usr" --with-ca-path=/etc/ssl/certs,--without-polarssl) \
+       $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path,--without-mbedtls) \
        \
        $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \
        $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \
index 1b5b63aa691aba368ab6cc220e9b8548bdd1b238..6f9cf2e998b4ea8ecf50e5e8bfc9367dd1690965 100644 (file)
@@ -9,3 +9,14 @@
    return snprintf(buffer, size, "%s/%d.%d.%d",
                    version >= 0x01030A00?"mbedTLS":"PolarSSL",
                    version>>24, (version>>16)&0xff, (version>>8)&0xff);
+--- a/lib/vtls/mbedtls.c
++++ b/lib/vtls/mbedtls.c
+@@ -686,7 +686,7 @@ void Curl_mbedtls_session_free(void *ptr
+ size_t Curl_mbedtls_version(char *buffer, size_t size)
+ {
+-  unsigned int version = mbedtls_version_get_number();
++  unsigned int version = MBEDTLS_VERSION_NUMBER;
+   return snprintf(buffer, size, "mbedTLS/%d.%d.%d", version>>24,
+                   (version>>16)&0xff, (version>>8)&0xff);
+ }