summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Haustein <mario.haustein@hrz.tu-chemnitz.de>2023-08-29 18:42:48 +0200
committerSam James <sam@gentoo.org>2023-08-30 00:20:59 +0100
commitb31e7e4664d8f8c61fb4fd6443b29d70702663f7 (patch)
tree7322b7a0618b83e5d25cf9e1b9b63f520ce6fecc /net-libs
parentdev-util/ccache: add 4.8.3 (diff)
downloadgentoo-b31e7e4664d8f8c61fb4fd6443b29d70702663f7.tar.gz
gentoo-b31e7e4664d8f8c61fb4fd6443b29d70702663f7.tar.bz2
gentoo-b31e7e4664d8f8c61fb4fd6443b29d70702663f7.zip
net-libs/libssh2: fix conflicting types (32-bit build)
Closes: https://bugs.gentoo.org/911279 Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de> Closes: https://github.com/gentoo/gentoo/pull/32510 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/libssh2/files/libssh2-1.11.0-size_t.patch95
-rw-r--r--net-libs/libssh2/libssh2-1.11.0-r2.ebuild66
2 files changed, 161 insertions, 0 deletions
diff --git a/net-libs/libssh2/files/libssh2-1.11.0-size_t.patch b/net-libs/libssh2/files/libssh2-1.11.0-size_t.patch
new file mode 100644
index 000000000000..ade3cdee8a49
--- /dev/null
+++ b/net-libs/libssh2/files/libssh2-1.11.0-size_t.patch
@@ -0,0 +1,95 @@
+https://bugs.gentoo.org/911279
+Upstream: https://github.com/libssh2/libssh2/issues/1053
+Commit: https://github.com/libssh2/libssh2/commit/1153ebdeba563ac657b525edd6bf6da68b1fe5e2
+From: Viktor Szakats <commit@vsz.me>
+Date: Tue, 30 May 2023 17:28:03 +0000
+Subject: [PATCH] mbedtls: use more `size_t` to sync up with `crypto.h`
+
+Ref: 5a96f494ee0b00282afb2db2e091246fc5e1774a #846 #879
+
+Fixes #1053
+Closes #1054
+--- a/src/mbedtls.c
++++ b/src/mbedtls.c
+@@ -186,7 +186,7 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx)
+ int
+ _libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
+ mbedtls_md_type_t mdtype,
+- const unsigned char *key, unsigned long keylen)
++ const unsigned char *key, size_t keylen)
+ {
+ const mbedtls_md_info_t *md_info;
+ int ret, hmac;
+@@ -221,7 +221,7 @@ _libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash)
+ }
+
+ int
+-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
++_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
+ mbedtls_md_type_t mdtype, unsigned char *hash)
+ {
+ const mbedtls_md_info_t *md_info;
+@@ -497,8 +497,9 @@ int
+ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
+ size_t hash_len,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m, unsigned long m_len)
++ size_t sig_len,
++ const unsigned char *m,
++ size_t m_len)
+ {
+ int ret;
+ int md_type;
+@@ -548,8 +549,9 @@ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
+ int
+ _libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx * rsactx,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m, unsigned long m_len)
++ size_t sig_len,
++ const unsigned char *m,
++ size_t m_len)
+ {
+ return _libssh2_mbedtls_rsa_sha2_verify(rsactx, SHA_DIGEST_LENGTH,
+ sig, sig_len, m, m_len);
+--- a/src/mbedtls.h
++++ b/src/mbedtls.h
+@@ -478,12 +478,12 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx);
+ int
+ _libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
+ mbedtls_md_type_t mdtype,
+- const unsigned char *key, unsigned long keylen);
++ const unsigned char *key, size_t keylen);
+
+ int
+ _libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash);
+ int
+-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
++_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
+ mbedtls_md_type_t mdtype, unsigned char *hash);
+
+ _libssh2_bn *
+@@ -526,9 +526,8 @@ _libssh2_mbedtls_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa,
+ int
+ _libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m,
+- unsigned long m_len);
++ size_t sig_len,
++ const unsigned char *m, size_t m_len);
+ int
+ _libssh2_mbedtls_rsa_sha1_sign(LIBSSH2_SESSION *session,
+ libssh2_rsa_ctx *rsa,
+@@ -540,8 +539,8 @@ int
+ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
+ size_t hash_len,
+ const unsigned char *sig,
+- unsigned long sig_len,
+- const unsigned char *m, unsigned long m_len);
++ size_t sig_len,
++ const unsigned char *m, size_t m_len);
+ int
+ _libssh2_mbedtls_rsa_sha2_sign(LIBSSH2_SESSION *session,
+ libssh2_rsa_ctx *rsa,
diff --git a/net-libs/libssh2/libssh2-1.11.0-r2.ebuild b/net-libs/libssh2/libssh2-1.11.0-r2.ebuild
new file mode 100644
index 000000000000..561e2a9ec8dc
--- /dev/null
+++ b/net-libs/libssh2/libssh2-1.11.0-r2.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Library implementing the SSH2 protocol"
+HOMEPAGE="https://www.libssh2.org"
+SRC_URI="https://www.libssh2.org/download/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="gcrypt mbedtls test zlib"
+REQUIRED_USE="?? ( gcrypt mbedtls )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
+ !gcrypt? (
+ mbedtls? ( net-libs/mbedtls:0=[${MULTILIB_USEDEP}] )
+ !mbedtls? (
+ >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+ )
+ )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+ ${RDEPEND}
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
+ "${FILESDIR}"/${PN}-1.11.0-size_t.patch
+)
+
+multilib_src_configure() {
+ local crypto_backend=OpenSSL
+ if use gcrypt; then
+ crypto_backend=Libgcrypt
+ elif use mbedtls; then
+ crypto_backend=mbedTLS
+ fi
+
+ local mycmakeargs=(
+ -DBUILD_SHARED_LIBS=ON
+ -DBUILD_TESTING=$(usex test)
+ -DCRYPTO_BACKEND=${crypto_backend}
+ -DENABLE_ZLIB_COMPRESSION=$(usex zlib)
+ )
+
+ if use test ; then
+ # Pass separately to avoid unused var warnings w/ USE=-test
+ mycmakeargs+=(
+ -DRUN_SSHD_TESTS=OFF
+ -DRUN_DOCKER_TESTS=OFF
+ )
+ fi
+
+ cmake_src_configure
+}
+
+multilib_src_install_all() {
+ einstalldocs
+}