Files
app/native-ssh/cmake/PatchMbedtls.cmake
Claude 55bd6015da iOS: SSH on libdmodemssh, the apps' own client on libssh
native-ssh is the desktop apps' SSH engine (D-Modem/gui's ssh/), built
here from libssh's and mbedTLS's release tarballs for the host, Android
and Apple's systems.  ios/build-native.sh makes it
DModemSSHNative.xcframework, each arch linked into one object whose only
globals are dmc_ssh_*, so its mbedTLS never meets the engine's.
DModemSSH's SSHShell keeps its API on it (SwiftNIO SSH goes), adding RSA,
keyboard-interactive and private keys; CI runs its tests and the
engine's against a real sshd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSV65geuGd6zMt2V6r
2026-11-12 13:15:49 +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
")