summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/buffer (follow)
Commit message (Collapse)AuthorAgeFilesLines
* libcrypto: constify most error string tablestb2024-06-241-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove BUF_[a-z]* APItb2023-07-282-96/+1
| | | | | | | | This are a bunch of strange string handlers with NULL checks that make no real sense except to some devs who like to sprinkle them everywhere. Fortunately, nothing uses these anymore, so they can go. ok jsing
* Hide symbols in cms, comp, conf, and bufferbeck2023-07-082-2/+7
| | | | ok jsing@
* Remove mkerr.pl remnants from LibreSSLkn2022-07-122-12/+2
| | | | | | | 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
* use freezero() instead of memset/explicit_bzero + free. Substantiallyderaadt2017-05-021-5/+2
| | | | | | | | | | reduces conditional logic (-218, +82). MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c wasn'tt quite right. Two other tricky bits with ASN1_STRING_FLAG_NDEF and BN_FLG_STATIC_DATA where the condition cannot be collapsed completely. Passes regress. ok beck
* Simplify/clean up BUF_MEM_grow_clean().jsing2017-04-091-17/+16
| | | | ok beck@
* With recallocarray() BUF_MEM_grow() is essentially the same asjsing2017-04-091-28/+2
| | | | | | | BUF_MEM_grow_clean() (the only difference is clearing on internal down sizing), so make it a wrapper. ok beck@ deraadt@
* Explicitly test for NULL.jsing2017-04-091-4/+4
| | | | ok beck@
* Convert BUF_MEM_grow() and BUF_MEM_grow_clean() to recallocarray(),jsing2017-03-161-13/+3
| | | | | | | | | | ensuring that the buffer contents are zeroed on allocation and not leaked when resizing. It is worth noting that BUF_MEM_grow_clean() already did this manually by avoiding realloc(). ok beck@ inoguchi@
* Use calloc() instead of malloc() followed by manually zeroing fields.jsing2017-03-161-6/+3
| | | | ok beck@ inoguchi@
* Send the function codes from the error functions to the bit bucket,beck2017-01-293-17/+12
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Put BUF_memdup() and BUF_reverse() under #ifndef LIBRESSL_INTERNAL.jsing2015-06-241-3/+2
|
* Get rid of the last remaining BUF_strdup and BUF_strlcpy and friends, usebeck2014-10-161-2/+5
| | | | | intrinsic functions everywhere, and wrap these functions in an #ifndef LIBRESSL_INTERNAL to make sure we don't bring their use back.
* unbreak build this needed to be an and..beck2014-07-131-2/+2
| | | | ok jsing@
* Take out __bounded__ in the include files we use it in when not on OpenBSD.beck2014-07-131-1/+4
| | | | | | | while we can take it out in portable at compile time, it is still a problem when we install this header file on a system that doesn't support __bounded__ if this is unguarded. ok miod@ bcook@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-112-4/+6
| | | | | | | | 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@
* Explicitly include <openssl/opensslconf.h> in every file that referencesjsing2014-07-101-1/+4
| | | | | | | | | 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.
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-101-1/+3
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* Replace memset(a, 0, ...); free(a); by explicit_bzero(a, ...); free(a); inmiod2014-07-091-2/+2
| | | | | | | fear a smartass-optimizing compiler decides memset is useless immediately before free(). ok jsing@ deraadt@ tedu@
* Unifdef -UNO_SYS_TYPES_Hmiod2014-06-241-4/+1
|
* Add more bounded attributes to the buffer and md5/sha headers in libsslavsm2014-06-141-3/+5
| | | | ok miod@
* tags as requested by miod and teduderaadt2014-06-123-3/+3
|
* realloc with NULL is same as mallocderaadt2014-06-011-4/+1
| | | | ok guenther
* Commit this before the head-scratching leads to premature baldness:deraadt2014-06-011-1/+1
| | | | | | | | | | | | | memset(a->data, 0, (unsigned int)a->max); but the decl is: size_t max; size_t could be larger than int, especially in some of the systems OpenSSL purports to support. How do _intentionally truncating_ casts like enter into a codebase? Lack of understanding of C, at a minimum. Generally the objects are small, but this code is _intentionally unready_ for large objects. ok miod
* More KNF.jsing2014-04-262-6/+10
|
* remove OPENSSL_realloc_clean usage here - replace with intrinsics to makebeck2014-04-171-4/+7
| | | | | it obvious what should happen. ok tedu@
* I've replaced everything in this file. ISC liscense it with my copyrightbeck2014-04-171-54/+13
|
* KNF.jsing2014-04-171-3/+3
|
* Initial KNF.jsing2014-04-173-139/+122
|
* simply wrap around intrinsics, and knf cleanup.beck2014-04-171-57/+54
| | | | ok miod@ deraadt@
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-172-8/+8
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* we don't use these files for buildingtedu2014-04-151-75/+0
|
* remove auto-generated dependencies from the old unused build system, soderaadt2014-04-141-22/+0
| | | | | that it is easier to find code pieces. They are getting in the way. ok miod
* Merge conflicts; remove MacOS, Netware, OS/2, VMS and Windows build machinery.miod2014-04-132-3/+3
|
* import files that CVS missed; sighdjm2012-10-131-0/+119
|
* resolve conflictsdjm2012-10-131-59/+1
|
* This commit was generated by cvs2git to track changes on a CVS vendordjm2012-10-131-2/+9
|\ | | | | branch.
| * import OpenSSL-1.0.1cdjm2012-10-131-2/+9
| |
* | cherrypick fix for CVE-2012-2110: libcrypto ASN.1 parsing heap overflowdjm2012-04-191-0/+17
| | | | | | | | ok miod@ deraadt@
* | resolve conflicts, fix local changesdjm2010-10-015-219/+91
| |
* | This commit was generated by cvs2git to track changes on a CVS vendordjm2010-10-011-10/+3
|\| | | | | branch.
| * import OpenSSL-1.0.0adjm2010-10-011-10/+3
| |
* | resolve conflictsdjm2009-01-091-58/+0
| |
* | This commit was generated by cvs2git to track changes on a CVS vendordjm2009-01-091-0/+116
|\ \ | | | | | | branch.
| * | import openssl-0.9.8jdjm2009-01-092-58/+116
| | |
| * | import of OpenSSL 0.9.8hdjm2008-09-063-14/+46
| | |
| * | import of openssl-0.9.7jdjm2006-06-271-6/+10
| | |
| * | import 0.9.7b (without idea and rc5)markus2003-05-112-0/+66
| | |
| * | import openssl-0.9.7-beta1markus2002-09-053-95/+92
| | |
* | | This commit was generated by cvs2git to track changes on a CVS vendordjm2009-01-091-3/+10
|\ \ \ | | |/ | |/| branch.