Skip to content

Commit d3e3ead

Browse files
committed
net-libs/libssh2: Sync with Gentoo
It's from Gentoo commit e34e106c9ff5de63b4823f2fe74474cb3d61da9e.
1 parent 36765ee commit d3e3ead

File tree

8 files changed

+227
-73
lines changed

8 files changed

+227
-73
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
DIST libssh2-1.10.0.tar.gz 965044 BLAKE2B 0e6f571cc723e0050bf7ba7492f361ef222547dcbc311019cb6762f01405b4906e0418207a7d484c5170bee5e6f666827a7ea0d0cf233f684f999f896ce0b415 SHA512 e064ee1089eb8e6cd5fa2617f4fd8ff56c2721c5476775a98bdb68c6c4ee4d05c706c3bb0eb479a27a8ec0b17a8a5ef43e1d028ad3f134519aa582d3981a3a30
1+
DIST libssh2-1.11.0.tar.xz 686796 BLAKE2B 36903798c72f7261d9e997254169c10a4e69166017445276de8b0066fff15cd4dae4119a8d6cbbab8859d765b2d7f34f2911bbaf83c8d6ac5d1feead6b5de64e SHA512 6d50c71b778ca0f769fcc9d2cc257ab669cd0b6c35e8b0e047b6b38aea10638974cc591ba27c25bb7dd523020b4a8a62e2c1ae368287d9dc254d5e24d4a7cee7
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- a/tests/CMakeLists.txt
2+
+++ b/tests/CMakeLists.txt
3+
@@ -63,7 +63,6 @@ if(SH_EXECUTABLE)
4+
mark_as_advanced(SSHD_EXECUTABLE)
5+
endif()
6+
7+
- add_test(NAME mansyntax COMMAND ${SH_EXECUTABLE} -c "${CMAKE_CURRENT_SOURCE_DIR}/mansyntax.sh")
8+
endif()
9+
10+
add_library(runner STATIC ${librunner_la_SOURCES})
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
https://bugs.gentoo.org/911279
2+
Upstream: https://github.com/libssh2/libssh2/issues/1053
3+
Commit: https://github.com/libssh2/libssh2/commit/1153ebdeba563ac657b525edd6bf6da68b1fe5e2
4+
From: Viktor Szakats <commit@vsz.me>
5+
Date: Tue, 30 May 2023 17:28:03 +0000
6+
Subject: [PATCH] mbedtls: use more `size_t` to sync up with `crypto.h`
7+
8+
Ref: 5a96f494ee0b00282afb2db2e091246fc5e1774a #846 #879
9+
10+
Fixes #1053
11+
Closes #1054
12+
--- a/src/mbedtls.c
13+
+++ b/src/mbedtls.c
14+
@@ -186,7 +186,7 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx)
15+
int
16+
_libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
17+
mbedtls_md_type_t mdtype,
18+
- const unsigned char *key, unsigned long keylen)
19+
+ const unsigned char *key, size_t keylen)
20+
{
21+
const mbedtls_md_info_t *md_info;
22+
int ret, hmac;
23+
@@ -221,7 +221,7 @@ _libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash)
24+
}
25+
26+
int
27+
-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
28+
+_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
29+
mbedtls_md_type_t mdtype, unsigned char *hash)
30+
{
31+
const mbedtls_md_info_t *md_info;
32+
@@ -497,8 +497,9 @@ int
33+
_libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
34+
size_t hash_len,
35+
const unsigned char *sig,
36+
- unsigned long sig_len,
37+
- const unsigned char *m, unsigned long m_len)
38+
+ size_t sig_len,
39+
+ const unsigned char *m,
40+
+ size_t m_len)
41+
{
42+
int ret;
43+
int md_type;
44+
@@ -548,8 +549,9 @@ _libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
45+
int
46+
_libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx * rsactx,
47+
const unsigned char *sig,
48+
- unsigned long sig_len,
49+
- const unsigned char *m, unsigned long m_len)
50+
+ size_t sig_len,
51+
+ const unsigned char *m,
52+
+ size_t m_len)
53+
{
54+
return _libssh2_mbedtls_rsa_sha2_verify(rsactx, SHA_DIGEST_LENGTH,
55+
sig, sig_len, m, m_len);
56+
--- a/src/mbedtls.h
57+
+++ b/src/mbedtls.h
58+
@@ -478,12 +478,12 @@ _libssh2_mbedtls_cipher_dtor(_libssh2_cipher_ctx *ctx);
59+
int
60+
_libssh2_mbedtls_hash_init(mbedtls_md_context_t *ctx,
61+
mbedtls_md_type_t mdtype,
62+
- const unsigned char *key, unsigned long keylen);
63+
+ const unsigned char *key, size_t keylen);
64+
65+
int
66+
_libssh2_mbedtls_hash_final(mbedtls_md_context_t *ctx, unsigned char *hash);
67+
int
68+
-_libssh2_mbedtls_hash(const unsigned char *data, unsigned long datalen,
69+
+_libssh2_mbedtls_hash(const unsigned char *data, size_t datalen,
70+
mbedtls_md_type_t mdtype, unsigned char *hash);
71+
72+
_libssh2_bn *
73+
@@ -526,9 +526,8 @@ _libssh2_mbedtls_rsa_new_private_frommemory(libssh2_rsa_ctx **rsa,
74+
int
75+
_libssh2_mbedtls_rsa_sha1_verify(libssh2_rsa_ctx *rsa,
76+
const unsigned char *sig,
77+
- unsigned long sig_len,
78+
- const unsigned char *m,
79+
- unsigned long m_len);
80+
+ size_t sig_len,
81+
+ const unsigned char *m, size_t m_len);
82+
int
83+
_libssh2_mbedtls_rsa_sha1_sign(LIBSSH2_SESSION *session,
84+
libssh2_rsa_ctx *rsa,
85+
@@ -540,8 +539,8 @@ int
86+
_libssh2_mbedtls_rsa_sha2_verify(libssh2_rsa_ctx * rsactx,
87+
size_t hash_len,
88+
const unsigned char *sig,
89+
- unsigned long sig_len,
90+
- const unsigned char *m, unsigned long m_len);
91+
+ size_t sig_len,
92+
+ const unsigned char *m, size_t m_len);
93+
int
94+
_libssh2_mbedtls_rsa_sha2_sign(LIBSSH2_SESSION *session,
95+
libssh2_rsa_ctx *rsa,

sdk_container/src/third_party/portage-stable/net-libs/libssh2/files/libssh2-1.8.0-mansyntax_sh.patch

Lines changed: 0 additions & 41 deletions
This file was deleted.

sdk_container/src/third_party/portage-stable/net-libs/libssh2/libssh2-1.10.0.ebuild renamed to sdk_container/src/third_party/portage-stable/net-libs/libssh2/libssh2-1.11.0-r1.ebuild

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
# Copyright 1999-2021 Gentoo Authors
1+
# Copyright 1999-2023 Gentoo Authors
22
# Distributed under the terms of the GNU General Public License v2
33

4-
EAPI=7
5-
CMAKE_ECLASS=cmake
4+
EAPI=8
5+
66
inherit cmake-multilib
77

88
DESCRIPTION="Library implementing the SSH2 protocol"
99
HOMEPAGE="https://www.libssh2.org"
10-
SRC_URI="https://www.libssh2.org/download/${P}.tar.gz"
10+
SRC_URI="https://www.libssh2.org/download/${P}.tar.xz"
1111

1212
LICENSE="BSD"
1313
SLOT="0"
14-
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
15-
IUSE="gcrypt mbedtls zlib"
14+
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ~ppc ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
15+
IUSE="gcrypt mbedtls test zlib"
1616
REQUIRED_USE="?? ( gcrypt mbedtls )"
17-
# Tests try to set containers up using docker (and fail for some reason).
18-
RESTRICT="test"
17+
RESTRICT="!test? ( test )"
1918

2019
RDEPEND="
2120
gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
@@ -31,6 +30,10 @@ DEPEND="
3130
${RDEPEND}
3231
"
3332

33+
PATCHES=(
34+
"${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
35+
)
36+
3437
multilib_src_configure() {
3538
local crypto_backend=OpenSSL
3639
if use gcrypt; then
@@ -41,13 +44,22 @@ multilib_src_configure() {
4144

4245
local mycmakeargs=(
4346
-DBUILD_SHARED_LIBS=ON
47+
-DBUILD_TESTING=$(usex test)
4448
-DCRYPTO_BACKEND=${crypto_backend}
4549
-DENABLE_ZLIB_COMPRESSION=$(usex zlib)
4650
)
51+
52+
if use test ; then
53+
# Pass separately to avoid unused var warnings w/ USE=-test
54+
mycmakeargs+=(
55+
-DRUN_SSHD_TESTS=OFF
56+
-DRUN_DOCKER_TESTS=OFF
57+
)
58+
fi
59+
4760
cmake_src_configure
4861
}
4962

5063
multilib_src_install_all() {
5164
einstalldocs
52-
find "${ED}" -name '*.la' -delete || die
5365
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Copyright 1999-2023 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
inherit cmake-multilib
7+
8+
DESCRIPTION="Library implementing the SSH2 protocol"
9+
HOMEPAGE="https://www.libssh2.org"
10+
SRC_URI="https://www.libssh2.org/download/${P}.tar.xz"
11+
12+
LICENSE="BSD"
13+
SLOT="0"
14+
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~mips ppc ~ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
15+
IUSE="gcrypt mbedtls test zlib"
16+
REQUIRED_USE="?? ( gcrypt mbedtls )"
17+
RESTRICT="!test? ( test )"
18+
19+
RDEPEND="
20+
gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
21+
!gcrypt? (
22+
mbedtls? ( net-libs/mbedtls:0=[${MULTILIB_USEDEP}] )
23+
!mbedtls? (
24+
>=dev-libs/openssl-1.0.1h-r2:0=[${MULTILIB_USEDEP}]
25+
)
26+
)
27+
zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
28+
"
29+
DEPEND="
30+
${RDEPEND}
31+
"
32+
33+
PATCHES=(
34+
"${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
35+
"${FILESDIR}"/${PN}-1.11.0-size_t.patch
36+
)
37+
38+
multilib_src_configure() {
39+
local crypto_backend=OpenSSL
40+
if use gcrypt; then
41+
crypto_backend=Libgcrypt
42+
elif use mbedtls; then
43+
crypto_backend=mbedTLS
44+
fi
45+
46+
local mycmakeargs=(
47+
-DBUILD_SHARED_LIBS=ON
48+
-DBUILD_TESTING=$(usex test)
49+
-DCRYPTO_BACKEND=${crypto_backend}
50+
-DENABLE_ZLIB_COMPRESSION=$(usex zlib)
51+
)
52+
53+
if use test ; then
54+
# Pass separately to avoid unused var warnings w/ USE=-test
55+
mycmakeargs+=(
56+
-DRUN_SSHD_TESTS=OFF
57+
-DRUN_DOCKER_TESTS=OFF
58+
)
59+
fi
60+
61+
cmake_src_configure
62+
}
63+
64+
multilib_src_install_all() {
65+
einstalldocs
66+
}
Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Copyright 1999-2021 Gentoo Authors
1+
# Copyright 1999-2023 Gentoo Authors
22
# Distributed under the terms of the GNU General Public License v2
33

4-
EAPI=7
5-
CMAKE_ECLASS=cmake
6-
inherit git-r3 cmake-multilib
4+
EAPI=8
5+
6+
inherit cmake-multilib git-r3
77

88
DESCRIPTION="Library implementing the SSH2 protocol"
99
HOMEPAGE="https://www.libssh2.org"
@@ -12,9 +12,9 @@ EGIT_REPO_URI="https://github.com/libssh2/libssh2"
1212
LICENSE="BSD"
1313
SLOT="0"
1414
KEYWORDS=""
15-
IUSE="gcrypt mbedtls zlib"
15+
IUSE="gcrypt mbedtls test zlib"
1616
REQUIRED_USE="?? ( gcrypt mbedtls )"
17-
RESTRICT="test"
17+
RESTRICT="!test? ( test )"
1818

1919
RDEPEND="
2020
gcrypt? ( >=dev-libs/libgcrypt-1.5.3:0[${MULTILIB_USEDEP}] )
@@ -26,12 +26,10 @@ RDEPEND="
2626
)
2727
zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
2828
"
29-
DEPEND="
30-
${RDEPEND}
31-
"
29+
DEPEND="${RDEPEND}"
3230

3331
PATCHES=(
34-
"${FILESDIR}"/${PN}-1.8.0-mansyntax_sh.patch
32+
"${FILESDIR}"/${PN}-1.11.0-mansyntax_sh.patch
3533
)
3634

3735
multilib_src_configure() {
@@ -44,13 +42,24 @@ multilib_src_configure() {
4442

4543
local mycmakeargs=(
4644
-DBUILD_SHARED_LIBS=ON
45+
-DBUILD_TESTING=$(usex test)
4746
-DCRYPTO_BACKEND=${crypto_backend}
4847
-DENABLE_ZLIB_COMPRESSION=$(usex zlib)
48+
-DRUN_SSHD_TESTS=OFF
49+
-DRUN_DOCKER_TESTS=OFF
4950
)
51+
52+
if use test ; then
53+
# Pass separately to avoid unused var warnings w/ USE=-test
54+
mycmakeargs+=(
55+
-DRUN_SSHD_TESTS=OFF
56+
-DRUN_DOCKER_TESTS=OFF
57+
)
58+
fi
59+
5060
cmake_src_configure
5161
}
5262

5363
multilib_src_install_all() {
5464
einstalldocs
55-
find "${ED}" -name '*.la' -delete || die
5665
}
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
33
<pkgmetadata>
4-
<maintainer type="project">
5-
<email>netmon@gentoo.org</email>
6-
</maintainer>
7-
<maintainer type="person">
8-
<email>mgorny@gentoo.org</email>
9-
<name>Michał Górny</name>
10-
</maintainer>
11-
<use>
12-
<flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
13-
<flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
14-
</use>
4+
<maintainer type="project">
5+
<email>netmon@gentoo.org</email>
6+
</maintainer>
7+
<maintainer type="person">
8+
<email>mgorny@gentoo.org</email>
9+
<name>Michał Górny</name>
10+
</maintainer>
11+
<use>
12+
<flag name="gcrypt">Use <pkg>dev-libs/libgcrypt</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
13+
<flag name="mbedtls">Use <pkg>net-libs/mbedtls</pkg> instead of <pkg>dev-libs/openssl</pkg></flag>
14+
</use>
15+
<upstream>
16+
<remote-id type="github">libssh2/libssh2</remote-id>
17+
</upstream>
1518
</pkgmetadata>

0 commit comments

Comments
 (0)