I thought of building the Total Commander’s SFTP plugin together with its dependencies.
Total Commander’s SFTP plugin has libssh2 as a dependency. libssh2 has OpenSSL and zlib dependencies.
...
I present you below version 1.4.2 of the SFTP plugin with batteries included:
...
I compiled the plugin for 32 and 64 bit versions of Total Commander.
Wouldn't it have been easier to just pack the dependent DLLs into the plugin archive? I mean, the TC Homepage lists the DLLs required to run the plugin successfully (and where to get them, too):
This plugin needs the DLLs libeay32.dll, libssh2.dll and zlib1.dll in the same directory as the plugin, or the Totalcmd directory. The DLLs can be found in the libcURL package at the following address: [...]
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
I guess the best approach would an 'on demand' downloader. In case the libs are required TC prompts the user and the libs are downloaded and installed.
libssh2 can be built without openssl and zlib (WinCNG configuration). This reduces compiling complexity.
And if libssh2 is built as static library, final wcx is quite small and doesn't need external dll's.
Source and binaries can be downloaded from https://www.dropbox.com/s/704hv5cid58p9ms/sftpplug_143.zip?dl=0
sftpplug source modifications are mainly done to reduce compiler warnings. LoadSSHLib function is cleaned up because there is no need to load dll’s.
There are bug fixes in sftpfunc.cpp:
line 1897 in original source/line 1610 in new source
line 2262/1976
line 3914/3636
line 3915/3637.
LoadSSHLib function is cleaned up because there is no need to load dll’s.
Unfortunately it is necessary when the dlls aren't located in the Total Commander directory: TC sets load restrictions to avoid unwanted dll injection. So when you try to load the ssh library when by itself tries to load the ssl dll, the loading of the ssl dll will fail (except when it is in the TC directory).
LoadSSHLib function is cleaned up because there is no need to load dll’s.
Unfortunately it is necessary when the dlls aren't located in the Total Commander directory: TC sets load restrictions to avoid unwanted dll injection. So when you try to load the ssh library when by itself tries to load the ssl dll, the loading of the ssl dll will fail (except when it is in the TC directory).
I think zeeko also linked statically to libssh2. And since he configured libssh2 to use WinCNG there is no OpenSSL dependency.
What does the lawyer say about using WinCNG in respect to cryptography export restrictions? In this case Windows does all the magic.
I think Total Commander could ship the sftplugin with libssh2 compiled statically to use WinCNG.