Răsfoiți Sursa

Bug 2162: Failure when doing agent forwarding with Pageant 0.74 or older

https://winscp.net/tracker/2162

Source commit: cd13e0ed61e2e4a0cd3da1b203cbead9326db40d
Martin Prikryl 2 ani în urmă
părinte
comite
e8229fd72a

+ 1 - 1
source/putty/ssh.h

@@ -1423,7 +1423,7 @@ int x11_identify_auth_proto(ptrlen protoname);
 void *x11_dehexify(ptrlen hex, int *outlen);
 bool x11_parse_ip(const char *addr_string, unsigned long *ip);
 
-Channel *agentf_new(SshChannel *c, Plug *plug); // WINSCP
+Channel *agentf_new(SshChannel *c, struct callback_set *callback_set); // WINSCP
 
 bool dh_is_gex(const ssh_kex *kex);
 dh_ctx *dh_setup_group(const ssh_kex *kex);

+ 4 - 4
source/putty/ssh/agentf.c

@@ -12,7 +12,7 @@
 #include "channel.h"
 
 typedef struct agentf {
-    Plug *plug; // WINSCP
+    struct callback_set * callback_set; // WINSCP
     SshChannel *c;
     bufchain inbuffer;
     agent_pending_query *pending;
@@ -98,7 +98,7 @@ static void agentf_try_forward(agentf *af)
         bufchain_fetch_consume(
             &af->inbuffer, strbuf_append(message, length), length);
         af->pending = agent_query(
-            message, &reply, &replylen, agentf_callback, af, get_callback_set(af->plug)); // WINSCP
+            message, &reply, &replylen, agentf_callback, af, af->callback_set); // WINSCP
         strbuf_free(message);
 
         if (af->pending)
@@ -174,10 +174,10 @@ static const ChannelVtable agentf_channelvt = {
     /*.request_response =*/ chan_no_request_response,
 };
 
-Channel *agentf_new(SshChannel *c, Plug *plug) // WINSCP
+Channel *agentf_new(SshChannel *c, struct callback_set *callback_set) // WINSCP
 {
     agentf *af = snew(agentf);
-    af->plug = plug; // WINSCP
+    af->callback_set = callback_set; // WINSCP
     af->c = c;
     af->chan.vt = &agentf_channelvt;
     af->chan.initial_fixed_window_size = 0;

+ 2 - 1
source/putty/ssh/connection2-client.c

@@ -113,13 +113,14 @@ static ChanopenResult chan_open_auth_agent(
         portfwd_raw_setup(ch, skt, sc);
         CHANOPEN_RETURN_SUCCESS(ch);
     } else {
+        struct callback_set *callback_set = get_callback_set(plug); // WINSCP
         portfwd_raw_free(ch);
         /*
          * Otherwise, fall back to the old-fashioned system of parsing the
          * forwarded data stream ourselves for message boundaries, and
          * passing each individual message to the one-off agent_query().
          */
-        CHANOPEN_RETURN_SUCCESS(agentf_new(sc, plug));
+        CHANOPEN_RETURN_SUCCESS(agentf_new(sc, callback_set));
     }
     } // WINSCP
 }