aboutsummaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
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>
2017-08-25examples: Fix fallthrough compiler warningsAndreas Schneider1-0/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05examples: Reformat usage() functionAndreas Schneider1-12/+15
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-04examples: Fix endif()Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03examples: Fix building on FreeBSDAndreas Schneider1-2/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02sample: Migrate client to connector APIAris Adamantiadis1-203/+33
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02examples: Do not usre deprecated functionsAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-17cmake: Try to fix FindArgp moduleAndreas Schneider1-5/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-14cmake: detect argp.h on osxAris Adamantiadis1-4/+1
2016-01-19buffer: use ssh_buffer_get() instead of ssh_buffer_get_begin()Fabiano FidĂȘncio1-2/+2
This commit is a preparatory stage for removing ssh_buffer_get_begin(). Note that removing ssh_buffer_get_begin() doesn't break API compatibility, as this functions has never been exposed (it only has the LIBSSH_API prefix). Signed-off-by: Fabiano FidĂȘncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14examples: Do not include internal headers in ssh_server_forkAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05example: Fix a use after free in the scp exampleAndreas Schneider1-0/+1
CID: #1032343 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05example: Check return value of ssh_get_fd()Andreas Schneider1-2/+11
CID: #1199454 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-20examples: Use safer names for stdin, stdout, stderrWilliam Orr1-20/+20
BUG: https://red.libssh.org/issues/168 On some platforms, like OpenBSD, stdin and friends are macros which break compilation of this struct. I've fixed these names such that it compiles and runs cleanly on OpenBSD Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-14examples: Fix a bad shift if ssh_get_fd() returns -1.Andreas Schneider1-2/+12
Found by Coverity. CID: #1199454
2014-04-09examples: Update ssh_server_fork for new SSH_BIND_OPTIONS_HOSTKEYAlan Dunn1-4/+6
Tested by ssh_server_fork -k <an ecdsa key> -k <an rsa key> ... and connection succeeded with OpenSSH clients both for ECDSA and RSA (the latter forced via -o HostKeyAlgorithms=ssh-rsa and some known hosts clearing was necessary). Also ssh_server_fork -k <an ecdsa key> -k <another ecdsa key> ... caused the second key to be used, as expected. Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27examples: Add ECDSA key option to ssh_server_forkAlan Dunn1-4/+22
Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27examples: Add no default keys options to ssh_server_forkAlan Dunn1-5/+40
It seems useful to be able to run ssh_server_fork without being required to load some key of RSA and DSA keytypes. However, with the current ssh_server_fork, you need to have some keys as some default value is set by default and you can't unset the value for a keytype (e.g. by using NULL as an argument). So the "no default keys" argument turns off the default key assignments. Signed-off-by: Alan Dunn <amdunn@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-17examples: Add missing include for stderr.Andreas Schneider1-0/+1
This should fix the build on FreeBSD.
2014-02-16cmake: Merge server examples.Andreas Schneider1-7/+5
2014-02-16examples: Remove old samplesshd-tty.Andreas Schneider2-475/+0
2014-02-16examples: Remove old samplesshd.Andreas Schneider2-317/+0
2014-02-16examples: Add ssh_server_fork exampleAudrius Butkevicius2-0/+644
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-14examples: Add missing include on FreeBSD.Andreas Schneider1-0/+3
2014-01-16src: Do not use deprecated functions.Andreas Schneider2-18/+18