path: root/src/threads.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-03threads: Automatically call ssh_init on loadAnderson Toshiyuki Sasaki1-186/+36
This makes unnecessary to call ssh_init() when the library is dynamically loaded. Also removes the threads shared library. The used threads implementation is chosen in configuration time, changing the ssh_threads_get_default() depending on the available threads library. Internally, it is expected a threads implementation providing: - void ssh_mutex_lock(void **mutex); - void ssh_mutex_unlock(void **mutex); - struct ssh_threads_callbacks_struct *ssh_threads_get_default(void); and a crypto implementation providing: - int crypto_thread_init(struct ssh_threads_callbacks_struct *user_callbacks); - void crypto_thread_finalize(void); This adds internal threads implementation for pthreads and noop. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2018-06-04threads: Fix compiler warningAndreas Schneider1-1/+4
Use a protype for libcrypto_lock_callback(). Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2018-01-18threads: Use calloc() instead of malloc()Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2017-12-28add mbedtls crypto supportJuraj Vijtiuk1-0/+32
Summary: This patch adds support for mbedTLS as a crypto backend for libssh. mbedTLS is an SSL/TLS library that has been designed to mainly be used in embedded systems. It is loosely coupled and has a low memory footprint. mbedTLS also provides a cryptography library (libmbedcrypto) that can be used without the TLS modules. The patch is unfortunately quite big, since several new files had to be added. DSA is disabled at compile time, since mbedTLS doesn't support DSA Patch review and feedback would be appreciated, and if any issues or suggestions appear, I'm willing to work on them. Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr> Test Plan: * The patch has been tested with a Debug and MinSizeRel build, with libssh unit tests, client tests and the pkd tests. * All the tests have been run with valgrind's memcheck, drd and helgrind tools. * The examples/samplessh client works when built with the patch. Reviewers: asn, aris Subscribers: simonsj Differential Revision: https://bugs.libssh.org/D1
2016-11-07threads: Use new API call for OpenSSL CRYPTO THREADIDAndreas Schneider1-2/+17
BUG: https://red.libssh.org/issues/222 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-01-08threads: support libgcrypt 1.6 hackAris Adamantiadis1-2/+23
Not 100% satisfied of this patch, but the way libgcrypt handles threading in 1.6 is not compatible with custom handlers. The new code basicaly uses pthreads in every case. This will probably not work on windows.
2012-02-19threads: Make libcrypto_mutexes static.Andreas Schneider1-1/+1
Fixes sparse warnings.
2012-02-19threads: Fix function defintions.Andreas Schneider1-2/+2
Fixes sparse warnings.
2011-09-18priv: Remove crypto.h and add correct includes to src files.Andreas Schneider1-0/+3
2011-02-12proper prototypesBernhard R. Link1-2/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2010-12-10doc: Follow the current naming convention.Andreas Schneider1-1/+1
2010-09-30Changed the threads cbks from struct to publ funcAris Adamantiadis1-1/+5
2010-09-28threads: Fixed windows build.Andreas Schneider1-6/+6
MSVC isn't C99.
2010-09-12Added initialisation logs for threadingAris Adamantiadis1-1/+7
2010-09-12Changed callbacks typeAris Adamantiadis1-2/+8
2010-09-06Implemented the noop and native pointersAris Adamantiadis1-1/+20
2010-09-06Moved pthread specific code in src/threads/pthread.cAris Adamantiadis1-21/+0
pthread example doesn't compile du to the lack of libssh_threads_native.so library
2010-09-06misc: Rename libssh/ to src/Andreas Schneider1-0/+159