summaryrefslogtreecommitdiff
path: root/lib/libcrypto/engine
AgeCommit message (Collapse)Author
2019-01-19$OpenBSD$Theo Buehler
2019-01-19Partial port of EC_KEY_METHOD from OpenSSL 1.1.Theo Buehler
This commit adds init/free, support for signing, setting and getting the method, engine support as well as extra data. from markus
2018-11-11Add automatic threading initialization for libcrypto.Brent Cook
This implements automatic thread support initialization in libcrypto. This does not remove any functions from the ABI, but does turn them into no-ops. Stub implementations of pthread_mutex_(init|lock|unlock) are provided for ramdisks. This does not implement the new OpenSSL 1.1 thread API internally, keeping the original CRYTPO_lock / CRYPTO_add_lock functions for library locking. For -portable, crypto_lock.c can be reimplemented with OS-specific primitives as needed. ok beck@, tb@, looks sane guenther@
2018-08-24In ENGINE_up_ref(), check return value of CRYPTO_add() and reportTheo Buehler
failure accordingly. ok jsing
2018-04-14Make ENGINE_free() succeed on NULL. Matches OpenSSL's behavior andTheo Buehler
simplifies the caller side. tested by & ok inoguchi; discussed with schwarze
2018-04-14make ENGINE_finish() succeed on NULL and simplify callers as inTheo Buehler
OpenSSL commit 7c96dbcdab9 by Rich Salz. This cleans up the caller side quite a bit and reduces the number of lines enclosed in #ifndef OPENSSL_NO_ENGINE. codesearch.debian.net shows that almost nothing checks the return value of ENGINE_finish(). While there, replace a few nearby 'if (!ptr)' with 'if (ptr == NULL)'. ok jsing, tested by & ok inoguchi
2018-03-17Bring in compatibility for OpenSSL 1.1 style init functions.Bob Beck
This adds OPENSSL_init_crypto and OPENSSL_init_ssl, as well thread safety modifications for the existing LibreSSL init functions. The initialization routines are called automatically by the normal entry points into the library, as in newer OpenSSL ok jsing@, nits by tb@ and deraadt@
2017-01-29Send the function codes from the error functions to the bit bucket,Bob Beck
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
2016-12-21Explicitly export a list of symbols from libcrypto.Joel Sing
Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@
2016-11-04Replace all uses of magic numbers when operating on OPENSSL_ia32_P[] byMiod Vallat
meaningful constants in a private header file, so that reviewers can actually get a chance to figure out what the code is attempting to do without knowing all cpuid bits. While there, turn it from an array of two 32-bit ints into a properly aligned 64-bit int. Use of OPENSSL_ia32_P is now restricted to the assembler parts. C code will now always use OPENSSL_cpu_caps() and check for the proper bits in the whole 64-bit word it returns. i386 tests and ok jsing@
2016-11-04Remove I386_ONLY define. It was only used to prefer aMiod Vallat
faster-on-genuine-80386-but-slower-on-80486-onwards innstruction sequence in the SHA512 code, and had not been enabled in years, if at all. ok tom@ bcook@
2015-12-07Remove SHA0 check, as we did in v1.21 of sha.h.Brent Cook
This enables ENGINE_get_digest to work again with SHA1. noted by NARUSE, Yui, @nurse from github
2015-08-28Kill coverity 128475Bob Beck
ok doug@
2015-07-19Remove OpenSSL engine RSAX.Doug Hogan
OpenSSL stopped building it last year and removed it this year. Based on OpenSSL commit c436e05bdc7f49985a750df64122c960240b3ae1. Also cranked major version in libcrypto, libssl and libtls. "fine with me" bcook@ miod@
2015-07-19abort when ENGINE_remove fails, fix Coverity 21656Brent Cook
ok doug@, beck@
2015-06-19Return the failing engine ID in the error stack.Brent Cook
Noted by doug@ in an earlier revision of the dynamic engine removal patch, but I had forgotten to include it in the latest version.
2015-06-19Disable ENGINE_load_dynamic (dynamic engine support).Brent Cook
We do not build, test or ship any dynamic engines, so we can remove the dynamic engine loader as well. This leaves a stub initialization function in its place. ok beck@, reyk@, miod@
2015-04-11Remove all getenv() calls, especially those wrapped by issetugid().Theo de Raadt
getenv()'s wrapped by issetugid() are safe, but issetugid() is correct difficult to impliment on many operating systems. By accident, a grand experiment was run over the last year, where issetugid() returned 1 (the safe value) on a few operating systems. Noone noticed & complained that certain environment variables were not working....... ok doug beck jsing, discussion with others
2015-02-11Enable building with -DOPENSSL_NO_DEPRECATED.Doug Hogan
If you didn't enable deprecated code, there were missing err.h and bn.h includes. This commit allows building with or without deprecated code. This was not derived from an OpenSSL commit. However, they recently enabled OPENSSL_NO_DEPRECATED in git and fixed these header problems in a different way. Verified with clang that this only changes line numbers in the generated asm. ok miod@
2015-02-10Remove assert() or OPENSSL_assert() of pointers being non-NULL. The policyMiod Vallat
for libraries in OpenBSD is to deliberately let NULL pointers cause a SIGSEGV. ok doug@ jsing@
2015-02-09BN_CTX_get() can fail - consistently check its return value.Joel Sing
There are currently cases where the return from each call is checked, the return from only the last call is checked and cases where it is not checked at all (including code in bn, ec and engine). Checking the last return value is valid as once the function fails it will continue to return NULL. However, in order to be consistent check each call with the same idiom. This makes it easy to verify. Note there are still a handful of cases that do not follow the idiom - these will be handled separately. ok beck@ doug@
2015-02-07Delete a lot of #if 0 code in libressl.Doug Hogan
There are a few instances where #if 1 is removed but the code remains. Based on the following OpenSSL commits. Some of the commits weren't strictly deletions so they are going to be split up into separate commits. 6f91b017bbb7140f816721141ac156d1b828a6b3 3d47c1d331fdc7574d2275cda1a630ccdb624b08 dfb56425b68314b2b57e17c82c1df42e7a015132 c8fa2356a00cbaada8963f739e5570298311a060 f16a64d11f55c01f56baa62ebf1dec7f8fe718cb 9ccc00ef6ea65567622e40c49aca43f2c6d79cdb 02a938c953b3e1ced71d9a832de1618f907eb96d 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 d6fbb194095312f4722c81c9362dbd0de66cb656 6f1a93ad111c7dfe36a09a976c4c009079b19ea1 1a5adcfb5edfe23908b350f8757df405b0f5f71f 8de24b792743d11e1d5a0dcd336a49368750c577 a2b18e657ea1a932d125154f4e13ab2258796d90 8e964419603d2478dfb391c66e7ccb2dcc9776b4 32dfde107636ac9bc62a5b3233fe2a54dbc27008 input + ok jsing@, miod@, tedu@
2014-11-19Nuke yet more obvious #include duplications.Kenneth R Westerback
ok deraadt@
2014-10-22Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().Joel Sing
arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
2014-10-18None of these need to include <openssl/rand.h>Joel Sing
2014-08-11Guard RSA / RC4-5 ASM when NO_ASM is not definedBrent Cook
Most assembly blocks remain inactive if OPENSSL_NO_ASM is not defined, only enabling inline assembly, but the RSA / RC4-5 blocks (used only in amd64 systems) turn on implicitly. Guard these two as well. This simplifies enabling just inline ASM in portable, no effective change in OpenBSD.
2014-07-13The bell tolls for BUF_strdup - Start the migration to usingBob Beck
intrinsics. This is the easy ones, a few left to check one at a time. ok miod@ deraadt@
2014-07-12if (x) FOO_free(x) -> FOO_free(x).Miod Vallat
Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
2014-07-11Only import cryptlib.h in the four source files that actually need it.Joel Sing
Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
2014-07-10Explicitly include <openssl/opensslconf.h> in every file that referencesJoel Sing
an OPENSSL_NO_* define. This avoids relying on something else pulling it in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is never going to do anything, since OPENSSL_NO_XYZ will never defined, due to the fact that opensslconf.h has not been included. This also includes some miscellaneous sorting/tidying of headers.
2014-07-10Stop including standard headers via cryptlib.h - pull in the headers thatJoel Sing
are needed in the source files that actually require them. ok beck@ miod@
2014-07-09remove unused dynamic_cmd_defns_empty structure.Brent Cook
ok miod@ deraadt@ guenther@
2014-06-29correct issetugid sense as spotted by Stijn van Drongelen.Theo de Raadt
Substantially expand the conditional to reduce potential for error.
2014-06-23Since this is a library, place issetugid() before every getenv()Theo de Raadt
ok miod
2014-06-22More KNF.Joel Sing
2014-06-22KNF.Joel Sing
2014-06-22KNF.Joel Sing
2014-06-22More KNF.Joel Sing
2014-06-12tags as requested by miod and teduTheo de Raadt
2014-06-11c-file-style hints, begone; ok beckTheo de Raadt
2014-06-10Abandon the auto-ENGINE /dev/crypto interface. VIA 3des cbc receivesTheo de Raadt
collateral damage. The syncronous nature of this mechanism has hampered performance for symmetric crypto relative to brute-force cpu. The assymetric crypto support never really materialized in drivers. So abandon the complexity. ok tedu beck mikeb some disagrement from djm but if he wants to test /dev/crypto ciphers he should do it without this this gigantic API in the way
2014-06-10KNF.Joel Sing
2014-06-10KNF.Joel Sing
2014-06-09use memset instead of bzeroTheo de Raadt
2014-06-07malloc() result does not need a cast.Theo de Raadt
ok miod
2014-06-02A few months back there was a big community fuss regarding direct-useTheo de Raadt
of the intel RDRAND instruction. Consensus was RDRAND should probably only be used as an additional source of entropy in a mixer. Guess which library bends over backwards to provide easy access to RDRAND? Yep. Guess which applications are using this support? Not even one... but still, this is being placed as a trap for someone. Send this support straight to the abyss. ok kettenis
2014-05-30more: no need for null check before freeTheo de Raadt
ok tedu guenther
2014-05-30no need for null check before free. from Brendan MacDonellTed Unangst
2014-05-29convert 53 malloc(a*b) to reallocarray(NULL, a, b). that is 53Theo de Raadt
potential integer overflows easily changed into an allocation return of NULL, with errno nicely set if need be. checks for an allocations returning NULL are commonplace, or if the object is dereferenced (quite normal) will result in a nice fault which can be detected & repaired properly. ok tedu
2014-05-22if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefullyMiod Vallat
eyeballed before applying. Contributed by Cyril Roelandt on tech@