aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asn1/x_long.c
Commit message (Collapse)AuthorAgeFilesLines
* Discourage the use of LONG and ZLONG, and deprecate it in the futureRichard Levitte2017-04-101-0/+4
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3126)
* asn1/x_long.c: remove conditions in inner loops and dependency on BN.Andy Polyakov2017-04-101-26/+47
| | | | | | Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3152)
* Fix faulty check of padding in x_long.cRichard Levitte2017-04-041-2/+5
| | | | | | | | Bug uncovered by test [extended tests] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3088)
* Fix a possible integer overflow in long_c2iMatt Caswell2017-04-041-0/+4
| | | | | | | Credit to OSS-Fuzz for finding this. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3088)
* Fix decoding of ASN.1 LONG and ZLONG itemsRichard Levitte2017-03-201-6/+28
| | | | | | | | | | | | | | LONG and ZLONG items (which are OpenSSL private special cases of ASN1_INTEGER) are encoded into DER with padding if the leading octet has the high bit set, where the padding can be 0x00 (for positive numbers) or 0xff (for negative ones). When decoding DER to LONG or ZLONG, the padding wasn't taken in account at all, which means that if the encoded size with padding is one byte more than the size of long, decoding fails. This change fixes that issue. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3000)
* Fix VC warnings about unary minus to an unsigned type.Kurt Roeckx2017-01-151-1/+1
| | | | | Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #2230
* Cast to an unsigned type before negatingKurt Roeckx2016-07-201-1/+1
| | | | | | | | | | | llvm's ubsan reported: runtime error: negation of -9223372036854775808 cannot be represented in type 'long'; cast to an unsigned type to negate this value to itself Found using afl Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #1325
* Avoid signed overflowKurt Roeckx2016-06-241-1/+1
| | | | | | | | Found by afl Reviewed-by: Rich Salz <rsalz@openssl.org> MR: #3013
* Copyright consolidation 08/10Rich Salz2016-05-171-54/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-141-1/+1
| | | | | | | | | | | | | There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix format script.Dr. Stephen Henson2015-03-021-68/+81
| | | | | | | | The format script didn't correctly recognise some ASN.1 macros and didn't reformat some files as a result. Fix script and reformat affected files. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-87/+91
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Update obsolete email address...Dr. Stephen Henson2008-11-051-1/+1
|
* Support custom primitive type printing routines and add one to LONG type.Dr. Stephen Henson2008-02-081-1/+9
|
* Deprecate the recursive includes of bn.h from various API headers (asn1.h,Geoff Thorpe2004-05-171-0/+1
| | | | | | dh.h, dsa.h, ec.h, ecdh.h, ecdsa.h, rsa.h), as the opaque bignum types are already declared in ossl_typ.h. Add explicit includes for bn.h in those C files that need access to structure internals or API functions+macros.
* Constify d2i, s2i, c2i and r2i functions and other associatedRichard Levitte2004-03-151-2/+3
| | | | | | | | functions and macros. This change has associated tags: LEVITTE_before_const and LEVITTE_after_const. Those will be removed when this change has been properly reviewed.
* Use BUF_strlcpy() instead of strcpy().Richard Levitte2003-12-271-2/+8
| | | | | | | Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
* A general spring-cleaning (in autumn) to fix up signed/unsigned warnings.Geoff Thorpe2003-10-291-1/+1
| | | | | | | | | | I have tried to convert 'len' type variable declarations to unsigned as a means to address these warnings when appropriate, but when in doubt I have used casts in the comparisons instead. The better solution (that would get us all lynched by API users) would be to go through and convert all the function prototypes and structure definitions to use unsigned variables except when signed is necessary. The proliferation of (signed) "int" for strictly non-negative uses is unfortunate.
* Get rid of ASN1_ITEM_FUNCTIONS dummy functionDr. Stephen Henson2001-02-231-2/+2
| | | | | | prototype hack. This unfortunately means that every ASN1_*_END construct cannot have a trailing ;
* Initial support for ASN1_ITEM_FUNCTION option toDr. Stephen Henson2001-02-231-2/+7
| | | | | | | | change the way ASN1 modules are exported. Still needs a bit of work for example the hack which a dummy function prototype to avoid compilers warning about multiple ;s.
* Merge from the ASN1 branch of new ASN1 codeDr. Stephen Henson2000-12-081-0/+158
to main trunk. Lets see if the makes it to openssl-cvs :-)