summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/tasn_dec.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Indent goto labels for diffability.jsing2021-12-251-6/+6
| | | | Whitespace change only.
* Consolidate ASN.1 universal tag type data.jsing2021-12-141-22/+1
| | | | | | | | | | | | There are currently three different tables in three different files that contain information about ASN.1 universal class tag types. Range checking is also implemented in three different places (with different implementations). Consolidate all of this into a single table, provide a lookup function that deals with the range checks and wrappers to deal with specific types. ok inoguchi@ tb@
* Convert asn1_d2i_ex_primitive()/asn1_collect() from BUF_MEM to CBB.jsing2021-12-131-31/+37
| | | | | | | | With this we get simpler code, overflow checking and more sensible memory ownership. Also switch the free_cont case to freezero() since this could contain secrets. ok inoguchi@ tb@
* Inline collect_data() in asn1_collect().jsing2021-12-091-21/+12
| | | | | | While here stop assigning a size_t to an int without bounds checks. ok inoguchi@ tb@
* Pull the recursion depth check up to the top of asn1_collect()jsing2021-12-091-5/+6
| | | | ok inoguchi@ tb@
* Remove handling of a NULL BUF_MEM from asn1_collect()jsing2021-12-091-14/+9
| | | | | | | | asn1_collect() (and hence collect_data()) is never called without a BUF_MEM - the only caller that passed NULL was removed in OpenSSL commit e1cc0671ac5. ok inoguchi@ tb@
* Replace asn1_tlc_clear and asn1_tlc_clear_nc macros with a function.jsing2021-12-031-32/+26
| | | | | | | | | | Call the replacement asn1_tlc_invalidate() since it does not actually clear the ASN1_TLC. While here, name the ASN1_TLC variables consistently as ctx, remove a pointless comment and simplify ASN1_item_d2i() slightly. ok inoguchi@ tb@
* Group and sort includes.jsing2021-12-031-3/+3
|
* Call asn1_item_ex_d2i() directly from ASN1_item_d2i()jsing2021-12-031-2/+5
| | | | | | | ASN1_item_ex_d2i() is just a wrapper around the internal asn1_item_ex_d2i() function, so call asn1_item_ex_d2i() directly. ok inoguchi@ tb@
* Fix a NULL dereference in GENERAL_NAME_cmp()tb2020-12-081-1/+21
| | | | | | | | | | | | Comparing two GENERAL_NAME structures containing an EDIPARTYNAME can lead to a crash. This enables a denial of service attack for an attacker who can control both sides of the comparison. Issue reported to OpenSSL on Nov 9 by David Benjamin. OpenSSL shared the information with us on Dec 1st. Fix from Matt Caswell (OpenSSL) with a few small tweaks. ok jsing
* Require all ASN1_PRIMITIVE_FUNCS functions to be provided.jsing2019-04-011-5/+8
| | | | | | | | | | | | If an ASN.1 item provides its own ASN1_PRIMITIVE_FUNCS functions, require all functions to be provided (currently excluding prim_clear). This avoids situations such as having a custom allocator that returns a specific struct but then is then printed using the default primative print functions, which interpret the memory as a different struct. Found by oss-fuzz, fixes issue #13799. ok beck@, tb@
* Simplify initialization of asn1_cb; use correct spelling of NULL.tb2018-09-171-4/+2
|
* Limit ASN.1 constructed types recursive definition depthinoguchi2018-03-291-20/+41
| | | | | | | | Fixes for CVE-2018-0739. Copied from commit below, and modified for adaption to our code. https://github.com/openssl/openssl/commit/9310d45087ae546e27e61ddf8f6367f29848220d ok bcook@ beck@ jsing@
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-93/+53
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Expand ASN1_ITEM_rptr and ASN1_ITEM_ptr macros - no change in generatedjsing2016-12-301-5/+5
| | | | assembly.
* internal only negative types should not be handled here.tedu2016-05-041-3/+1
| | | | CVE-2016-2108 from openssl.
* revert the big change from yesterday to prepare for smaller commits.tedu2016-05-041-1/+3
|
* patch from openssl for multiple issues:tedu2016-05-031-3/+1
| | | | | | | missing padding check in aesni functions overflow in evp encode functions use of invalid negative asn.1 types ok beck
* move initialization of buf up to quell warnings and make it obvious the err ↵beck2015-12-121-4/+5
| | | | | | case is ok. ok bcook@
* Fix for OpenSSL CVE-2015-3195beck2015-12-041-3/+8
| | | | ok djm@ jsing@
* Check the return value of asn1_enc_save(). ok bcook@ doug@miod2015-07-201-2/+4
|
* Fix several crash causing defects from OpenSSL.tedu2015-03-191-3/+24
| | | | | | | | | | | | | These include: CVE-2015-0209 - Use After Free following d2i_ECPrivatekey error CVE-2015-0286 - Segmentation fault in ASN1_TYPE_cmp CVE-2015-0287 - ASN.1 structure reuse memory corruption CVE-2015-0289 - PKCS7 NULL pointer dereferences Several other issues did not apply or were already fixed. Refer to https://www.openssl.org/news/secadv_20150319.txt joint work with beck, doug, guenther, jsing, miod
* Remove IMPLEMENT_COMPAT_ASN1() and related support code. Nothing uses it inmiod2015-02-141-69/+3
| | | | | | libcrypto/libssl, and nothing seems to use it in the wild, apart from embedded copies of OpenSSL. ok jsing@
* 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
|
* i give up. reuse problem is unfixable. dlg says puppet crashes.tedu2014-05-041-8/+4
|
* Replace all use of ERR_add_error_data with ERR_asprintf_error_data.beck2014-04-261-3/+3
| | | | | | | | This avoids a lot of ugly gymnastics to do snprintfs before sending the bag of strings to ERR, and eliminates at least one place in dso_dlfctn.c where it was being called with the incorrect number of arguments and using random things off the stack as addresses of strings. ok krw@, jsing@
* another attempt at fixing stale x509 data. since we don't know where thetedu2014-04-191-10/+8
| | | | | initial storage came from, we can't free it. just memset in the sequence case. probably ok beck
* can't actually do this. cause unknown.tedu2014-04-191-1/+1
|
* guenther would prefer more separationtedu2014-04-181-0/+2
|
* Some dude named Tavis Ormandy reported a bug which has gone unfixed.tedu2014-04-181-0/+5
| | | | | | | | | | | http://marc.info/?l=openssl-users&m=138014120223264&w=2 Arguably a doc bug, but we argue not. If you parse a new cert into memory occupied by a previously verified cert, the new cert will inherit that state, bypassing future verification checks. To avoid this, we will always start fresh with a new object. grudging ok from guenther, after i threatened to make him read the code yet again. "that ok was way more painful and tiring then it should have been"
* blank lines between decls and codetedu2014-04-181-0/+5
|
* More KNF.jsing2014-04-181-197/+195
|
* lob a few more knf grenades in here to soften things up.tedu2014-04-181-266/+143
|
* putting most of the braces in the right column is the very least we can do.tedu2014-04-181-234/+234
|
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-2/+2
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* openssl-1.0.0e: resolve conflictsdjm2011-11-031-2/+1
|
* resolve conflicts, fix local changesdjm2010-10-011-10/+14
|
* resolve conflictsdjm2009-04-061-11/+33
|
* resolve conflictsdjm2009-01-091-1/+1
|
* resolve conflictsdjm2008-09-061-380/+679
|
* openssl security fixes, diff from markus@, ok & "commit it" djm@pvalchev2006-10-041-0/+2
| | | | http://www.openssl.org/news/secadv_20060928.txt for more
* resolve conflictsdjm2006-06-271-11/+67
|
* security fix from http://www.openssl.org/news/secadv_20030930.txtmarkus2003-09-301-1/+8
| | | | see also http://cvs.openssl.org/chngview?cn=11471
* merge 0.9.7b with local changes; crank majors for libssl/libcryptomarkus2003-05-121-2/+2
|
* merge with openssl-0.9.7-stable-SNAP-20020911,markus2002-09-141-3/+3
| | | | | new minor for libcrypto (_X509_REQ_print_ex) tested by miod@, pb@
* OpenSSL 0.9.7 stable 2002 05 08 mergebeck2002-05-151-0/+958