Bläddra i källkod

Updating code to PuTTY 85770b20

Source commit: 0e857a27e6048eb749220759e5b7fafa75dc97fa
Martin Prikryl 6 år sedan
förälder
incheckning
1736013ede

+ 0 - 4
source/Putty.cbproj

@@ -118,10 +118,6 @@
 		<CppCompile Include="putty\import.c">
 			<BuildOrder>46</BuildOrder>
 		</CppCompile>
-		<CppCompile Include="putty\int64.c">
-			<BuildOrder>8</BuildOrder>
-			<BuildOrder>24</BuildOrder>
-		</CppCompile>
 		<CppCompile Include="putty\logging.c">
 			<BuildOrder>27</BuildOrder>
 			<BuildOrder>11</BuildOrder>

+ 1 - 1
source/ScpCore.cbproj

@@ -36,7 +36,7 @@
 		<BCC_wdiu>false</BCC_wdiu>
 		<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
 		<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace)</DCC_Namespace>
-		<Defines>USE_COMPATIBLE_THREAD;_WINDOWS;WIN32;WINNT;_CRTIMP=;_LIB;$(BUILD_TYPE);$(Defines)</Defines>
+		<Defines>WINSCP;USE_COMPATIBLE_THREAD;_WINDOWS;WIN32;WINNT;_CRTIMP=;_LIB;$(BUILD_TYPE);$(Defines)</Defines>
 		<FinalOutputDir>$(INTERM_PATH)\$(Platform)\$(Config)</FinalOutputDir>
 		<ILINK_LibraryPath>$(BDS)\lib;$(ILINK_LibraryPath)</ILINK_LibraryPath>
 		<IncludePath>core\;putty;putty\windows;filezilla;resource;..\libs\openssl\include;..\libs\expat\lib;..\libs\neon\src;..\libs\libs3\inc;$(BDS)\include;$(BDS)\include\windows\vcl;$(BDS)\include\Mfc;$(IncludePath)</IncludePath>

+ 8 - 10
source/core/HierarchicalStorage.cpp

@@ -35,11 +35,10 @@ UnicodeString __fastcall MungeStr(const UnicodeString & Str, bool ForceAnsi, boo
       Source.Insert(Bom, 1);
     }
   }
-  // should contain ASCII characters only
-  RawByteString Dest;
-  Dest.SetLength(Source.Length() * 3 + 1);
-  putty_mungestr(Source.c_str(), Dest.c_str());
-  PackStr(Dest);
+  strbuf * sb = strbuf_new();
+  escape_registry_key(Source.c_str(), sb);
+  RawByteString Dest(sb->s);
+  strbuf_free(sb);
   if (Value)
   {
     // We do not want to munge * in PasswordMask
@@ -52,11 +51,10 @@ UnicodeString __fastcall UnMungeStr(const UnicodeString & Str)
 {
   // Str should contain ASCII characters only
   RawByteString Source = AnsiString(Str);
-  RawByteString Dest;
-  Dest.SetLength(Source.Length() + 1);
-  putty_unmungestr(Source.c_str(), Dest.c_str(), Dest.Length());
-  // Cut the string at null character
-  PackStr(Dest);
+  strbuf * sb = strbuf_new();
+  unescape_registry_key(Source.c_str(), sb);
+  RawByteString Dest(sb->s);
+  strbuf_free(sb);
   UnicodeString Result;
   if (Dest.SubString(1, LENOF(Bom)) == Bom)
   {

+ 8 - 8
source/core/PuttyIntf.cpp

@@ -14,13 +14,13 @@
 //---------------------------------------------------------------------------
 char sshver[50];
 extern const char commitid[] = "";
-const int platform_uses_x11_unix_by_default = TRUE;
+const bool platform_uses_x11_unix_by_default = true;
 CRITICAL_SECTION putty_section;
 bool SaveRandomSeed;
 char appname_[50];
 const char *const appname = appname_;
-extern const int share_can_be_downstream = FALSE;
-extern const int share_can_be_upstream = FALSE;
+extern const bool share_can_be_downstream = false;
+extern const bool share_can_be_upstream = false;
 //---------------------------------------------------------------------------
 extern "C"
 {
@@ -113,7 +113,7 @@ struct callback_set * get_seat_callback_set(Seat * seat)
   return SecureShell->GetCallbackSet();
 }
 //---------------------------------------------------------------------------
-extern "C" char * do_select(Plug * plug, SOCKET skt, int startup)
+extern "C" char * do_select(Plug * plug, SOCKET skt, bool startup)
 {
   bool pfwd;
   TSecureShell * SecureShell = GetSecureShell(plug, pfwd);
@@ -129,7 +129,7 @@ extern "C" char * do_select(Plug * plug, SOCKET skt, int startup)
   return NULL;
 }
 //---------------------------------------------------------------------------
-static int output(Seat * seat, int is_stderr, const void * data, int len)
+static int output(Seat * seat, bool is_stderr, const void * data, int len)
 {
   TSecureShell * SecureShell = static_cast<ScpSeat *>(seat)->SecureShell;
   if (is_stderr >= 0)
@@ -145,9 +145,9 @@ static int output(Seat * seat, int is_stderr, const void * data, int len)
   return 0;
 }
 //---------------------------------------------------------------------------
-static int eof(Seat *)
+static bool eof(Seat *)
 {
-  return FALSE;
+  return false;
 }
 //---------------------------------------------------------------------------
 static int get_userpass_input(Seat * seat, prompts_t * p, bufchain * DebugUsedArg(input))
@@ -237,7 +237,7 @@ int verify_ssh_host_key(Seat * seat, const char * host, int port, const char * k
   return 1;
 }
 //---------------------------------------------------------------------------
-int have_ssh_host_key(Seat * seat, const char * hostname, int port,
+bool have_ssh_host_key(Seat * seat, const char * hostname, int port,
   const char * keytype)
 {
   TSecureShell * SecureShell = static_cast<ScpSeat *>(seat)->SecureShell;

+ 26 - 24
source/core/SecureShell.cpp

@@ -187,9 +187,11 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
       conf_set_filename(conf, KEY, filename); \
       filename_free(filename); \
     }
+  #define CONF_DEF_BOOL_NONE(KEY) conf_set_bool(conf, KEY, false);
   #define CONF_SET_DEFAULT(VALTYPE, KEYTYPE, KEYWORD) CONF_DEF_ ## VALTYPE ## _ ## KEYTYPE(CONF_ ## KEYWORD);
   CONFIG_OPTIONS(CONF_SET_DEFAULT);
   #undef CONF_SET_DEFAULT
+  #undef CONF_DEF_BOOL_NONE
   #undef CONF_DEF_FILENAME_NONE
   #undef CONF_DEF_FONT_NONE
   #undef CONF_DEF_STR_STR
@@ -202,13 +204,13 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
   conf_set_str(conf, CONF_username, UTF8String(Data->UserNameExpanded).c_str());
   conf_set_int(conf, CONF_port, Data->PortNumber);
   conf_set_int(conf, CONF_protocol, PROT_SSH);
-  conf_set_int(conf, CONF_change_password, Data->ChangePassword);
+  conf_set_bool(conf, CONF_change_password, Data->ChangePassword);
   // always set 0, as we will handle keepalives ourselves to avoid
   // multi-threaded issues in putty timer list
   conf_set_int(conf, CONF_ping_interval, 0);
-  conf_set_int(conf, CONF_compression, Data->Compression);
-  conf_set_int(conf, CONF_tryagent, Data->TryAgent);
-  conf_set_int(conf, CONF_agentfwd, Data->AgentFwd);
+  conf_set_bool(conf, CONF_compression, Data->Compression);
+  conf_set_bool(conf, CONF_tryagent, Data->TryAgent);
+  conf_set_bool(conf, CONF_agentfwd, Data->AgentFwd);
   conf_set_int(conf, CONF_addressfamily, Data->AddressFamily);
   conf_set_str(conf, CONF_ssh_rekey_data, AnsiString(Data->RekeyData).c_str());
   conf_set_int(conf, CONF_ssh_rekey_time, Data->RekeyTime);
@@ -286,13 +288,13 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
   filename_free(KeyFileFileName);
 
   conf_set_int(conf, CONF_sshprot, Data->SshProt);
-  conf_set_int(conf, CONF_ssh2_des_cbc, Data->Ssh2DES);
-  conf_set_int(conf, CONF_ssh_no_userauth, Data->SshNoUserAuth);
-  conf_set_int(conf, CONF_try_tis_auth, Data->AuthTIS);
-  conf_set_int(conf, CONF_try_ki_auth, Data->AuthKI);
-  conf_set_int(conf, CONF_try_gssapi_auth, Data->AuthGSSAPI);
-  conf_set_int(conf, CONF_gssapifwd, Data->GSSAPIFwdTGT);
-  conf_set_int(conf, CONF_change_username, Data->ChangeUsername);
+  conf_set_bool(conf, CONF_ssh2_des_cbc, Data->Ssh2DES);
+  conf_set_bool(conf, CONF_ssh_no_userauth, Data->SshNoUserAuth);
+  conf_set_bool(conf, CONF_try_tis_auth, Data->AuthTIS);
+  conf_set_bool(conf, CONF_try_ki_auth, Data->AuthKI);
+  conf_set_bool(conf, CONF_try_gssapi_auth, Data->AuthGSSAPI);
+  conf_set_bool(conf, CONF_gssapifwd, Data->GSSAPIFwdTGT);
+  conf_set_bool(conf, CONF_change_username, Data->ChangeUsername);
 
   conf_set_int(conf, CONF_proxy_type, Data->ProxyMethod);
   conf_set_str(conf, CONF_proxy_host, AnsiString(Data->ProxyHost).c_str());
@@ -308,7 +310,7 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
     conf_set_str(conf, CONF_proxy_telnet_command, AnsiString(Data->ProxyTelnetCommand).c_str());
   }
   conf_set_int(conf, CONF_proxy_dns, Data->ProxyDNS);
-  conf_set_int(conf, CONF_even_proxy_localhost, Data->ProxyLocalhost);
+  conf_set_bool(conf, CONF_even_proxy_localhost, Data->ProxyLocalhost);
 
   conf_set_int(conf, CONF_sshbug_ignore1, Data->Bug[sbIgnore1]);
   conf_set_int(conf, CONF_sshbug_plainpw1, Data->Bug[sbPlainPW1]);
@@ -337,16 +339,16 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
     }
 
     // when setting up a tunnel, do not open shell/sftp
-    conf_set_int(conf, CONF_ssh_no_shell, TRUE);
+    conf_set_bool(conf, CONF_ssh_no_shell, TRUE);
   }
   else
   {
     DebugAssert(Simple);
-    conf_set_int(conf, CONF_ssh_simple, Data->SshSimple && Simple);
+    conf_set_bool(conf, CONF_ssh_simple, Data->SshSimple && Simple);
 
     if (Data->FSProtocol == fsSCPonly)
     {
-      conf_set_int(conf, CONF_ssh_subsys, FALSE);
+      conf_set_bool(conf, CONF_ssh_subsys, FALSE);
       if (Data->Shell.IsEmpty())
       {
         // Following forces Putty to open default shell
@@ -362,18 +364,18 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
     {
       if (Data->SftpServer.IsEmpty())
       {
-        conf_set_int(conf, CONF_ssh_subsys, TRUE);
+        conf_set_bool(conf, CONF_ssh_subsys, TRUE);
         conf_set_str(conf, CONF_remote_cmd, "sftp");
       }
       else
       {
-        conf_set_int(conf, CONF_ssh_subsys, FALSE);
+        conf_set_bool(conf, CONF_ssh_subsys, FALSE);
         conf_set_str(conf, CONF_remote_cmd, AnsiString(Data->SftpServer).c_str());
       }
 
       if (Data->FSProtocol != fsSFTPonly)
       {
-        conf_set_int(conf, CONF_ssh_subsys2, FALSE);
+        conf_set_bool(conf, CONF_ssh_subsys2, FALSE);
         if (Data->Shell.IsEmpty())
         {
           // Following forces Putty to open default shell
@@ -382,7 +384,7 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
           // PuTTY ignores CONF_remote_cmd2 set to "",
           // so we have to enforce it
           // (CONF_force_remote_cmd2 is our config option)
-          conf_set_int(conf, CONF_force_remote_cmd2, 1);
+          conf_set_bool(conf, CONF_force_remote_cmd2, 1);
         }
         else
         {
@@ -393,7 +395,7 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
       if ((Data->FSProtocol == fsSFTPonly) && Data->SftpServer.IsEmpty())
       {
         // see psftp_connect() from psftp.c
-        conf_set_int(conf, CONF_ssh_subsys2, FALSE);
+        conf_set_bool(conf, CONF_ssh_subsys2, FALSE);
         conf_set_str(conf, CONF_remote_cmd2,
           "test -x /usr/lib/sftp-server && exec /usr/lib/sftp-server\n"
           "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n"
@@ -406,9 +408,9 @@ Conf * __fastcall TSecureShell::StoreToConfig(TSessionData * Data, bool Simple)
   conf_set_int(conf, CONF_sndbuf, Data->SendBuf);
 
   // permanent settings
-  conf_set_int(conf, CONF_nopty, TRUE);
-  conf_set_int(conf, CONF_tcp_keepalives, 0);
-  conf_set_int(conf, CONF_ssh_show_banner, TRUE);
+  conf_set_bool(conf, CONF_nopty, TRUE);
+  conf_set_bool(conf, CONF_tcp_keepalives, 0);
+  conf_set_bool(conf, CONF_ssh_show_banner, TRUE);
   conf_set_int(conf, CONF_proxy_log_to_term, FORCE_OFF);
 
   conf_set_str(conf, CONF_loghost, AnsiString(Data->LogicalHostName).c_str());
@@ -463,7 +465,7 @@ void __fastcall TSecureShell::Open()
       InitError = backend_init(&ssh_backend, FSeat, &FBackendHandle, FLogCtx, conf,
         AnsiString(FSessionData->HostNameExpanded).c_str(), FSessionData->PortNumber, &RealHost,
         (FSessionData->TcpNoDelay ? 1 : 0),
-        conf_get_int(conf, CONF_tcp_keepalives));
+        conf_get_bool(conf, CONF_tcp_keepalives));
     }
     __finally
     {

+ 3 - 0
source/putty/defs.h

@@ -15,6 +15,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#ifndef WINSCP
+// This is used in pageant, pscp, psftp and servers only
 #if defined _MSC_VER && _MSC_VER < 1800
 /* Work around lack of inttypes.h in older MSVC */
 #define PRIx32 "x"
@@ -23,6 +25,7 @@
 #else
 #include <inttypes.h>
 #endif
+#endif
 
 typedef struct conf_tag Conf;
 typedef struct terminal_tag Terminal;

+ 1 - 1
source/putty/mainchan.c

@@ -287,7 +287,7 @@ static void mainchan_request_response(Channel *chan, bool success)
         if (success) {
             ppl_logevent(("Started a shell/command"));
             mainchan_ready(mc);
-        } else if (*conf_get_str(mc->conf, CONF_remote_cmd2) || conf_get_int(mc->conf, CONF_force_remote_cmd2)) { // WINSCP
+        } else if (*conf_get_str(mc->conf, CONF_remote_cmd2) || conf_get_bool(mc->conf, CONF_force_remote_cmd2)) { // WINSCP
             ppl_logevent(("Primary command failed; attempting fallback"));
             mainchan_try_fallback_command(mc);
         } else {

+ 1 - 1
source/putty/noshare.c

@@ -15,7 +15,7 @@
 int platform_ssh_share(const char *name, Conf *conf,
                        Plug *downplug, Plug *upplug, Socket **sock,
                        char **logtext, char **ds_err, char **us_err,
-                       int can_upstream, int can_downstream)
+                       bool can_upstream, bool can_downstream)
 {
     return SHARE_NONE;
 }

+ 2 - 2
source/putty/putty.h

@@ -1400,8 +1400,8 @@ void cleanup_exit(int);
     /* MPEXT BEGIN */ \
     X(INT, NONE, connect_timeout) \
     X(INT, NONE, sndbuf) \
-    X(INT, NONE, force_remote_cmd2) \
-    X(INT, NONE, change_password) \
+    X(BOOL, NONE, force_remote_cmd2) \
+    X(BOOL, NONE, change_password) \
     /* MPEXT END */ \
     /* end of list */
 

+ 0 - 5
source/putty/puttyexp.h

@@ -51,11 +51,6 @@ long reg_set_winscp_value_ex(HKEY Key, const char * ValueName, unsigned long Res
   unsigned long Type, const unsigned char * Data, unsigned long DataSize);
 long reg_close_winscp_key(HKEY Key);
 
-// from winstore.c
-
-void putty_mungestr(const char *in, char *out);
-void putty_unmungestr(const char *in, char *out, int outlen);
-
 // from winnet.c
 
 void select_result(WPARAM wParam, LPARAM lParam);

+ 1 - 1
source/putty/ssh.c

@@ -235,7 +235,7 @@ static void ssh_got_ssh_version(struct ssh_version_receiver *rcv,
                     conf_get_bool(ssh->conf, CONF_gssapifwd),
                     &ssh->gss_state,
                     conf_get_str(ssh->conf, CONF_loghost),
-                    conf_get_int(ssh->conf, CONF_change_password)); // WINSCP
+                    conf_get_bool(ssh->conf, CONF_change_password)); // WINSCP
                 ssh_connect_ppl(ssh, userauth_layer);
                 transport_child_layer = userauth_layer;
 

+ 2 - 4
source/putty/ssh.h

@@ -803,7 +803,7 @@ struct ssh_keyalg {
     const char *ssh_id;    /* string identifier in the SSH protocol */
     const char *cache_id;  /* identifier used in PuTTY's host key cache */
     const void *extra;     /* private to the public key methods */
-    const unsigned supported_flags;    /* signature-type flags we understand */
+    /*WINSCP const*/ unsigned supported_flags;    /* signature-type flags we understand */
 };
 
 #define ssh_key_new_pub(alg, data) ((alg)->new_pub(alg, data))
@@ -1206,11 +1206,9 @@ char *ssh2_fingerprint_blob(const void *blob, int bloblen);
 char *ssh2_fingerprint(ssh_key *key);
 int key_type(const Filename *filename);
 const char *key_type_to_str(int type);
-#ifdef MPEXT
-int openssh_loadpub_line(char * line, char **algorithm,
+bool openssh_loadpub_line(char * line, char **algorithm, // WINSCP
                          BinarySink *bs,
                          char **commentptr, const char **errorstr);
-#endif
 
 bool import_possible(int type);
 int import_target_type(int type);

+ 3 - 3
source/putty/ssh2connection.c

@@ -974,7 +974,7 @@ static void ssh2_connection_process_queue(PacketProtocolLayer *ppl)
     // WINSCP
     if (!s->mainchan)
     {
-        s->ready = TRUE;
+        s->ready = true;
     }
 
     /*
@@ -1662,7 +1662,7 @@ static void ssh2_set_wants_user_input(ConnectionLayer *cl, bool wanted)
         container_of(cl, struct ssh2_connection_state, cl);
 
     s->want_user_input = wanted;
-    s->ready = TRUE; // WINSCP
+    s->ready = true; // WINSCP
 }
 
 static bool ssh2_connection_want_user_input(PacketProtocolLayer *ppl)
@@ -1722,7 +1722,7 @@ static unsigned int ssh2_connection_winscp_query(PacketProtocolLayer *ppl, int q
     }
     else if (query == WINSCP_QUERY_MAIN_CHANNEL)
     {
-        return (s->ready != 0);
+        return s->ready;
     }
     else
     {

+ 1 - 1
source/putty/ssh2connection.h

@@ -18,7 +18,7 @@ struct ssh2_connection_state {
     int session_attempt, session_status;
     int term_width, term_height;
     bool want_user_input;
-    int ready; // WINSCP
+    bool ready; // WINSCP
 
     bool ssh_is_simple;
     bool persistent;

+ 6 - 6
source/putty/ssh2userauth.c

@@ -28,7 +28,7 @@ struct ssh2_userauth_state {
     char *default_username;
     bool try_ki_auth, try_gssapi_auth, try_gssapi_kex_auth, gssapi_fwd;
     char *loghost; // WINSCP
-    int change_password; // WINSCP
+    bool change_password; // WINSCP
 
     ptrlen session_id;
     enum {
@@ -120,7 +120,7 @@ PacketProtocolLayer *ssh2_userauth_new(
     const char *default_username, bool change_username,
     bool try_ki_auth, bool try_gssapi_auth, bool try_gssapi_kex_auth,
     bool gssapi_fwd, struct ssh_connection_shared_gss_state *shgss,
-    const char * loghost, int change_password) // WINSCP
+    const char * loghost, bool change_password) // WINSCP
 {
     struct ssh2_userauth_state *s = snew(struct ssh2_userauth_state);
     memset(s, 0, sizeof(*s));
@@ -1267,7 +1267,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
                 s->ppl.bpp->pls->actx = SSH2_PKTCTX_PASSWORD;
 
                 // WINSCP
-                if (s->change_password != 0)
+                if (s->change_password)
                 {
                     s->password = dupstr("");
                     s->type = AUTH_TYPE_PASSWORD;
@@ -1349,7 +1349,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
                 changereq_first_time = true;
 
                 while ((pktin->type == SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ) ||
-                       (s->change_password != 0)) { // WINSCP
+                       s->change_password) { // WINSCP
 
                     /* 
                      * We're being asked for a new password
@@ -1360,7 +1360,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
                     bool got_new = false; /* not live over crReturn */
                     ptrlen prompt;  /* not live over crReturn */
                     
-                    if (s->change_password == 0) // WINSCP
+                    if (!s->change_password) // WINSCP
                     {
                         const char *msg;
                         if (changereq_first_time)
@@ -1371,7 +1371,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl)
                         ppl_printf(("%s\r\n", msg));
                     }
 
-                    s->change_password = 0; // WINSCP
+                    s->change_password = false; // WINSCP
 
                     prompt = get_string(pktin);
 

+ 6 - 6
source/putty/sshaes.c

@@ -1782,11 +1782,11 @@ void call_aes_setup(void * ctx, unsigned char * key, int keylen)
 
 // Based on pre 0.71 code, with use of 0.71 macros
 
-static void aes_encrypt(AESContext * ctx, word32 * block)
+static void aes_encrypt(AESContext * ctx, uint32_t * block)
 {
   int i;
-  word32 *keysched = ctx->keysched;
-  word32 newstate[4];
+  uint32_t *keysched = ctx->keysched;
+  uint32_t newstate[4];
   ADD_ROUND_KEY;
   assert(ctx->Nr - 1 > 0);
   for (i = 0; i < ctx->Nr - 1; i++) {
@@ -1796,11 +1796,11 @@ static void aes_encrypt(AESContext * ctx, word32 * block)
   ENCLASTROUND;
 }
 
-static void aes_decrypt(AESContext * ctx, word32 * block)
+static void aes_decrypt(AESContext * ctx, uint32_t * block)
 {
   int i;
-  word32 *keysched = ctx->invkeysched;
-  word32 newstate[4];
+  uint32_t *keysched = ctx->invkeysched;
+  uint32_t newstate[4];
   ADD_ROUND_KEY;
   assert(ctx->Nr - 1 > 0);
   for (i = 0; i < ctx->Nr - 1; i++) {

+ 1 - 1
source/putty/sshppl.h

@@ -109,7 +109,7 @@ PacketProtocolLayer *ssh2_userauth_new(
     bool try_ki_auth,
     bool try_gssapi_auth, bool try_gssapi_kex_auth,
     bool gssapi_fwd, struct ssh_connection_shared_gss_state *shgss,
-    const char * loghost, int change_password); // WINSCP
+    const char * loghost, bool change_password); // WINSCP
 PacketProtocolLayer *ssh2_connection_new(
     Ssh *ssh, ssh_sharing_state *connshare, bool is_simple,
     Conf *conf, const char *peer_verstring, ConnectionLayer **cl_out);

+ 1 - 5
source/putty/sshpubk.c

@@ -969,11 +969,7 @@ bool rfc4716_loadpub(FILE *fp, char **algorithm,
     return false;
 }
 
-#ifdef MPEXT
-bool openssh_loadpub_line(char * aline, char **algorithm,
-#else
-bool openssh_loadpub(FILE *fp, char **algorithm,
-#endif
+bool openssh_loadpub_line(char * aline, char **algorithm, // WINSCP
                      BinarySink *bs,
                      char **commentptr, const char **errorstr)
 {

+ 0 - 1
source/putty/windows/winhsock.c

@@ -12,7 +12,6 @@
 #include "network.h"
 
 #ifdef MPEXT
-extern char *do_select(Plug * plug, SOCKET skt, int startup);
 #define queue_toplevel_callback(FN, CTX) queue_toplevel_callback(get_callback_set(CTX->plug), FN, CTX)
 #endif
 

+ 0 - 8
source/putty/windows/winnet.c

@@ -863,10 +863,6 @@ static void sk_net_set_frozen(Socket *s, bool is_frozen);
 static const char *sk_net_socket_error(Socket *s);
 static SocketPeerInfo *sk_net_peer_info(Socket *s);
 
-#ifdef MPEXT
-extern char *do_select(Plug * plug, SOCKET skt, int startup);
-#else
-#endif
 static const SocketVtable NetSocket_sockvt = {
     sk_net_plug,
     sk_net_close,
@@ -1441,10 +1437,6 @@ Socket *sk_newlistener(const char *srcaddr, int port, Plug *plug,
 
 static void sk_net_close(Socket *sock)
 {
-#ifdef MPEXT
-    extern char *do_select(Plug * plug, SOCKET skt, int startup);
-#else
-#endif
     NetSocket *s = container_of(sock, NetSocket, sock);
 
     if (s->child)

+ 0 - 13
source/putty/windows/winstore.c

@@ -899,16 +899,3 @@ void cleanup_all(void)
      */
 }
 
-#ifdef MPEXT
-
-void putty_mungestr(const char *in, char *out)
-{
-  mungestr(in, out);
-}
-
-void putty_unmungestr(const char *in, char *out, int outlen)
-{
-  unmungestr(in, out, outlen);
-}
-
-#endif

+ 1 - 1
source/putty/windows/winstuff.h

@@ -365,7 +365,7 @@ DECL_WINDOWS_FUNCTION(GLOBAL, int, select,
  * Provided by each client of winnet.c, and called by winnet.c to turn
  * on or off WSA*Select for a given socket.
  */
-char *do_select(SOCKET skt, bool startup);
+char *do_select(Plug * plug, SOCKET skt, bool startup); // WINSCP
 
 /*
  * Network-subsystem-related functions provided in other Windows modules.