summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/err (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Support OPENSSL_NO_FILENAMEStb2025-03-091-73/+73
| | | | | | | | | | Some people are concerned that leaking a user name is a privacy issue. Allow disabling the __FILE__ and __LINE__ argument in the error stack to avoid this. This can be improved a bit in tree. From Viktor Szakats in https://github.com/libressl/portable/issues/761 ok bcook jsing
* Assert assumption on CRYPTO_THREADIDtb2024-11-021-1/+2
| | | | | | | | This type has been opaque for a while, and nobody should be able to call this function with id != NULL. If they do, we want to know and it should be noisy. suggested by/ok jsing
* Inline last uses of CRYPTO_THREADID in err/tb2024-11-022-19/+10
| | | | | | | | This is another Thorpian obfuscation scheme hiding nasty casts of pthread_t to unsigned long and comparing them. We can do this in a less underhanded way by calling the portable functions directly. ok jsing
* err.c: zap stray spacetb2024-10-111-2/+2
|
* Apply some style(9) and tidy some comments.jsing2024-10-111-62/+73
|
* Remove pointless locking from err_build_SYS_str_reasons().jsing2024-10-111-20/+2
| | | | | | | | err_build_SYS_str_reasons() is only called during initialisation, under pthread_once(). As such, there is no need to grab CRYPTO_LOCK_ERR or check for reentrant calls. ok tb@
* Convert err_clear_data() and err_clear() from macros to functions.jsing2024-10-111-23/+25
| | | | ok tb@
* Remove unused typedef for ERR_FNS.jsing2024-10-111-3/+1
|
* Add err_ prefix to build_SYS_str_reasons().jsing2024-10-111-3/+3
|
* Make ERR_str_{libraries,reasons,functs}[] const.jsing2024-10-111-12/+18
| | | | | | | | Provide err_load_const_strings(), which takes a const ERR_STRING_DATA * and does not perform a library error value fixup. Make ERR_str_*[] tables const. ok tb@
* Add ERR_LIB_SYS to the error values in ERR_str_functs[].jsing2024-10-111-12/+12
| | | | | | | | This is currently added via err_load_strings(), which means ERR_str_functs[] cannot be made const. Adding ERR_LIB_SYS means the fixup becomes unnecessary. ok tb@
* Reorder functions.jsing2024-10-021-297/+286
| | | | | Reorder functions so that things are somewhat more logical, moving internal functions towards the top (and removing now unnecessary prototypes).
* Remove err_fns and associated machinery.jsing2024-10-021-142/+65
| | | | | | | | | | | | Like all good OpenSSL code, errors was built to be completely extensible. Thankfully, the ERR_{get,set}_implementation() functions were removed in r1.127 of err.c, which means that the extensibility can no longer be used. Take the first of many steps to clean up this code - remove err_fns and associated machinery, calling functions directly. Rename so that we have an 'err_' prefix rather than 'int_' (or nothing). ok joshua@ tb@
* Remove ERR_add_{,v}data()tb2024-08-312-35/+2
| | | | | | Another unused bit of legacy API... ok beck jsing
* Hide remaining unused ERR functions in err.hbeck2024-07-092-4/+4
| | | | ok tb@
* libcrypto: constify most error string tablestb2024-06-242-17/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | These constitute the bulk of the remaining global mutable state in libcrypto. This commit moves most of them into data.rel.ro, leaving out ERR_str_{functs,libraries,reasons} (which require a slightly different approach) and SYS_str_reasons which is populated on startup. The main observation is that if ERR_load_strings() is called with a 0 lib argument, the ERR_STRING_DATA argument is not actually modified. We could use this fact to cast away const on the caller side and be done with it. We can make this cleaner by adding a helper ERR_load_const_strings() which explicitly avoids the assignment to str->error overriding the error code already set in the table. In order for this to work, we need to sprinkle some const in err/err.c. CMS called ERR_load_strings() with non-0 lib argument, but this didn't actually modify the error data since it ored in the value already stored in the table. Annoyingly, we need to cast const away once, namely in the call to lh_insert() in int_err_set_item(). Fixing this would require changing the public API and is going to be tricky since it requires that the LHASH_DOALL_FN_* types adjust. ok jsing
* Stop using pem2.h.jsing2024-03-291-2/+2
| | | | | | | | Somewhere in the past 25 years, the circular dependency between err and pem went away. Stop pulling in pem2.h and just use pem.h directly (pem2.h can probably be removed at some point, but that remains for another day). ok joshua@ tb@
* Bye bye gost, bye, bye turdinesstb2024-03-241-4/+1
| | | | ok beck
* Remove some GOST relicstb2024-03-021-4/+1
|
* Make CRYPTO_THREADID opaquetb2024-03-022-2/+5
| | | | | | | | 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
* Adjust signature of ERR_load_strings()tb2024-03-021-3/+3
| | | | | | This aligns the prototypes with OpenSSL 1.1. ok jsing
* Remove ERR_get_statetb2024-03-022-15/+16
| | | | | | | | | The ERR_STATE struct is an unused implementation detail of the horrific error stack code. It is the last public consumer of CRYPTO_THREAD internals. Make this and its accessor internal so we can make the CRYPTO_THREAD struct opaque. ok jsing
* Remove last calls to CRYPTO_{push,pop}_info()tb2024-02-241-9/+3
| | | | | | | These don't do anything but return 0 and will be garbage collected in the upcoming bump. ok jsing
* err.c: fix incorrect line wrappingtb2024-02-241-5/+5
|
* Drop an unnecessary casttb2024-01-101-2/+2
| | | | from jsing
* Fix print_fp()tb2024-01-101-7/+5
| | | | | | | | | | | The callback-based printing needs to die. But first BIO_set() will die. We have a FILE *. We have fprintf(). No need to use a static BIO to dump error codes to said stream. This basically undoes an unrelated change of "Move crpytlib.h prior bio.h" from 19 years ago (OpenSSL 25a66ee3). Except we don't cast and check len. ok jsing (who had a nearly identical diff)
* Unifdef OPENSSL_NO_ENGINE in libcryptotb2023-11-191-7/+1
| | | | | | | This is mechanical apart from a few manual edits to avoid doubled empty lines. ok jsing
* Remove more ERR crufttb2023-07-282-30/+2
| | | | | | | Ever wondered how many entries populate the various err hashes? Me neither. Remove this garbage. ok jsing
* Remove ERR_{get,set}_implementation()tb2023-07-282-38/+4
| | | | | | | Much like ex_data, applications can make the library use their own error stack implementation. Well, except as of right now they no longer can. ok jsing
* Drop DSO and define OPENSSL_NO_DSOtb2023-07-281-3/+1
| | | | | | | | DSO and in particular dlopen() was used for dynamic engines, which we removed a long time ago and for dynamic conf modules, which we removed only very recently. Now remove this dangerous interface. ok jsing
* Remove ECDH errorstb2023-07-281-7/+1
| | | | | | | Much like the ECDSA errors, the ECDH errors have been unused for a while. Garbage collect them. ok jsing
* Remove ecs_err.ctb2023-07-281-7/+1
| | | | | | | These error codes have been unused for a while, so the public API loading them is pointless. ok jsing
* Unbreak the namespace build after a broken mk.conf and tool misfire hadbeck2023-07-071-3/+3
| | | | | | | | me aliasing symbols not in the headers I was procesing. This unbreaks the namespace build so it will pass again ok tb@
* Hide symbols in hkdf, evp, err, ecdsa, and ecbeck2023-07-073-3/+40
| | | | | | (part 2 of commit) ok jsing@
* Unifdef ZLIBtb2023-06-111-4/+1
| | | | | | | This has long been unused code and compilation with -DZLIB was broken for a long time after BIO was made opaque. ok jsing
* Move a few functions out of OPENSSL_NO_DEPRECATEDtb2023-04-092-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | Geoff Thorpe added OPENSSL_NO_DEPRECATED nearly two decades ago. The hope was that at some point some functions can be dropped. Most of the functions marked deprecated are actually unused nowadays but unfortunately some of them are still used in the ecosystem. Move them out of OPENSSL_NO_DEPRECATED so we can define it without breaking the consumers in the next bump. ERR_remove_state() is still used by a dozen or so ports. This isn't a big deal since it is just a stupid wrapper for the not quite as deprecated ERR_remove_thread_state(). It's not worth patching these ports. Annoyingly, {DH,DSA}_generate_parameters() and RSA_generate_key() are still used. They "make use" of the old-style BN_GENCB callback, which is therefore more difficult to remove - in case you don't know know: that's the thing responsible for printing pretty '.', '+' and '*' when you generate keys. Most annoyingly, DH_generate_parameters() was added to rust-openssl in 2020 for "advanced DH support". This is very unfortunate since cargo bundles a rust-openssl and updates it only every few years or so. As a consequence we're going to be stuck with this nonsense for a good while. ok beck jsing
* Avoid errno is EINVAL after OpenSSL initializationjan2023-03-271-1/+5
| | | | ok tb@
* spelling fixes; from paul tagliamontejmc2022-12-261-2/+2
| | | | | | | i removed the arithmetics -> arithmetic changes, as i felt they were not clearly correct ok tb
* Provide ERR_R_INIT_FAIL.jsing2022-08-292-3/+4
| | | | | | Needed for an upcoming change. ok tb@
* Remove mkerr.pl remnants from LibreSSLkn2022-07-121-96/+0
| | | | | | | 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
* Sort alphabetically so that future omissions will be easier to spot.tb2022-05-071-35/+35
| | | | discussed with jsing
* Add missing ERR_load_{COMP,CT,KDF}_strings()tb2022-05-061-1/+11
| | | | ok beck
* Provide KDFerr() and KDFerror() macrostb2022-05-051-1/+4
| | | | ok beck jsing
* Add a new, mostly empty, bio_local.h and include it in the filestb2022-01-071-1/+3
| | | | | | that will need it in the upcoming bump. discussed with jsing
* Make the certificate transparency code build with the rest of the librarybeck2021-11-241-1/+4
| | | | | | Do not expose it yet, this will wait for an upcoming bump ok tb@
* Provide err_clear_last_constant_time() as a way of clearing an error fromjsing2019-10-171-1/+22
| | | | | | | | | | the top of the error stack in constant time. This will be used by upcoming RSA changes. From OpenSSL 1.1.1d. ok inoguchi@ tb@
* Load CMS error strings.jsing2019-09-091-1/+5
|
* KNF: move two opening curly braces of function bodies to their own linestb2018-04-031-2/+3
|
* Bring in compatibility for OpenSSL 1.1 style init functions.beck2018-03-172-6/+44
| | | | | | | | | 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@
* Mark ERR_add_error_data and ERR_add_error_vdata as not for internal use,beck2017-02-202-10/+13
| | | | | and document ERR_asprintf_error_data as their replacement. ok jsing@, ingo@