aboutsummaryrefslogtreecommitdiff
path: root/src/server.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-06doc: Improve documentation for ssh_set_auth_methods()Andreas Schneider1-6/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19cleanup: use ssh_ prefix in the packet (non-static) functionsFabiano Fidêncio1-12/+12
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-8/+8
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-5/+5
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-24crypto: move key setup in newkeys handlerAris Adamantiadis1-0/+8
2015-08-18server: Fix return code check of ssh_buffer_pack()Andreas Schneider1-1/+1
Thanks to Andreas Gutschick <andreas.gutschick@mitel.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-05-05server: return SSH_OK for ignored SSH_MSG_KEXDH_INIT caseJon Simons1-0/+1
Return SSH_OK for the case that an incoming SSH_MSG_KEXDH_INIT should be ignored. That is, for the case that the initial 'first_kex_packet_follows' guess is incorrect. Before this change sessions served with libssh can be observed to error out unexpectedly early when testing with dropbear clients that send an incompatible guess. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-04-23CVE-2015-3146: Fix state validation in packet handlersAris Adamantiadis1-3/+5
The state validation in the packet handlers for SSH_MSG_NEWKEYS and SSH_MSG_KEXDH_REPLY had a bug which did not raise an error. The issue has been found and reported by Mariusz Ziule. Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-02server: Add support for ed25519 keys in the server.Aris Adamantiadis1-2/+12
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-10-02server: fix auth_interactive_request replyJon Simons1-1/+1
Fix a missing 'buffer_pack' formatter in 'ssh_message_auth_interactive_request'. With this fix the 'examples/samplesshd-kbdint' program is working again for me. Signed-off-by: Jon Simons <jon@jonsimons.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-08-06buffers: adapt server.c to ssh_buffer_(un)pack()Aris Adamantiadis1-178/+108
Signed-off-by: Andreas Schneider <asn@samba.org>
2014-04-22kex: server fix for first_kex_packet_followsJon Simons1-0/+9
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-9/+0
The patch breaks the client with ECDSA. This reverts commit 5865b9436fda96ac9fc7c18e4dffe5fb12dcc515.
2014-04-10kex: server fix for first_kex_packet_followsJon Simons1-0/+9
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-12server: silence build warningLuka Perkov1-0/+1
The commit fixes this build warning: ==== src/server.c:223:8: warning: ‘privkey’ may be used uninitialized in this function [-Wmaybe-uninitialized] rc = ssh_pki_export_privkey_to_pubkey(*privkey, &pubkey); ^ src/server.c:243:11: note: ‘privkey’ was declared here ssh_key privkey; ==== Signed-off-by: Luka Perkov <luka.perkov@sartura.hr> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-01-19src: Rename buffer_init to ssh_buffer_init().Andreas Schneider1-3/+3
2014-01-07update copyright informationAris Adamantiadis1-1/+1
2013-11-24server: Add a ssh_send_keepalive() function.Nicolas Viennot1-0/+41
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-11-09server: Fix malloc call.Andreas Schneider1-1/+1
2013-09-27kex: implement curve25519-sha256@libssh.orgAris Adamantiadis1-0/+6
2013-07-14src: Remove enter_function() and leave_function().Andreas Schneider1-14/+5
2013-07-14src: Migrate to SSH_LOG.Andreas Schneider1-20/+20
2013-07-13Server: fix rekeyingAris Adamantiadis1-21/+25
2013-07-13Doc: fix a few broken parametersAris Adamantiadis1-2/+2
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-07-13server: move message-specific call to ssh_*Aris Adamantiadis1-17/+40
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2013-06-13server: Fix a double free.Andreas Schneider1-4/+1
2012-12-19Fix an invalid strlen comparison in ssh_message_auth_reply_defaultAndrew Collins1-1/+1
During the transition to strncat in ssh_message_auth_reply_default, an invalid strlen comparison was added which causes the function to fail whenever it's called. Signed-off-by: Andrew Collins <bsderandrew@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2012-10-12kex: Use getter functions to access kex arrays.Andreas Schneider1-1/+1
This should fix the build on OpenIndiana.
2012-10-12server: Use strncat instead of strcat.Andreas Schneider1-4/+12
This is just hardening the code. Found by Coverity.
2012-10-12server: Don't leak memory on calling ssh_string_from_char().Andreas Schneider1-8/+32
Also check the return values. Found by Coverity.
2012-10-12server: Fix for loop to free server methods.Andreas Schneider1-1/+1
Found by Coverity.
2012-10-07server: Removed unused variable keytype in the ecdsa case.Andreas Schneider1-2/+0
2012-09-04dh: Add support for diffie-hellman-group14-sha1.Dmitriy Kuznetsov1-0/+1
2012-02-19server: Add ecdsa hostkey support.Andreas Schneider1-12/+43
2012-02-05session: Use a struct for all options.Andreas Schneider1-4/+4
2011-11-10kex: Fix some build warnings.Andreas Schneider1-2/+1
2011-09-24Fix warningAris Adamantiadis1-0/+1
2011-09-23Fix bugs found by clangAris Adamantiadis1-0/+2
2011-09-18priv: Move kex functions to kex header.Andreas Schneider1-1/+1
2011-09-18priv: Move options and config prototypes to own header.Andreas Schneider1-0/+1
2011-09-18server: split dh_handsake_serverAris Adamantiadis1-33/+44
2011-09-18kex: moved KEX structures to ssh_crypto_structAris Adamantiadis1-2/+2
2011-09-18kex: have server_kex use the elected methodsAris Adamantiadis1-1/+2
2011-09-18kex: split key selection and sendingAris Adamantiadis1-22/+37
2011-09-17session: Use defines for ssh_handle_packets().Andreas Schneider1-1/+1
2011-09-11server: Fix some build warnings.Andreas Schneider1-2/+2
2011-09-11server: Fix compiler warning.Andreas Schneider1-2/+3
2011-09-02Update libssh to ssh_handle_packets_terminationAris Adamantiadis1-15/+21
cherry-picked from 0cb5248 Should resolve all timeout problems Conflicts: src/auth.c src/channels.c
2011-08-30pki: Use consistent API for ssh_pki_export_privkey_to_pubkey().Andreas Schneider1-2/+2
2011-08-30pki: Use consistent API for ssh_pki_export_pubkey_blob().Andreas Schneider1-4/+5