Files
gui/ssh/cmake/PatchMbedtls.cmake
T
Claude a771d03af4 Add libdmodemssh: an SSH client on libssh for every app
One engine in C on libssh 0.11 (with mbedTLS, both built from their
release tarballs where the system has no libssh 0.11): host keys for
the caller to trust (and OpenSSH's known_hosts when asked), logins by
password, keyboard-interactive, a key, the agent or OpenSSH's defaults,
a shell on a pty, commands, direct channels, remote listens and the
server's agent channels; keys made, read and re-encrypted.  Its tests
log in to a real sshd when DMODEM_SSH_TEST names one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSV65geuGd6zMt2V6r
2026-11-12 12:58:43 +00:00

25 lines
764 B
CMake

# mbedTLS's config with threading on, as libssh wants it: its own
# pthread mutexes, or (Windows) libssh's given through threading_alt.h.
# Run in mbedTLS's source tree by BundledLibssh.cmake.
set(_config include/mbedtls/mbedtls_config.h)
file(READ ${_config} _text)
if(NOT _text MATCHES "D-Modem: threading")
file(APPEND ${_config} "
/* D-Modem: threading, for libssh */
#define MBEDTLS_THREADING_C
#if defined(_WIN32)
#define MBEDTLS_THREADING_ALT
#else
#define MBEDTLS_THREADING_PTHREAD
#endif
")
endif()
file(WRITE include/mbedtls/threading_alt.h "/* D-Modem: libssh's mutexes (a pointer each) */
#ifndef DMODEM_THREADING_ALT_H
#define DMODEM_THREADING_ALT_H
typedef struct mbedtls_threading_mutex_t {
void *mutex;
} mbedtls_threading_mutex_t;
#endif
")