summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_dec.c
AgeCommit message (Collapse)Author
2016-11-10Don't set choice selector on parse failure.Dr. Stephen Henson
Don't set choice selector on parse failure: this can pass unexpected values to the choice callback. Instead free up partial structure directly. CVE-2016-7053 Thanks to Tyler Nighswander of ForAllSecure for reporting this issue. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-05spelling fixes, just comments and readme.klemens
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1413)
2016-07-06Don't indicate errors during initial adb decode.Dr. Stephen Henson
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-06-15Change (!seqtt) to (seqtt == NULL)Richard Levitte
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-06-15Always check that the value returned by asn1_do_adb() is non-NULLRichard Levitte
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-06-04Check for overflows in EOC.Dr. Stephen Henson
RT#4474 (partial) Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-05-20Rename lh_xxx,sk_xxx tp OPENSSL_{LH,SK}_xxxRich Salz
Rename sk_xxx to OPENSSL_sk_xxx and _STACK to OPENSSL_STACK Rename lh_xxx API to OPENSSL_LH_xxx and LHASH_NODE to OPENSSL_LH_NODE Make lhash stuff opaque. Use typedefs for function pointers; makes the code simpler. Remove CHECKED_xxx macros. Add documentation; remove old X509-oriented doc. Add API-compat names for entire old API Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
2016-05-17Copyright consolidation 08/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-03Fix ASN1_INTEGER handling.Dr. Stephen Henson
Only treat an ASN1_ANY type as an integer if it has the V_ASN1_INTEGER tag: V_ASN1_NEG_INTEGER is an internal only value which is never used for on the wire encoding. Thanks to David Benjamin <davidben@google.com> for reporting this bug. This was found using libFuzzer. RT#4364 (part)CVE-2016-2108. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2016-04-04Fix memory leaks in ASN.1Emilia Kasper
These leaks affect 1.1.0 dev branch only; introduced around commit f93ad22f6adb00e722c130e792799467f3927b56 Found with LibFuzzer Reviewed-by: Ben Laurie <ben@openssl.org>
2016-02-05GH601: Various spelling fixes.FdaSilvaYY
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
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>
2016-01-24Fix possible memory leak on BUF_MEM_grow_clean failureFdaSilvaYY
Simplify BUF_MEM init. code Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #580
2016-01-23free item after sk_push failmrpre
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-11-09Continue standardising malloc style for libcryptoMatt Caswell
Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-10-05Free up ASN.1 structures at top level only.Dr. Stephen Henson
When a decoding error in ASN.1 occurs only free up the partial structure at the top level. This simplifies embedded handling and fixes freeing up of structures when presented with malformed input. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-16New ASN.1 embed macro.Dr. Stephen Henson
New ASN.1 macro ASN1_EMBED. This is the same as ASN1_SIMPLE except the structure is not allocated: it is part of the parent. That is instead of FOO *x; it must be: FOO x; This reduces memory fragmentation and make it impossible to accidentally set a mandatory field to NULL. This currently only works for SEQUENCE and since it is equivalent to ASN1_SIMPLE it cannot be tagged, OPTIONAL, SET OF or SEQUENCE OF. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-09-14d2i: don't update input pointer on failureKurt Roeckx
Reviewed-by: Dr. Stephen Henson <steve@openssl.org> MR #1005
2015-05-06Initialize potentially uninitialized local variablesGunnar Kudrjavets
Compiling OpenSSL code with MSVC and /W4 results in a number of warnings. One category of warnings is particularly interesting - C4701 (potentially uninitialized local variable 'name' used). This warning pretty much means that there's a code path which results in uninitialized variables being used or returned. Depending on compiler, its options, OS, values in registers and/or stack, the results can be nondeterministic. Cases like this are very hard to debug so it's rational to fix these issues. This patch contains a set of trivial fixes for all the C4701 warnings (just initializing variables to 0 or NULL or appropriate error code) to make sure that deterministic values will be returned from all the execution paths. RT#3835 Signed-off-by: Matt Caswell <matt@openssl.org> Matt's note: All of these appear to be bogus warnings, i.e. there isn't actually a code path where an unitialised variable could be used - its just that the compiler hasn't been able to figure that out from the logic. So this commit is just about silencing spurious warnings. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-05-01free null cleanup finaleRich Salz
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-28Make asn1_ex_i2c, asn1_ex_c2i static.Dr. Stephen Henson
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-03-26Move more internal only functions to asn1_locl.hDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-25Move internal only ASN.1 functions to asn1_locl.hDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-23Remove old style ASN.1 support.Dr. Stephen Henson
Remove old ASN.1 COMPAT type. This was meant as a temporary measure so older ASN.1 code (from OpenSSL 0.9.6) still worked. It's a hack which breaks constification and hopefully nothing uses it now, if it ever did. Reviewed-by: Matt Caswell <matt@openssl.org>
2015-03-19Free up ADB and CHOICE if already initialised.Dr. Stephen Henson
CVE-2015-0287 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-01-29clang on Linux x86_64 complains about unreachable code.Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix strange formatting by indentMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-17Reject invalid constructed encodings.Dr. Stephen Henson
According to X6.90 null, object identifier, boolean, integer and enumerated types can only have primitive encodings: return an error if any of these are received with a constructed encoding. Reviewed-by: Emilia Käsper <emilia@openssl.org>
2010-06-12Fix warnings.Ben Laurie
2009-03-25Update from stable branch.Dr. Stephen Henson
2009-03-25Update from stable branch.Dr. Stephen Henson
2009-03-14Update from stable branch.Dr. Stephen Henson
2008-11-12Revert the size_t modifications from HEAD that had led to moreGeoff Thorpe
knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD.
2008-11-05Update obsolete email address...Dr. Stephen Henson
2008-11-01size_tification.Ben Laurie
2008-06-04More type-checking.Ben Laurie
2007-01-23Update from 0.9.7-stable.Dr. Stephen Henson
2006-11-16Initial, incomplete support for typesafe macros without using functionDr. Stephen Henson
casts.
2006-09-28Fix ASN.1 parsing of certain invalid structures that can resultMark J. Cox
in a denial of service. (CVE-2006-2937) [Steve Henson]
2006-08-31Fix leakDr. Stephen Henson
2006-02-19Tolerate a SEQUENCE in DN components.Dr. Stephen Henson
2006-02-08p could be uninitializedNils Larsch
2006-01-31Ignore zero length constructed segments.Dr. Stephen Henson
2006-01-29add additional checks + cleanupNils Larsch
Submitted by: David Hartman <david_hartman@symantec.com>
2005-09-01Extend callback function to support print customization.Dr. Stephen Henson
2005-05-11Fix more error codes.Bodo Möller
(Also improve util/ck_errf.pl script, and occasionally fix source code formatting.)
2005-04-30Typo.Dr. Stephen Henson
2005-04-30Don't attempt to parse nested ASN1 strings by default.Dr. Stephen Henson
2005-04-30Use more efficient way to locate end of an ASN1 structure.Dr. Stephen Henson