summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_int.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Encode an ASN.1 INTEGER with NULL data to value of zero.jsing2022-08-281-2/+4
| | | | | | | | | | | When an ASN1_INTEGER is created it has NULL data until a value is set - previously, an ASN1_INTEGER in this state encoded to an ASN.1 INTEGER with a value of 0, rather than being treated as an error. While code should really set values, the historical behaviour has not required this. Found the hard way by sthen@ with acme-client. ok tb@
* Rewrite i2c_ASN1_INTEGER() using CBB/CBS.jsing2022-08-201-97/+100
| | | | | | | | | | This gives us cleaner and safer code, although it is worth noting that we now generate the encoding even when called with NULL as the output pointer (and then discard it, returning just the length). Resolves oss-fuzz #49963. ok tb@
* Cast int64_t to uint64_t before negating.jsing2022-07-131-3/+7
| | | | | | | | | Avoid undefined behaviour/integer overflow by casting an int64_t to uint64_t before negating. Fixes oss-fuzz #49043 ok tb@
* Make ASN1_{INTEGER,ENUMERATED}_get() return 0 on NULL againtb2022-07-091-1/+3
| | | | | | | | This is the documented behavior which got lost in the recent rewrite. Mismatch of documentation and reality pointed out by schwarze ok jsing
* Negate unsigned then cast to signed.jsing2022-06-281-2/+2
| | | | | | | | | Avoid undefined behaviour by negating the unsigned value, before casting to int64_t, rather than casting to int64_t then negating. Fixes oss-fuzz #48499 ok tb@
* Rewrite ASN1_INTEGER_{get,set}() using CBS/CBBjsing2022-06-251-60/+177
| | | | | | In the process, prepare to provide ASN1_INTEGER_{get,set}_{u,}int64(). ok beck@ tb@
* Simplify ASN1_INTEGER_cmp()jsing2022-06-251-16/+9
| | | | ok beck@ tb@
* Rewrite c2i_ASN1_INTEGER() using CBS.jsing2022-04-271-84/+129
| | | | | | | | This also makes validation stricter and inline with X.690 - we now reject zero length inputs (rather than treating them as zero values) and enforce minimal encoding. ok tb@
* Indent goto labels for diffability.jsing2021-12-251-7/+7
| | | | Whitespace change only.
* Consolidate code/templates for ASN.1 types.jsing2021-12-251-1/+32
| | | | | | | 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-143/+143
| | | | No functional change.
* Consolidate various ASN.1 code.jsing2021-12-151-1/+130
| | | | | | | | | Rather than having multiple files per type (with minimal code per file), use one file per type (a_<type>.c). No functional change. Discussed with tb@
* Avoid an undefined shift in ASN1_INTEGER_get().tb2019-04-281-4/+8
| | | | | | Fixes oss-fuzz issue #13804 ok beck, jsing
* Use limits.h instead of sys/limits.h for portability.jsing2019-03-261-3/+2
| | | | From phrocker via github.
* Add range checks to varios ASN1_INTEGER functions to ensure thebeck2019-03-231-3/+53
| | | | | | sizes used remain a positive integer. Should address issue 13799 from oss-fuzz ok tb@ jsing@
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-7/+7
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Replace M_ASN1_INTEGER_(new|free) with ASN1_INTEGER_(new|free) - this isjsing2015-09-301-7/+7
| | | | | | | different from the macro expansion, but the result is the same. Also replace some ASN1_STRING_dup() with ASN1_INTEGER_dup(). ok beck@ doug@
* Remove unnecessary type assignments - M_ASN1_INTEGER_new() already setsjsing2015-09-301-3/+1
| | | | | | the type to V_ASN1_INTEGER. ok doug@
* Expand obsolete M_ASN1.*(cmp|dup|print|set) macros - no change in generatedjsing2015-07-291-2/+2
| | | | | | assembly. ok bcook@
* Drop stupid (int) casts for the arguments of malloc() and friends. This ismiod2015-07-191-2/+2
| | | | | not 16-bit MS-DOS anymore. ok bcook@ tedu@
* Fix several crash causing defects from OpenSSL.tedu2015-03-191-3/+3
| | | | | | | | | | | | | 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
* 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.
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-2/+2
| | | | | | | | 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-5/+5
|
* tags as requested by miod and teduderaadt2014-06-121-1/+1
|
* Add a comment documenting where libssl depends upon the current (objectionable)miod2014-05-311-0/+1
| | | | behaviour of this code, to prevent people from blindly changing it.
* more: no need for null check before freederaadt2014-05-301-6/+3
| | | | ok tedu guenther
* improve realloc/calloc/malloc patterns; ok guentherderaadt2014-04-211-4/+3
|
* More KNF.jsing2014-04-191-2/+2
|
* More KNF.jsing2014-04-181-158/+189
|
* lob a few more knf grenades in here to soften things up.tedu2014-04-181-51/+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-9/+9
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
* Merge conflicts; remove MacOS, Netware, OS/2, VMS and Windows build machinery.miod2014-04-131-1/+1
|
* resolve conflictsdjm2012-10-131-2/+2
|
* openssl-1.0.0e: resolve conflictsdjm2011-11-031-2/+1
|
* resolve conflicts, fix local changesdjm2010-10-011-5/+5
|
* resolve conflictsdjm2008-09-061-10/+16
|
* resolve conflictsdjm2005-04-291-1/+20
|
* Merge OpenSSL 0.9.7-stable-20020605,beck2002-06-071-1/+10
| | | | correctly autogenerate obj_mac.h
* OpenSSL 0.9.7 stable 2002 05 08 mergebeck2002-05-151-56/+8
|
* openssl-engine-0.9.6 mergebeck2000-12-151-35/+73
|
* OpenSSL 0.9.5 mergebeck2000-03-191-11/+30
| | | | | | *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-52/+163
|
* Import of SSLeay-0.9.0b with RSA and IDEA stubbed + OpenBSD buildryker1998-10-051-0/+305
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.