aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-10-07packet: Use a stack buffer for the headermaster-packetAndreas Schneider1-25/+17
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-07packet: Reformat packet_send2()Andreas Schneider1-86/+101
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-07sftp: Only prepend header data onceAndreas Schneider1-9/+15
This reduces memory moving. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-07sftp: Reformat sftp_packet_write()Andreas Schneider1-22/+23
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-05agent: Use (PUSH|PULL)_BE_U32 in agent_talk()Andreas Schneider1-23/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2018-10-05agent: Just use uint32_t for the countAndreas Schneider1-3/+10
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2018-10-05sftp: Use bytearray macrosAndreas Schneider1-14/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2018-10-05include: Add macros for bytearray handlingAndreas Schneider3-0/+473
Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
2018-10-05examples: Reformat knownhostsAndreas Schneider1-70/+73
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-10-02cmake: Always build position independent codeAndreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27gitlab-ci: Report errors on debianAndreas Schneider1-2/+3
2018-09-27messages: Fixed possible memory leak in ssh_message_queueAnderson Toshiyuki Sasaki1-0/+7
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27examples: Add null checks in libssh_scp.cAnderson Toshiyuki Sasaki1-0/+10
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27examples: Fix libssh_scp.c code styleAnderson Toshiyuki Sasaki1-276/+321
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27examples: Fix possible memory leak in libssh_scp.cAnderson Toshiyuki Sasaki1-20/+89
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27tests: Add frees to avoid memory leak errorsAnderson Toshiyuki Sasaki2-0/+12
The added frees are unnecessary, but the static analyser does not know. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27tests: Replace ssh_buffer_free() with SSH_BUFFER_FREE()Anderson Toshiyuki Sasaki2-11/+11
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27tests: Replace ssh_string_free() with SSH_STRING_FREE()Anderson Toshiyuki Sasaki4-10/+10
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27tests: Replace ssh_key_free() with SSH_KEY_FREE()Anderson Toshiyuki Sasaki8-152/+129
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27tests: Use SSH_STRING_FREE_CHARAnderson Toshiyuki Sasaki6-33/+36
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27include: Add SSH_KEY_FREEAnderson Toshiyuki Sasaki1-0/+2
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-27gitlab-ci: Get build and test errors from mingwAndreas Schneider1-10/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-26gitlab-ci: Use -DCMAKE_BUILD_TYPE=UndefinedSanitizerAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-26cmake: Add UndefinedSanitizerAndreas Schneider1-2/+14
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-26cmake: Also add DEFAULT_LINK_FLAGS for SolarisAndreas Schneider1-0/+9
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-26cmake: Rewritten AddCMockaTest.cmakeAnderson Toshiyuki Sasaki3-91/+174
This changes add_cmocka_test() to receive compiler options, the libraries to be linked to the test, and the linker options. The way the tests are declared in tests/unittests and tests/client were updated. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25sftpserver: allocate packet on sftp_server_newAlberto Aguirre2-2/+21
Ensure sftp_server_new allocates the packet and payload as sftp_packet_read now expects the packet and payload to be pre-allocated. Similarly, ensure sftp_get_client_message does not free the packet. Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25connector: Add checks if file descriptor is a socketDavid Wedderwille1-7/+120
Fixes T104 Signed-off-by: David Wedderwille <davidwe@posteo.de>
2018-09-25socket: Pass MSG_NOSIGNAL to send()Andreas Schneider1-1/+6
This avoid that we get a SIGPIPE. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25socket: Return ssize_t for ssh_socket_unbuffered_write()Andreas Schneider1-10/+16
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25socket: Reformat ssh_socket_write()Andreas Schneider1-53/+61
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25socket: Reformat ssh_socket_unbuffered_write()Andreas Schneider1-21/+23
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25socket: Return ssize_t for ssh_socket_unbuffered_read()Andreas Schneider1-14/+19
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25socket: Reformat ssh_socket_pollcallback()Andreas Schneider1-36/+61
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25socket: Reformat ssh_socket_unbuffered_read()Andreas Schneider1-16/+18
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25connect: Fix build warning on WindowsAndreas Schneider1-1/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25config: Fix building without globbing supportAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25include: Do not declare ssh_channel_new() twiceAndreas Schneider1-1/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-25cmake: Add -Wattributs for configure checksAndreas Schneider1-0/+7
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20cmake: Bump library versionAndreas Schneider4-2/+424
2018-09-20sftpserver: Support some openssh extensionsChris Townsend3-1/+39
Add support for "hardlink@openssh.com" and "posix-rename@openssh.com" extensions. Signed-off-by: Chris Townsend <christopher.townsend@canonical.com> Signed-off-by: Alberto Aguirre <albaguirre@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20pki: Use strndup in ssh_pki_export_privkey_base64()Andreas Schneider1-11/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20tests: Add a test for ssh_pki_export_privkey_base64()Andreas Schneider1-1/+55
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20pki: Add ssh_pki_export_privkey_base64()DavidWed2-0/+66
Fixes T53 Signed-off-by: DavidWedderwille <davidwe@posteo.de> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-09-20tests: Add test for ssh_get_fingerprint_hash()Andreas Schneider1-0/+27
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20dh: Use ssh_get_fingerprint_hash() in ssh_print_hash()Andreas Schneider1-23/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20dh: Add ssh_get_fingerprint_hash()Andreas Schneider2-0/+76
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-09-20dh: Removed duplicated codeAnderson Toshiyuki Sasaki1-15/+5
The code for calculating SHA 512 in ssh_make_sessionid() had been duplicated; the cases were unified. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2018-09-20dh: Add diffie-hellman-group18-sha512 supportAnderson Toshiyuki Sasaki11-6/+152
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
2018-09-20buffer: Don't call va_end() twiceAndreas Schneider1-1/+0
This is handled in the cleanup. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>