aboutsummaryrefslogtreecommitdiff
path: root/src/kex.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-19cleanup: use ssh_ prefix in the packet (non-static) functionsFabiano Fidêncio1-1/+1
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19cleanup: use ssh_ prefix in the kex (non-static) functionsFabiano Fidêncio1-4/+4
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19cleanup: use ssh_ prefix in the dh (non-static) functionsFabiano Fidêncio1-3/+3
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19cleanup: use ssh_ prefix in the buffer (non-static) functionsFabiano Fidêncio1-9/+9
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-16kex: Fix zlib compressionAndreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-15kex: Prefer sha2 over sha1Andreas Schneider1-5/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-06-24kex: Add comments to #if clausesAndreas Schneider1-6/+10
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05kex: also compare host keys for 'first_kex_packet_follows'Jon Simons1-21/+23
Also consider the host key type at hand when computing whether a 'first_kex_packet_follows' packet matches the current server settings. Without this change libssh may incorrectly believe that guessed settings which match by kex algorithm alone fully match: the host key types must also match. Observed when testing with dropbear clients. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02kex: Add support for ed25519 on client connections.Aris Adamantiadis1-4/+12
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-01-26kex: disable des-cbc-ssh1 by defaultAris Adamantiadis1-4/+6
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-12-17CVE-2014-8132: Fixup error path in ssh_packet_kexinit()Jon Simons1-1/+6
Before this change, dangling pointers can be unintentionally left in the respective next_crypto kex methods slots. Ensure to set all slots to NULL in the error-out path. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-08-06buffer: adapt kex.c to new ssh_buffer_(un)pack()Aris Adamantiadis1-11/+13
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-06kex: NULL checks for 'first_kex_packet_follows'Jon Simons1-11/+17
Add NULL checks to 'is_first_kex_packet_follows_guess_wrong' to ensure that a 'strdup(NULL)' path can not be taken. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-22Add negotiation for SHA2 HMAC algorithmsDirkjan Bussink1-4/+4
BUG: https://red.libssh.org/issues/91 Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-22kex: server fix for first_kex_packet_followsJon Simons1-64/+151
Ensure to honor the 'first_kex_packet_follow' field when processing KEXINIT messages in the 'ssh_packet_kexinit' callback. Until now libssh would assume that this field is always unset (zero). But some clients may set this (dropbear at or beyond version 2013.57), and it needs to be included when computing the session ID. Also include logic for handling wrongly-guessed key exchange algorithms. Save whether a client's guess is wrong in a new field in the session struct: when set, the next KEX_DHINIT message to be processed will be ignored per RFC 4253, 7.1. While here, update both 'ssh_packet_kexinit' and 'make_sessionid' to use softabs with a 4 space indent level throughout, and also convert various error-checking to store intermediate values into an explicit 'rc'. Patch adjusted from original to ensure that client tests remain passing (ie 'torture_connect'): restrict the changes in 'ssh_packet_kexinit' only for the 'server_kex' case. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-15Revert "kex: server fix for first_kex_packet_follows"Andreas Schneider1-149/+64
The patch breaks the client with ECDSA. This reverts commit 5865b9436fda96ac9fc7c18e4dffe5fb12dcc515.
2014-04-10kex: server fix for first_kex_packet_followsJon Simons1-64/+149
Ensure to honor the 'first_kex_packet_follow' field when processing KEXINIT messages in the 'ssh_packet_kexinit' callback. Until now libssh would assume that this field is always unset (zero). But some clients may set this (dropbear at or beyond version 2013.57), and it needs to be included when computing the session ID. Also include logic for handling wrongly-guessed key exchange algorithms. Save whether a client's guess is wrong in a new field in the session struct: when set, the next KEX_DHINIT message to be processed will be ignored per RFC 4253, 7.1. While here, update both 'ssh_packet_kexinit' and 'make_sessionid' to use softabs with a 4 space indent level throughout, and also convert various error-checking to store intermediate values into an explicit 'rc'. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-03-27kex: enable more ECDSA hostkey algosJon Simons1-1/+1
Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-02-05knownhosts: resolve leaks found by coverityAris Adamantiadis1-1/+3
2014-02-04knownhosts: detect variations of ecdsaAris Adamantiadis1-23/+49
2014-02-02Kex: fix coverity warning + edge caseAris Adamantiadis1-4/+8
2014-02-01Knownhosts: implement hostkey with knownhosts heuristicAris Adamantiadis1-1/+24
2014-01-19src: Rename buffer_add_data() to ssh_buffer_add_data().Andreas Schneider1-1/+1
2014-01-19src: Rename buffer_init to ssh_buffer_init().Andreas Schneider1-2/+2
2013-09-27kex: implement curve25519-sha256@libssh.orgAris Adamantiadis1-2/+12
2013-07-14src: Remove enter_function() and leave_function().Andreas Schneider1-16/+4
2013-07-14src: Migrate to SSH_LOG.Andreas Schneider1-4/+4
2013-06-13kex: Fix a double free.Andreas Schneider1-0/+1
2012-12-23Implement key re-exchangeAris Adamantiadis1-1/+4
2012-10-12kex: Use getter functions to access kex arrays.Andreas Schneider1-4/+20
This should fix the build on OpenIndiana.
2012-10-12kex: Don't compare an array to null.Andreas Schneider1-4/+4
Found by Coverity.
2012-10-07kex: Fix supported methods index.Andreas Schneider1-5/+4
2012-09-25kex: Fix simpledes with gcrypt.Andreas Schneider1-21/+21
2012-09-07kex: Add simple DES support for SSHv1.Dmitriy Kuznetsov1-0/+2
2012-09-04dh: Add support for diffie-hellman-group14-sha1.Dmitriy Kuznetsov1-2/+4
2012-02-05session: Use a struct for all options.Andreas Schneider1-1/+1
2012-02-04pki: Make a strcmp better readable.Andreas Schneider1-1/+1
2012-02-04kex: Add support for ecdsa hostkeys.Andreas Schneider1-2/+4
2012-02-04kex: Add a define for the kex method size.Andreas Schneider1-16/+19
2011-11-10kex: Fix some build warnings.Andreas Schneider1-1/+1
2011-09-23build: Fix zlib support.Andreas Schneider1-1/+1
2011-09-18gzip: Fix zlib support.Andreas Schneider1-1/+1
2011-09-18priv: Move kex functions to kex header.Andreas Schneider1-5/+5
2011-09-18kex: moved KEX structures to ssh_crypto_structAris Adamantiadis1-18/+19
2011-09-18kex: split key selection and sendingAris Adamantiadis1-42/+39
2011-09-11kex: Fix includes.Andreas Schneider1-4/+0
2011-09-10kex: Split out SSHv1 functions to kex1.c.Andreas Schneider1-436/+2
2011-08-22kex: Move ssh_encrypt_rsa1 to SSHv1 kex code.Andreas Schneider1-0/+66
2011-08-06session: Fix timeout handling.rofl0r1-2/+2
-2 now means to use the timeout specified in options. It wasn't used earlier and poll only knows -1 and 0 anyway for special meanings.
2011-06-13[crypto] initial support for ecdh-sha2-nistp256Aris Adamantiadis1-3/+15
Works with openssl Still requires work for libgcrypt and other modes