aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2024-04-18 21:46:11 +0200
committerFelix Fietkau <nbd@nbd.name>2024-04-18 21:46:20 +0200
commit23bd17806b7b687e6723e9239c50b4208e2bb7d6 (patch)
tree9b18890468ba2cdad9d1a3a8ab45e9da51243d03 /libs
parent4e20600abfbfb86008143bf26cbdf1495e0c5800 (diff)
libssh: update to version 0.10.6, fix build with mbedtls 3.6
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'libs')
-rw-r--r--libs/libssh/Makefile6
-rw-r--r--libs/libssh/patches/100-mbedtls_fix.patch53
2 files changed, 56 insertions, 3 deletions
diff --git a/libs/libssh/Makefile b/libs/libssh/Makefile
index 7cd1bd6b6..21d03c7fe 100644
--- a/libs/libssh/Makefile
+++ b/libs/libssh/Makefile
@@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libssh
-PKG_VERSION:=0.10.4
-PKG_RELEASE:=2
+PKG_VERSION:=0.10.6
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.libssh.org/files/0.10/
-PKG_HASH:=07392c54ab61476288d1c1f0a7c557b50211797ad00c34c3af2bbc4dbc4bd97d
+PKG_HASH:=1861d498f5b6f1741b6abc73e608478491edcf9c9d4b6630eef6e74596de9dc1
PKG_MAINTAINER:=Mislav Novakovic <mislav.novakovic@sartura.hr>
PKG_LICENSE:=LGPL-2.1-or-later BSD-2-Clause
diff --git a/libs/libssh/patches/100-mbedtls_fix.patch b/libs/libssh/patches/100-mbedtls_fix.patch
new file mode 100644
index 000000000..4a6309c39
--- /dev/null
+++ b/libs/libssh/patches/100-mbedtls_fix.patch
@@ -0,0 +1,53 @@
+--- a/cmake/Modules/FindMbedTLS.cmake
++++ b/cmake/Modules/FindMbedTLS.cmake
+@@ -34,7 +34,7 @@ set(_MBEDTLS_ROOT_HINTS_AND_PATHS
+
+ find_path(MBEDTLS_INCLUDE_DIR
+ NAMES
+- mbedtls/config.h
++ mbedtls/version.h
+ HINTS
+ ${_MBEDTLS_ROOT_HINTS_AND_PATHS}
+ PATH_SUFFIXES
+@@ -72,7 +72,13 @@ find_library(MBEDTLS_X509_LIBRARY
+ set(MBEDTLS_LIBRARIES ${MBEDTLS_SSL_LIBRARY} ${MBEDTLS_CRYPTO_LIBRARY}
+ ${MBEDTLS_X509_LIBRARY})
+
+-if (MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h")
++if (MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h")
++ file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/build_info.h" _mbedtls_version_str REGEX
++ "^#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[0-9]+.[0-9]+.[0-9]+\"")
++
++ string(REGEX REPLACE "^.*MBEDTLS_VERSION_STRING.*([0-9]+.[0-9]+.[0-9]+).*"
++ "\\1" MBEDTLS_VERSION "${_mbedtls_version_str}")
++elseif (MBEDTLS_INCLUDE_DIR AND EXISTS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h")
+ file(STRINGS "${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h" _mbedtls_version_str REGEX
+ "^#[\t ]*define[\t ]+MBEDTLS_VERSION_STRING[\t ]+\"[0-9]+.[0-9]+.[0-9]+\"")
+
+@@ -93,7 +99,7 @@ if (MBEDTLS_VERSION)
+ in the system variable MBEDTLS_ROOT_DIR"
+ )
+ else (MBEDTLS_VERSION)
+- find_package_handle_standard_args(MBedTLS
++ find_package_handle_standard_args(MbedTLS
+ "Could NOT find mbedTLS, try to set the path to mbedLS root folder in
+ the system variable MBEDTLS_ROOT_DIR"
+ MBEDTLS_INCLUDE_DIR
+--- a/src/libmbedcrypto.c
++++ b/src/libmbedcrypto.c
+@@ -118,8 +118,14 @@ int hmac_update(HMACCTX c, const void *d
+
+ int hmac_final(HMACCTX c, unsigned char *hashmacbuf, size_t *len)
+ {
++ const mbedtls_md_info_t *md_info;
+ int rc;
+- *len = (unsigned int)mbedtls_md_get_size(c->md_info);
++#if MBEDTLS_VERSION_MAJOR >= 3
++ md_info = mbedtls_md_info_from_ctx(c);
++#else
++ md_info = c->md_info;
++#endif
++ *len = (unsigned int)mbedtls_md_get_size(md_info);
+ rc = !mbedtls_md_hmac_finish(c, hashmacbuf);
+ mbedtls_md_free(c);
+ SAFE_FREE(c);