mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
c1ddacf78f
This fills in the remaining gap in the interactive prompt rework of the proxy system in general. If you used the Telnet proxy with a command containing %user or %pass, and hadn't filled in those variables in the PuTTY config, then proxy/telnet.c would prompt you at run time to enter the proxy auth details. But the local proxy command, which uses the same format_telnet_command function, would not do that. Now it does! I've implemented this by moving the formatting of the proxy command into a new module proxy/local.c, shared between both the Unix and Windows local-proxy implementations. That module implements a DeferredSocketOpener, which constructs the proxy command (prompting first if necessary), and once it's constructed, hands it to a per-platform function platform_setup_local_proxy(). So each platform-specific proxy function, instead of starting a subprocess there and then and passing its details to make_fd_socket or make_handle_socket, now returns a _deferred_ version of one of those sockets, with the DeferredSocketOpener being the thing in proxy/local.c. When that calls back to platform_setup_local_proxy(), we actually start the subprocess and pass the resulting fds/handles to the deferred socket to un-defer it. A side effect of the rewrite is that when proxy commands are logged in the Event Log, they now get the same amenities as in the Telnet proxy type: the proxy password is sanitised out, and any difficult characters are escaped.
146 lines
3.7 KiB
CMake
146 lines
3.7 KiB
CMake
cmake_minimum_required(VERSION 3.7)
|
|
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)
|
|
|
|
include_directories(terminal)
|
|
|
|
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
|
|
proxy/cproxy.c proxy/sshproxy.c)
|
|
add_subdirectory(crypto)
|
|
|
|
add_library(network STATIC
|
|
stubs/nullplug.c errsock.c logging.c x11disp.c
|
|
proxy/proxy.c
|
|
proxy/http.c
|
|
proxy/socks4.c
|
|
proxy/socks5.c
|
|
proxy/telnet.c
|
|
proxy/local.c
|
|
proxy/interactor.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/terminal.c terminal/bidi.c
|
|
ldisc.c config.c dialog.c
|
|
$<TARGET_OBJECTS:logging>)
|
|
|
|
add_library(noterminal STATIC
|
|
stubs/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
|
|
test/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(bidi_gettype
|
|
terminal/bidi_gettype.c)
|
|
target_link_libraries(bidi_gettype guiterminal utils ${platform_libraries})
|
|
|
|
add_executable(bidi_test
|
|
terminal/bidi_test.c)
|
|
target_link_libraries(bidi_test guiterminal utils ${platform_libraries})
|
|
|
|
add_executable(plink
|
|
${platform}/plink.c)
|
|
# Note: if we ever port Plink to a platform where we can't implement a
|
|
# serial backend, this be_list command will need to become platform-
|
|
# dependent, so that it only sets the SERIAL option on platforms where
|
|
# that backend exists. For the moment, though, we have serial port
|
|
# backends for both our platforms, so we can do this unconditionally.
|
|
be_list(plink Plink SSH SERIAL OTHERBACKENDS)
|
|
target_link_libraries(plink
|
|
eventloop noterminal console sshclient otherbackends settings network crypto
|
|
utils
|
|
${platform_libraries})
|
|
installed_program(plink)
|
|
|
|
add_executable(pscp
|
|
pscp.c)
|
|
be_list(pscp PSCP SSH)
|
|
target_link_libraries(pscp
|
|
sftpclient eventloop console sshclient settings network crypto utils
|
|
${platform_libraries})
|
|
installed_program(pscp)
|
|
|
|
add_executable(psftp
|
|
psftp.c)
|
|
be_list(psftp PSFTP SSH)
|
|
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
|
|
stubs/norand.c
|
|
proxy/nocproxy.c
|
|
proxy/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)
|