summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_dump.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove BIO_dump_*{cb,fp}()tb2024-03-021-37/+1
| | | | | | | These were disabled and the internals that need to remain were fixed. Time for this garbage to go. ok jsing
* BIO_dump*() avoid signed integer overflowtb2024-02-151-1/+10
| | | | | | | | | This API returns an int encoding the number of bytes printed. Thus, a dump of a large enough byte string can make this overflow and rely on undefined behavior. With an indent of 64, as little as 26 MB is enough to make this happen. ok jsing
* Reimplement BIO_dump_indent() with CBS/CBB and BIO_printf()tb2024-02-021-64/+115
| | | | | | | | | | | | | Instead of heaps of unchecked strlcpy/strlcat/snprintf doing hard to follow gymnastics, use a byte string, a somewhat comprehensible computation of the number of bytes to dump per output line and write using checked BIO_printf() directly to the BIO. Longer strings will still overflow the terminal width of 80 and even longer strings will still overflow the return value (undefined behavior). I don't care much about the former but the latter should be fixed in a later pass. ok beck
* Prepare to remove the _cb() and _fp() versions of BIO_dump()tb2024-02-011-33/+30
| | | | | | | | | | | | | apache-httpd uses BIO_dump(), libssl uses BIO_dump_indent(), and the openssl(1) app uses both. Otherwise this is unused. This is horribly bad code even by libcrypto standards. By doing away with the callbacks fixes incorrect error checking for fwrite() but there is a lot more wrong in here. This can be cleaned up in a later pass, the only concern here is to be able to remove the unused variants in the next major bump. ok beck
* reinstate KNF for commenttb2023-07-291-2/+2
|
* Unbreak the namespace build after a broken mk.conf and tool misfire hadbeck2023-07-071-3/+1
| | | | | | | | 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 asn1 and biobeck2023-07-051-1/+7
| | | | ok jsing@
* Avoid potential divide by zero in BIO_dump_indent_cb()jsing2022-10-171-8/+7
| | | | | | | | | | | | | Passing an indent value of 67 results in DUMP_WIDTH_LESS_IDENT returning a value of zero, which is promptly used for division. Likewise, passing a value larger than 67 results in a negative value being returned. Prevent this by limiting indent to 64 (which matches OpenSSL's current behaviour), as well as ensuring that dump_width is > 0. Should fix oss-fuzz #52464 and #52467. ok miod@ tb@
* While the traditional OpenSSL return value and behaviour of BIO_dump(3)beck2021-07-111-5/+10
| | | | | | | | | | | is pure comedy gold, and now documented as such, sadly this bit of pure Muppet genius can't really in good consience stay in the tree as is. Change BIO_dump to always return the number of bytes printed on success and to stop printing and return -1 on failure if a writing function fails. ok tb@, jsing@
* Do not need to buf[0] = 0 before strlcpy(buf, ...deraadt2015-04-231-2/+1
|
* f{read,write} take a number of items and an item size as arguments, andmiod2014-11-111-2/+2
| | | | | | | | | | | | | | | | | | | | | return the number of items read of written. When you intend to return the number of bytes actually processed, it is wise to pass 1 as the item size and the size as the number of items. But in *some* places, the OpenSSL does the opposite, and has extra logic to change a successful return of 1 (item processed) into the real size. And, guess why it does that? Because of old VMS, for they (used to) have a substandard stdio implementation. Note that this change causes the return values of BIO_dump_fp() and BIO_dump_indent_fp() to no longer be useless (actual number of callback calls), but actual bytes output. Given the irrelevance of the return value before, it is unlikely that anything depends upon it (and if something does, it probably has other problems in need for a fix...) ok tedu@ beck@ jsing@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-3/+1
| | | | | | | | 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@
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-101-1/+2
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* Everything sane has stdio, and FILE *. we don't need ifdefs for this.beck2014-05-291-2/+0
| | | | ok to firebomb from tedu@
* Sort and group includes.jsing2014-05-051-1/+3
|
* We'll interpret a (void) cast on snprintf() to mean it's been verified thatguenther2014-04-191-4/+4
| | | | | | truncation is either desirable, not an issue, or is detected and handled later ok deraadt@
* use intrinsic strlcpy and strlcat everywhere so we only have one set ofbeck2014-04-191-7/+7
| | | | | | funcitons to check for incorrect use. keep BUF_strlcpy and BUF_strlcat for API comptibility only. ok tedu@
* - Why do we hide from the OpenSSL police, dad?miod2014-04-161-2/+2
| | | | | | | | - Because they're not like us, son. They use macros to wrap stdio routines, for an undocumented (OPENSSL_USE_APPLINK) use case, which only serves to obfuscate the code. ok tedu@
* More KNF.jsing2014-04-161-7/+7
|
* Send the rotIBM stream cipher (ebcdic) to Valhalla to party for eternitybeck2014-04-151-6/+0
| | | | | with the bearded ones... some API's that nobody should be using will dissapear with this commit.
* First pass at applying KNF to the OpenSSL code, which almost makes itjsing2014-04-151-84/+87
| | | | | readable. This pass is whitespace only and can readily be verified using tr and md5.
* Part 1 of eliminating BIO_snprintf(). This fixes mechanical conversionsbeck2014-04-151-5/+5
| | | | | where the return value is ignored changing to (void) snprintf. ok deraadt@
* resolve conflictsdjm2008-09-061-22/+53
|
* merge 0.9.7dmarkus2004-04-081-12/+12
|
* Less strcpy/strcat/sprintf. tdeval@ ok.ho2003-03-161-14/+18
|
* openssl-engine-0.9.6 mergebeck2000-12-151-49/+73
|
* OpenSSL 0.9.5 mergebeck2000-03-191-2/+2
| | | | | | *warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/<arch>) on cvs or ~beck/src-patent.tar.gz on cvs
* OpenSSL 0.9.4 mergebeck1999-09-291-5/+8
|
* Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD buildryker1998-10-051-0/+125
functionality for shared libs. Note that routines such as sslv2_init and friends that use RSA will not work due to lack of RSA in this library. Needs documentation and help from ports for easy upgrade to full functionality where legally possible.