From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libssh2/, net-libs/libssh2/files/
Date: Tue, 29 Aug 2023 23:21:13 +0000 (UTC) [thread overview]
Message-ID: <1693351259.b31e7e4664d8f8c61fb4fd6443b29d70702663f7.sam@gentoo> (raw)
commit: b31e7e4664d8f8c61fb4fd6443b29d70702663f7
Author: Mario Haustein <mario.haustein <AT> hrz <DOT> tu-chemnitz <DOT> de>
AuthorDate: Tue Aug 29 16:42:48 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug 29 23:20:59 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b31e7e46
net-libs/libssh2: fix conflicting types (32-bit build)
Closes: https://bugs.gentoo.org/911279
Signed-off-by: Mario Haustein <mario.haustein <AT> hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/32510
Signed-off-by: Sam James <sam <AT> gentoo.org>
net-libs/libssh2/files/libssh2-1.11.0-size_t.patch | 95 ++++++++++++++++++++++
net-libs/libssh2/libssh2-1.11.0-r2.ebuild | 66 +++++++++++++++
2 files changed, 161 insertions(+)
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
+}
next reply other threads:[~2023-08-29 23:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-29 23:21 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-12-06 20:26 [gentoo-commits] repo/gentoo:master commit in: net-libs/libssh2/, net-libs/libssh2/files/ Michał Górny
2024-09-06 14:39 Eli Schwartz
2023-09-02 18:01 Andreas Sturmlechner
2023-05-30 18:46 Sam James
2019-06-24 9:08 Jeroen Roovers
2018-06-20 17:39 Pacho Ramos
2018-06-20 17:39 Pacho Ramos
2017-08-15 6:10 Jeroen Roovers
2016-10-31 9:20 Sergei Trofimovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1693351259.b31e7e4664d8f8c61fb4fd6443b29d70702663f7.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox