1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00
Commit Graph

57 Commits

Author SHA1 Message Date
Alberto Aguirre
7e1e0e5098 misc: Use SecureZeroMemory if available for explicit_bzero
Useful on Windows platforms where SecureZeroMemory is available.

Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-11 22:58:49 +01:00
Alberto Aguirre
3fa0e3959c misc: Use memset_s if available for explicit_bzero
Useful on OSX where memset_s is available.

Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-11 22:58:13 +01:00
Andreas Schneider
81847bf513 priv: Implement explicit_bzero as a function if not available
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Alberto Aguirre <albaguirre@gmail.com>
2018-03-02 18:07:42 +01:00
Juraj Vijtiuk
778652460f add mbedtls crypto support
Summary:
This patch adds support for mbedTLS as a crypto backend for libssh.
mbedTLS is an SSL/TLS library that has been designed to mainly be used
in embedded systems.  It is loosely coupled and has a low memory
footprint.  mbedTLS also provides a cryptography library (libmbedcrypto)
that can be used without the TLS modules.
The patch is unfortunately quite big, since several new files had to
be added.
DSA is disabled at compile time, since mbedTLS doesn't support DSA
Patch review and feedback would be appreciated, and if any issues or
suggestions appear, I'm willing to work on them.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>

Test Plan:
* The patch has been tested with a Debug and MinSizeRel build, with
libssh unit tests, client tests and the pkd tests.
* All the tests have been run with valgrind's memcheck, drd and helgrind
tools.
* The examples/samplessh client works when built with the patch.

Reviewers: asn, aris

Subscribers: simonsj

Differential Revision: https://bugs.libssh.org/D1
2017-12-28 11:17:39 +01:00
Aris Adamantiadis
f818e63f8f Add new options
Pair-Programmed-With: Jakub Jelen <jjelen@redhat.com>
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be>
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2017-12-15 12:00:49 +01:00
Jon Simons
380390c4b6 misc: relax fatal errors in ssh_analyze_banner
Relax the cases where `ssh_analyze_banner` fails to extract a
major and minor version from banners which appear like OpenSSH
banners.

Update the tests to demonstrate that now a banner as might be
sent by `ssh-keyscan(1)` ("SSH-2.0-OpenSSH-keyscan") no longer
returns failure.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2017-07-18 09:32:31 +02:00
Jon Simons
a89a67e008 misc: fix error-checking in ssh_analyze_banner
Fix error-checking for `strtoul` in `ssh_analyze_banner`, and
enable some tests which demonstrate the fix before-and-after.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2017-07-13 19:35:34 +02:00
Jon Simons
a97db12f4f misc: reindent ssh_analyze_banner, update docs
No changes to code, only whitespace indentation and
an update to the function docs.

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2017-07-13 19:34:57 +02:00
Andreas Schneider
0cb2974bd8 misc: Use strtoul in ssh_analyze_banner()
Thanks to Tilo Eckert.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-06-28 12:29:53 +02:00
Andreas Schneider
c50f2d1356 misc: Do not fall through and return a value
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-06-06 10:25:15 +02:00
Andreas Schneider
d5d8349224 misc: Validate integers converted from the SSH banner
BUG: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1181

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-04-21 11:02:29 +02:00
Andreas Schneider
52efbc3a23 misc: Use simpler macros for htonll and ntohll
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-07 09:39:19 +01:00
Andreas Schneider
5d1a8cd88b cmake: Check for io.h on Windows
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06 11:57:52 +01:00
Andreas Schneider
528b9c5323 cmake: Correctly check for sys/[u]time.h
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06 11:52:12 +01:00
Andreas Schneider
ef751a26d0 misc: Correctly guard the sys/time.h include
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24 17:13:19 +02:00
Joseph Southwell
6bbdaceaca src: Define MAX_BUF_SIZE globally and use it.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-02 22:19:46 +01:00
Andreas Schneider
6fe51b13fb src: Update my mail address. 2014-01-07 16:08:23 +01:00
Andreas Schneider
c4937cedea misc: Use the szPath variable instead of calling getenv. 2013-07-16 13:36:52 +02:00
Andreas Schneider
ebdd0c6ac1 src: Migrate to SSH_LOG. 2013-07-14 12:44:26 +02:00
Andreas Schneider
bd3acae4f3 CVE-2012-4560: Fix a write one past the end of 'buf'. 2012-11-14 17:36:24 +01:00
Andreas Schneider
894bbf3137 CVE-2012-4560: Fix a write one past the end of the 'u' buffer. 2012-11-14 17:36:24 +01:00
Andreas Schneider
e04dc45f20 misc: Use a fixed buffer for getenv(). 2012-10-12 14:45:54 +02:00
Andreas Schneider
a660177a6e misc: Use strncpy instead of strcat.
This is just hardening the code.

Found by Coverity.
2012-10-12 14:45:36 +02:00
Andreas Schneider
191faea325 misc: Use size_t for len. 2012-10-07 18:06:33 +02:00
Andreas Schneider
61d032fc03 misc: Don't leak memory on ssh_path_expand_escape() on error. 2012-10-05 11:12:13 +02:00
Andreas Schneider
66aaa6f573 misc: Improve byte swapping of ntohll().
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
3582e386b7 misc: Fix definitions of ssh_list_new().
Fixes sparse warnings.
2012-02-19 13:26:02 +01:00
Andreas Schneider
ee774479de session: Use a struct for all options. 2012-02-05 11:50:49 +01:00
rofl0r
4305da29a1 session: Cleanup timeout functions.
It is possible that we get unrelated packets while waiting for
termination, thus waiting indefinitely. As a workaround we have to
check the user-supplied timeout.
2012-01-02 12:39:43 +01:00
Andreas Schneider
6859e4f4ec build: Fix zlib support. 2011-09-23 22:57:21 +02:00
Andreas Schneider
dc42a1757f gzip: Fix zlib support. 2011-09-18 21:37:18 +02:00
Aris Adamantiadis
20f8e73e3e Update libssh to ssh_handle_packets_termination
cherry-picked from 0cb5248

Should resolve all timeout problems

Conflicts:

	src/auth.c
	src/channels.c
2011-09-02 13:58:37 +03:00
Aris Adamantiadis
6d8bb956c5 channels: replaced bugged lists with ssh_list
cherry-picked from 0aef5f
Conflicts:

	src/session.c
2011-09-02 13:46:10 +03:00
Andreas Schneider
6c03b7a9c9 misc: Add ssh_match_group(). 2011-08-22 16:16:34 +02:00
Andreas Schneider
ddcb88070b misc: Remove session from ssh_get_local_username(). 2011-08-16 23:04:25 +02:00
rofl0r
c31cac93f3 misc: Fix ssh_timeout_update(). 2011-08-06 11:08:38 +02:00
Aris Adamantiadis
54fb43358c Workaround ssh_get_user_home_dir on LDAP users 2011-07-13 12:04:46 +02:00
Andreas Schneider
640e3830f2 build: Check for ntohll().
This function is available on AIX.
2011-06-06 18:56:30 +02:00
Andreas Schneider
ba03388031 misc: Fix compilation on Windows. 2011-05-26 11:20:04 +02:00
Andreas Schneider
07fb895fe9 cmake: Fix detection of clock_gettime. 2011-05-25 22:08:31 +02:00
Aris Adamantiadis
65282841e2 Replace clock_gettime with gettimeofday when missing 2011-05-25 21:27:48 +02:00
Aris Adamantiadis
59f7647cd9 Introduced ssh_timeout_elapsed functions
Functions to mesure elapsed time before and after a serie of
calls. Introduces a dependancy to clock_gettime() and librt,
hope this doesn't break anything. Porting to gettimeofday() should
not be too hard.
2011-05-24 23:26:18 +02:00
Oliver Stöneberg
166ee451c5 build: Fixed some VS2010 problems. 2011-04-11 11:18:57 +02:00
Andreas Schneider
eea1df3574 misc: Fixed ssh_is_ipaddr_v4() on Windows. 2011-02-13 17:36:45 +01:00
Andreas Schneider
cd30a1d4b1 misc: Added working ssh_is_ipaddr for Windows. 2011-02-13 11:56:47 +01:00
Andreas Schneider
d1ddec00d9 misc: Fixed ssh_is_ipaddr on FreeBSD. 2011-02-13 10:32:47 +01:00
Andreas Schneider
b313fa944a misc: Added ssh_is_ipaddr() function. 2011-02-12 19:08:59 +01:00
Aris Adamantiadis
7fbb926c0b Fix getpwuid_r on opensolaris 2011-01-11 17:55:12 +01:00
Andreas Schneider
1b88542fbe misc: Avoid redefine of _WIN32_IE. 2011-01-01 18:43:37 +01:00
Andreas Schneider
a0e98f585a misc: Fixed a possible memory leak. 2010-12-27 18:08:30 +01:00