1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

446 Commits

Author SHA1 Message Date
Eduardo Correia
d6dd4c7ec8 Free the Ed448 curve in ec_cleanup
ec_cleanup frees every curve ecc-ssh.c sets up except Ed448: ec_ed448 lacks
the WINSCP_CURVE_CLEANUP its siblings have and ec_cleanup does not call it,
so its points and bignums leak at shutdown once an Ed448 key was used.
2026-10-13 11:16:37 +02:00
Eduardo Correia
be053db0a6 Forget the freed system directory in win_misc_cleanup
win_misc_cleanup frees get_system_dir's cached buffer but leaves the pointer
and its size, so a get_system_dir call after the cleanup returns freed
memory instead of fetching the directory again.
2026-10-13 11:13:14 +02:00
Eduardo Correia
d89d03e5df Leave the PuTTY section when random_add_noise returns early
random_add_noise enters putty_section and then returns without leaving it
when the generator is not active. The section is recursive, so the thread
that returned keeps working, but any other thread entering it -- another
session's socket, RNG or bignum code -- then blocks for good.
2026-10-13 11:10:16 +02:00
Eduardo Correia
4e9af64b9c Pop aes-ni.c's clang attribute under the condition it was pushed
aes-ni.c pushes its target attribute under #ifdef __clang__ but pops it
under #ifdef _WIN64. For clang targeting Win64 the two coincide. Otherwise
they do not: clang targeting 32-bit Windows (clang-cl in a WINSCP_VS build)
reports the push as unterminated and fails, and MSVC targeting x64 meets a
pop of a clang pragma it does not know (warning C4068). The pop now has the
push's condition.
2026-10-13 11:03:41 +02:00
Martin Prikryl
0a91a3e4e3 Merge branch 'thirdparty'
# Conflicts:

#	source/putty/ssh/connection2.c

Source commit: 4413da04be2a27098da2488953e6e86301be66cd
2026-08-26 16:07:38 +02:00
Martin Prikryl
b3732d9b70 PuTTY 0.85
Source commit: c9fb0e3663609e43f0fc37e1e96e9f2177809f15
2026-08-26 16:06:53 +02:00
Martin Prikryl
184bda4bf7 Resetting differences to official PuTTY from afbcdcd1 that are not needed with Clang-based compiler
Source commit: aea5830a0db64b028ed6dd6328cbcb8f2d87baf8
2026-08-26 16:05:41 +02:00
Martin Prikryl
9d2ab68f0f Merge branch 'thirdparty_hotfix' into thirdparty
Source commit: 29cd13353b04e1e8333d6a4e5308ca72111e9029
2026-08-26 16:04:08 +02:00
Martin Prikryl
6f632e38a9 Merge branch 'hotfix'
Source commit: bb4d452ea03a6de19b972c809f65a4318955e559
2026-08-26 16:03:42 +02:00
Martin Prikryl
afbcdcd14b Updating PuTTY 0.85 fixes to bcc32
Source commit: 0fe575bc262df9e28a86ab8e0ba39163410e56b6
2026-08-26 00:47:07 +02:00
Martin Prikryl
fec8b0d00d Merge branch 'thirdparty_hotfix' into hotfix
# Conflicts:
#	source/putty/ssh/connection2.c

Source commit: b4afce76ac7977473f5f01de24061065eecc66f2
2026-08-26 00:46:09 +02:00
Simon Tatham
2b1419f914 Validate Argon2 parameters when loading a PPK file.
This prevents a couple of different possible crashes if a PPK file
constructed by something other than PuTTYgen contains invalid
parameters. If parallelism is 0 then the Argon2 code can divide by
zero; if the memory requirement is too small for the parallelism then
it can overrun a buffer.

Signed-off-by: Martin Prikryl <martin@winscp.net>

Source commit: e66db8e4bd600fd9d92467fb8b6cc31cd86fc0ad
2026-08-26 00:45:11 +02:00
Simon Tatham
f4157b1cd4 Reject remote max packet size 0 when opening channels.
This case led to a tight loop in ssh2_try_send, which would calculate
the largest size of data packet it could send on a channel as the min
of various things including the max packet size; find, of course, that
the largest size was therefore 0; send no data; and loop round again
to keep trying.

There's nothing you can sensibly do about that by the time you get to
ssh2_try_send, so a better response is to reject the connection at
open time.

When the connection is initiated from the far end (i.e. we receive
CHANNEL_OPEN) we can do this relatively nondestructively, by rejecting
just that one channel-open request. When it's initiated from our end,
and the CHANNEL_OPEN_CONFIRMATION we got back contained the zero
maxpkt, there's no similar protocol method for rejecting the
confirmation, so instead we disconnect the whole SSH session.

(That seems harsh, but I think it's reasonable, because one reason for
aborting an SSH connection is that you genuinely don't _know_ what
your client can legally do next – and this is exactly that situation.)

Signed-off-by: Martin Prikryl <martin@winscp.net>

Source commit: 5b7de97f5fcb3f4b957e9585ea15018831c8b547
2026-08-26 00:44:50 +02:00
Simon Tatham
28b3293ac1 Fix buffer overflow in ETM mode packet decode.
The space allocated for the decrypted packet was 4 bytes too small,
because we end up reading (s->packetlen + s->maclen) bytes into it,
but we allocated the buffer based on the largest possible size of
(s->len + s->maclen). The two differ by 4. So if a packet is within 4
bytes of the largest size accepted by the check of s->len against
OUR_V2_PACKETLIMIT, then it overruns the buffer allocated for the
following BPP_READ.

Thanks to Yukihiro Nakamura for spotting this.

Signed-off-by: Martin Prikryl <martin@winscp.net>

Source commit: dc1ea030899bc7ec7ed4388cfc01757c41816f0c
2026-08-26 00:44:30 +02:00
Martin Prikryl
56c81a5f36 Resolving some warnings in PuTTY code
Source commit: c458b24e9476c08302942093c7e621a3f97e7833
2026-06-04 00:45:48 +02:00
Martin Prikryl
95ac37750b rsakex-double-free and ecdsa-remotely-triggerable-assertion fixes from PuTTY 0.84
Source commit: 5fae646d5c4e8b820fe0a423f2758c33259f0b4e
2026-06-02 01:14:19 +02:00
Martin Prikryl
8d257cc59a Merge branch 'hotfix'
Source commit: b7cb499bdc47a8b5e54277bec7ea5d7f28b0ec89
2026-06-02 01:10:36 +02:00
Martin Prikryl
ce7699c617 Merge branch 'thirdparty_hotfix' into hotfix
Source commit: 2b8a2d2bab169ca7ba5b36f1face51a4de3cecb4
2026-06-02 01:07:40 +02:00
Martin Prikryl
94af53fd2d rsakex-double-free and ecdsa-remotely-triggerable-assertion fixes from PuTTY 0.84
(cherry picked from commit 5fae646d5c4e8b820fe0a423f2758c33259f0b4e)

Source commit: 309869e4787025160d0b47f342a26e18e8605d89
2026-06-02 01:04:36 +02:00
Martin Prikryl
cc81f2c3fc Updating code to PuTTY 0.84
Source commit: 71b0bdd5bb7ff22e916234fffeedf5db87668460
2026-05-30 01:07:44 +02:00
Martin Prikryl
4d24fdb881 Merge branch 'thirdparty_dev' into dev
# Conflicts:
#	source/putty/callback.c

#	source/putty/putty.h
#	source/putty/ssh/ssh.c
#	source/putty/windows/network.c
#	source/putty/windows/platform.h

Source commit: e4552f4c309c1e34fce155ecad0bfaf22cd8bcee
2026-05-30 01:04:55 +02:00
Martin Prikryl
fbc97830e9 PuTTY 0.84
Source commit: 74c128b1c46223d1ff41e055c5fadd44bf73dbe4
2026-05-30 01:01:18 +02:00
Martin Prikryl
d725f98ec4 Issue 618 – Experimental 64-bit version of WinSCP
https://winscp.net/tracker/618

Source commit: 329fb51d696db6c1d37d5c5240ff253af0df941b
2026-05-11 18:39:51 +02:00
Martin Prikryl
843729d656 Issue 1682 – Support OpenSSH ssh-agent
https://winscp.net/tracker/1682

Source commit: ec5961549076ee19737c0950b44216967609c51f
2026-02-25 01:22:31 +01:00
Martin Prikryl
115871701b There are no "missing braces" warnings afte f670f4eb + Solving some unused variables
Source commit: 06241c0127599e00d4ad3c60aa01a2cbff38ee74
2026-02-12 01:05:55 +01:00
Martin Prikryl
e97e7c7399 Resetting never needed modifications to aes-ni.c
And adding it to a project file for consistency and 64-bit compatibility (for which it will be compiled by bcc64)

Source commit: edc84e36955a053c777b9ebedca5b6a354dc202e
2026-01-23 16:08:53 +01:00
Martin Prikryl
0429c6ea70 Dropping legacy AES layer
Source commit: 8afc72ce0dbc33b9c86e38aa23204bdb05d2cd5b
2026-01-16 01:10:29 +01:00
Martin Prikryl
ebecfdf81c Compiling some PuTTY crypto with Clang
Primarily because linking MSVC object files to Clang executable do not seem to be possible anymore.

But there's even 25% boost comparing to MSVC for SHA-256 and AES SW (Argon not measured)

AES NI won't compile without huge changes (alignment, partial reimplementation in asm), which hopefully won't be needed on 64-bit (and inline asm is allegedly not even possible with 64-bit Clang).
So sticking with MSVC for now.
With the changes similar boost as with Clang. Though -O3 optimization (BCC_OptimizeMaximum) was needed. Without it, the speed was 10x slower.

Source commit: 07d16b2a5ebf3b166af572a76fdbab6c488cc00f
2026-01-16 01:07:25 +01:00
Martin Prikryl
f670f4ebb1 Resetting differences to official PuTTY that are no longer needed
Most, if not all, were for compatibility with the classic C++Builder compiler (declarations in the middle of code + inline structure initializers)

Source commit: a9f38c3a07777e538c3c6e0fbdd38e9d68327dfa
2025-12-06 01:29:35 +01:00
Martin Prikryl
980db10682 Renaming files with "error" in name that triggers red highlight in IDE build log
Source commit: b31b9814c8e1956ba11a91f1b1312863da530992
2025-12-05 01:21:16 +01:00
Martin Prikryl
6963f08ffd Enabling all warnings in all projects and only selectively disabling those that are needed
with aim to eventually update the code to need as little warnings disabled as needed.

Some code updates (and even fixes) to avoid warning done already

Source commit: 5c45a6f56c52e7b0c5034ed9980cd65259a7372b
2025-12-04 01:16:16 +01:00
Martin Prikryl
94fa2239f2 Issue 2407 – Failure when opening site imported from PuTTY with unsupported SSH proxy
https://winscp.net/tracker/2407
(cherry picked from commit ff1fb558c5)

Source commit: 4b829d429b5a4f01bef8ff3b7512f2e3bc7a026f
2025-10-31 13:59:30 +01:00
Martin Prikryl
ff1fb558c5 Issue 2407 – Failure when opening site imported from PuTTY with unsupported SSH proxy
https://winscp.net/tracker/2407

Source commit: db2b4eddd5444a0d3dcb3aa62c2a7c208a98e4ad
2025-10-31 13:47:54 +01:00
Martin Prikryl
9fc373f067 Issue 2379 – Failure when canceling reconnection on authentication banner, when the connection was already closed by the server
https://winscp.net/tracker/2379
(cherry picked from commit ba8994ca1f)

Source commit: eb15ad855f5235f1daa6b336fbed510117fc6443
2025-06-03 17:48:43 +02:00
Martin Prikryl
ba8994ca1f Issue 2379 – Failure when canceling reconnection on authentication banner, when the connection was already closed by the server
https://winscp.net/tracker/2379

Source commit: 6797a6eb7c41fff0ae0fe6b2ae8d7be0a1db52c6
2025-06-03 16:44:44 +02:00
Martin Prikryl
c70989efd2 Issue 2376 – Failure when proxy hostname resolution fails with SFTP/SCP protocols
https://winscp.net/tracker/2376
(cherry picked from commit 2a9075b4f9)

Source commit: 1b6757ab23fcc8b1c62a2f73f2cb7415d90996ca
2025-05-20 01:12:06 +02:00
Martin Prikryl
2a9075b4f9 Issue 2376 – Failure when proxy hostname resolution fails with SFTP/SCP protocols
https://winscp.net/tracker/2376

Source commit: 5014ea48bd61dc233b76168f8719f9cd769f5971
2025-05-20 01:06:57 +02:00
Martin Prikryl
5dc46ec23f Clang identifies some functions as "noreturn" + one noexcept(false)
(cherry picked from commit 7b54dde3a6)

Source commit: e6fd24a871e574ed762797210a5ce126deeab1f3
2025-03-14 16:19:14 +01:00
Martin Prikryl
7b54dde3a6 Clang identifies some functions as "noreturn" + one noexcept(false)
Source commit: fc0c35fdddcd50a10d9ca13fc515164885325f81
2025-03-14 16:15:03 +01:00
Martin Prikryl
23f7ce72d8 BCB11 has strtoumax
Source commit: 8f39df83ecbe435ec1c30cda1bedf1ccbe0eb773
2025-03-14 09:52:20 +01:00
Martin Prikryl
3f4e41fee0 Clang imposed changes that should be noop and have no effect on classic compiler
Mostly:
– incorrectly identified uninitialized variables
– explicit static global variables
– const, sign and down casts and safety
– typename use
– semicolon after function implementation
– unused variables, fields, arguments and macros
– field initialization order
– exact include filename case
– redundant in code macros already defined at project level

(cherry picked from commit f7f00c631e)

Source commit: 90ad9390853aba308abe73cf02e0281238c53c87
2025-03-13 16:46:26 +01:00
Martin Prikryl
8cd48fd0e5 Code errors identified by Clang
Notably:
Bug fix: Monospace font is not remembered if SSH banners are administratively forced
Change: Bug fix: In XML log, filename tag was included in stat tag, although explicitly documented not to

(cherry picked from commit 4019b56ffb)

Source commit: 8f8d10bc0c9f4ca626dceda1d3e9889dc22f4394
2025-03-13 06:42:18 +01:00
Martin Prikryl
8302885613 Updating PuTTY 0.83 code to C++Builder
Source commit: e3ca66f699fc8c8bf2b88137ae0ebe9f49deeda5
2025-02-09 01:00:48 +01:00
Martin Prikryl
7d468363f9 Merge branch 'thirdparty'
Source commit: 59e298e83f9891d9aac94b1ea2d27c38ecd41b64
2025-02-09 00:58:28 +01:00
Martin Prikryl
cfd8d4fb6b PuTTY 0.83
Source commit: b0090a95261e1444074c54571fefe51629b4204b
2025-02-09 00:56:05 +01:00
Martin Prikryl
59a148c152 Updating code to PuTTY Pre-release 0.83:2025-01-03.1e45199 + Updating PuTTY code to C++ Builder
Source commit: f19842107de91d45c4a819260d5d335a7635980c
2025-01-05 01:04:26 +01:00
Martin Prikryl
85bddc2c5c Merge branch 'thirdparty_dev' into dev
Source commit: 4d92009391120144deb49f4cae233abae481b71f
2025-01-05 00:58:01 +01:00
Martin Prikryl
8459471bad PuTTY Pre-release 0.83:2025-01-03.1e45199
Source commit: 1675133a3ca89ff21576d3c554b83fcb225d73c3
2025-01-05 00:55:14 +01:00
Martin Prikryl
caa8c317d9 Updating updated PuTTY 0.82 ntru.c to C++ Builder compiler
Source commit: c068a3a2f3a93b0815a0c8d5e59a19fd76f7bcdc
2024-12-28 01:07:26 +01:00
Martin Prikryl
5044f790a3 Merge branch 'thirdparty_dev' into dev
# Conflicts:
#	source/putty/crypto/ntru.c

Source commit: bbce48c778ebeec236e5bf5c4679d7c8f9705595
2024-12-28 01:04:51 +01:00