summaryrefslogtreecommitdiff
path: root/net-libs
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/Manifest.gzbin31011 -> 31007 bytes
-rw-r--r--net-libs/libssh/Manifest3
-rw-r--r--net-libs/libssh/files/libssh-0.10.6-ipv6-hostname-parsing.patch135
-rw-r--r--net-libs/libssh/files/libssh-0.10.6-libgcrypt-type-mismatches.patch60
-rw-r--r--net-libs/libssh/libssh-0.10.6-r1.ebuild140
5 files changed, 338 insertions, 0 deletions
diff --git a/net-libs/Manifest.gz b/net-libs/Manifest.gz
index 20fb35e33d76..39a60a9ed5e0 100644
--- a/net-libs/Manifest.gz
+++ b/net-libs/Manifest.gz
Binary files differ
diff --git a/net-libs/libssh/Manifest b/net-libs/libssh/Manifest
index da99054b7a16..1116f247a920 100644
--- a/net-libs/libssh/Manifest
+++ b/net-libs/libssh/Manifest
@@ -1,4 +1,7 @@
+AUX libssh-0.10.6-ipv6-hostname-parsing.patch 5095 BLAKE2B d231effe7a624f3d42ccae9ae2f8db5d567da3ff4c32f18ad217b11a19f9fa919b6feb42aeb82b8f9b15063ac252db44d79efe27e056f533d1eebdfe9b3d4b8e SHA512 8612f8c9f90e480e8ce4657ba6a150a09ad080c2ed8d4f4a1902fd57b4008d68edaaa31dd3cfb423f2619f580ec0c8b6cd711a91ad6c161f207c8e719200f385
+AUX libssh-0.10.6-libgcrypt-type-mismatches.patch 2544 BLAKE2B 14999447e240fa7a2a5e09d04a09f7a95049482eec3aa9e7094d11ed5a5720a901ac69b663e680e5413dac418792a0701ce3bd294b84e1d2310c8a5ca837de70 SHA512 949789b95347a23eccf9a1d4e4f37a1b410a912895d369aa3c845f44a3dd2213cd507b49ea3ef7f42b83fcb758ddcba7bc443e2f260253eec46e0c2d3adb4222
DIST libssh-0.10.6.tar.xz 561036 BLAKE2B 6ae1c611b685fa8ec5e5fb159f93493edf4d8ae8536300cd9a357daadc28ca2fbd8a64a22157744bc97e2e672b0b84b58e1167d7369fe88306b3581098af9f57 SHA512 40c62d63c44e882999b71552c237d73fc7364313bd00b15a211a34aeff1b73693da441d2c8d4e40108d00fb7480ec7c5b6d472f9c0784b2359a179632ab0d6c1
+EBUILD libssh-0.10.6-r1.ebuild 3629 BLAKE2B c8b7ece541317689831e5197cc0066a80bbeb2962a611006f364077133efc929ce010d2868bc7d9a25f658f310f9b9b30578a28f3b65346b9353ad2a4f2ebf1d SHA512 b47081dcdcad2846ab6d0617c4b9751c78e3db9250d9216c636807c622401d8add916cc4cd1e4f5c2276a89e87038915f9ba49bb45bca91e6f9e9997714bd723
EBUILD libssh-0.10.6.ebuild 3495 BLAKE2B 14035950f9906974d2e25f5aed3bc1ffbccc2c5f6628d43f00c495d39a2a9fd52fd84257e252468b04430540ccbcc2351248c49489a17e501ee88977d96577d2 SHA512 9feed2dda2d5d3c0db116d01e34adf695b15149ca0e4532074a84cd279ced5ece624c5bd4297b59ea8847061af366ffda9d605e46e6a034273910479f1dd0266
EBUILD libssh-9999.ebuild 3503 BLAKE2B a91bb2d862b5e15f9c57619325781a603b685fe8fc2995a287136fc0178c1b2461b9471822a2be4623ce77b852063139590ae54af6cc52d797598e4103a7090a SHA512 0ef5869b0e59a14dce1069dc6dbea6720df0ea32a89831a045d3654548535c4bb9b7262b2dbbee77d573e584d70eca3e9522cb2350a16e61d2446cecc022868d
MISC metadata.xml 783 BLAKE2B 79be0ef9802a5f1d58b866dd2738a721696b0a4a1b6fcf44b024c74593ba9737e4a64ce2cf1cb8ba4a17139da06ccbe2fe3d8365221159ebf797de1c4aa5b490 SHA512 f2204075966244ebc337663f1a9d010320dffeda90954c6bac69c22859fefd2b6ca0ff5809fc2d34743de6400e3d9da234c5b8a9ef211cc634f381ded5d97825
diff --git a/net-libs/libssh/files/libssh-0.10.6-ipv6-hostname-parsing.patch b/net-libs/libssh/files/libssh-0.10.6-ipv6-hostname-parsing.patch
new file mode 100644
index 000000000000..4d62ca5e9459
--- /dev/null
+++ b/net-libs/libssh/files/libssh-0.10.6-ipv6-hostname-parsing.patch
@@ -0,0 +1,135 @@
+From 4f997aee7c7d7ea346b3e8ba505da0b7601ff318 Mon Sep 17 00:00:00 2001
+From: Jakub Jelen <jjelen@redhat.com>
+Date: Fri, 22 Dec 2023 10:32:40 +0100
+Subject: [PATCH] Fix regression in IPv6 addresses in hostname parsing
+
+Signed-off-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
+---
+ include/libssh/config_parser.h | 11 ++++++++---
+ src/config.c | 4 ++--
+ src/config_parser.c | 16 +++++++++++-----
+ src/options.c | 10 ++--------
+ 4 files changed, 23 insertions(+), 18 deletions(-)
+
+diff --git a/include/libssh/config_parser.h b/include/libssh/config_parser.h
+index a7dd42a2c..ca353432b 100644
+--- a/include/libssh/config_parser.h
++++ b/include/libssh/config_parser.h
+@@ -30,6 +30,8 @@
+ extern "C" {
+ #endif
+
++#include <stdbool.h>
++
+ char *ssh_config_get_cmd(char **str);
+
+ char *ssh_config_get_token(char **str);
+@@ -49,14 +51,17 @@ int ssh_config_get_yesno(char **str, int notfound);
+ * be stored or NULL if we do not care about the result.
+ * @param[out] port Pointer to the location, where the new port will
+ * be stored or NULL if we do not care about the result.
++ * @param[in] ignore_port Set to true if the we should not attempt to parse
++ * port number.
+ *
+ * @returns SSH_OK if the provided string is in format of SSH URI,
+ * SSH_ERROR on failure
+ */
+ int ssh_config_parse_uri(const char *tok,
+- char **username,
+- char **hostname,
+- char **port);
++ char **username,
++ char **hostname,
++ char **port,
++ bool ignore_port);
+
+ #ifdef __cplusplus
+ }
+diff --git a/src/config.c b/src/config.c
+index 5eedbce96..7135c3b19 100644
+--- a/src/config.c
++++ b/src/config.c
+@@ -464,7 +464,7 @@ ssh_config_parse_proxy_jump(ssh_session session, const char *s, bool do_parsing)
+ }
+ if (parse_entry) {
+ /* We actually care only about the first item */
+- rv = ssh_config_parse_uri(cp, &username, &hostname, &port);
++ rv = ssh_config_parse_uri(cp, &username, &hostname, &port, false);
+ /* The rest of the list needs to be passed on */
+ if (endp != NULL) {
+ next = strdup(endp + 1);
+@@ -475,7 +475,7 @@ ssh_config_parse_proxy_jump(ssh_session session, const char *s, bool do_parsing)
+ }
+ } else {
+ /* The rest is just sanity-checked to avoid failures later */
+- rv = ssh_config_parse_uri(cp, NULL, NULL, NULL);
++ rv = ssh_config_parse_uri(cp, NULL, NULL, NULL, false);
+ }
+ if (rv != SSH_OK) {
+ goto out;
+diff --git a/src/config_parser.c b/src/config_parser.c
+index 9ffc8b8b0..5f30cd3e1 100644
+--- a/src/config_parser.c
++++ b/src/config_parser.c
+@@ -162,9 +162,10 @@ int ssh_config_get_yesno(char **str, int notfound)
+ }
+
+ int ssh_config_parse_uri(const char *tok,
+- char **username,
+- char **hostname,
+- char **port)
++ char **username,
++ char **hostname,
++ char **port,
++ bool ignore_port)
+ {
+ char *endp = NULL;
+ long port_n;
+@@ -210,12 +211,17 @@ int ssh_config_parse_uri(const char *tok,
+ if (endp == NULL) {
+ goto error;
+ }
+- } else {
+- /* Hostnames or aliases expand to the last colon or to the end */
++ } else if (!ignore_port) {
++ /* Hostnames or aliases expand to the last colon (if port is requested)
++ * or to the end */
+ endp = strrchr(tok, ':');
+ if (endp == NULL) {
+ endp = strchr(tok, '\0');
+ }
++ } else {
++ /* If no port is requested, expand to the end of line
++ * (to accommodate the IPv6 addresses) */
++ endp = strchr(tok, '\0');
+ }
+ if (tok == endp) {
+ /* Zero-length hostnames are not valid */
+diff --git a/src/options.c b/src/options.c
+index 2e73be462..676c49e7a 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -634,17 +634,11 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
+ ssh_set_error_invalid(session);
+ return -1;
+ } else {
+- char *username = NULL, *hostname = NULL, *port = NULL;
+- rc = ssh_config_parse_uri(value, &username, &hostname, &port);
++ char *username = NULL, *hostname = NULL;
++ rc = ssh_config_parse_uri(value, &username, &hostname, NULL, true);
+ if (rc != SSH_OK) {
+ return -1;
+ }
+- if (port != NULL) {
+- SAFE_FREE(username);
+- SAFE_FREE(hostname);
+- SAFE_FREE(port);
+- return -1;
+- }
+ if (username != NULL) {
+ SAFE_FREE(session->opts.username);
+ session->opts.username = username;
+--
+GitLab
+
diff --git a/net-libs/libssh/files/libssh-0.10.6-libgcrypt-type-mismatches.patch b/net-libs/libssh/files/libssh-0.10.6-libgcrypt-type-mismatches.patch
new file mode 100644
index 000000000000..89e6d012240e
--- /dev/null
+++ b/net-libs/libssh/files/libssh-0.10.6-libgcrypt-type-mismatches.patch
@@ -0,0 +1,60 @@
+From c01377081fc60132fd3e256ad56eab6b329f5493 Mon Sep 17 00:00:00 2001
+From: Gerald Combs <gerald@zing.org>
+Date: Thu, 1 Jun 2023 12:42:50 -0700
+Subject: [PATCH] libgcrypt.c: Fix type mismatches
+
+Fix
+
+ /build/libssh-0.10.5/src/libgcrypt.c:903:20: error: incompatible function pointer types initializing 'void (*)(struct ssh_cipher_struct *, void *, void *, size_t)' (aka 'void (*)(struct ssh_cipher_struct *, void *, void *, unsigned long long)') with an expression of type 'void (struct ssh_cipher_struct *, void *, void *, unsigned long)' [-Wincompatible-function-pointer-types]
+ .encrypt = des3_encrypt,
+ ^~~~~~~~~~~~
+ /build/libssh-0.10.5/src/libgcrypt.c:904:20: error: incompatible function pointer types initializing 'void (*)(struct ssh_cipher_struct *, void *, void *, size_t)' (aka 'void (*)(struct ssh_cipher_struct *, void *, void *, unsigned long long)') with an expression of type 'void (struct ssh_cipher_struct *, void *, void *, unsigned long)' [-Wincompatible-function-pointer-types]
+ .decrypt = des3_decrypt
+ ^~~~~~~~~~~~
+
+Fixes: #196
+
+Signed-off-by: Gerald Combs <gerald@zing.org>
+Reviewed-by: Jakub Jelen <jjelen@redhat.com>
+Reviewed-by: Norbert Pocs <npocs@redhat.com>
+---
+ src/libgcrypt.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/libgcrypt.c b/src/libgcrypt.c
+index cea20370b..58f510954 100644
+--- a/src/libgcrypt.c
++++ b/src/libgcrypt.c
+@@ -198,12 +198,12 @@ static int blowfish_set_key(struct ssh_cipher_struct *cipher, void *key, void *I
+ }
+
+ static void blowfish_encrypt(struct ssh_cipher_struct *cipher, void *in,
+- void *out, unsigned long len) {
++ void *out, size_t len) {
+ gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
+ }
+
+ static void blowfish_decrypt(struct ssh_cipher_struct *cipher, void *in,
+- void *out, unsigned long len) {
++ void *out, size_t len) {
+ gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
+ }
+ #endif /* WITH_BLOWFISH_CIPHER */
+@@ -469,12 +469,12 @@ static int des3_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) {
+ }
+
+ static void des3_encrypt(struct ssh_cipher_struct *cipher, void *in,
+- void *out, unsigned long len) {
++ void *out, size_t len) {
+ gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
+ }
+
+ static void des3_decrypt(struct ssh_cipher_struct *cipher, void *in,
+- void *out, unsigned long len) {
++ void *out, size_t len) {
+ gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
+ }
+
+--
+GitLab
+
diff --git a/net-libs/libssh/libssh-0.10.6-r1.ebuild b/net-libs/libssh/libssh-0.10.6-r1.ebuild
new file mode 100644
index 000000000000..fcdd767eddc4
--- /dev/null
+++ b/net-libs/libssh/libssh-0.10.6-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib
+
+DESCRIPTION="Access a working SSH implementation by means of a library"
+HOMEPAGE="https://www.libssh.org/"
+
+if [[ ${PV} == *9999* ]] ; then
+ inherit git-r3
+ EGIT_REPO_URI="https://git.libssh.org/projects/libssh.git"
+else
+ SRC_URI="https://www.libssh.org/files/$(ver_cut 1-2)/${P}.tar.xz"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0/4" # subslot = soname major version
+IUSE="debug doc examples gcrypt gssapi mbedtls pcap server +sftp static-libs test zlib"
+# Maintainer: check IUSE-defaults at DefineOptions.cmake
+
+REQUIRED_USE="?? ( gcrypt mbedtls )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ !gcrypt? (
+ !mbedtls? (
+ >=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
+ )
+ )
+ gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
+ gssapi? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
+ mbedtls? ( net-libs/mbedtls:=[${MULTILIB_USEDEP}] )
+ zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
+"
+DEPEND="${RDEPEND}
+ test? (
+ >=dev-util/cmocka-0.3.1[${MULTILIB_USEDEP}]
+ elibc_musl? ( sys-libs/argp-standalone )
+ )
+"
+BDEPEND="doc? ( app-text/doxygen[dot] )"
+
+DOCS=( AUTHORS CHANGELOG README )
+
+PATCHES=(
+ "${FILESDIR}/${P}-libgcrypt-type-mismatches.patch" # bug 932715
+ "${FILESDIR}/${P}-ipv6-hostname-parsing.patch"
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ # just install the examples, do not compile them
+ cmake_comment_add_subdirectory examples
+
+ sed -e "/^check_include_file.*HAVE_VALGRIND_VALGRIND_H/s/^/#DONT /" \
+ -i ConfigureChecks.cmake || die
+
+ if use test; then
+ local skip_tests=(
+ # keyfile torture test is currently broken
+ -e "/torture_keyfiles/d"
+
+ # Tries to expand ~ which fails w/ portage homedir
+ # (torture_path_expand_tilde_unix and torture_config_make_absolute_no_sshdir)
+ -e "/torture_misc/d"
+ -e "/torture_config/d"
+ )
+
+ # Disable tests that take too long (bug #677006)
+ if use sparc; then
+ skip_tests+=(
+ -e "/torture_threads_pki_rsa/d"
+ -e "/torture_pki_dsa/d"
+ )
+ fi
+
+ if (( ${#skip_tests[@]} )) ; then
+ sed -i "${skip_tests[@]}" tests/unittests/CMakeLists.txt || die
+ fi
+
+ if use elibc_musl; then
+ sed -e "/SOLARIS/d" \
+ -i tests/CMakeLists.txt || die
+ fi
+ fi
+}
+
+multilib_src_configure() {
+ local mycmakeargs=(
+ -DWITH_NACL=OFF
+ -DWITH_STACK_PROTECTOR=OFF
+ -DWITH_STACK_PROTECTOR_STRONG=OFF
+ -DWITH_DEBUG_CALLTRACE=$(usex debug)
+ -DWITH_DEBUG_CRYPTO=$(usex debug)
+ -DWITH_GCRYPT=$(usex gcrypt)
+ -DWITH_GSSAPI=$(usex gssapi)
+ -DWITH_MBEDTLS=$(usex mbedtls)
+ -DWITH_PCAP=$(usex pcap)
+ -DWITH_SERVER=$(usex server)
+ -DWITH_SFTP=$(usex sftp)
+ -DBUILD_STATIC_LIB=$(usex static-libs)
+ # TODO: try enabling {CLIENT,SERVER}_TESTING
+ -DUNIT_TESTING=$(usex test)
+ -DWITH_ZLIB=$(usex zlib)
+ )
+
+ multilib_is_native_abi || mycmakeargs+=( -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON )
+
+ cmake_src_configure
+}
+
+multilib_src_compile() {
+ cmake_src_compile
+ multilib_is_native_abi && use doc && cmake_src_compile docs
+}
+
+multilib_src_install() {
+ cmake_src_install
+ multilib_is_native_abi && use doc && local HTML_DOCS=( "${BUILD_DIR}"/doc/html/. )
+
+ use static-libs && dolib.a src/libssh.a
+
+ # compatibility symlink until all consumers have been updated
+ # to no longer use libssh_threads.so
+ dosym libssh.so /usr/$(get_libdir)/libssh_threads.so
+}
+
+multilib_src_install_all() {
+ use mbedtls && DOCS+=( README.mbedtls )
+ einstalldocs
+
+ if use examples; then
+ docinto examples
+ dodoc examples/*.{c,h,cpp}
+ fi
+}