aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/async
Commit message (Collapse)AuthorAgeFilesLines
* OpenBSD doesn't have ucontext.h so don't try and include itMatt Caswell2016-06-011-1/+3
| | | | | | | | On OpenBSD we turn off async capabilities due to no ucontext.h. RT#4379 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove unused error/function codes.Rich Salz2016-05-231-8/+1
| | | | | | | | Add script to find unused err/reason codes Remove unused reason codes. Remove entries for unused functions Reviewed-by: Matt Caswell <matt@openssl.org>
* Manual fixes after copyright consolidationRich Salz2016-05-171-51/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation 04/10Rich Salz2016-05-179-432/+46
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fold threads.h into crypto.h making API publicViktor Dukhovni2016-05-161-1/+0
| | | | | | Document thread-safe lock creation Reviewed-by: Richard Levitte <levitte@openssl.org>
* Android build fixes.Andy Polyakov2016-05-021-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove --classic build entirelyRichard Levitte2016-04-201-63/+0
| | | | | | | | The Unix build was the last to retain the classic build scheme. The new unified scheme has matured enough, even though some details may need polishing. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix memory leak where fdlookup linked list is not freed duringSteven Linsell2016-03-211-7/+9
| | | | | | | ASYNC_WAIT_CTX_free Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove the remainder of util/mk1mf.pl and companion scriptsRichard Levitte2016-03-211-3/+0
| | | | | | | This removes all scripts that deal with MINFO as well, since that's only used by mk1mf. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Remove #error from include files.Rich Salz2016-03-201-0/+2
| | | | | | | | Don't have #error statements in header files, but instead wrap the contents of that file in #ifndef OPENSSL_NO_xxx This means it is now always safe to include the header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Some platforms provide getcontext() but it does not workMatt Caswell2016-03-161-1/+7
| | | | | | | | | | Some platforms claim to be POSIX but their getcontext() implementation does not work. Therefore we update the ASYNC_is_capable() function to test for this. RT#4366 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add a function to detect if we have async or notMatt Caswell2016-03-073-1/+15
| | | | | | | Add the ASYNC_is_capable() function and use it in speed. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Ensure Async is deinited properlyMatt Caswell2016-03-021-2/+0
| | | | | | The global thread local keys were not being deinited properly in async. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Convert ASYNC code to use new Thread APIMatt Caswell2016-03-028-114/+31
| | | | | | | The async code uses thread local variables. We should convert to using the new Thread API for doing this. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Clarify ASYNC_WAIT_CTX_clear_fd() docsMatt Caswell2016-02-291-1/+2
| | | | | | | Clarify that the "cleanup" routing does not get called if you invoke ASYNC_WAIT_CTX_clear_fd() directly. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Refactor the async wait fd logicMatt Caswell2016-02-298-137/+266
| | | | | | | | | | | | | | | | | | | Implementation experience has shown that the original plan for async wait fds was too simplistic. Originally the async logic created a pipe internally and user/engine code could then get access to it via API calls. It is more flexible if the engine is able to create its own fd and provide it to the async code. Another issue is that there can be a lot of churn in the fd value within the context of (say) a single SSL connection leading to continually adding and removing fds from (say) epoll. It is better if we can provide some stability of the fd value across a whole SSL connection. This is problematic because an engine has no concept of an SSL connection. This commit refactors things to introduce an ASYNC_WAIT_CTX which acts as a proxy for an SSL connection down at the engine layer. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Always build library object files with shared library cflagsRichard Levitte2016-02-201-1/+1
| | | | | | | | | | | | | | | | This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPENDRichard Levitte2016-02-181-1/+1
| | | | | | | | | | All those flags existed because we had all the dependencies versioned in the repository, and wanted to have it be consistent, no matter what the local configuration was. Now that the dependencies are gone from the versioned Makefile.ins, it makes much more sense to use the exact same flags as when compiling the object files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* async_win.c: remove unused variableViktor Szakats2016-02-131-2/+0
| | | | | | | | | | | Silencing this: crypto/async/arch/async_win.c: In function 'async_fibre_init_dispatcher': crypto/async/arch/async_win.c:112:12: warning: unused variable 'dispatcher' [-Wunused-variable] LPVOID dispatcher; ^ Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename INSTALL_PREFIX to DESTDIR, remove option --install_prefixRichard Levitte2016-02-121-2/+2
| | | | | | | | | | | | | INSTALL_PREFIX is a confusing name, as there's also --prefix. Instead, tag along with the rest of the open source world and adopt the Makefile variable DESTDIR to designate the desired staging directory. The Configure option --install_prefix is removed, the only way to designate a staging directory is with the Makefile variable (this is also implemented for VMS' descrip.mms et al). Reviewed-by: Rich Salz <rsalz@openssl.org>
* Attempt to log an error if init failedMatt Caswell2016-02-101-2/+0
| | | | | | | | | If init failed we'd like to set an error code to indicate that. But if init failed then when the error system tries to load its strings its going to fail again. We could get into an infinite loop. Therefore we just set a single error the first time around. After that no error is set. Reviewed-by: Rich Salz <rsalz@openssl.org>
* The new init functions can now fail so shouldn't be voidMatt Caswell2016-02-101-3/+7
| | | | | | | The new init functions can fail if the library has already been stopped. We should be able to indicate failure with a 0 return value. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Rename INIT funtions, deprecate old ones.Rich Salz2016-02-101-2/+2
| | | | | | Man, there were a lot of renamings :) Reviewed-by: Richard Levitte <levitte@openssl.org>
* Auto init/deinit libcryptoMatt Caswell2016-02-098-108/+75
| | | | | | | This builds on the previous commit to auto initialise/deinitialise libcrypto. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add option to disable asyncTodd Short2016-02-042-2/+2
| | | | | | | | | | | | Add no-async option to Configure that forces ASYNC_NULL. Related to RT1979 An embedded system or replacement C library (e.g. musl or uClibc) may not support the *context APIs that are needed for async operation. Compiles with musl. Ran unit tests, async tests skipped as expected. Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* unified build scheme: add build.info filesRichard Levitte2016-02-011-0/+3
| | | | | | | | | Now that we have the foundation for the "unified" build scheme in place, we add build.info files. They have been generated from the Makefiles in the same directories. Things that are platform specific will appear in later commits. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Templatize util/domdRich Salz2016-01-291-2/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-269-9/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Remove update tagsRich Salz2016-01-201-2/+0
| | | | | Also remove depend/local_depend. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Use POSIX functions on Cygwin, not Win32 functionCorinna Vinschen2016-01-182-2/+2
| | | | | | | Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove some old makefile targetsRich Salz2016-01-171-12/+0
| | | | | | | | Remove lint, tags, dclean, tests. This is prep for a new makedepend scheme. This is temporary pending unified makefile, and might help it. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Move Makefiles to Makefile.inRich Salz2016-01-122-128/+81
| | | | | | | | | | Create Makefile's from Makefile.in Rename Makefile.org to Makefile.in Rename Makefiles to Makefile.in Address review feedback from Viktor and Richard Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Rename DECLARE*STACK_OF to DEFINE*STACK_OFDr. Stephen Henson2016-01-071-1/+1
| | | | | | | | | | Applications wishing to include their own stacks now just need to include DEFINE_STACK_OF(foo) in a header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix build on SolarisMatt Caswell2015-12-151-0/+4
| | | | | | | | | | | Solaris builds were failing during async compilation because the .o files created from compiling the corresponding .c files held in async/arch were ending up in the top level async directory. Consequently the link fails because it can't find the .o files. Thanks to Richard Levitte for pointing me in the right direction on this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* make updateDr. Stephen Henson2015-12-141-6/+6
| | | | Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Fix compile failure with no-threadsMatt Caswell2015-12-121-1/+1
| | | | | | The async code was causing a compile failure if no-threads was used. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* make updateMatt Caswell2015-12-101-6/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* "make update" after async merge.Rich Salz2015-11-231-2/+10
| | | | Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Async error handling and MacOS/X fixesViktor Dukhovni2015-11-227-50/+50
| | | | | | | | | | | | | | | | | | | In the async code for MacOS/X define _XOPEN_SOURCE (if not already defined) as early as possible. We must do this before including any header files, because on MacOS/X <stlib.h> includes <signal.h> which includes <ucontext.h>. If we delay defining _XOPEN_SOURCE and include <ucontext.h> after various system headers are included, we are very likely to end up with the wrong (truncated) definition of ucontext_t. Also, better error handling and some code cleanup in POSIX fibre construction and destruction. We make sure that async_fibre_makecontext() always initializes the fibre to a state that can be freed. For all implementations, check for error returns from async_fibre_makecontext(). Reviewed-by: Matt Caswell <matt@openssl.org>
* Implement windows async thread local variable supportMatt Caswell2015-11-207-17/+124
| | | | | | | Implements Thread Local Storage in the windows async port. This also has some knock on effects to the posix and null implementations. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Convert __thread to pthreads for Thread Local StorageMatt Caswell2015-11-206-24/+62
| | | | | | | | | | | | In theory the pthreads approach for Thread Local Storage should be more portable. This also changes some APIs in order to accommodate this change. In particular ASYNC_init_pool is renamed ASYNC_init_thread and ASYNC_free_pool is renamed ASYNC_cleanup_thread. Also introduced ASYNC_init and ASYNC_cleanup. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Simplify async pool handlingMatt Caswell2015-11-209-176/+96
| | | | | | | | A lot of the pool handling code was in the arch specific files, but was actually boiler plate and the same across the implementations. This commit moves as much code as possible out of the arch specific files. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Swap to using proper windows pipesMatt Caswell2015-11-205-21/+25
| | | | | | | | | | We were using _pipe to create a pipe on windows. This uses the "int" type for its file descriptor for compatibility. However most windows functions expect to use a "HANDLE". Probably we could get away with just casting but it seems more robust to use the proper type and main stream windows functions. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix some style issuesMatt Caswell2015-11-203-35/+38
| | | | | | | There were a number of places where the async code did not conform to the OpenSSL coding style. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add ASYNC_block_pause and ASYNC_unblock_pauseMatt Caswell2015-11-202-3/+32
| | | | | | | | | There are potential deadlock situations that can occur if code executing within the context of a job aquires a lock, and then pauses the job. This adds an ability to temporarily block pauses from occuring whilst performing work and holding a lock. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Further OS-X deprecated warnings tweakMatt Caswell2015-11-201-1/+3
| | | | | | | | | | Even with _XOPEN_SOURCE defined OS-X still displays warnings that makecontext and friends are deprecated. This isn't a problem until you try and build with --strict-warnings, and the build fails. This change suppresses the warnings. We know they are deprecated but there is no alternative! Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix bug in async_fibre_makecontext for POSIXMatt Caswell2015-11-201-2/+2
| | | | | | | | | | async_fibre_makecontext was initialise the fibre first and then calling getcontext(). It should be the other way around because the getcontext call may overwrite some of the things we just initialised. This didn't cause an issue on Linux and so the problem went unnoticed. On OS-X it causes a crash. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix compilation error on OS-XMatt Caswell2015-11-201-0/+6
| | | | | | OS-X complains if we don't have _XOPEN_SOURCE defined. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix clang errorsMatt Caswell2015-11-201-13/+17
| | | | | | Make clang build without errors in the async code Reviewed-by: Rich Salz <rsalz@openssl.org>
* Swap to using _longjmp/_setjmp instead of longjmp/setjmpMatt Caswell2015-11-201-2/+2
| | | | | | | | _longjmp/_setjmp do not manipulate the signal mask whilst longjmp/setjmp may do. Online sources suggest this could result in a significant speed up in the context switching. Reviewed-by: Rich Salz <rsalz@openssl.org>