summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/bio_asn1.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ASN.1 BIO: properly wire up prefix_free and suffix_freetb2023-03-101-1/+7
| | | | | | | | | | | | | | If something goes wrong before the ASN.1 BIO state machine has passed both flushing states, asn1_bio_free() forgets to free the ndef_aux and the ex_arg since the prefix_free() and suffix_free callbacks are not called. This can lead to leaks, notably in streaming bios. Part of https://github.com/openssl/openssl/pull/15999 I have a regress covering this but it is not yet ready to land. ok beck jsing
* Avoid infinite loop in bio_asn1 state machinetb2023-03-041-2/+2
| | | | | | | | | | | | If the BIO_write() in the ASN1_STATE_DATA_COPY state fails, incorrect error handling will break out of the switch without changing the state, and the infinite for loop will immediately try the same write again, which is unlikely to succeed... Clearly this code intended to break out of the loop instead. Via OpenSSL 1.1 commit 723f616df81ea05f31407f7417f49eea89bb459a ok millert
* Implement new-style OpenSSL BIO callbackstb2022-01-141-3/+3
| | | | | | | | | | This provides support for new-style BIO callbacks in BIO_{read,write,gets,puts}() and a helper function to work out whether it should call the new or the old style callback. It also adds a few typedefs and minor code cleanup as well as the BIO_{get,set}_callback_ex() from jsing, ok tb
* 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
* Indent goto labels for diffability.jsing2021-12-251-2/+2
| | | | Whitespace change only.
* Fix incomplete initialization bug: BIO_new(BIO_f_asn1()) neglectedschwarze2021-11-271-23/+10
| | | | | | | | | | | | | | | | initializing five of the fields in BIO_ASN1_BUF_CTX (prefix, prefix_free, suffix, suffix_free, ex_arg), inviting a segfault in a subsequent call from the application program to BIO_write(3) because subroutines of that function assume that the function pointers are either NULL or valid. Fix this by using the less error-prone calloc(3) idiom. While here, inline asn1_bio_init() at the only call site in asn1_bio_new() to simplify the code and make it easier to read. Bug found and initial patch by me, this version (with inlining) by and OK tb@.
* const for BIO_{new,set}() and most of the BIO_{f,s}_*() family oftb2018-05-011-3/+3
| | | | | | functions. ok beck, jsing
* assign pointer to NULL rather than 0mmcc2015-12-231-2/+2
|
* Replace assert() and OPENSSL_assert() calls with proper error return paths.miod2015-02-101-5/+6
| | | | Careful review, feedback & ok doug@ jsing@
* 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@
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* no need for null check before free. from Brendan MacDonelltedu2014-05-301-2/+1
|
* Use C99 initializers for the various FOO_METHOD structs. More readable, andmiod2014-04-271-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | avoid unreadable/unmaintainable constructs like that: const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { EVP_PKEY_CMAC, EVP_PKEY_CMAC, 0, "CMAC", "OpenSSL CMAC method", 0,0,0,0, 0,0,0, cmac_size, 0, 0,0,0,0,0,0,0, cmac_key_free, 0, 0,0 }; ok matthew@ deraadt@
* More KNF.jsing2014-04-191-72/+80
|
* lob a few more knf grenades in here to soften things up.tedu2014-04-181-35/+24
|
* putting most of the braces in the right column is the very least we can do.tedu2014-04-181-66/+66
|
* fix some more leaks, mostly suggestions from miodjsg2014-04-171-1/+3
| | | | ok miod@
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-4/+4
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* import of OpenSSL 0.9.8kdjm2009-04-061-0/+495