Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-libs/libssh2/, net-libs/libssh2/files/
Date: Mon, 24 Jun 2019 09:08:14
Message-Id: 1561367286.bf0f75b200b1451f24710ed87ceff7fefa065606.jer@gentoo
1 commit: bf0f75b200b1451f24710ed87ceff7fefa065606
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 24 09:06:13 2019 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 24 09:08:06 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf0f75b2
7
8 net-libs/libssh2: Version 1.9.0
9
10 Package-Manager: Portage-2.3.67, Repoman-2.3.16
11 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
12
13 net-libs/libssh2/Manifest | 1 +
14 net-libs/libssh2/files/libssh2-1.9.0-missing.patch | 181 +++++++++++++++++++++
15 .../{libssh2-9999.ebuild => libssh2-1.9.0.ebuild} | 11 +-
16 net-libs/libssh2/libssh2-9999.ebuild | 4 +-
17 4 files changed, 188 insertions(+), 9 deletions(-)
18
19 diff --git a/net-libs/libssh2/Manifest b/net-libs/libssh2/Manifest
20 index f5809249d6d..3750c1955eb 100644
21 --- a/net-libs/libssh2/Manifest
22 +++ b/net-libs/libssh2/Manifest
23 @@ -1,2 +1,3 @@
24 DIST libssh2-1.8.0.tar.gz 854916 BLAKE2B 618c4a19789f2e5eda85852760dffff5672d420d2fa50393b05b7398a1913f74e5f6695f078628050ac9851965d6e45cf410b7c4590a8f18d67c718c829ab352 SHA512 289aa45c4f99653bebf5f99565fe9c519abc204feb2084b47b7cc3badc8bf4ecdedd49ea6acdce8eb902b3c00995d5f92a3ca77b2508b92f04ae0e7de7287558
25 DIST libssh2-1.8.2.tar.gz 859587 BLAKE2B 58e0854e83001c424a767ceb4ddfb535373320d8319aa632244dc14434276db7c8b7a77d4a5f22fe8e397f1050b33516d2fca1162658a9f414166f560bc1f358 SHA512 390ab4ad93bb738415ec11a6eb92806c9b9e9e5d8ee7c442d841a58b4292c1c447a9bc99e153ba464e2e11f9c0d1913469303598c3046722d1ae821991e8cb93
26 +DIST libssh2-1.9.0.tar.gz 888551 BLAKE2B 7bce5cd38b88654f0ca0f8b562e4bddc56346e3359e5873000cad7619607b2ec01c3945112dd8815d5de6daf650a750a4727cebe7d8996cc62f07ded06f3235f SHA512 41a3ebcf84e32eab69b7411ffb0a3b6e6db71491c968602b17392cfe3490ef00239726ec28acb3d25bf0ed62700db7f4d0bb5a9175618f413865f40badca6e17
27
28 diff --git a/net-libs/libssh2/files/libssh2-1.9.0-missing.patch b/net-libs/libssh2/files/libssh2-1.9.0-missing.patch
29 new file mode 100644
30 index 00000000000..7cc58d23963
31 --- /dev/null
32 +++ b/net-libs/libssh2/files/libssh2-1.9.0-missing.patch
33 @@ -0,0 +1,181 @@
34 +--- /dev/null
35 ++++ b/tests/test_public_key_auth_succeeds_with_correct_ed25519_key.c
36 +@@ -0,0 +1,37 @@
37 ++#include "session_fixture.h"
38 ++
39 ++#include <libssh2.h>
40 ++
41 ++#include <stdio.h>
42 ++
43 ++static const char *USERNAME = "libssh2"; /* configured in Dockerfile */
44 ++static const char *KEY_FILE_PRIVATE = "key_ed25519";
45 ++static const char *KEY_FILE_PUBLIC = "key_ed25519.pub"; /* configured in Dockerfile */
46 ++
47 ++int test(LIBSSH2_SESSION *session)
48 ++{
49 ++ int rc;
50 ++ const char *userauth_list = NULL;
51 ++
52 ++ userauth_list = libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
53 ++ if(userauth_list == NULL) {
54 ++ print_last_session_error("libssh2_userauth_list");
55 ++ return 1;
56 ++ }
57 ++
58 ++ if(strstr(userauth_list, "publickey") == NULL) {
59 ++ fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
60 ++ userauth_list);
61 ++ return 1;
62 ++ }
63 ++
64 ++ rc = libssh2_userauth_publickey_fromfile_ex(
65 ++ session, USERNAME, strlen(USERNAME), KEY_FILE_PUBLIC, KEY_FILE_PRIVATE,
66 ++ NULL);
67 ++ if(rc != 0) {
68 ++ print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
69 ++ return 1;
70 ++ }
71 ++
72 ++ return 0;
73 ++}
74 +--- /dev/null
75 ++++ b/tests/test_public_key_auth_succeeds_with_correct_encrypted_ed25519_key.c
76 +@@ -0,0 +1,38 @@
77 ++#include "session_fixture.h"
78 ++
79 ++#include <libssh2.h>
80 ++
81 ++#include <stdio.h>
82 ++
83 ++static const char *USERNAME = "libssh2"; /* configured in Dockerfile */
84 ++static const char *PASSWORD = "libssh2";
85 ++static const char *KEY_FILE_PRIVATE = "key_ed25519_encrypted";
86 ++static const char *KEY_FILE_PUBLIC = "key_ed25519_encrypted.pub"; /* configured in Dockerfile */
87 ++
88 ++int test(LIBSSH2_SESSION *session)
89 ++{
90 ++ int rc;
91 ++ const char *userauth_list = NULL;
92 ++
93 ++ userauth_list = libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
94 ++ if(userauth_list == NULL) {
95 ++ print_last_session_error("libssh2_userauth_list");
96 ++ return 1;
97 ++ }
98 ++
99 ++ if(strstr(userauth_list, "publickey") == NULL) {
100 ++ fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
101 ++ userauth_list);
102 ++ return 1;
103 ++ }
104 ++
105 ++ rc = libssh2_userauth_publickey_fromfile_ex(
106 ++ session, USERNAME, strlen(USERNAME), KEY_FILE_PUBLIC, KEY_FILE_PRIVATE,
107 ++ PASSWORD);
108 ++ if(rc != 0) {
109 ++ print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
110 ++ return 1;
111 ++ }
112 ++
113 ++ return 0;
114 ++}
115 +--- /dev/null
116 ++++ b/tests/test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c
117 +@@ -0,0 +1,97 @@
118 ++#include "session_fixture.h"
119 ++
120 ++#include <libssh2.h>
121 ++
122 ++#include <stdio.h>
123 ++#include <stdlib.h>
124 ++
125 ++static const char *USERNAME = "libssh2"; /* configured in Dockerfile */
126 ++static const char *KEY_FILE_ED25519_PRIVATE = "key_ed25519";
127 ++
128 ++int read_file(const char *path, char **buf, size_t *len);
129 ++
130 ++int test(LIBSSH2_SESSION *session)
131 ++{
132 ++ int rc;
133 ++ FILE *fp = NULL;
134 ++ char *buffer = NULL;
135 ++ size_t len = 0;
136 ++ const char *userauth_list = NULL;
137 ++
138 ++ userauth_list = libssh2_userauth_list(session, USERNAME, strlen(USERNAME));
139 ++ if(userauth_list == NULL) {
140 ++ print_last_session_error("libssh2_userauth_list");
141 ++ return 1;
142 ++ }
143 ++
144 ++ if(strstr(userauth_list, "publickey") == NULL) {
145 ++ fprintf(stderr, "'publickey' was expected in userauth list: %s\n",
146 ++ userauth_list);
147 ++ return 1;
148 ++ }
149 ++
150 ++ if(read_file(KEY_FILE_ED25519_PRIVATE, &buffer, &len)) {
151 ++ fprintf(stderr, "Reading key file failed.");
152 ++ return 1;
153 ++ }
154 ++
155 ++ rc = libssh2_userauth_publickey_frommemory(session, USERNAME, strlen(USERNAME),
156 ++ NULL, 0, buffer, len, NULL);
157 ++
158 ++ free(buffer);
159 ++
160 ++ if(rc != 0) {
161 ++ print_last_session_error("libssh2_userauth_publickey_fromfile_ex");
162 ++ return 1;
163 ++ }
164 ++
165 ++ return 0;
166 ++}
167 ++
168 ++int read_file(const char *path, char **out_buffer, size_t *out_len)
169 ++{
170 ++ int rc;
171 ++ FILE *fp = NULL;
172 ++ char *buffer = NULL;
173 ++ size_t len = 0;
174 ++
175 ++ if(out_buffer == NULL || out_len == NULL || path == NULL) {
176 ++ fprintf(stderr, "invalid params.");
177 ++ return 1;
178 ++ }
179 ++
180 ++ *out_buffer = NULL;
181 ++ *out_len = 0;
182 ++
183 ++ fp = fopen(path, "r");
184 ++
185 ++ if(!fp) {
186 ++ fprintf(stderr, "File could not be read.");
187 ++ return 1;
188 ++ }
189 ++
190 ++ fseek(fp, 0L, SEEK_END);
191 ++ len = ftell(fp);
192 ++ rewind(fp);
193 ++
194 ++ buffer = calloc(1, len + 1);
195 ++ if(!buffer) {
196 ++ fclose(fp);
197 ++ fprintf(stderr, "Could not alloc memory.");
198 ++ return 1;
199 ++ }
200 ++
201 ++ if(1 != fread(buffer, len, 1, fp)) {
202 ++ fclose(fp);
203 ++ free(buffer);
204 ++ fprintf(stderr, "Could not read file into memory.");
205 ++ return 1;
206 ++ }
207 ++
208 ++ fclose(fp);
209 ++
210 ++ *out_buffer = buffer;
211 ++ *out_len = len;
212 ++
213 ++ return 0;
214 ++}
215
216 diff --git a/net-libs/libssh2/libssh2-9999.ebuild b/net-libs/libssh2/libssh2-1.9.0.ebuild
217 similarity index 79%
218 copy from net-libs/libssh2/libssh2-9999.ebuild
219 copy to net-libs/libssh2/libssh2-1.9.0.ebuild
220 index d1797b7dcfa..12ad74fa242 100644
221 --- a/net-libs/libssh2/libssh2-9999.ebuild
222 +++ b/net-libs/libssh2/libssh2-1.9.0.ebuild
223 @@ -1,16 +1,16 @@
224 # Copyright 1999-2019 Gentoo Authors
225 # Distributed under the terms of the GNU General Public License v2
226
227 -EAPI=6
228 -inherit git-r3 cmake-multilib
229 +EAPI=7
230 +inherit cmake-multilib
231
232 DESCRIPTION="Library implementing the SSH2 protocol"
233 HOMEPAGE="https://www.libssh2.org"
234 -EGIT_REPO_URI="https://github.com/libssh2/libssh2"
235 +SRC_URI="https://www.${PN}.org/download/${P}.tar.gz"
236
237 LICENSE="BSD"
238 SLOT="0"
239 -KEYWORDS=""
240 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
241 IUSE="gcrypt libressl mbedtls zlib"
242 REQUIRED_USE="?? ( gcrypt mbedtls )"
243 RESTRICT="test"
244 @@ -32,6 +32,7 @@ DEPEND="
245
246 PATCHES=(
247 "${FILESDIR}"/${PN}-1.8.0-mansyntax_sh.patch
248 + "${FILESDIR}"/${PN}-1.9.0-missing.patch
249 )
250
251 multilib_src_configure() {
252 @@ -53,6 +54,4 @@ multilib_src_configure() {
253 multilib_src_install_all() {
254 einstalldocs
255 find "${ED}" -name '*.la' -delete || die
256 - mv "${ED}"/usr/share/doc/${PN}/* "${ED}"/usr/share/doc/${PF}/ || die
257 - rm -r "${ED}"/usr/share/doc/${PN}/ || die
258 }
259
260 diff --git a/net-libs/libssh2/libssh2-9999.ebuild b/net-libs/libssh2/libssh2-9999.ebuild
261 index d1797b7dcfa..5bf05457d9a 100644
262 --- a/net-libs/libssh2/libssh2-9999.ebuild
263 +++ b/net-libs/libssh2/libssh2-9999.ebuild
264 @@ -1,7 +1,7 @@
265 # Copyright 1999-2019 Gentoo Authors
266 # Distributed under the terms of the GNU General Public License v2
267
268 -EAPI=6
269 +EAPI=7
270 inherit git-r3 cmake-multilib
271
272 DESCRIPTION="Library implementing the SSH2 protocol"
273 @@ -53,6 +53,4 @@ multilib_src_configure() {
274 multilib_src_install_all() {
275 einstalldocs
276 find "${ED}" -name '*.la' -delete || die
277 - mv "${ED}"/usr/share/doc/${PN}/* "${ED}"/usr/share/doc/${PF}/ || die
278 - rm -r "${ED}"/usr/share/doc/${PN}/ || die
279 }