aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2017-04-13buffer: Create ssh_buffer_validate_length()Andreas Schneider1-0/+2
This functions allows if a given length can be obtained from the buffer. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-04-13Revert "buffer: Create ssh_buffer_validate_length()"Andreas Schneider1-2/+0
This reverts commit 34bdc1ca7871e8e9258077411edd516c8de55299.
2017-04-13buffer: Create ssh_buffer_validate_length()Andreas Schneider1-0/+2
This functions allows if a given length can be obtained from the buffer. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-04-11server: Add option SSH_BIND_OPTIONS_IMPORT_KEY to serverAlfredo Mazzinghi1-1/+2
This sets the bind private key directly from an ssh_key struct instead of reading a file. Signed-off-by: Alfredo Mazzinghi <am2419@cl.cam.ac.uk> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-07libcrypto: Use a pointer for EVP_CIPHER_CTXJakub Jelen1-1/+1
This has been made opaque and it needs to be a pointer. This is for OpenSSL 1.1.0 support. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-07misc: Use simpler macros for htonll and ntohllAndreas Schneider2-9/+18
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06cmake: Correctly check for sys/[u]time.hAndreas Schneider1-4/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-06doc: Improve documentation for ssh_set_auth_methods()Andreas Schneider1-0/+17
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05callbacks: Add support for MSVCAndreas Schneider1-5/+3
__typeof__ is GCC specific Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-05known_hosts: Add ssh_dump_knownhost() functionStef Walter1-0/+1
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-03bignum: Use const in ssh_print_bignum()Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-11-03ecdh: Implement ECDH using libgcryptJustus Winter2-1/+13
* 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 Winter1-2/+2
* 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 Winter1-1/+6
* 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-10-06sftp: Add sftp_fsync() functionAndreas Schneider1-0/+16
BUG: https://red.libssh.org/issues/141 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-02connector: Implement ssh_connector_except()Aris Adamantiadis2-0/+28
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02channels: Move ssh_channel_write_stderr out of server-onlyAris Adamantiadis2-3/+3
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02callbacks: Implement list of callbacks for channelsAris Adamantiadis2-1/+38
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02callback: Add macro to iterate callbacksAris Adamantiadis1-0/+37
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02callbacks: Add macro for callbacks execute listAris Adamantiadis1-0/+28
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02packets: Handle flow control callbacksAris Adamantiadis1-0/+20
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02events: Add functions for poll objectsAris Adamantiadis1-0/+2
Signed-off-by: Aris Adamantiadis <aris@0xbadc0de.be> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02auth: Cleanup memory leak when using SSH agentStef Walter1-0/+2
In Cockpit we've seen this memory leak: at 0x4C2A9C7: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) by 0x5B76B03: ssh_userauth_agent (auth.c:778) by 0x40DD5A: cockpit_ssh_authenticate (cockpitsshtransport.c:327) BUG: https://red.libssh.org/issues/208 Signed-off-by: Stef Walter <stefw@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02libgcrypt: Add helper to extract MPIs into ssh_stringsJustus Winter1-0/+10
* include/libssh/libgcrypt.h (ssh_sexp_extract_mpi): New prototype. * src/libgcrypt.c (ssh_sexp_extract_mpi): New function. Signed-off-by: Justus Winter <justus@g10code.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-05-02dh: Rename ssh_get_publickey() to ssh_get_server_publickey()Andreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-03-14server: handle keepalive@openssh.com global requestsAris Adamantiadis1-0/+1
2016-01-19buffer: expose ssh_buffer_get()Fabiano Fidêncio2-3/+1
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19buffer: expose ssh_buffer_{add,get}_data()Fabiano Fidêncio2-2/+2
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19buffer: expose ssh_buffer_reinit()Fabiano Fidêncio2-1/+1
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19libssh.h: move LIBSSH_API buffer' functions to libssh.hFabiano Fidêncio2-4/+4
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19buffer: remove ssh_buffer_get_begin()Fabiano Fidêncio1-1/+0
Note that removing ssh_buffer_get_begin() doesn't break API compatibility, as this functions has never been exposed (it only has the LIBSSH_API prefix). Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19buffer: remove ssh_buffer_get_rest_len()Fabiano Fidêncio1-3/+2
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19buffer: rename ssh_buffer_get_rest() to ssh_buffer_get()Fabiano Fidêncio1-1/+1
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-01-19cleanup: use ssh_ prefix in the packet (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>
2016-01-19cleanup: use ssh_ prefix in the gcrypt missing 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 kex (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 dh (non-static) functionsFabiano Fidêncio1-14/+14
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 channels (non-static) functionsFabiano Fidêncio1-6/+6
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-22/+22
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 blf (non-static) functionsFabiano Fidêncio1-13/+13
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 bignum (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 agent (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>
2015-11-10headers: fix missing mode_t (2nd)Dirk Neukirchen1-0/+1
Reviewed-By: Aris Adamantiadis <aris@0xbadc0de.be>
2015-10-20agent: Fix agent auth on big endian machinesAndreas Schneider1-0/+10
BUG: https://red.libssh.org/issues/204 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-25crypto: old-fashioned aes_ctr when evp_aes_ctr is missingAris Adamantiadis1-0/+1
2015-09-25SSH1: fix duplicate identifierAris Adamantiadis1-1/+1
2015-09-25libcrypto: clean up EVP functionsAris Adamantiadis1-3/+20
2015-09-07pki: Add certificate loading functionsAxel Eppe2-0/+13
- ssh_pki_import_cert_base64() - ssh_pki_import_cert_file() - ssh_pki_import_cert_blob() Those functions are currently simple wrappers around their pubkey counterpart. - ssh_pki_copy_cert_to_privkey() This function copies the cert-specific data to a private key. Signed-off-by: Axel Eppe <aeppe@google.com> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-09-07pki: Add rsa, dss certificate key type definitionsAxel Eppe2-1/+4
- Add rsa/dsa (ssh-{rsa,dss}-cert-v01@openssh.com) as key types. - Add a cert_type member in the ssh_key struct. Signed-off-by: Axel Eppe <aeppe@google.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>