aboutsummaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
2021-05-12examples/ssh_server: Support the command line parser without argp packageXiang Xiao1-4/+88
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: Ia39a402e4684d2f0ef014b4effd255692b576ce3
2021-05-12examples/ssh_server: Add -u and -P optionXiang Xiao1-3/+25
enable pass username and password from command line Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: I6404b90a99253d3240f7a28827635b159ff6a574
2021-05-12examples/libssh_scp: Remove the duplication of free(loc->host)Xiang Xiao1-4/+1
and free sources at the end of program Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: Ia6a51d52439722b46547449e85350b3193e5ba28
2021-05-12examples/libssh_scp: call ssh_init and ssh_finalize explicitlyXiang Xiao1-2/+4
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: I4c80904d40b068f47334c3116576de07782162f6
2021-05-12examples/ssh_client: Check SIGWINCH is defined before using itXiang Xiao1-5/+7
since not all POSIX platform support SIGWINCH signal and remove the global variable chan Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com> Change-Id: I70217020c84b056270ed680008a1871383b5fc7b
2020-06-22examples: Tolerate incomplete writes in exec exampleAnderson Toshiyuki Sasaki1-7/+22
Previously, the exec example would fail if it could not write the whole read buffer to stdout. With this changes, the exec example will be able to write parts of the buffer until the whole buffer is written. This makes the exec example to run when the stdout buffer is small. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-05-06cmake: Add autogenerated libssh_version.hHeiko Thiery1-1/+1
Set the cmake project verision to the autogenerated file to have a single point to set the version. This will be included in the libssh.h file. Pair-Programmed-With: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2020-05-05Allow example client and server to process different configuration filesJakub Jelen2-5/+27
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2020-04-20examples: Avoid unused parameter warnings and reformatJakub Jelen1-60/+116
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2020-04-15examples: Add missing includesJakub Jelen1-0/+2
Fixes: T225 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-12-23examples: Enable strict buildJakub Jelen1-4/+4
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-12-09examples: Use SSH_STRING_FREE_CHAR()Andreas Schneider2-9/+9
Fixes T183 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-12-09examples: Fix integer types in libssh_scp.cAndreas Schneider1-4/+5
Fixes T188 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-12-09examples: Remove internal include from sshd_direct-tcpip.cAndreas Schneider1-7/+34
Fixes T188 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-11-07cmake: Do not use cached LIBSSH_PUBLIC_INCLUDE_DIRSAndreas Schneider1-4/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-11-07cmake: Create ssh library directly as libsshAndreas Schneider1-16/+16
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-11-07examples: Build keygen2 only if argp is availableAnderson Toshiyuki Sasaki1-4/+4
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-11-07examples: Added keygen2 exampleAnderson Toshiyuki Sasaki2-0/+461
The added example is an application which can generate keys of different types using libssh. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-07-30examples: Load ED25519 key when loading all keysJakub Jelen1-0/+2
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-07-08examples: Fix freeing the channel in ssh_clientAndreas Schneider1-1/+13
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2019-07-08examples: Update header in ssh_clientAndreas Schneider1-12/+13
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-07-08exmples: Use SSH_CONNECTOR_STDINOUT in client exampleAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-06-27examples: Check ssh_event_dopoll() return valueAnderson Toshiyuki Sasaki1-1/+6
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-05-28examples: Fix a possible resource leak in sshd_direct-tcpipAndreas Schneider1-0/+2
CID 1398985 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2019-02-21examples: Fix unused parameter warnings in sshd_direct-tcpipAndreas Schneider1-3/+14
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2019-02-20examples: Add direct-tcpip server sampleTill Wimmer2-0/+645
Signed-off-by: Till Wimmer <g4-lisz@tonarchiv.ch> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-02-07examples: Add simple way to generate key files from libsshJakub Jelen2-0/+45
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-24examples: add public key auth for specific keyEric Bentley1-0/+62
There was no example of using a specific key for authentication so I added one. Signed-off-by: Eric Bentley <ebentley66@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2019-01-24examples: add public key authentication to ssh_server_forkEric Bentley1-2/+67
I noticed that there was no example showing server side public key encryption in the examples so I added this one. I used authorizedkeys as a global to minimize the changes to the original code as well as I was not sure the correct methodology of determining the .ssh directory location for a user not using Linux. One code using the user parameter to determine the location to use instead if desired. Signed-off-by: Eric Bentley <ebentley66@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24exmpales: Init rc in ssh_server_forkAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24examples: Zero fds in sshnetcatAndreas Schneider2-0/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19examples: Explicitly track auth state in samplesshd-kbdintAndreas Schneider1-4/+16
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-16examples: Use ssh_session_update_known_hosts() for updating known_hostsAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-05examples: Reformat knownhostsAndreas Schneider1-70/+73
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27examples: Add null checks in libssh_scp.cAnderson Toshiyuki Sasaki1-0/+10
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27examples: Fix libssh_scp.c code styleAnderson Toshiyuki Sasaki1-276/+321
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27examples: Fix possible memory leak in libssh_scp.cAnderson Toshiyuki Sasaki1-20/+89
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20examples: Reformat authenticaton.cAndreas Schneider1-66/+69
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-18examples: Fix code style in samplesftp.cAnderson Toshiyuki Sasaki1-143/+162
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-18examples: Fixed possible memory leak in samplesftp.cAnderson Toshiyuki Sasaki1-13/+17
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-31examples: Reformat ssh_clientAndreas Schneider1-135/+186
The example should be clean code if possible. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-29examples: Use ssh_print_hash()Andreas Schneider1-7/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-20cmake: Improve compiler flag detectionAndreas Schneider1-0/+11
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-20examples: Fix function declaration in sshnetcatAndreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30example: Add missing error checks in ssh_server_forkAndreas Schneider1-1/+11
CID 1393676 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30examples: Make gobal variables static in scp_downloadAndreas Schneider1-3/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30examples: Define LIMIT as unsinged longAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-04examples: Use new known hosts functionsAndreas Schneider1-8/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-11-08examples: Build server examples on Linux tooAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-11-07examples: Rename samplessh to ssh-clientAndreas Schneider2-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>