SFTP plugin with dependencies builtin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
drac
Junior Member
Junior Member
Posts: 37
Joined: 2006-04-04, 19:50 UTC

SFTP plugin with dependencies builtin

Post by *drac »

You might find this useful:

http://cristianadam.eu/20150927/total-commander-and-sftp/
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.

Cheers
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6496
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

No, its not useful
because there is no problem to get TC's sftp plugin running.
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Interesting approach.

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

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

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.
drac
Junior Member
Junior Member
Posts: 37
Joined: 2006-04-04, 19:50 UTC

Post by *drac »

Dalai wrote: Wouldn't it have been easier to just pack the dependent DLLs into the plugin archive?
Dalai
Sure. That would be easier, but I wanted to have only one wcx file, no dependencies.

By compiling all dependencies with the same compiler (Visual C++ 2013) there is only one CRT used. Who knows how the dlls were compiled.

The downside is that for every security release I have to rebuild the whole thing.
zeeko
Junior Member
Junior Member
Posts: 50
Joined: 2009-02-21, 19:57 UTC

Post by *zeeko »

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.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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).
Author of Total Commander
https://www.ghisler.com
drac
Junior Member
Junior Member
Posts: 37
Joined: 2006-04-04, 19:50 UTC

Post by *drac »

ghisler(Author) wrote:
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.
Post Reply