aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
Commit message (Collapse)AuthorAgeFilesLines
* bn/asm/x86_64-mont5.pl: fix carry propagating bug (CVE-2015-3193).Andy Polyakov2015-12-031-3/+19
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* perlasm/ppc-xlate.pl: comply with ABIs that specify vrsave as reserved.Andy Polyakov2015-12-031-0/+20
| | | | | | RT#4162 Reviewed-by: Richard Levitte <levitte@openssl.org>
* modes/ocb128.c: fix sanitizer warning.Andy Polyakov2015-12-021-7/+7
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove RSA_FLAG_SIGN_VER flag.Dr. Stephen Henson2015-12-021-2/+2
| | | | | | | | Remove RSA_FLAG_SIGN_VER: this was origininally used to retain binary compatibility after RSA_METHOD was extended to include rsa_sign and rsa_verify fields. It is no longer needed. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove legacy sign/verify from EVP_MD.Dr. Stephen Henson2015-12-0217-387/+67
| | | | | | | | | | | | | Remove sign/verify and required_pkey_type fields of EVP_MD: these are a legacy from when digests were linked to public key types. All signing is now handled by the corresponding EVP_PKEY_METHOD. Only allow supported digest types in RSA EVP_PKEY_METHOD: other algorithms already block unsupported types. Remove now obsolete EVP_dss1() and EVP_ecdsa(). Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add backtrace to memory leak outputRichard Levitte2015-12-021-26/+49
| | | | | | This is an option for builds with gcc and --strict-warnings. Reviewed-by: Rich Salz <rsalz@openssl.org>
* crypto/sparcv9cap.c: add SIGILL-free feature detection for Solaris.Andy Polyakov2015-12-021-0/+47
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* modes/ocb128.c: split fixed block xors to aligned and misaligned.Andy Polyakov2015-12-022-57/+26
| | | | | | | Main goal was to improve performance on RISC platforms, e.g. 10% was measured on MIPS, POWER8... Reviewed-by: Matt Caswell <matt@openssl.org>
* modes/ocb128.c: ocb_lookup_l to allow non-contiguous lookupAndy Polyakov2015-12-021-8/+29
| | | | | | and CRYPTO_ocb128_encrypt to handle in==out. Reviewed-by: Matt Caswell <matt@openssl.org>
* ex_data part 2: doc fixes and CRYPTO_free_ex_index.Rich Salz2015-12-0113-131/+97
| | | | | | | | | | Add CRYPTO_free_ex_index (for shared libraries) Unify and complete the documentation for all "ex_data" API's and objects. Replace xxx_get_ex_new_index functions with a macro. Added an exdata test. Renamed the ex_data internal datatypes. Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove BN_initRich Salz2015-11-306-12/+14
| | | | | | Rename it to be an internal function bn_init. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Remove X509_VERIFY_PARAM_IDDr. Stephen Henson2015-11-263-73/+49
| | | | | | | Now that X509_VERIFY_PARAM is opaque X509_VERIFY_PARAM_ID is no longer needed. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix a NULL deref in an error pathMatt Caswell2015-11-261-1/+1
| | | | | | | The SRP_create_verifier_BN function goes to the |err| label if the |salt| value passed to it is NULL. It is then deref'd. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Tighten up BN_with_flags usage and avoid a reachable assertMatt Caswell2015-11-267-129/+194
| | | | | | | | | | | | | | | | | | The function rsa_ossl_mod_exp uses the function BN_with_flags to create a temporary copy (local_r1) of a BIGNUM (r1) with modified flags. This temporary copy shares some state with the original r1. If the state of r1 gets updated then local_r1's state will be stale. This was occurring in the function so that when local_r1 was freed a call to bn_check_top was made which failed an assert due to the stale state. To resolve this we must free local_r1 immediately after we have finished using it and not wait until the end of the function. This problem prompted a review of all BN_with_flag usage within the codebase. All other usage appears to be correct, although often not obviously so. This commit refactors things to make it much clearer for these other uses. Reviewed-by: Emilia Käsper <emilia@openssl.org>
* Remove useless locking codeAlessandro Ghedini2015-11-241-2/+0
| | | | | | | | | Follow-up to 070c233. Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@akamai.com> GH: #454
* mark openssl configuration as loaded at end of OPENSSL_configMarcus Meissner2015-11-241-0/+1
| | | | | | | Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@akamai.com> GH: #466
* Add ctrl for SHA1 and SSLv3Dr. Stephen Henson2015-11-241-0/+55
| | | | | | | Add SSLv3 ctrl to EVP_sha1() this is only needed if SSLv3 client authentication is used with DSA/ECDSA. Reviewed-by: Tim Hudson <tjh@openssl.org>
* make updateDr. Stephen Henson2015-11-241-0/+15
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add EVP_MD_CTX_ctrl function.Dr. Stephen Henson2015-11-241-0/+11
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add ssl3 ctrl to EVP_md5_sha1().Dr. Stephen Henson2015-11-241-0/+70
| | | | | | | Add a ctrl to EVP_md5_sha1() to handle the additional operations needed to handle SSL v3 client authentication and finished message. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add MD5+SHA1Dr. Stephen Henson2015-11-243-2/+117
| | | | | | | Add digest combining MD5 and SHA1. This is used by RSA signatures for TLS 1.1 and earlier. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Fix uninitialised p error.Dr. Stephen Henson2015-11-241-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Limit depth of ASN1 parse printing.Dr. Stephen Henson2015-11-241-0/+9
| | | | | | Thanks to Guido Vranken <guidovranken@gmail.com> for reporting this issue. Reviewed-by: Tim Hudson <tjh@openssl.org>
* "make update" after async merge.Rich Salz2015-11-232-11/+19
| | | | Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Fix a few missed "if (!ptr)" cleanupsRich Salz2015-11-232-5/+4
| | | | | And a scalar !x --> x==0 test Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Patch containing TLS implementation for GOST 2012Dmitry Belyavsky2015-11-231-0/+2
| | | | | | | | This patch contains the necessary changes to provide GOST 2012 ciphersuites in TLS. It requires the use of an external GOST 2012 engine. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* x86_64 assembly pack: tune clang version detection.Andy Polyakov2015-11-2313-13/+13
| | | | | | RT#4142 Reviewed-by: Richard Levitte <levitte@openssl.org>
* e_os.h: __sun done right.Andy Polyakov2015-11-231-1/+1
| | | | | | RT #4144 Reviewed-by: Viktor Dukhovni <viktor@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>
* Use defined(__sun) instead of defined(sun)Kurt Roeckx2015-11-221-1/+1
| | | | | | | | Strict ISO confirming C compilers only define __sun Reviewed-by: Viktor Dukhovni <openssl-users@dukhovni.org> RT #4144, MR #1353
* Fix STRICT_ALIGNMENT for whrlpoolAndy Polyakov2015-11-211-20/+23
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Declare cleanse_ctr variable as externAlessandro Ghedini2015-11-211-0/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix (minor) problems found by ubsanAlessandro Ghedini2015-11-211-1/+1
| | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@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>
* Fix async deadlock problemMatt Caswell2015-11-201-0/+17
| | | | | | | | | The rand code can aquire locks and then attempt crypto operations. This can end up in a deadlock if we are using an async engine, because control returns back to the user code whilst still holding the lock. We need to force synchronous operation for these sections of code. 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>
* Fix Linux crashMatt Caswell2015-11-201-0/+8
| | | | | | | | | | | | | If config'd without -d (--debug), asynctest was crashing with: *** longjmp causes uninitialized stack frame *** This is because gcc will add certain checks for some functions (including longjmp). The checks assume you can only longjmp down the stack not up. However, if we are actually jumping to a different fibre then it can appear as if we are going up the stack when we are not really. This change disables the check. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Tweak async documentation based on feedbackMatt Caswell2015-11-201-3/+3
| | | | | | | | | | Add some clarifications to the async documentation. Also changed ASYNC_pause_job() so that it returns success if you are not within the context of a job. This is so that engines can be used either asynchronously or synchronously and can treat an error from ASYNC_pause_job() as a real error. Reviewed-by: Rich Salz <rsalz@openssl.org>
* make updateMatt Caswell2015-11-202-22/+30
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add ASYNC error codesMatt Caswell2015-11-206-10/+135
| | | | | | | Add ASYNCerr support to give some meaningful error message in the event of a failure. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Normalise ASYNC namingMatt Caswell2015-11-207-99/+98
| | | | | | Tidied up the naming of functions and structures to be consistent Reviewed-by: Rich Salz <rsalz@openssl.org>