1
1
Граф коммитов

227 Коммитов

Автор SHA1 Сообщение Дата
Andreas Schneider
12ec1fed2f examples: Zero fds in sshnetcat
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
0ff566b6dd examples: Explicitly track auth state in samplesshd-kbdint
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 12:31:04 +02:00
Andreas Schneider
16b876d07f examples: Use ssh_session_update_known_hosts() for updating known_hosts
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-16 08:58:31 +02:00
Andreas Schneider
e210b61148 examples: Reformat knownhosts
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-05 14:38:43 +02:00
Anderson Toshiyuki Sasaki
31202822a7 examples: Add null checks in libssh_scp.c
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
6118628424 examples: Fix libssh_scp.c code style
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27 15:21:30 +02:00
Anderson Toshiyuki Sasaki
00e5ef1b3c examples: Fix possible memory leak in libssh_scp.c
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27 15:21:30 +02:00
Andreas Schneider
4c47719d98 examples: Reformat authenticaton.c
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20 15:37:23 +02:00
Anderson Toshiyuki Sasaki
f246e31ca0 examples: Fix code style in samplesftp.c
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-18 10:19:59 +02:00
Anderson Toshiyuki Sasaki
7390db6bbb examples: Fixed possible memory leak in samplesftp.c
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-18 10:19:59 +02:00
Andreas Schneider
2b05e46b62 examples: Reformat ssh_client
The example should be clean code if possible.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-31 10:21:06 +02:00
Andreas Schneider
5b07c1aa2c examples: Use ssh_print_hash()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-29 19:04:44 +02:00
Andreas Schneider
a9a99fb31f cmake: Improve compiler flag detection
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-20 18:42:03 +02:00
Andreas Schneider
1d9f548204 examples: Fix function declaration in sshnetcat
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-08-20 18:42:03 +02:00
Andreas Schneider
a19513b87a example: Add missing error checks in ssh_server_fork
CID 1393676

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30 14:37:04 +02:00
Andreas Schneider
8917b84840 examples: Make gobal variables static in scp_download
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30 14:37:04 +02:00
Andreas Schneider
4b0fd10a99 examples: Define LIMIT as unsinged long
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-30 14:37:04 +02:00
Andreas Schneider
5012a9c146 examples: Use new known hosts functions
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-04 11:20:28 +02:00
Andreas Schneider
01994ea302 examples: Build server examples on Linux too
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-11-08 16:28:35 +01:00
Andreas Schneider
2ec633f33d examples: Rename samplessh to ssh-client
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-11-07 15:28:52 +01:00
Andreas Schneider
2e70077bbc examples: Fix fallthrough compiler warnings
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-08-25 10:06:00 +02:00
Andreas Schneider
fa2332354b examples: Reformat usage() function
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05 15:53:20 +01:00
Andreas Schneider
d5068ed07d examples: Fix endif()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-04 14:25:46 +02:00
Andreas Schneider
d4e3401c23 examples: Fix building on FreeBSD
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03 12:12:23 +02:00
Aris Adamantiadis
f8be4d1b3b sample: Migrate client to connector API
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02 16:59:18 +02:00
Andreas Schneider
0faffac020 examples: Do not usre deprecated functions
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02 16:55:29 +02:00
Andreas Schneider
2384236849 cmake: Try to fix FindArgp module
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-17 10:42:52 +01:00
Aris Adamantiadis
5027627344 cmake: detect argp.h on osx 2016-03-14 22:27:06 +01:00
Fabiano Fidêncio
d1d003c232 buffer: use ssh_buffer_get() instead of ssh_buffer_get_begin()
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-19 11:31:08 +01:00
Andreas Schneider
ed6294b4bb examples: Do not include internal headers in ssh_server_fork
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-14 08:04:49 +01:00
Andreas Schneider
96882cc58c example: Fix a use after free in the scp example
CID: #1032343

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05 11:27:09 +02:00
Andreas Schneider
7c79959e94 example: Check return value of ssh_get_fd()
CID: #1199454

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05 11:27:09 +02:00
William Orr
7070117dc3 examples: Use safer names for stdin, stdout, stderr
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>
2015-01-20 19:27:14 +01:00
Andreas Schneider
79d51099ac examples: Fix a bad shift if ssh_get_fd() returns -1.
Found by Coverity.

CID: #1199454
2014-04-14 21:24:28 +02:00
Alan Dunn
491b407d17 examples: Update ssh_server_fork for new SSH_BIND_OPTIONS_HOSTKEY
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-04-09 10:59:21 +02:00
Alan Dunn
5c0c95bd34 examples: Add ECDSA key option to ssh_server_fork
Signed-off-by: Alan Dunn <amdunn@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27 10:06:36 +01:00
Alan Dunn
c82dd2eb81 examples: Add no default keys options to ssh_server_fork
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-03-27 10:06:11 +01:00
Andreas Schneider
c96e862c08 examples: Add missing include for stderr.
This should fix the build on FreeBSD.
2014-02-17 09:20:46 +01:00
Andreas Schneider
7021a46617 cmake: Merge server examples. 2014-02-16 17:59:46 +01:00
Andreas Schneider
c7cb2d0657 examples: Remove old samplesshd-tty. 2014-02-16 17:58:55 +01:00
Andreas Schneider
fd50a4dd9f examples: Remove old samplesshd. 2014-02-16 17:57:09 +01:00
Audrius Butkevicius
afe97d6cab examples: Add ssh_server_fork example
Signed-off-by: Audrius Butkevicius <audrius.butkevicius@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-16 17:52:50 +01:00
Andreas Schneider
2a1cb323f7 examples: Add missing include on FreeBSD. 2014-02-14 10:33:07 +01:00
Andreas Schneider
2fe59071b2 src: Do not use deprecated functions. 2014-01-16 15:27:46 +01:00
Andreas Schneider
09a715b147 example: Add missing include for forkpty(). 2014-01-07 09:03:53 +01:00
Andreas Schneider
d9c5d0767c examples: Fix building samplesshd-tty on FreeBSD. 2013-12-26 09:42:32 +01:00
Andreas Schneider
d61fcbf7b2 examples: Fix else branch.
CID #1127816
2013-11-27 20:16:09 +01:00
Andreas Schneider
aa33d18930 example: Use ssh_get_publickey_hash(). 2013-11-06 17:10:41 +01:00
Aris Adamantiadis
ebf4a03908 examples: fix forktty() warning on OSX 2013-11-03 14:10:04 +01:00
Aris Adamantiadis
4f3ee2fc7e Fix examples compilation on OSX (libargp) 2013-11-03 13:49:27 +01:00
Andreas Schneider
5ba88f01e8 cmake: Rewrote FindGSSAPI.cmake. 2013-07-24 20:48:14 +02:00
Andreas Schneider
61084b76f6 example: Fix a memory leak on error in tty server.
CID: #1032746
2013-07-24 17:38:27 +02:00
Andreas Schneider
e1576ef55a cmake: Don't build examples on Windows but on Unix. 2013-07-23 10:44:51 +02:00
Andreas Schneider
df81a05505 cmake: Check for unistd.h. 2013-07-23 10:44:51 +02:00
Andreas Schneider
2c9808daf8 example: Fix location of port definition.
It shouldn't be inside #ifdef HAVE_ARGP.
2013-07-22 10:42:30 +02:00
Andreas Schneider
351e4107ed examples: Check return value of fstat().
CID #743297
2013-07-14 15:02:11 +02:00
Andreas Schneider
776ff528df examples: Make sure we have a valid scp pointer.
CID #1032343
2013-07-14 15:02:11 +02:00
Andreas Schneider
483ba8100f examples: Check return value of ssh_event_dopoll().
CID #0
2013-07-14 15:02:08 +02:00
Andreas Schneider
e3b4f27aa9 examples: Remove ssh_log from ssh client example. 2013-07-14 13:35:25 +02:00
Aris Adamantiadis
6ad80bb4b2 examples: fix warning 2013-07-14 11:18:13 +02:00
Aris Adamantiadis
e95e3b5736 examples: fix compilation warnings 2013-07-14 09:32:19 +02:00
Andreas Schneider
1663917f71 cmake: Make GSSAPI optional. 2013-07-13 15:48:49 +02:00
Aris Adamantiadis
47a4eea827 examples: fix with new gssapi cb API
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 15:23:33 +02:00
Aris Adamantiadis
e809fa881e examples: adapt samplesshd-cb to new callback
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:54:15 +02:00
Aris Adamantiadis
52d9e15c25 examples: adapt to the new callback format
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
9bdb546852 Examples: Exemple of an SSH proxy
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:51:00 +02:00
Aris Adamantiadis
65eccf1969 gssapi: retrieve forwarded (delegated) tickets
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:50:56 +02:00
Aris Adamantiadis
7cb6b15aaa auth: implement client-side gssapi
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:41:20 +02:00
Aris Adamantiadis
212261bb10 examples:Compile samplessh on bsd too
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:25:32 +02:00
Aris Adamantiadis
6bb5063046 example: adapt example for gssapi callback
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:19:23 +02:00
Aris Adamantiadis
a34ad5825b Added server example with callbacks impl
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:10:03 +02:00
Aris Adamantiadis
4497cd9b43 Make examples more BSD friendly
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:08:44 +02:00
Aris Adamantiadis
2b54db7603 Try to find ARGP on solaris, BSD
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13 14:07:46 +02:00
Andreas Schneider
89be6d0309 examples: Check return value of fileno(). 2013-06-19 12:32:10 +02:00
Andreas Schneider
de4cb811a0 examples: Fix a possible memory leak. 2013-06-19 12:16:57 +02:00
Andreas Schneider
abb25861e5 examples: Fix a possible memory leak. 2013-06-19 12:14:25 +02:00
Andreas Schneider
59dcebd604 sample: Fix a possible buffer overrun. 2013-06-17 13:27:40 +02:00
Andreas Schneider
d93e38bbfe examples: Check return value of ssh_channel_read. 2013-06-17 12:35:42 +02:00
Andreas Schneider
a03d8f49fb examples: Fix a use after free in scp example. 2013-06-13 10:55:12 +02:00
Andreas Schneider
87036839f9 example: Simplify auth_callback of the client.
Found by Coverity.
2012-10-09 11:09:34 +02:00
Andreas Schneider
ca74d91d50 example: Clear the password. 2012-10-07 21:49:45 +02:00
Andreas Schneider
c078e36219 example: Fix a build warning. 2012-10-07 10:56:10 +02:00
Andreas Schneider
387d9e4855 examples: Fix sparse warnings in sshd examples. 2012-02-19 13:26:03 +01:00
Andreas Schneider
2ca0a9cdb2 examples: Make variabes static in client sample.
Fixes sparse warnings.
2012-02-19 13:26:03 +01:00
Andreas Schneider
29ad0d19f9 examples: Make variables static in scp example.
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
c31004442a examples: Make variables static in scp example.
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Anthony VEREZ
9e5b3914de examples: Fix PTY allocation error. 2012-01-30 09:48:01 +01:00
Aris Adamantiadis
7f5206b8ac sample: fix ssh_channel_read 2011-09-02 11:43:11 +03:00
Andreas Schneider
89253fd22a auth: Make ssh_userauth_autopubkey legacy. 2011-08-25 10:19:09 +02:00
Andreas Schneider
15ebbad146 examples: Fix permissions of the file we copy.
Thanks to Baptiste Marchand.
2011-08-03 22:21:43 +02:00
Oliver Stöneberg
525324b2f9 examples: Use the right cleanup functions. 2011-05-17 14:20:48 +02:00
Oliver Stöneberg
a73459171b examples: Removed unnecessary \n from ssh_log() calls in samplessh. 2011-05-01 19:33:26 +02:00
Oliver Stöneberg
c3849a3cfd examples: Fixed memory leak in samplessh when using commands. 2011-05-01 19:33:09 +02:00
Andreas Schneider
644145a88c examples: Fix some memory leaks. 2011-04-15 19:05:53 +02:00
Andreas Schneider
3e7d4534ce examples: Call correct functions on exit. 2011-04-14 14:16:58 +02:00
Andreas Schneider
633d6532be example: Use const in auth_password from samplesshd. 2011-03-10 11:23:45 +01:00
milo
000d659ea2 examples: Added a event context based sshd example. 2011-02-20 14:37:43 +01:00
milo
cc76a192df New example server for kbdint authentication. 2011-02-10 14:39:58 +01:00
Andreas Schneider
5144f390ca examples: Fixed build warning. 2011-02-08 19:36:44 +01:00
Andreas Schneider
ac785e0aa3 examples: The exec example should be like tutorial one. 2011-02-08 10:54:25 +01:00