Andreas Schneider
9fbbdcc154
messages: Rework ssh_message_queue()
...
Return early and make it easier to understand.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
b9ac61d5a3
messages: Use calloc in ssh_message_new()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
ca425ebe67
messages: Make ssh_message_queue() static
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
7e6b540277
exmpales: Init rc in ssh_server_fork
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
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
fb70d0fb41
pki: Add NULL check in ssh_pki_key_ecdsa_name()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
f8b70d6a73
pki_crypto: Mark iqmp as unused
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
74888a6fa4
pki: Remove superfluous statement
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
729384f346
pki: Add log message on error in ssh_pki_openssh_import()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
7e5291668c
gssapi: Check return code of gss_indicate_mechs()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
bb081f6681
gssapi: Ignore return codes of gss_release_buffer()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
8a3ea3bdd5
packet: Do not segfault if we don't have packet_second_block
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
a190ff9302
packet: Add missing null pointer check in ssh_packet_socket_callback()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
2e7e0ad6c9
wrapper: Fix size type and loops in crypt_set_algorithms_server()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
39b08af2e8
wrapper: Reformat crypt_set_algorithms2()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
60a3796041
messages: Log message if callback for window change fails
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
cc4f220fd3
messages: Log message if sending reply fails
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
bc72ec5821
messages: Some cleanup for ssh_packet_service_request
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
54ec81db2d
messages: Reformat ssh_packet_service_request()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
1ec2ca4202
connect: Zero the origfds struct
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
2fad391456
client: Remove superfluous strlen()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
cde13b0f00
channels: Check return code of ssh_packet_send()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
8f31623947
channels: Reformat ssh_channel_send_eof()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
253bda4bac
channels: Check return of ssh_buffer_unpack()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
480915c07d
libsshpp: Pass username and submethods to ssh_userauth_kbdint()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
e27c6b21b5
include: Fix HAVE_<FEATURE> checks in pki.h
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
f65c00f39d
cmake: Fix -Wattributes check in ConfigureChecks.cmake
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Andreas Schneider
1d33a4424d
gitlab-ci: Fix -DWITH_PCAP=ON
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-24 09:48:35 +02:00
Jakub Jelen
0386e088eb
tests: Verify we can authenticate using ed25519 key
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
e91bb29e9d
tests: Global known_hosts are used for host key verification
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
f622c4309b
knownhosts: Consult also the global known hosts file
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
ae6b0e0f49
options: Set the global known_hosts file
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
bdb3bb9ccd
tests: Verify the hostkey ordering for negotiation is correct
...
Previously, not all of the host keys algorithms were used for algorithm
negotiation. This verifies the algorithms list is sane and ordered
with the key types from known hosts in the first place.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
32e502a79d
tests: Generate valid known_hosts file, fixing the current test
...
Previously, the file contained the known_hosts strings separated
by NULL bytes which somehow magically worked.
The test was also expecting all the keys from the file will have
the same key type, which was not indeed true.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
6ec5a08639
tests: Verify the ecdsa key types are handled correctly
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:20 +02:00
Jakub Jelen
35a6455489
kex: Use all supported hostkey algorithms for negotiation
...
Previously, only the algorithms we had a keys for in known_hosts
were used, which could lead to no-matching algorithms errors if the
one key we used to depend on was removed from the server.
This commit adds also the other algorithms, but lists them only after
all the key types we have in known_hosts file.
Resolves: T105
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:43:17 +02:00
Jakub Jelen
c1a8c41c5d
kex: Honor more host key algorithms than the first one (ssh-ed25519)
...
The code as it was written used only the first algorithm from
preferred_hostkeys array and compared it with the list returned
from the known hosts.
This commit is fixing the code so we actually compare each of the
algorithms from both of the lists and returns the intersection.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:42:55 +02:00
Jakub Jelen
893b69d82b
knownhosts: Use the correct name for ECDSA keys for host key negotiation
...
The conversion from ssh_keytype_e to string does not work for ECDSA keys,
because different key lengths have different string representation.
The usage of type_c should work also for every other key type in future,
but it does not reflrect different signature types (SHA2 extension for RSA
keys), but this early in the key exchange phase, we can not make any
assumptions about supported extensions by the server.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:42:55 +02:00
Jakub Jelen
9285e8516b
tests: Do not trace sshd
...
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:42:55 +02:00
Andreas Schneider
91f35eca4d
libsshpp: Use ssh_session_update_known_hosts()
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 17:42:02 +02:00
Andreas Schneider
49e287006f
tests: Add option tests for global and user specific known_hosts
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 12:31:04 +02:00
Andreas Schneider
85fc0d5b83
options: Add support for getting the known_hosts locations
...
Fixes T111
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 12:31:04 +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
9c200d3ef4
messages: Check that the requested service is 'ssh-connection'
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 12:31:04 +02:00
Meng Tan
4ea46eecce
server: Set correct state after sending INFO_REQUEST (Kbd Interactive)
...
Signed-off-by: Meng Tan <mtan@wallix.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-19 10:20:53 +02:00
Andreas Schneider
009ca5c9dd
priv: Add ssize_t if not available with MSVC
...
Fixes T113
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Tested-by: Wolf Wolfswinkel <wolf.wolfswinkel@objectplus.nl>
2018-10-17 15:37:28 +02:00
Andreas Schneider
fe618a35dc
packet: Add missing break in ssh_packet_incoming_filter()
...
CID 1396239
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-17 08:19:23 +02:00
Andreas Schneider
795389ae1b
src: Fix typos
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-16 16:36:20 +02:00
Andreas Schneider
60037f3275
Bump ABI to 4.7.1
...
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-16 09:24:39 +02:00
Anderson Toshiyuki Sasaki
e1548a71bd
CVE-2018-10933: Add tests for packet filtering
...
Created the test torture_packet_filter.c which tests if packets are
being correctly filtered.
Fixes T101
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-16 09:19:03 +02:00