aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-11-06cmake: Check for io.h on WindowsAndreas Schneider5-7/+12
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06cmake: Correctly check for sys/[u]time.hAndreas Schneider7-12/+17
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06cmake: Always check for strtoullAndreas Schneider1-1/+1
This fixes building with different compilers on Windows BUG: https://red.libssh.org/issues/225 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06doc: Improve documentation for ssh_set_auth_methods()Andreas Schneider2-6/+17
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06bcrypt: Fix type of shalenAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06pki_ed25519: Do paranoia checks before we allocate memoryAndreas Schneider1-5/+7
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05callbacks: Add support for MSVCAndreas Schneider4-15/+22
__typeof__ is GCC specific Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05connector: Fix build with Visual StudioAndreas Schneider1-0/+14
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05options: Fix log level documentationAndreas Schneider1-4/+4
BUG: https://red.libssh.org/issues/210 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05known_hosts: Add ssh_dump_knownhost() functionStef Walter2-57/+85
This works similarly to ssh_write_knownhost(), but allows the caller to get a line with the known_hosts line. BUG: https://red.libssh.org/issues/207 Signed-off-by: Stef Walter <stefw@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05cmake: Correctly check for *snprintf functions on WindowsAndreas Schneider1-7/+12
BUG: https://red.libssh.org/issues/205 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05examples: Reformat usage() functionAndreas Schneider1-12/+15
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05tests: Fix memory leak in torture_auth_certAndreas Schneider1-3/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04tests: Fix memory leak in torture_callbacksAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04tests: Reset output buffer in torture_cryptoAndreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04tests: Some cleanup for torture_pkiAndreas Schneider1-2/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04tests: Fix memory leak in torture_auth_certAndreas Schneider1-3/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04tests: Fix memory leaks in torture_knownhostsAndreas Schneider1-0/+6
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-04tests: Fix build warning with pkd_hello and cmocka 1.1.0Andreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03bignum: Use const in ssh_print_bignum()Andreas Schneider2-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03tests: Disable x11 test which fails too oftenAndreas Schneider1-3/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03ecdh: Implement ECDH using libgcryptJustus Winter7-266/+645
* include/libssh/crypto.h (struct ssh_crypto_struct): Provide a suitable 'ecdh_privkey'. * include/libssh/ecdh.h: Also define 'HAVE_ECDH' if we do ECC using libgcrypt. (ecdh_build_k): New prototype. * src/CMakeLists.txt (libssh_SRCS): Add backend-specific files. * src/ecdh.c: Move backend-specific parts to... * src/ecdh_crypto.c: ... this file. * src/ecdh_gcrypt.c: New file. * src/wrapper.c (crypto_free): Free 'ecdh_privkey'. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03pki_gcrypt: Handle ECDSA keys and signaturesJustus Winter4-11/+570
* ConfigureChecks.cmake: Set 'HAVE_ECC' and 'HAVE_GCRYPT_ECC' if applicable. * include/libssh/pki.h (struct ssh_key_struct): Fix type of field 'ecdsa'. (struct ssh_signature_struct): Likewise for 'ecdsa_sig'. * src/pki.c (ssh_pki_key_ecdsa_name): Relax guard now that the used function is also provided by the gcrypt backend. (ssh_signature_free): Free ecdsa signature. * src/pki_gcrypt.c (ECDSA_HEADER_{BEGIN,END}): New macros. (privatekey_string_to_buffer): Handle ECDSA keys. (pki_key_ecdsa_to_nid): New function. (pki_key_ecdsa_nid_to_gcrypt_name): Likewise. (pki_key_ecdsa_nid_to_name): Likewise. (pki_key_ecdsa_nid_to_char): Likewise. (pki_key_ecdsa_nid_from_name): Implement. (asn1_oi_to_nid): New function. (b64decode_ecdsa_privatekey): Likewise. (pki_private_key_from_base64): Handle ECDSA keys. (pki_pubkey_build_ecdsa): Implement. (pki_key_dup): Handle ECDSA keys. (pki_key_generate): Likewise. (pki_key_generate_ecdsa): Implement. (pki_key_compare): Handle ECDSA keys. (pki_publickey_to_blob): Likewise. (pki_signature_from_blob): Likewise. (pki_signature_verify): Likewise. (pki_do_sign): Likewise. (pki_do_sign_sessionid): Likewise. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03libgcrypt: Implement the 'evp' interfaceJustus Winter2-1/+59
* include/libssh/libgcrypt.h (EVPCTX): Fix type. (NID_gcrypt_nistp{256,384,521}): New constants. * src/libgcrypt.c (nid_to_md_algo): New function mapping curves to digest algorithms. (evp{,_init,_update,_final}): New functions. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03pki_gcrypt: Add a little more ASN1 infrastructureJustus Winter1-0/+15
* src/pki_gcrypt.c (ASN1_OCTET_STRING): New macro. (ASN1_OBJECT_IDENTIFIER): Likewise. (asn1_check_tag): New function. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-02curve25519: Small libgcrypt bignum fixJustus Winter1-0/+7
* src/curve25519.c (ssh_client_curve25519_init): Make use of the gcrypt-variant of 'bignum_bin2bn'. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-22Remove extra newlines from log/error messagesPino Toscano8-14/+14
Signed-off-by: Pino Toscano <ptoscano@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-22sftp: Fix memory leak in sftp_fstatPino Toscano1-1/+4
When parsing the result of a successful fstat call, make sure to free the resulting reply message. Signed-off-by: Pino Toscano <ptoscano@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-10-08tests: Add test for sftp_fsync()Andreas Schneider2-1/+132
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-08torture: Add support to specify verbosity level via env variableAndreas Schneider1-1/+8
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-08session: Add missing ifdef that prevented Windows buildsTilo Eckert1-0/+2
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-08sftp: Add support for append in sftp_open()Tilo Eckert1-0/+20
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
2016-10-08sftp: Do not always set SSH_FXF_READTilo Eckert1-5/+6
Comparison ((flags & O_RDONLY) == O_RDONLY) is always true. Also, O_RDWR, O_WRONLY and O_RDONLY are mutually exclusive => no need to check all of them Signed-off-by: Tilo Eckert <tilo.eckert@flam.de>
2016-10-07sftp: Correctly check for EOF else keep spinning if there is no dataAndreas Schneider1-16/+17
This fixes an issue introduced with dbf72ffba2ad5b5694cd55aa1a7ca99053d20386 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-06gssapi: Use correct return code in ssh_gssapi_auth_mic()Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-06gssapi: Print minor stat in error logging functionAndreas Schneider1-17/+91
This also releases the memory allocated for the messages. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-10-06sftp: Add sftp_fsync() functionAndreas Schneider2-1/+128
BUG: https://red.libssh.org/issues/141 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-09-09sftp: ensure sftp_packet_read recognizes channel EOF to avoid infinite loopJeremy Cross1-1/+1
Signed-off-by: Jeremy Cross <jcross@bomgar.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-10sftpserver: Fix SSH_FXP_FSTAT argumentsAndreas Schneider1-3/+2
Thanks to Игорь Коваленко <igor.a.kovalenko@gmail.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-09tests: Try to fix the x11 testAndreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-09tests: Fix buffer test without NARG macro supportAndreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-04sftp: Use calloc() instead of malloc()/memset()Andreas Schneider1-26/+14
This is calloc() is faster then calling memset(). Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-04config: Fix build warningsAndreas Schneider1-2/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-04examples: Fix endif()Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03Make "Host" pattern list handling consistent with OpenSSHTravers Carter1-10/+14
https://red.libssh.org/issues/187 Signed-off-by: Travers Carter <tcarter@noggin.com.au> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03tests: Improve the torture_request_env testAndreas Schneider1-3/+3
This still doesn't work on FreeBSD Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03examples: Fix building on FreeBSDAndreas Schneider1-2/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03torture: Fix a warningAndreas Schneider1-47/+47
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03priv: Fix client banner specification for libsshAndreas Schneider1-2/+2
BUG: https://red.libssh.org/issues/231 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-03client: If SSHv1 is disabled send the banner immediatelyAndreas Schneider1-1/+9
This saves a round-trip with SSHv2 connecting to the server. See RFC 4253 section 5.2 (New Client, Old Server). Thanks to Yang Yubo <yang@yangyubo.com> for the suggestion. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>