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-misc/putty/, net-misc/putty/files/
Date: Tue, 26 Mar 2019 07:54:50
Message-Id: 1553586877.f7b0fab72e164d096b3f5e01dd6a5c4b2affa139.jer@gentoo
1 commit: f7b0fab72e164d096b3f5e01dd6a5c4b2affa139
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Tue Mar 26 07:52:57 2019 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Tue Mar 26 07:54:37 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7b0fab7
7
8 net-misc/putty: Replace no-gssapi patch after upstream review
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Bug: https://bugs.gentoo.org/show_bug.cgi?id=675524
12 Bug: https://bugs.gentoo.org/show_bug.cgi?id=680818
13 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
14
15 net-misc/putty/files/putty-0.71-no-gssapi.patch | 190 ++++++++++++---------
16 .../{putty-0.71-r1.ebuild => putty-0.71-r2.ebuild} | 0
17 2 files changed, 108 insertions(+), 82 deletions(-)
18
19 diff --git a/net-misc/putty/files/putty-0.71-no-gssapi.patch b/net-misc/putty/files/putty-0.71-no-gssapi.patch
20 index 75add0687d2..33a3f226851 100644
21 --- a/net-misc/putty/files/putty-0.71-no-gssapi.patch
22 +++ b/net-misc/putty/files/putty-0.71-no-gssapi.patch
23 @@ -1,6 +1,27 @@
24 +From 7ad08649a223a4cd61e67d8334a147f55c79399d Mon Sep 17 00:00:00 2001
25 +From: Jacob Nevins <jacobn@×××××××××××××××××××.uk>
26 +Date: Mon, 25 Mar 2019 23:46:59 +0000
27 +Subject: [PATCH] Fix compilation with NO_GSSAPI.
28 +
29 +This is a fairly shallow patch, which removes the UI and interactions
30 +with external libraries. Some other machinery (which is dead code in
31 +this configuration) is left in place.
32 +
33 +Adapted by me from a patch by Jeroen Roovers.
34 +---
35 + config.c | 4 ++++
36 + settings.c | 12 ++++++++++--
37 + ssh.c | 16 +++++++++++++++-
38 + ssh2transport.c | 3 +--
39 + ssh2userauth.c | 8 ++++++--
40 + sshserver.c | 13 ++++++++++++-
41 + 6 files changed, 48 insertions(+), 8 deletions(-)
42 +
43 +diff --git a/config.c b/config.c
44 +index 9c299fee..6528a969 100644
45 --- a/config.c
46 +++ b/config.c
47 -@@ -2442,10 +2442,12 @@
48 +@@ -2442,10 +2442,12 @@ void setup_config_box(struct controlbox *b, bool midsession,
49 HELPCTX(ssh_kexlist),
50 kexlist_handler, P(NULL));
51 c->listbox.height = KEX_MAX;
52 @@ -13,7 +34,7 @@
53
54 s = ctrl_getset(b, "Connection/SSH/Kex", "repeat",
55 "Options controlling key re-exchange");
56 -@@ -2455,11 +2457,13 @@
57 +@@ -2455,11 +2457,13 @@ void setup_config_box(struct controlbox *b, bool midsession,
58 conf_editbox_handler,
59 I(CONF_ssh_rekey_time),
60 I(-1));
61 @@ -27,9 +48,11 @@
62 ctrl_editbox(s, "Max data before rekey (0 for no limit)", 'x', 20,
63 HELPCTX(ssh_kex_repeat),
64 conf_editbox_handler,
65 +diff --git a/settings.c b/settings.c
66 +index 8d563026..54f5ab7b 100644
67 --- a/settings.c
68 +++ b/settings.c
69 -@@ -592,21 +592,25 @@
70 +@@ -592,21 +592,25 @@ void save_open_settings(settings_w *sesskey, Conf *conf)
71 write_setting_b(sesskey, "Compression", conf_get_bool(conf, CONF_compression));
72 write_setting_b(sesskey, "TryAgent", conf_get_bool(conf, CONF_tryagent));
73 write_setting_b(sesskey, "AgentFwd", conf_get_bool(conf, CONF_agentfwd));
74 @@ -56,7 +79,7 @@
75 wprefs(sesskey, "GSSLibs", gsslibkeywords, ngsslibs, conf, CONF_ssh_gsslist);
76 write_setting_filename(sesskey, "GSSCustom", conf_get_filename(conf, CONF_ssh_gss_custom));
77 #endif
78 -@@ -937,7 +941,9 @@
79 +@@ -937,7 +941,9 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
80 gppb(sesskey, "TryAgent", true, conf, CONF_tryagent);
81 gppb(sesskey, "AgentFwd", false, conf, CONF_agentfwd);
82 gppb(sesskey, "ChangeUsername", false, conf, CONF_change_username);
83 @@ -66,7 +89,7 @@
84 gprefs(sesskey, "Cipher", "\0",
85 ciphernames, CIPHER_MAX, conf, CONF_ssh_cipherlist);
86 {
87 -@@ -990,7 +996,9 @@
88 +@@ -990,7 +996,9 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
89 gprefs(sesskey, "HostKey", "ed25519,ecdsa,rsa,dsa,WARN",
90 hknames, HK_MAX, conf, CONF_ssh_hklist);
91 gppi(sesskey, "RekeyTime", 60, conf, CONF_ssh_rekey_time);
92 @@ -76,7 +99,7 @@
93 gpps(sesskey, "RekeyBytes", "1G", conf, CONF_ssh_rekey_data);
94 {
95 /* SSH-2 only by default */
96 -@@ -1007,9 +1015,9 @@
97 +@@ -1007,9 +1015,9 @@ void load_open_settings(settings_r *sesskey, Conf *conf)
98 gppb(sesskey, "SshBanner", true, conf, CONF_ssh_show_banner);
99 gppb(sesskey, "AuthTIS", false, conf, CONF_try_tis_auth);
100 gppb(sesskey, "AuthKI", true, conf, CONF_try_ki_auth);
101 @@ -87,9 +110,11 @@
102 gprefs(sesskey, "GSSLibs", "\0",
103 gsslibkeywords, ngsslibs, conf, CONF_ssh_gsslist);
104 gppfile(sesskey, "GSSCustom", conf, CONF_ssh_gss_custom);
105 +diff --git a/ssh.c b/ssh.c
106 +index e35ebc64..e8ad61b8 100644
107 --- a/ssh.c
108 +++ b/ssh.c
109 -@@ -50,7 +50,9 @@
110 +@@ -50,7 +50,9 @@ struct Ssh {
111 ssh_sharing_state *connshare;
112 bool attempting_connshare;
113
114 @@ -99,7 +124,7 @@
115
116 char *savedhost;
117 int savedport;
118 -@@ -252,10 +254,17 @@
119 +@@ -252,10 +254,18 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv,
120 conf_get_bool(ssh->conf, CONF_tryagent), username,
121 conf_get_bool(ssh->conf, CONF_change_username),
122 conf_get_bool(ssh->conf, CONF_try_ki_auth),
123 @@ -107,31 +132,86 @@
124 conf_get_bool(ssh->conf, CONF_try_gssapi_auth),
125 conf_get_bool(ssh->conf, CONF_try_gssapi_kex),
126 conf_get_bool(ssh->conf, CONF_gssapifwd),
127 - &ssh->gss_state);
128 +- &ssh->gss_state);
129 ++ &ssh->gss_state
130 +#else
131 -+ NULL,
132 -+ NULL,
133 -+ NULL,
134 -+ NULL);
135 ++ false,
136 ++ false,
137 ++ false,
138 ++ NULL
139 +#endif
140 ++ );
141 ssh_connect_ppl(ssh, userauth_layer);
142 transport_child_layer = userauth_layer;
143
144 -@@ -267,7 +276,11 @@
145 +@@ -267,7 +277,11 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv,
146 ssh->fullhostname,
147 ssh_verstring_get_local(old_bpp),
148 ssh_verstring_get_remote(old_bpp),
149 +#ifndef NO_GSSAPI
150 &ssh->gss_state,
151 +#else
152 -+ NULL,
153 ++ NULL,
154 +#endif
155 &ssh->stats, transport_child_layer, false);
156 ssh_connect_ppl(ssh, ssh->base_layer);
157
158 +diff --git a/ssh2transport.c b/ssh2transport.c
159 +index 8640d89d..5e8955a0 100644
160 +--- a/ssh2transport.c
161 ++++ b/ssh2transport.c
162 +@@ -1781,6 +1781,7 @@ static void ssh2_transport_gss_update(struct ssh2_transport_state *s,
163 + if (mins > 0 && s->gss_ctxt_lifetime <= mins * 60)
164 + s->gss_status |= GSS_CTXT_EXPIRES;
165 + }
166 ++#endif /* NO_GSSAPI */
167 +
168 + ptrlen ssh2_transport_get_session_id(PacketProtocolLayer *ppl)
169 + {
170 +@@ -1805,8 +1806,6 @@ void ssh2_transport_notify_auth_done(PacketProtocolLayer *ppl)
171 + queue_idempotent_callback(&s->ppl.ic_process_queue);
172 + }
173 +
174 +-#endif /* NO_GSSAPI */
175 +-
176 + static bool ssh2_transport_get_specials(
177 + PacketProtocolLayer *ppl, add_special_fn_t add_special, void *ctx)
178 + {
179 +diff --git a/ssh2userauth.c b/ssh2userauth.c
180 +index fc413923..7f5a1292 100644
181 +--- a/ssh2userauth.c
182 ++++ b/ssh2userauth.c
183 +@@ -613,8 +613,10 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
184 + * Scan it for method identifiers we know about.
185 + */
186 + bool srv_pubkey = false, srv_passwd = false;
187 +- bool srv_keyb_inter = false, srv_gssapi = false;
188 +- bool srv_gssapi_keyex_auth = false;
189 ++ bool srv_keyb_inter = false;
190 ++#ifndef NO_GSSAPI
191 ++ bool srv_gssapi = false, srv_gssapi_keyex_auth = false;
192 ++#endif
193 +
194 + for (ptrlen method; get_commasep_word(&methods, &method) ;) {
195 + if (ptrlen_eq_string(method, "publickey"))
196 +@@ -623,10 +625,12 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
197 + srv_passwd = true;
198 + else if (ptrlen_eq_string(method, "keyboard-interactive"))
199 + srv_keyb_inter = true;
200 ++#ifndef NO_GSSAPI
201 + else if (ptrlen_eq_string(method, "gssapi-with-mic"))
202 + srv_gssapi = true;
203 + else if (ptrlen_eq_string(method, "gssapi-keyex"))
204 + srv_gssapi_keyex_auth = true;
205 ++#endif
206 + }
207 +
208 + /*
209 +diff --git a/sshserver.c b/sshserver.c
210 +index 5f6e7dde..5c34bb35 100644
211 --- a/sshserver.c
212 +++ b/sshserver.c
213 -@@ -50,7 +50,9 @@
214 +@@ -50,7 +50,9 @@ struct server {
215 PacketProtocolLayer *base_layer;
216 ConnectionLayer *cl;
217
218 @@ -141,18 +221,19 @@
219 };
220
221 static void ssh_server_free_callback(void *vsrv);
222 -@@ -246,8 +248,10 @@
223 +@@ -245,9 +247,11 @@ Plug *ssh_server_plug(
224 + bufchain_init(&srv->out_raw);
225 bufchain_init(&srv->dummy_user_input);
226
227 - /* FIXME: replace with sensible */
228 +#ifndef NO_GSSAPI
229 + /* FIXME: replace with sensible */
230 srv->gss_state.libs = snew(struct ssh_gss_liblist);
231 srv->gss_state.libs->nlibraries = 0;
232 +#endif
233
234 return &srv->plug;
235 }
236 -@@ -297,7 +301,9 @@
237 +@@ -297,7 +301,9 @@ static void ssh_server_free_callback(void *vsrv)
238 conf_free(srv->conf);
239 log_free(srv->logctx);
240
241 @@ -162,75 +243,20 @@
242
243 sfree(srv);
244
245 -@@ -442,7 +448,11 @@
246 +@@ -442,7 +448,12 @@ static void server_got_ssh_version(struct ssh_version_receiver *rcv,
247 srv->conf, NULL, 0, NULL,
248 ssh_verstring_get_remote(old_bpp),
249 ssh_verstring_get_local(old_bpp),
250 +- &srv->gss_state, &srv->stats, transport_child_layer, true);
251 +#ifndef NO_GSSAPI
252 - &srv->gss_state, &srv->stats, transport_child_layer, true);
253 ++ &srv->gss_state,
254 +#else
255 -+ NULL, &srv->stats, transport_child_layer, true);
256 ++ NULL,
257 +#endif
258 ++ &srv->stats, transport_child_layer, true);
259 ssh2_transport_provide_hostkeys(
260 srv->base_layer, srv->hostkeys, srv->nhostkeys);
261 if (userauth_layer)
262 ---- a/ssh2userauth.c
263 -+++ b/ssh2userauth.c
264 -@@ -241,7 +241,9 @@
265 - * Misc one-time setup for authentication.
266 - */
267 - s->publickey_blob = NULL;
268 -+#ifndef NO_GSSAPI
269 - s->session_id = ssh2_transport_get_session_id(s->transport_layer);
270 -+#endif
271 -
272 - /*
273 - * Load the public half of any configured public key file for
274 -@@ -613,8 +615,12 @@
275 - * Scan it for method identifiers we know about.
276 - */
277 - bool srv_pubkey = false, srv_passwd = false;
278 -+#ifndef NO_GSSAPI
279 - bool srv_keyb_inter = false, srv_gssapi = false;
280 - bool srv_gssapi_keyex_auth = false;
281 -+#else
282 -+ bool srv_keyb_inter = false;
283 -+#endif
284 -
285 - for (ptrlen method; get_commasep_word(&methods, &method) ;) {
286 - if (ptrlen_eq_string(method, "publickey"))
287 -@@ -623,10 +629,12 @@
288 - srv_passwd = true;
289 - else if (ptrlen_eq_string(method, "keyboard-interactive"))
290 - srv_keyb_inter = true;
291 -+#ifndef NO_GSSAPI
292 - else if (ptrlen_eq_string(method, "gssapi-with-mic"))
293 - srv_gssapi = true;
294 - else if (ptrlen_eq_string(method, "gssapi-keyex"))
295 - srv_gssapi_keyex_auth = true;
296 -+#endif
297 - }
298 -
299 - /*
300 -@@ -1640,7 +1648,9 @@
301 - * any packets since. Signal the transport layer to consider
302 - * doing an immediate rekey, if it has any reason to want to.
303 - */
304 -+#ifndef NO_GSSAPI
305 - ssh2_transport_notify_auth_done(s->transport_layer);
306 -+#endif
307 -
308 - /*
309 - * Finally, hand over to our successor layer, and return
310 ---- a/ssh2userauth-server.c
311 -+++ b/ssh2userauth-server.c
312 -@@ -122,7 +122,9 @@
313 -
314 - crBegin(s->crState);
315 -
316 -+#ifndef NO_GSSAPI
317 - s->session_id = ssh2_transport_get_session_id(s->transport_layer);
318 -+#endif
319 -
320 - while (1) {
321 - crMaybeWaitUntilV((pktin = ssh2_userauth_server_pop(s)) != NULL);
322 +--
323 +2.11.0
324 +
325
326 diff --git a/net-misc/putty/putty-0.71-r1.ebuild b/net-misc/putty/putty-0.71-r2.ebuild
327 similarity index 100%
328 rename from net-misc/putty/putty-0.71-r1.ebuild
329 rename to net-misc/putty/putty-0.71-r2.ebuild