Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here's my merge of the https://github.com/tnn2/esp-idf-libssh code to implement libssh.
It's mostly a straight copy of src and include dirs.
One issue I had was that libssh uses the include of "config.h", but because of the way the project is setup that includes the libsmb2 generated one, as the include path has:
which means anyone doing
gets the file under smb2. sad-panda.
So I manually changed all those to "libssh/config.h"
I've merged the "compat" files that are in the esp-idf-libssh directly into the tree, rather than having it separate. This could be changed, but again is complicated by there being multiple "config.h" files all over the place.
Instead, I merged compat/config.h into libssh/config.h
The only major changes I had to make was by blocking out some code (using LIBSSH_FUJINET define) in options.c, as it is hardwired to require a config dir to try and read some defaults from, and tries to read from "~/.ssh" by default.
There are several files not moved across, because they were not referenced in https://github.com/tnn2/esp-idf-libssh/blob/master/components/libssh/CMakeLists.txt so that build wasn't using them anyway.
Investigating, most are openssl requiring files, but it would be worth getting a second pair of eyes on this.
Note, as in the original SSH.cpp, there is no host validation nor config reading, which leaves the implementation a little fragile to MITM attacks etc.
I did try to enable pthread, but ssh init failed and I couldn't debug it, I was getting weird issues of the unicode sequence for FFFD being spammed to the monitor console whenever I add any debug to init.c, so I stopped trying to get pthread support after an hour of problems.
There are very few changes to the original c files in libssh. I've included a diff file between them below.
This is only for the files I copied into the project.
libssh-diffs.txt
This was generated with the script:
I haven't delete the libssh2 dir, but I have commented out the use of esp32sshclient in modem.h