Meng Tan
e005fd310f
Fix ssh_event_add_session() when session socket has two pollhandlers
...
Signed-off-by: Meng Tan <mtan@wallix.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-04-10 11:20:52 +02:00
Axel Eppe
fb2fefb3c6
channels: add ssh_channel_request_send_break to support RFC 4335
...
Signed-off-by: Axel Eppe <aeppe@google.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-04-10 11:16:23 +02:00
Andreas Schneider
6026fc8036
cmake: Fix libfuzzer linking with clang6
...
This is always available using -fsanitize=fuzzer now.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-04-10 11:13:57 +02:00
Andreas Schneider
2cc5b5865c
kex1: Use new dh pubkey import functions
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-28 10:20:54 +02:00
Andreas Schneider
8d65edb41f
kex1: Fix building with OpenSSL 1.1+
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-28 10:20:32 +02:00
Andreas Schneider
1247ba3398
channels1: Add missing config.h include
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-28 10:11:45 +02:00
Alberto Aguirre
be22c0d442
Add a NODELAY option
...
Add a new option SSH_OPTIONS_NODELAY to enable or disable the
Nagle Algorithm (TCP_NODELAY) on the session socket.
Improved performance can be achieved for some applications like
sftp servers by enabling SSH_OPTIONS_NODELAY as typically, the
next request won't arrive until the server replies, which are
typically small writes.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-21 20:44:04 +01:00
Andreas Schneider
467d78a442
tests: Fix mixed code compiler warning in torture_rand
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-21 20:41:16 +01:00
Andreas Schneider
a4aeee972c
torture: Increase wait time for the sshd process to exit
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-21 20:40:04 +01:00
Andreas Schneider
16217454d5
crypto: Change the type of server_pubkey to ssh_key
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-21 20:40:02 +01:00
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
Alberto Aguirre
dd20253fec
tests: fix OSX build errors when enabling tests
...
Fix OSX build error about embedding a directive within macro arguments.
Apparently, snprintf is implemented as a macro on that platform.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-11 22:54:47 +01:00
Alberto Aguirre
85ab4ee53a
connector: ensure channel callbacks are removed
...
ssh_connector_free fails to remove the in/out channel callbacks
as ssh_connector_remove_event sets the in/out channel variables
to NULL.
Have ssh_connector_free, remove the channel callbacks first before
invoking ssh_connector_remove_event.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-07 15:48:04 +01:00
Alberto Aguirre
25f31760aa
connector: Check for POLLHUP on in_fd
...
POLLHUP needs to be checked on in_fd, which may be a pipe.
A pipe in Linux signals EOF through POLLHUP (see:
http://www.greenend.org.uk/rjk/tech/poll.html )
Without checking POLLHUP, a client could spin up indefinetely
doing ssh_event_dopoll.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-07 15:47:03 +01:00
Juraj Vijtiuk
d11869bdb6
pki: Add mbedTLS ECDSA key comparison support
...
Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-03-07 15:44:05 +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
Andreas Schneider
bba40abc76
priv: Fix explicit_bzero macro if we pass a function
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-22 16:28:24 +01:00
Alberto Aguirre
0c12643466
sftp: Remove stray semi-colon in sftp.h header
...
The stray semi-colon in sftp.h is flagged when using -pedantic
which affects clients that include the header and use -pedantic
and -Werror on their codebase.
Signed-off-by: Alberto Aguirre <albaguirre@gmail.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-22 16:28:24 +01:00
Andreas Schneider
1319d2ceb2
cmake: Mark LIBSSH_LIBRARIES and LIBSSH_INCLUDE_DIR as advanced
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-16 16:52:02 +01:00
Andreas Schneider
cc1f496741
pki: Use explicit_bzero() to wipe privkey in memory
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-16 16:51:37 +01:00
jvijtiuk
963111b836
tests: Fix segfault with mbedTLS built without threading support
...
torture_rand and torture_server_x11 call ssh_init without checking
the return value. If mbedTLS is built without threading support
ssh_init fails but the tests continue and then segfault since threading
wasn't correctly initialised.
Add a section that documents requirements for mbedTLS usage in a
multi threaded environment to README.mbedtls.
Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-12 20:05:49 +01:00
Andreas Schneider
ebcff9fd63
src: Use explicit_bzero() if available on the platform
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-12 14:41:27 +01:00
Andreas Schneider
25ff1214a4
cmake: Build ssh_server_fuzzer if enabled
...
Fixes T67
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-04 11:52:45 +01:00
Alex Gaynor
d84b0926f0
tests: Added a fuzzer for the server
...
Fixes T67
Signed-off-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-02-04 11:51:58 +01:00
Meng Tan
f19158cadf
Set channel as bound when accepting channel open request
...
Signed-off-by: Meng Tan <mtan@wallix.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-02-01 18:23:38 +01:00
Andreas Schneider
459677e20e
libssh: Bump the version to 0.7.90
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-29 20:43:35 +01:00
Andreas Schneider
43bd7b6eee
dh: Use calloc() instead of malloc()
2018-01-18 18:57:18 +01:00
Andreas Schneider
d7c47f529f
pki_gcrypt: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:55:52 +01:00
Andreas Schneider
2cff66c155
threads: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:55:04 +01:00
Andreas Schneider
78ce67f579
sftpserver: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:54:18 +01:00
Andreas Schneider
2fb8198c48
server: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:53:35 +01:00
Andreas Schneider
2ea3683347
kex: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:52:04 +01:00
Andreas Schneider
aaeb938ca4
channels: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:52:04 +01:00
Andreas Schneider
ef4a81ea0c
auth: Use calloc() instead of malloc()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18 18:52:00 +01:00
Andreas Schneider
e9073a6bdb
torture_pki_ed25519: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
9086d5ca33
torture_pki_ecdsa: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
3c65057fad
torture_key: Add ecdsa keys with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
f9b1dece41
torture_pki_dsa: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
f7a2330de7
torture_pki_rsa: Add tests for private key with passphrase
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
67b8f3d6df
pki_crypto: Fix private key generation with password
...
We need to specify a cipher when we generate a key with a password.
OpenSSH uses aes_128_cbc, so we should use the same.
Thanks to Julian Lunz for the report.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
b0af812710
tests: Move torture keys to own file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
d13a17a27c
cmake: Move ed25519 tests into unix part
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
ddfc36aa56
tests: Move rsa tests to own test file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
a5997d180d
tests: Remove obsolete setup_both_keys()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
51875db70c
tests: Move ed25519 functions to the right file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:31:02 +01:00
Andreas Schneider
5ad7da7fd2
tests: Move ecdsa tests to own test file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:27:52 +01:00
Andreas Schneider
59308bc269
tests: Move dsa tests to own test file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:27:52 +01:00
Andreas Schneider
fd2ef07f37
tests: Move helper functions to a common file
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:24:11 +01:00
Andreas Schneider
e19163eabb
libgcrypt: Add missing config.h include
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-10 22:24:11 +01:00