mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-08 08:58:00 +00:00
0d3bb73608
This introduces a new entry to the radio-button list of proxy types, in which the 'Proxy host' box is taken to be the name of an SSH server or saved session. We make an entire subsidiary SSH connection to that host, open a direct-tcpip channel through it, and use that as the connection over which to run the primary network connection. The result is basically the same as if you used a local proxy subprocess, with a command along the lines of 'plink -batch %proxyhost -nc %host:%port'. But it's all done in-process, by having an SshProxy object implement the Socket trait to talk to the main connection, and implement Seat and LogPolicy to talk to its subsidiary SSH backend. All the refactoring in recent years has got us to the point where we can do that without both SSH instances fighting over some global variable or unique piece of infrastructure. From an end user perspective, doing SSH proxying in-process like this is a little bit easier to set up: it doesn't require you to bake the full pathname of Plink into your saved session (or to have it on the system PATH), and the SshProxy setup function automatically turns off SSH features that would be inappropriate in this context, such as additional port forwardings, or acting as a connection-sharing upstream. And it has minor advantages like getting the Event Log for the subsidiary connection interleaved in the main Event Log, as if it were stderr output from a proxy subcommand, without having to deliberately configure the subsidiary Plink into verbose mode. However, this is an initial implementation only, and it doesn't yet support the _big_ payoff for doing this in-process, which (I hope) will be the ability to handle interactive prompts from the subsidiary SSH connection via the same user interface as the primary one. For example, you might need to answer two password prompts in succession, or (the first time you use a session configured this way) confirm the host keys for both proxy and destination SSH servers. Comments in the new source file discuss some design thoughts on filling in this gap. For the moment, if the proxy SSH connection encounters any situation where an interactive prompt is needed, it will make the safe assumption, the same way 'plink -batch' would do. So it's at least no _worse_ than the existing technique of putting the proxy connection in a subprocess.
123 lines
2.9 KiB
CMake
123 lines
2.9 KiB
CMake
cmake_minimum_required(VERSION 3.12)
|
|
project(putty LANGUAGES C)
|
|
|
|
include(cmake/setup.cmake)
|
|
|
|
# Scan the docs directory first, so that when we start calling
|
|
# installed_program(), we'll know if we have man pages available
|
|
add_subdirectory(doc)
|
|
|
|
add_compile_definitions(HAVE_CMAKE_H)
|
|
|
|
add_library(utils STATIC
|
|
${GENERATED_COMMIT_C})
|
|
add_dependencies(utils cmake_commit_c)
|
|
add_subdirectory(utils)
|
|
|
|
add_library(logging OBJECT
|
|
logging.c)
|
|
|
|
add_library(eventloop STATIC
|
|
callback.c timing.c)
|
|
|
|
add_library(console STATIC
|
|
clicons.c console.c)
|
|
|
|
add_library(settings STATIC
|
|
cmdline.c settings.c)
|
|
|
|
add_library(crypto STATIC
|
|
cproxy.c sshproxy.c)
|
|
add_subdirectory(crypto)
|
|
|
|
add_library(network STATIC
|
|
be_misc.c nullplug.c errsock.c proxy.c logging.c x11disp.c)
|
|
|
|
add_library(keygen STATIC
|
|
import.c)
|
|
add_subdirectory(keygen)
|
|
|
|
add_library(agent STATIC
|
|
sshpubk.c pageant.c aqsync.c)
|
|
|
|
add_library(guiterminal STATIC
|
|
terminal.c ldisc.c minibidi.c config.c dialog.c
|
|
$<TARGET_OBJECTS:logging>)
|
|
|
|
add_library(noterminal STATIC
|
|
noterm.c ldisc.c)
|
|
|
|
add_library(all-backends OBJECT
|
|
pinger.c)
|
|
|
|
add_library(sftpclient STATIC
|
|
psftpcommon.c)
|
|
add_subdirectory(ssh)
|
|
|
|
add_library(otherbackends STATIC
|
|
$<TARGET_OBJECTS:all-backends>
|
|
$<TARGET_OBJECTS:logging>)
|
|
add_subdirectory(otherbackends)
|
|
|
|
add_executable(testcrypt
|
|
testcrypt.c sshpubk.c ssh/crc-attack-detector.c)
|
|
target_link_libraries(testcrypt
|
|
keygen crypto utils ${platform_libraries})
|
|
|
|
add_executable(test_host_strfoo
|
|
utils/host_strchr_internal.c)
|
|
target_compile_definitions(test_host_strfoo PRIVATE TEST)
|
|
target_link_libraries(test_host_strfoo utils ${platform_libraries})
|
|
|
|
add_executable(test_tree234
|
|
utils/tree234.c)
|
|
target_compile_definitions(test_tree234 PRIVATE TEST)
|
|
target_link_libraries(test_tree234 utils ${platform_libraries})
|
|
|
|
add_executable(test_wildcard
|
|
utils/wildcard.c)
|
|
target_compile_definitions(test_wildcard PRIVATE TEST)
|
|
target_link_libraries(test_wildcard utils ${platform_libraries})
|
|
|
|
add_executable(plink
|
|
${platform}/plink.c
|
|
be_all_s.c)
|
|
target_link_libraries(plink
|
|
eventloop noterminal console sshclient otherbackends settings network crypto
|
|
utils
|
|
${platform_libraries})
|
|
installed_program(plink)
|
|
|
|
add_executable(pscp
|
|
pscp.c
|
|
be_ssh.c)
|
|
target_link_libraries(pscp
|
|
sftpclient eventloop console sshclient settings network crypto utils
|
|
${platform_libraries})
|
|
installed_program(pscp)
|
|
|
|
add_executable(psftp
|
|
psftp.c
|
|
be_ssh.c)
|
|
target_link_libraries(psftp
|
|
sftpclient eventloop console sshclient settings network crypto utils
|
|
${platform_libraries})
|
|
installed_program(psftp)
|
|
|
|
add_executable(psocks
|
|
${platform}/psocks.c
|
|
psocks.c
|
|
norand.c
|
|
nocproxy.c
|
|
nosshproxy.c
|
|
ssh/portfwd.c)
|
|
target_link_libraries(psocks
|
|
eventloop console network utils
|
|
${platform_libraries})
|
|
|
|
foreach(subdir ${platform} ${extra_dirs})
|
|
add_subdirectory(${subdir})
|
|
endforeach()
|
|
|
|
configure_file(cmake/cmake.h.in ${GENERATED_SOURCES_DIR}/cmake.h)
|