Browse Source

Replacing tabs with spaces in customized PuTTY code (in original PuTTY code, this has been done in 59f0cf60)

(cherry picked from commit c9ea2bc6662e5b043c8af3e33dbeffdd8c9b9adc)

Source commit: ad36425dd95d1ea5717c67d252d19de1adb06b2a
Martin Prikryl 4 years ago
parent
commit
f9a24f516b

+ 1 - 1
source/putty/network.h

@@ -163,7 +163,7 @@ Socket *sk_new(SockAddr *addr, int port, bool privport, bool oobinline,
               int sndbuf,
               const char *srcaddr
 #endif
-	      );
+              );
 
 Socket *sk_newlistener(const char *srcaddr, int port, Plug *plug,
                        bool local_host_only, int address_family);

+ 5 - 5
source/putty/proxy.c

@@ -496,11 +496,11 @@ Socket *new_connection(SockAddr *addr, const char *hostname,
                                  conf_get_int(conf, CONF_proxy_port),
                                  privport, oobinline,
                                  nodelay, keepalive, &ret->plugimpl,
-				 #ifdef MPEXT
-				 conf_get_int(conf, CONF_connect_timeout), conf_get_int(conf, CONF_sndbuf),
-				 conf_get_str(conf, CONF_srcaddr)
-				 #endif
-				 );
+                                 #ifdef MPEXT
+                                 conf_get_int(conf, CONF_connect_timeout), conf_get_int(conf, CONF_sndbuf),
+                                 conf_get_str(conf, CONF_srcaddr)
+                                 #endif
+                                 );
         if (sk_socket_error(ret->sub_socket) != NULL)
             return &ret->sock;
 

+ 2 - 2
source/putty/ssh1connection-client.c

@@ -495,12 +495,12 @@ static void ssh1_rportfwd_response(struct ssh1_connection_state *s,
         ppl_logevent("Remote port forwarding from %s refused",
                      rpf->log_description);
 
-	{ // WINSCP
+        { // WINSCP
         struct ssh_rportfwd *realpf = del234(s->rportfwds, rpf);
         assert(realpf == rpf);
         portfwdmgr_close(s->portfwdmgr, rpf->pfr);
         free_rportfwd(rpf);
-	} // WINSCP
+        } // WINSCP
     }
 }
 

+ 2 - 2
source/putty/ssh2connection-client.c

@@ -223,12 +223,12 @@ static void ssh2_rportfwd_globreq_response(struct ssh2_connection_state *s,
         ppl_logevent("Remote port forwarding from %s refused",
                      rpf->log_description);
 
-	{ // WINSCP
+        { // WINSCP
         struct ssh_rportfwd *realpf = del234(s->rportfwds, rpf);
         assert(realpf == rpf);
         portfwdmgr_close(s->portfwdmgr, rpf->pfr);
         free_rportfwd(rpf);
-	} // WINSCP
+        } // WINSCP
     }
 }
 

+ 153 - 153
source/putty/sshaesold.c

@@ -34,9 +34,9 @@
 
 #include "ssh.h"
 
-#define MAX_NR 14		       /* max no of rounds */
-#define MAX_NK 8		       /* max no of words in input key */
-#define MAX_NB 8		       /* max no of words in cipher blk */
+#define MAX_NR 14                      /* max no of rounds */
+#define MAX_NK 8                       /* max no of words in input key */
+#define MAX_NB 8                       /* max no of words in cipher blk */
 
 #define mulby2(x) ( ((x&0x7F) << 1) ^ (x & 0x80 ? 0x1B : 0) )
 
@@ -658,14 +658,14 @@ static const word32 D3[256] = {
  * Common macros in both the encryption and decryption routines.
  */
 #define ADD_ROUND_KEY_4 (block[0]^=*keysched++, block[1]^=*keysched++, \
-		         block[2]^=*keysched++, block[3]^=*keysched++)
+                         block[2]^=*keysched++, block[3]^=*keysched++)
 #define ADD_ROUND_KEY_6 (block[0]^=*keysched++, block[1]^=*keysched++, \
-		         block[2]^=*keysched++, block[3]^=*keysched++, \
-		         block[4]^=*keysched++, block[5]^=*keysched++)
+                         block[2]^=*keysched++, block[3]^=*keysched++, \
+                         block[4]^=*keysched++, block[5]^=*keysched++)
 #define ADD_ROUND_KEY_8 (block[0]^=*keysched++, block[1]^=*keysched++, \
-		         block[2]^=*keysched++, block[3]^=*keysched++, \
-		         block[4]^=*keysched++, block[5]^=*keysched++, \
-		         block[6]^=*keysched++, block[7]^=*keysched++)
+                         block[2]^=*keysched++, block[3]^=*keysched++, \
+                         block[4]^=*keysched++, block[5]^=*keysched++, \
+                         block[6]^=*keysched++, block[7]^=*keysched++)
 #define MOVEWORD(i) ( block[i] = newstate[i] )
 
 /*
@@ -673,13 +673,13 @@ static const word32 D3[256] = {
  * cores, for Nb=4,6,8.
  */
 #define MAKEWORD(i) ( newstate[i] = (E0[(block[i] >> 24) & 0xFF] ^ \
-				     E1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
-				     E2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
-				     E3[block[(i+C3)%Nb] & 0xFF]) )
+                                     E1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
+                                     E2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
+                                     E3[block[(i+C3)%Nb] & 0xFF]) )
 #define LASTWORD(i) ( newstate[i] = (Sbox[(block[i] >> 24) & 0xFF] << 24) | \
-			    (Sbox[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
-			    (Sbox[(block[(i+C2)%Nb] >>  8) & 0xFF] <<  8) | \
-			    (Sbox[(block[(i+C3)%Nb]      ) & 0xFF]      ) )
+                            (Sbox[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
+                            (Sbox[(block[(i+C2)%Nb] >>  8) & 0xFF] <<  8) | \
+                            (Sbox[(block[(i+C3)%Nb]      ) & 0xFF]      ) )
 
 /*
  * Core encrypt routines, expecting word32 inputs read big-endian
@@ -692,15 +692,15 @@ static void aes_encrypt_nb_4(AESContext * ctx, word32 * block)
     word32 *keysched = ctx->keysched;
     word32 newstate[4];
     for (i = 0; i < ctx->Nr - 1; i++) {
-	ADD_ROUND_KEY_4;
-	MAKEWORD(0);
-	MAKEWORD(1);
-	MAKEWORD(2);
-	MAKEWORD(3);
-	MOVEWORD(0);
-	MOVEWORD(1);
-	MOVEWORD(2);
-	MOVEWORD(3);
+        ADD_ROUND_KEY_4;
+        MAKEWORD(0);
+        MAKEWORD(1);
+        MAKEWORD(2);
+        MAKEWORD(3);
+        MOVEWORD(0);
+        MOVEWORD(1);
+        MOVEWORD(2);
+        MOVEWORD(3);
     }
     ADD_ROUND_KEY_4;
     LASTWORD(0);
@@ -720,19 +720,19 @@ static void aes_encrypt_nb_6(AESContext * ctx, word32 * block)
     word32 *keysched = ctx->keysched;
     word32 newstate[6];
     for (i = 0; i < ctx->Nr - 1; i++) {
-	ADD_ROUND_KEY_6;
-	MAKEWORD(0);
-	MAKEWORD(1);
-	MAKEWORD(2);
-	MAKEWORD(3);
-	MAKEWORD(4);
-	MAKEWORD(5);
-	MOVEWORD(0);
-	MOVEWORD(1);
-	MOVEWORD(2);
-	MOVEWORD(3);
-	MOVEWORD(4);
-	MOVEWORD(5);
+        ADD_ROUND_KEY_6;
+        MAKEWORD(0);
+        MAKEWORD(1);
+        MAKEWORD(2);
+        MAKEWORD(3);
+        MAKEWORD(4);
+        MAKEWORD(5);
+        MOVEWORD(0);
+        MOVEWORD(1);
+        MOVEWORD(2);
+        MOVEWORD(3);
+        MOVEWORD(4);
+        MOVEWORD(5);
     }
     ADD_ROUND_KEY_6;
     LASTWORD(0);
@@ -756,23 +756,23 @@ static void aes_encrypt_nb_8(AESContext * ctx, word32 * block)
     word32 *keysched = ctx->keysched;
     word32 newstate[8];
     for (i = 0; i < ctx->Nr - 1; i++) {
-	ADD_ROUND_KEY_8;
-	MAKEWORD(0);
-	MAKEWORD(1);
-	MAKEWORD(2);
-	MAKEWORD(3);
-	MAKEWORD(4);
-	MAKEWORD(5);
-	MAKEWORD(6);
-	MAKEWORD(7);
-	MOVEWORD(0);
-	MOVEWORD(1);
-	MOVEWORD(2);
-	MOVEWORD(3);
-	MOVEWORD(4);
-	MOVEWORD(5);
-	MOVEWORD(6);
-	MOVEWORD(7);
+        ADD_ROUND_KEY_8;
+        MAKEWORD(0);
+        MAKEWORD(1);
+        MAKEWORD(2);
+        MAKEWORD(3);
+        MAKEWORD(4);
+        MAKEWORD(5);
+        MAKEWORD(6);
+        MAKEWORD(7);
+        MOVEWORD(0);
+        MOVEWORD(1);
+        MOVEWORD(2);
+        MOVEWORD(3);
+        MOVEWORD(4);
+        MOVEWORD(5);
+        MOVEWORD(6);
+        MOVEWORD(7);
     }
     ADD_ROUND_KEY_8;
     LASTWORD(0);
@@ -802,13 +802,13 @@ static void aes_encrypt_nb_8(AESContext * ctx, word32 * block)
  * cores, for Nb=4,6,8.
  */
 #define MAKEWORD(i) ( newstate[i] = (D0[(block[i] >> 24) & 0xFF] ^ \
-				     D1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
-				     D2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
-				     D3[block[(i+C3)%Nb] & 0xFF]) )
+                                     D1[(block[(i+C1)%Nb] >> 16) & 0xFF] ^ \
+                                     D2[(block[(i+C2)%Nb] >> 8) & 0xFF] ^ \
+                                     D3[block[(i+C3)%Nb] & 0xFF]) )
 #define LASTWORD(i) (newstate[i] = (Sboxinv[(block[i] >> 24) & 0xFF] << 24) | \
-			   (Sboxinv[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
-			   (Sboxinv[(block[(i+C2)%Nb] >>  8) & 0xFF] <<  8) | \
-			   (Sboxinv[(block[(i+C3)%Nb]      ) & 0xFF]      ) )
+                           (Sboxinv[(block[(i+C1)%Nb] >> 16) & 0xFF] << 16) | \
+                           (Sboxinv[(block[(i+C2)%Nb] >>  8) & 0xFF] <<  8) | \
+                           (Sboxinv[(block[(i+C3)%Nb]      ) & 0xFF]      ) )
 
 /*
  * Core decrypt routines, expecting word32 inputs read big-endian
@@ -821,15 +821,15 @@ static void aes_decrypt_nb_4(AESContext * ctx, word32 * block)
     word32 *keysched = ctx->invkeysched;
     word32 newstate[4];
     for (i = 0; i < ctx->Nr - 1; i++) {
-	ADD_ROUND_KEY_4;
-	MAKEWORD(0);
-	MAKEWORD(1);
-	MAKEWORD(2);
-	MAKEWORD(3);
-	MOVEWORD(0);
-	MOVEWORD(1);
-	MOVEWORD(2);
-	MOVEWORD(3);
+        ADD_ROUND_KEY_4;
+        MAKEWORD(0);
+        MAKEWORD(1);
+        MAKEWORD(2);
+        MAKEWORD(3);
+        MOVEWORD(0);
+        MOVEWORD(1);
+        MOVEWORD(2);
+        MOVEWORD(3);
     }
     ADD_ROUND_KEY_4;
     LASTWORD(0);
@@ -849,19 +849,19 @@ static void aes_decrypt_nb_6(AESContext * ctx, word32 * block)
     word32 *keysched = ctx->invkeysched;
     word32 newstate[6];
     for (i = 0; i < ctx->Nr - 1; i++) {
-	ADD_ROUND_KEY_6;
-	MAKEWORD(0);
-	MAKEWORD(1);
-	MAKEWORD(2);
-	MAKEWORD(3);
-	MAKEWORD(4);
-	MAKEWORD(5);
-	MOVEWORD(0);
-	MOVEWORD(1);
-	MOVEWORD(2);
-	MOVEWORD(3);
-	MOVEWORD(4);
-	MOVEWORD(5);
+        ADD_ROUND_KEY_6;
+        MAKEWORD(0);
+        MAKEWORD(1);
+        MAKEWORD(2);
+        MAKEWORD(3);
+        MAKEWORD(4);
+        MAKEWORD(5);
+        MOVEWORD(0);
+        MOVEWORD(1);
+        MOVEWORD(2);
+        MOVEWORD(3);
+        MOVEWORD(4);
+        MOVEWORD(5);
     }
     ADD_ROUND_KEY_6;
     LASTWORD(0);
@@ -885,23 +885,23 @@ static void aes_decrypt_nb_8(AESContext * ctx, word32 * block)
     word32 *keysched = ctx->invkeysched;
     word32 newstate[8];
     for (i = 0; i < ctx->Nr - 1; i++) {
-	ADD_ROUND_KEY_8;
-	MAKEWORD(0);
-	MAKEWORD(1);
-	MAKEWORD(2);
-	MAKEWORD(3);
-	MAKEWORD(4);
-	MAKEWORD(5);
-	MAKEWORD(6);
-	MAKEWORD(7);
-	MOVEWORD(0);
-	MOVEWORD(1);
-	MOVEWORD(2);
-	MOVEWORD(3);
-	MOVEWORD(4);
-	MOVEWORD(5);
-	MOVEWORD(6);
-	MOVEWORD(7);
+        ADD_ROUND_KEY_8;
+        MAKEWORD(0);
+        MAKEWORD(1);
+        MAKEWORD(2);
+        MAKEWORD(3);
+        MAKEWORD(4);
+        MAKEWORD(5);
+        MAKEWORD(6);
+        MAKEWORD(7);
+        MOVEWORD(0);
+        MOVEWORD(1);
+        MOVEWORD(2);
+        MOVEWORD(3);
+        MOVEWORD(4);
+        MOVEWORD(5);
+        MOVEWORD(6);
+        MOVEWORD(7);
     }
     ADD_ROUND_KEY_8;
     LASTWORD(0);
@@ -933,7 +933,7 @@ static void aes_decrypt_nb_8(AESContext * ctx, word32 * block)
  * (256-bit).
  */
 static void aes_setup(AESContext * ctx, int blocklen,
-	       unsigned char *key, int keylen)
+               unsigned char *key, int keylen)
 {
     int i, j, Nk, rconst;
 
@@ -951,73 +951,73 @@ static void aes_setup(AESContext * ctx, int blocklen,
      * Assign core-function pointers.
      */
     if (ctx->Nb == 8)
-	ctx->encrypt = aes_encrypt_nb_8, ctx->decrypt = aes_decrypt_nb_8;
+        ctx->encrypt = aes_encrypt_nb_8, ctx->decrypt = aes_decrypt_nb_8;
     else if (ctx->Nb == 6)
-	ctx->encrypt = aes_encrypt_nb_6, ctx->decrypt = aes_decrypt_nb_6;
+        ctx->encrypt = aes_encrypt_nb_6, ctx->decrypt = aes_decrypt_nb_6;
     else if (ctx->Nb == 4)
-	ctx->encrypt = aes_encrypt_nb_4, ctx->decrypt = aes_decrypt_nb_4;
+        ctx->encrypt = aes_encrypt_nb_4, ctx->decrypt = aes_decrypt_nb_4;
 
     /*
      * Now do the key setup itself.
      */
     rconst = 1;
     for (i = 0; i < (ctx->Nr + 1) * ctx->Nb; i++) {
-	if (i < Nk)
-	    ctx->keysched[i] = GET_32BIT_MSB_FIRST(key + 4 * i);
-	else {
-	    word32 temp = ctx->keysched[i - 1];
-	    if (i % Nk == 0) {
-		int a, b, c, d;
-		a = (temp >> 16) & 0xFF;
-		b = (temp >> 8) & 0xFF;
-		c = (temp >> 0) & 0xFF;
-		d = (temp >> 24) & 0xFF;
-		temp = Sbox[a] ^ rconst;
-		temp = (temp << 8) | Sbox[b];
-		temp = (temp << 8) | Sbox[c];
-		temp = (temp << 8) | Sbox[d];
-		rconst = mulby2(rconst);
-	    } else if (i % Nk == 4 && Nk > 6) {
-		int a, b, c, d;
-		a = (temp >> 24) & 0xFF;
-		b = (temp >> 16) & 0xFF;
-		c = (temp >> 8) & 0xFF;
-		d = (temp >> 0) & 0xFF;
-		temp = Sbox[a];
-		temp = (temp << 8) | Sbox[b];
-		temp = (temp << 8) | Sbox[c];
-		temp = (temp << 8) | Sbox[d];
-	    }
-	    ctx->keysched[i] = ctx->keysched[i - Nk] ^ temp;
-	}
+        if (i < Nk)
+            ctx->keysched[i] = GET_32BIT_MSB_FIRST(key + 4 * i);
+        else {
+            word32 temp = ctx->keysched[i - 1];
+            if (i % Nk == 0) {
+                int a, b, c, d;
+                a = (temp >> 16) & 0xFF;
+                b = (temp >> 8) & 0xFF;
+                c = (temp >> 0) & 0xFF;
+                d = (temp >> 24) & 0xFF;
+                temp = Sbox[a] ^ rconst;
+                temp = (temp << 8) | Sbox[b];
+                temp = (temp << 8) | Sbox[c];
+                temp = (temp << 8) | Sbox[d];
+                rconst = mulby2(rconst);
+            } else if (i % Nk == 4 && Nk > 6) {
+                int a, b, c, d;
+                a = (temp >> 24) & 0xFF;
+                b = (temp >> 16) & 0xFF;
+                c = (temp >> 8) & 0xFF;
+                d = (temp >> 0) & 0xFF;
+                temp = Sbox[a];
+                temp = (temp << 8) | Sbox[b];
+                temp = (temp << 8) | Sbox[c];
+                temp = (temp << 8) | Sbox[d];
+            }
+            ctx->keysched[i] = ctx->keysched[i - Nk] ^ temp;
+        }
     }
 
     /*
      * Now prepare the modified keys for the inverse cipher.
      */
     for (i = 0; i <= ctx->Nr; i++) {
-	for (j = 0; j < ctx->Nb; j++) {
-	    word32 temp;
-	    temp = ctx->keysched[(ctx->Nr - i) * ctx->Nb + j];
-	    if (i != 0 && i != ctx->Nr) {
-		/*
-		 * Perform the InvMixColumn operation on i. The D
-		 * tables give the result of InvMixColumn applied
-		 * to Sboxinv on individual bytes, so we should
-		 * compose Sbox with the D tables for this.
-		 */
-		int a, b, c, d;
-		a = (temp >> 24) & 0xFF;
-		b = (temp >> 16) & 0xFF;
-		c = (temp >> 8) & 0xFF;
-		d = (temp >> 0) & 0xFF;
-		temp = D0[Sbox[a]];
-		temp ^= D1[Sbox[b]];
-		temp ^= D2[Sbox[c]];
-		temp ^= D3[Sbox[d]];
-	    }
-	    ctx->invkeysched[i * ctx->Nb + j] = temp;
-	}
+        for (j = 0; j < ctx->Nb; j++) {
+            word32 temp;
+            temp = ctx->keysched[(ctx->Nr - i) * ctx->Nb + j];
+            if (i != 0 && i != ctx->Nr) {
+                /*
+                 * Perform the InvMixColumn operation on i. The D
+                 * tables give the result of InvMixColumn applied
+                 * to Sboxinv on individual bytes, so we should
+                 * compose Sbox with the D tables for this.
+                 */
+                int a, b, c, d;
+                a = (temp >> 24) & 0xFF;
+                b = (temp >> 16) & 0xFF;
+                c = (temp >> 8) & 0xFF;
+                d = (temp >> 0) & 0xFF;
+                temp = D0[Sbox[a]];
+                temp ^= D1[Sbox[b]];
+                temp ^= D2[Sbox[c]];
+                temp ^= D3[Sbox[d]];
+            }
+            ctx->invkeysched[i * ctx->Nb + j] = temp;
+        }
     }
 }
 

+ 1 - 1
source/putty/storage.h

@@ -78,7 +78,7 @@ void enum_settings_finish(settings_e *handle);
 
 #ifdef MPEXT
 int retrieve_host_key(const char *hostname, int port,
-		    const char *keytype, char *key, int maxlen);
+                      const char *keytype, char *key, int maxlen);
 #else
 /*
  * See if a host key matches the database entry. Return values can

+ 3 - 3
source/putty/utils.c

@@ -371,14 +371,14 @@ static char *dupvprintf_inner(char *buf, size_t oldlen, size_t *sizeptr,
     while (1) {
         va_list aq;
         va_copy(aq, ap);
-	{ // WINSCP
+        { // WINSCP
 #if defined _DEBUG && defined IDE
 // CodeGuard hangs in v*printf functions. But while it's possible to disable CodeGuard in vsprintf, it's not possible for vsnprintf.
 // We never want to distribute this version of the code, hence the IDE condition.
 // Put this into WinSCP.cgi along with WinSCP.exe
 // [vsprintf]
 // Disable=yes
-	int len = vsprintf(buf + oldlen, fmt, aq);
+        int len = vsprintf(buf + oldlen, fmt, aq);
 #else
         int len = vsnprintf(buf + oldlen, size - oldlen, fmt, aq);
 #endif
@@ -398,7 +398,7 @@ static char *dupvprintf_inner(char *buf, size_t oldlen, size_t *sizeptr,
              * buffer wasn't big enough, so we enlarge it a bit and hope. */
             sgrowarray_nm(buf, size, size);
         }
-	} // WINSCP
+        } // WINSCP
     }
 }
 

+ 32 - 32
source/putty/windows/winnet.c

@@ -174,7 +174,7 @@ DECL_WINDOWS_FUNCTION(static, int, bind,
                       (SOCKET, const struct sockaddr FAR *, int));
 #ifdef MPEXT
 DECL_WINDOWS_FUNCTION(static, int, getsockopt,
-		      (SOCKET, int, int, char FAR *, int *));
+                      (SOCKET, int, int, char FAR *, int *));
 #endif
 DECL_WINDOWS_FUNCTION(static, int, setsockopt,
                       (SOCKET, int, int, const char FAR *, int));
@@ -487,9 +487,9 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname,
                 sfree(trimmed_host);
             }
             if (err == 0)
-	    {
+            {
                 ret->resolved = true;
-	    }	
+            }
         } else
 #endif
         {
@@ -520,11 +520,11 @@ SockAddr *sk_namelookup(const char *host, char **canonicalname,
                 /* Are we in IPv4 fallback mode? */
                 /* We put the IPv4 address into the a variable so we can further-on use the IPv4 code... */
                 if (ret->ais->ai_family == AF_INET)
-		{
+                {
                     memcpy(&a,
                            (char *) &((SOCKADDR_IN *) ret->ais->
                                       ai_addr)->sin_addr, sizeof(a));
-		}
+                }
 
                 if (ret->ais->ai_canonname)
                     strncpy(realhost, ret->ais->ai_canonname, lenof(realhost));
@@ -924,7 +924,7 @@ static DWORD try_connect(NetSocket *sock,
 
     if (sock->s != INVALID_SOCKET) {
 #ifdef MPEXT
-	do_select(sock->plug, sock->s, false);
+        do_select(sock->plug, sock->s, false);
 #else
         do_select(sock->s, false);
 #endif
@@ -979,12 +979,12 @@ static DWORD try_connect(NetSocket *sock,
 
     if (sndbuf > 0)
     {
-	int rcvbuf = 4 * 1024 * 1024;
-	p_setsockopt(s, SOL_SOCKET, SO_SNDBUF, (void *) &sndbuf, sizeof(sndbuf));
+        int rcvbuf = 4 * 1024 * 1024;
+        p_setsockopt(s, SOL_SOCKET, SO_SNDBUF, (void *) &sndbuf, sizeof(sndbuf));
 
-	// For now we increase receive buffer, whenever send buffer is set.
-	// The size is not configurable. The constant taken from FZ.
-	p_setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void*) &rcvbuf, sizeof(rcvbuf));
+        // For now we increase receive buffer, whenever send buffer is set.
+        // The size is not configurable. The constant taken from FZ.
+        p_setsockopt(s, SOL_SOCKET, SO_RCVBUF, (void*) &rcvbuf, sizeof(rcvbuf));
     }
 
     /*
@@ -1009,11 +1009,11 @@ static DWORD try_connect(NetSocket *sock,
 #endif
         {
             a.sin_family = AF_INET;
-	    if (srcaddr && srcaddr[0]) {
-	        a.sin_addr.s_addr = p_inet_addr(srcaddr);
-	    } else {
+            if (srcaddr && srcaddr[0]) {
+                a.sin_addr.s_addr = p_inet_addr(srcaddr);
+            } else {
                 a.sin_addr.s_addr = p_htonl(INADDR_ANY);
-	    }
+            }
             a.sin_port = p_htons(localport);
         }
 #ifndef NO_IPV6
@@ -1119,8 +1119,8 @@ static DWORD try_connect(NetSocket *sock,
          */
         if ( err != WSAEWOULDBLOCK ) {
 #ifdef MPEXT
-    // unselect on error
-    do_select(sock->plug, s, 0);
+            // unselect on error
+            do_select(sock->plug, s, 0);
 #endif
             sock->error = winsock_error_string(err);
             goto ret;
@@ -1149,9 +1149,9 @@ static DWORD try_connect(NetSocket *sock,
      * window, or an EventSelect on an event object. */
     errstr = do_select(sock->plug, s, 1);
     if (errstr) {
-	sock->error = errstr;
-	err = 1;
-	goto ret;
+        sock->error = errstr;
+        err = 1;
+        goto ret;
     }
 #endif
 
@@ -1176,11 +1176,11 @@ static DWORD try_connect(NetSocket *sock,
 Socket *sk_new(SockAddr *addr, int port, bool privport, bool oobinline,
                bool nodelay, bool keepalive, Plug *plug,
 #ifdef MPEXT
-	      int timeout,
-	      int sndbuf,
-	      const char *srcaddr
+              int timeout,
+              int sndbuf,
+              const char *srcaddr
 #endif
-	      )
+              )
 {
     NetSocket *ret;
     DWORD err;
@@ -1642,15 +1642,15 @@ void select_result(WPARAM wParam, LPARAM lParam)
             while (err && s->addr && sk_nextaddr(s->addr, &s->step)) {
                 err = try_connect(s
 #ifdef MPEXT
-		    , 0, 0, NULL
+                    , 0, 0, NULL
 #endif
-		);
+                );
             }
         }
         if (err != 0)
-	{
+        {
             plug_closing(s->plug, winsock_error_string(err), err, 0);
-	}
+        }
         return;
     }
 
@@ -1758,10 +1758,10 @@ void select_result(WPARAM wParam, LPARAM lParam)
                 if (ret)
                     plug_receive(s->plug, 0, buf, ret);
                 else
-		{
+                {
                     plug_closing(s->plug, NULL, 0, 0);
                 }
-	    }
+            }
         } while (ret > 0);
         return;
       case FD_ACCEPT: {
@@ -1875,7 +1875,7 @@ static void sk_net_set_frozen(Socket *sock, bool is_frozen)
     s->frozen = is_frozen;
     if (!is_frozen) {
 #ifdef MPEXT
-	do_select(s->plug, s->s, true);
+        do_select(s->plug, s->s, true);
 #else
         do_select(s->s, true);
 #endif
@@ -1895,7 +1895,7 @@ void socket_reselect_all(void)
     for (i = 0; (s = index234(sktree, i)) != NULL; i++) {
         if (!s->frozen)
 #ifdef MPEXT
-	    do_select(s->plug, s->s, true);
+            do_select(s->plug, s->s, true);
 #else
             do_select(s->s, true);
 #endif

+ 1 - 1
source/putty/windows/winstore.c

@@ -342,7 +342,7 @@ static void hostkey_regname(strbuf *sb, const char *hostname,
 
 #ifdef MPEXT
 int retrieve_host_key(const char *hostname, int port,
-		    const char *keytype, char *key, int maxlen)
+                    const char *keytype, char *key, int maxlen)
 #else
 int verify_host_key(const char *hostname, int port,
                     const char *keytype, const char *key)

+ 5 - 5
source/putty/x11fwd.c

@@ -311,11 +311,11 @@ struct X11Display *x11_setup_display(const char *display, Conf *conf,
             /* Create trial connection to see if there is a useful Unix-domain
              * socket */
             Socket *s = sk_new(sk_addr_dup(ux), 0, false, false,
-	                       false, false, nullplug,
-	    #ifdef MPEXT
-	    0, 0, NULL
-	    #endif
-	    );
+                               false, false, nullplug,
+            #ifdef MPEXT
+            0, 0, NULL
+            #endif
+            );
             err = sk_socket_error(s);
             sk_close(s);
         }