summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_object.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make internal header file names consistenttb2022-11-261-2/+2
| | | | | | | | | | | | | | | | Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
* Fix d2i_ASN1_OBJECT()tb2022-05-131-2/+2
| | | | | | | | | Due to a confusion of two CBS, the API would incorrectly advance the *der_in pointer, resulting in a DER parse failure. Issue reported by Aram Sargsyan ok jsing
* Convert asn1_ex_c2i() to CBS.jsing2022-04-231-2/+7
| | | | | | This allows us to make direct use of c2i_ASN1_OBJECT_cbs(). ok inoguchi@ tb@
* Set ASN1_OBJECT_FLAG_DYNAMIC_DATA flag with t2i_ASN1_OBJECT_internalinoguchi2022-04-101-1/+2
| | | | | | | 'flags' should have ASN1_OBJECT_FLAG_DYNAMIC_DATA bit to free 'data' by ASN1_OBJECT_free as c2i_ASN1_OBJECT_cbs does. ok jsing@ tb@
* Convert c2i_ASN1_OBJECT() and d2i_ASN1_OBJECT to CBS.jsing2022-03-261-81/+92
| | | | | | | | | Along the way, rather than having yet another piece of code that parses OID arcs, reuse oid_parse_arc(). Always allocate a new ASN1_OBJECT rather than doing a crazy dance with ASN1_OBJECT_FLAG_DYNAMIC and trying to free parts of an ASN1_OBJECT if one is passed in. ok inoguchi@ tb@
* Move/group i2d_ASN1_OBJECT() and d2i_ASN1_OBJECT().jsing2022-03-201-53/+53
|
* Provide t2i_ASN1_OBJECT_internal() and use it for OBJ_txt2obj()jsing2022-03-191-1/+38
| | | | | | | | | | | The current OBJ_txt2obj() implementation converts the text to ASN.1 object content octets, builds a full DER encoding from it, then feeds the entire thing back through the DER to ASN.1 object conversion. Rather than doing this crazy dance, provide an t2i_ASN1_OBJECT_internal() function that converts the text to ASN.1 object content octets, then creates a new ASN1_OBJECT and attaches the content octets to it. ok inoguchi@ tb@
* Rewrite ascii/text to ASN.1 object conversion.jsing2022-03-191-121/+167
| | | | | | | | Rewrite the ascii/text to ASN.1 object conversion code using CBB/CBS, while also addressing some of the bizarre behaviour (such as allowing mixed separators and treating '..' as a zero value). ok inoguchi@ tb@
* Initialise *out_name at the start of i2t_ASN1_OBJECT_name().jsing2022-03-151-1/+3
| | | | ok tb@
* Do not write out terminating NUL in i2a_ASN1_OBJECT()tb2022-03-031-2/+2
| | | | | | | | | | | The conversion to CBB made us write out an extra NUL since we no longer use the return value of i2t_ASN1_OBJECT() (which returns strlen(data)) but rather the size of the CBB (which includes a terminal NUL) to write out data. Issue found by anton via an openssl-ruby test failure. ok jsing
* whitespacetb2022-03-021-2/+2
|
* Rewrite ASN1_OBJECT content to ascii/text conversion.jsing2022-03-021-24/+177
| | | | | | | | | | Rewrite the ASN1_OBJECT content to ascii/text conversion code using CBB and CBS. Currently there is a strange split with i2t_ASN1_OBJECT() calling OBJ_obj2txt() which implements the conversion, while OBJ_txt2obj() calls back into the misnamed a2d_ASN1_OBJECT() function. Move the conversion code into asn1/a_object.c and have OBJ_txt2obj() call that instead. ok inoguchi@ tb@
* include asn1_locl.h where it will be needed for the bump.tb2022-01-071-1/+3
| | | | discussed with jsing
* Indent goto labels for diffability.jsing2021-12-251-4/+4
| | | | Whitespace change only.
* Consolidate code/templates for ASN.1 types.jsing2021-12-251-1/+8
| | | | | | | Where an ASN.1 type has its own file, move the ASN.1 item template and template related functions into the file. Discussed with tb@
* Move ASN1_<type>_* functions to the top, encoding/decoding to the bottom.jsing2021-12-251-50/+50
| | | | No functional change.
* Convert ASN1_OBJECT_new() to calloc().jsing2021-12-031-11/+6
| | | | | | | Rather than using malloc() and then initialising all struct members, use calloc() and only initialise the single non-zero value member. ok schwarze@ tb@
* Plug leak in c2i_ASN1_OBJECTtb2021-05-011-3/+8
| | | | | | | | | | When using the object reuse facility of c2i_ASN1_OBJECT, the dynamically allocated strings a may contain are set to NULL, so we must free them beforehand. Also clear the flag, because that's what OpenSSL chose to do. From Richard Levitte OpenSSL 1.1.1 65b88a75921533ada8b465bc8d5c0817ad927947 ok inoguchi
* Add const to functions in asn1/asn1.h as they did in OpenSSL.tb2018-04-251-4/+4
| | | | | | | BIO_f_asn1() will be taken care of later. Tested in a bulk by sthen ok bcook jca jsing
* use freezero() instead of memset/explicit_bzero + free. Substantiallyderaadt2017-05-021-11/+5
| | | | | | | | | | 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
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-17/+12
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* don't dereference a if NULLbcook2016-11-061-2/+2
|
* simplify error handling in c2i_ASN1_OBJECTbcook2016-11-061-10/+12
| | | | ok beck@, miod@
* explicit_bzero for asn1 objects on free. Too often these contain sensitive ↵beck2016-03-171-24/+27
| | | | | | | information and they should not be a performance bottleneck ok miod@ krw@
* explict_bzero for some asn1 free's - ok miod@beck2016-03-061-1/+3
|
* The IMPLEMENT_STACK_OF and IMPLEMENT_ASN1_SET_OF macros were turned intojsing2015-02-101-4/+1
| | | | | noops around 15 years ago. Remove multiple occurances of both that still exist in the code today.
* Fix CVE-2014-3508, pretty printing and OID validation:guenther2014-08-081-10/+21
| | | | | | | | | | | - make sure the output buffer is always NUL terminated if buf_len was initially greater than zero. - reject OIDs that are too long, too short, or not in proper base-127 Based on https://git.openssl.org/gitweb/?p=openssl.git;a=commit;h=0042fb5fd1c9d257d713b15a1f45da05cf5c1c87 ok bcook@
* if (x) FOO_free(x) -> FOO_free(x).miod2014-07-121-5/+3
| | | | | | | Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-4/+4
| | | | | | | | 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-2/+4
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* delete some casts. ok miodtedu2014-07-101-3/+3
|
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* more: no need for null check before freederaadt2014-05-301-8/+4
| | | | ok tedu guenther
* remove CONST_STRICT. ok beck deraadttedu2014-05-301-2/+0
|
* improve realloc/calloc/malloc patterns; ok guentherderaadt2014-04-211-2/+2
|
* More KNF.jsing2014-04-191-1/+1
|
* More KNF.jsing2014-04-181-128/+159
|
* lob a few more knf grenades in here to soften things up.tedu2014-04-181-60/+29
|
* putting most of the braces in the right column is the very least we can do.tedu2014-04-181-70/+70
|
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-13/+13
| | | | | | | | 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/+2
|
* resolve conflicts, fix local changesdjm2010-10-011-9/+26
|
* resolve conflictsdjm2008-09-061-17/+83
|
* merge 0.9.7b with local changes; crank majors for libssl/libcryptomarkus2003-05-121-2/+2
|
* OpenSSL 0.9.7 stable 2002 05 08 mergebeck2002-05-151-1/+1
|
* openssl-engine-0.9.6 mergebeck2000-12-151-23/+39
|
* OpenSSL 0.9.5 mergebeck2000-03-191-3/+3
| | | | | | *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-112/+27
|
* Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD buildryker1998-10-051-0/+389
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.