summaryrefslogtreecommitdiff
path: root/lib/libcrypto/crypto.h
AgeCommit message (Collapse)Author
2024-04-10Finish Hiding symbols in crypto.hBob Beck
crypto.h already had the symbols not hidden behind LIBRESSL_INTERNAL hidden - This now picks up the reset of them marking them as LCRYPTO_UNUSED, and removes the LIBRESSL_INTERNAL guard. These symbols will now be hidden, but if we use them inside the library in a namespaced build we will get a deprecation warning. use outside the library will be as with any other hidden symbol, so fine. ok tb@
2024-03-02include <time.h> for time_t and struct tm, needed for macosTheo Buehler
ok millert miod
2024-03-02Change sk in CRYPTO_EX_DATA from STACK_OF(void) * to void *Theo Buehler
Requested by jsing
2024-03-02tedu OPENSSL_isservice() prototypeTheo Buehler
When tedu tedued OPENSSL_isservice(), tedus chainsaw missed crypto.h. Finish the teduing of the hack for Visual C++ 5.0 (!), which is still present in the latest and greatest OpenSSL. ok jsing
2024-03-02Make CRYPTO_THREADID opaqueTheo Buehler
With ERR_STATE out of the way, we can make CRYPTO_THREADID opaque. The type is still accessed by used public API, but some of the public API can also go away. ok jsing
2024-03-02Fix CRYPTO_malloc/free signaturesTheo Buehler
Importantly, the size in malloc is now a size_t instead of an int. The API now also takes a file and line to match upstream's signature. ok jsing
2024-03-02Remove CRYPTO_*infoTheo Buehler
Long time neutered, only used (pointlessly without error checking) in the error code until very recently. ok jsing
2024-03-02Remove a bunch of CRYPTO memory APITheo Buehler
This was neutered early on in the fork and has been rotting ever since. Some parts of the API are still used, but it's easier to clean up when most of the mess is gone. ok jsing
2024-03-02Expose OPENSSL_{gmtime,posix_to_tm,timegm,tm_to_posix}()Theo Buehler
Apart from OPENSSL_gmtime(), which is OpenSSL API, this is BoringSSL's interface to deal with the time related portability and code mess. ok jsing
2024-02-18Add posix_time.h from BoringSSLTheo Buehler
This is prepares to expose some internal API as OPENSSL_tm_to_posix() and OPENSSL_posix_to_tm(). They will be used in libtls and ocspcheck(8) to get rid of the portability nightmare that is timegm(). Also fix the location of OPENSSL_gmtime() and OPENSSL_timegm() (this API is not yet exposed). The former is from OpenSSL and surprisingly lives in crypto.h, not asn1.h, and the latter is BoringSSL API and lives in the new posix_time.h. Initial diff from beck, this pulls in further upstream work after review feedback. ok jsing
2023-07-28Make ex_data implementations internalTheo Buehler
To state the obvious: library suffers from way too much extensibility. In theory, applications can implement their own ex_data implementation. In practice, none did. A glance at ex_data.c might give an idea as to why. Make this internal so this particular turd can be replaced with something slightly saner. Also sync up the CRYPTO_EX_INDEX_* defines with OpenSSL - at least the parts we support. ok jsing
2023-07-05Adjust the public declaration of OpenSSLDie to use a portableBrent Cook
method of indicating that the function does not return. ok tb@
2023-07-01crypto.h: move the error stuff to the endTheo Buehler
The other public headers have function and reason codes at the end because the error header was inlined. This was also the case here, too, until the automatic library initialization was appended.
2023-04-30Remove __dead again. Apparently this causes issues for some upstreams.Theo Buehler
Thanks to orbea for the report
2023-04-28Mark OpenSSLDie() as __deadTheo Buehler
This tells gcc that OPENSSL_assert() will not return and thus avoids a silly warning that triggers scary gentoo QA warnings. From claudio
2022-12-26spelling fixes; from paul tagliamonteJason McIntyre
i removed the arithmetics -> arithmetic changes, as i felt they were not clearly correct ok tb
2022-09-11Expose OPENSL_cleanup()Theo Buehler
ok jsing
2022-09-03Prepare to provide OPENSSL_cleanup.Joel Sing
OPENSSL_cleanup() cleans up and deallocates memory in use by the library. There are a couple of use cases for this, primarily related to memory leak testing. This will not be called automatically in LibreSSL, which means that OpenSSL's OPENSSL_NO_INIT_ATEXIT is implied. If code wants to clean up then they need to explicitly call this themselves. ok tb@
2022-07-12Remove mkerr.pl remnants from LibreSSLKlemens Nanni
This script is not used at all and files are edited by hand instead. Thus remove misleading comments incl. the obsolete script/config. Feedback OK jsing tb
2022-01-14Garbage collect the unused OPENSSL_ITEMTheo Buehler
ok inoguchi jsing
2021-12-11Stop passing __FILE__ and __LINE__ to various libcrypto functions. The argumentsAnton Lindqvist
are unused in the end anyway and occupies needless space, especially in ftp(1) shipped with the ramdisk. ok tb@
2021-11-01Unifdef LIBRESSL_NEW_API. Now that the library is bumped, this isTheo Buehler
no longer needed. ok jsing
2021-10-23Add back the fips mode test functions, new stuff requires this.Bob Beck
Symbols.list changes to follow with tb's upcoming bump ok jsing@
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 back a few missing compatibility stubsBrent Cook
ok beck@
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-24Let CRYPTO_mem_leaks{,_fp,_cb}() return -1.Theo Buehler
These functions are no-ops. Their signature was changed by OpenSSL to allow error checking. This way we return an error and do not indicate the (non-)existence of memory leaks. tested in a bulk by sthen ok jsing
2018-05-13Use recallocarray() instead of OPENSSL_realloc_clean().Joel Sing
Also place all of the OPENSSL_* memory related prototypes under #ifndef LIBRESSL_INTERNAL. ok beck@ tb@
2018-03-19Correct mistake of loading the default openssl.conf by default during autoinit.Bob Beck
This brings in the OPENSSL_INIT_LOAD_CONFIG flag with the same semantics as OpenSSL. As a result, by default the openssl.conf file is not loaded during autoinit, which makes autoinit safe for pledge(stdio). ok jsing@
2018-03-18Fix a typo: OPENSSL_INIT_LOAD_CONFIG doesn't have double underbars.Theo Buehler
Found via port build failures reported by sthen. ok jsing
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@
2018-02-14Start providing parts of the OpenSSL 1.1 API.Joel Sing
This will ease the burden on ports and others trying to make software work with LibreSSL, while avoiding #ifdef mazes. Note that we are not removing 1.0.1 API or making things opaque, hence software written to use the older APIs will continue to work, as will software written to use the 1.1 API (as more functionality become available). Discussed at length with deraadt@ and others.
2017-04-29Stop calling OPENSSL_init() internally, since it is a no-op. Also placeJoel Sing
it under #ifndef LIBRESSL_INTERNAL. ok beck@
2015-09-17include stdint.h for uint64_tBrent Cook
noted by Bernard Spil
2015-09-13Since a major bump of libcrypto is coming, remove OPENSSL_ia32cap andMiod Vallat
OPENSSL_ia32cap_loc; nothing in ports uses them besides embedded copies of OpenSSL. This opens the `all hell gets loose' window.
2015-09-13Add a new interface, OPENSSL_cpu_caps(), to return the currently runningMiod Vallat
cpu's specific hardware capabilities users of libcrypto might be interested in, as an integer value. This deprecates the existing OPENSSL_ia32cap() macro and the OPENSSL_ia32cap_loc() function (which returns the pointer so that you can mess with stuff you shouldn't mess with). Interpreting the value returned by OPENSSL_cpu_caps() is, of course, machine-dependent. Minor version bump for libcrypto. ok beck@ jsing@
2015-09-10Put OPENSSL_cleanse under #ifndef LIBRESSL_INTERNAL.Joel Sing
2015-09-10CRYPTO_set_mem_debug_functions() and CRYPTO_set_mem_functions() are alreadyJoel Sing
noops, so neuter the CRYPTO_malloc_init and CRYPTO_malloc_debug_init macros. With input from miod@ ok beck@ bcook@ miod@
2015-06-20Put CRYPTO_memcmp() under #ifndef LIBRESSL_INTERNAL.Joel Sing
ok doug@ deraadt@
2015-04-11Send OPENSSL_issetugid() straight to hell, no final cigarette.Theo de Raadt
The issetugid() API is supposed to make a strong promise where "0 means it is safe to look at the environment". Way back in the past someone on the OpenSSL team responded to the environment access danger by creating a wrapper called OPENSSL_issetugid, and went to use it a number of places. However, by default on systems lacking true issetugid(), OPENSSL_issetugid returns 0. 0 indicating safely. False safety. Which means OPENSSL_issetugid() fails to make any sort of promise about safety, in fact it is just the opposite. Can you believe the OpenSSL team? This nastiness was noticed over the years, however noone could gain traction and get it fixed in OpenSSL. Also see a paragraph about this in http://www.tedunangst.com/flak/post/worst-common-denominator-programming ok jsing
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-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-06-24Remove ancient workaround for previous century's compilers in the declarationMiod Vallat
of CRYPTO_EX_DATA; riding upon the libcrypto major bump.
2014-06-12tags as requested by miod and teduTheo de Raadt
2014-06-01Add a deprecated attribute to all CRYPTO_dbg_ functions.Miod Vallat
ok deraadt@
2014-05-29Everything sane has stdio, and FILE *. we don't need ifdefs for this.Bob Beck
ok to firebomb from tedu@
2014-05-25define LIBRESSL_INTERNAL, and use it to hide the bad stuff from ourselvesTed Unangst
ok beck
2014-05-24Almost nothing actually needs to include <openssl/e_os2.h>, however byJoel Sing
including it they get <openssl/opensslconf.h>. So instead of pulling in <openssl/e_os2.h>, just pull in <openssl/opensslconf.h>. "go ahead" miod@
2014-05-23don't deprecate until at least the base src tree is clean.Ted Unangst
2014-05-22Mark the malloc wrapper functions as deprecated so warnings willBob Beck
happen on their use. ok miod@