boringssl/crypto/asn1
David Benjamin c4d5925ca6 Fix various malloc failure checks.
asn1_template_noexp_d2i call ASN1_item_ex_free(&skfield,...) on error.

Reworked error handling in asn1_item_ex_combine_new:
- call ASN1_item_ex_free and return the correct error code if
  ASN1_template_new failed.
- dont call ASN1_item_ex_free if ASN1_OP_NEW_PRE failed.

Reworked error handing in x509_name_ex_d2i and x509_name_encode.

(Imported from upstream's 748cb9a17f4f2b77aad816cf658cd4025dc847ee.)

I believe the tasn1_new.c change is a no-op since we have no
ASN1_OP_NEW_PRE hooks anymore. I'm not sure what the commit message is
referring to with ASN1_template_new. It also seems odd as
ASN1_item_ex_free should probably be able to survive *pval being NULL.
Whatever.

We'd previously tried to fix x509_name_ex_d2i, but I think ours wasn't
quite right. (This thing is a mess...) I've aligned that function with
upstream.

Change-Id: Ie71521cd8a1ec357876caadd13be1ce247110f76
Reviewed-on: https://boringssl-review.googlesource.com/13831
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
2017-02-17 01:11:21 +00:00
..
a_bitstr.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
a_bool.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
a_d2i_fp.c Harden ASN.1 BIO handling of large amounts of data. 2016-04-26 17:06:16 +00:00
a_dup.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
a_enum.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
a_gentm.c Don't leak memory on ASN1_GENERALIZEDTIME_adj() error path 2016-11-10 16:17:29 +00:00
a_i2d_fp.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
a_int.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
a_mbstr.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
a_object.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
a_octet.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
a_print.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
a_strnid.c Fix some missing inits 2016-06-07 22:05:10 +00:00
a_time.c Delete d2i_ASN1_bytes and i2d_ASN1_bytes. 2016-08-16 19:45:13 +00:00
a_type.c Fix ASN1_INTEGER handling. 2016-05-03 16:58:51 +00:00
a_utctm.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
a_utf8.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
asn1_lib.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
asn1_locl.h Remove ASN.1 print hooks. 2016-06-14 17:38:31 +00:00
asn1_par.c Remove ASN1_parse and ASN1_parse_dump. 2016-06-14 17:39:17 +00:00
asn1_test.cc Replace Scoped* heap types with bssl::UniquePtr. 2016-09-01 22:22:54 +00:00
asn_pack.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
charmap.pl
CMakeLists.txt Delete d2i_ASN1_bytes and i2d_ASN1_bytes. 2016-08-16 19:45:13 +00:00
f_enum.c Purge some a2i functions. 2016-08-16 19:38:31 +00:00
f_int.c Purge some a2i functions. 2016-08-16 19:38:31 +00:00
f_string.c Purge some a2i functions. 2016-08-16 19:38:31 +00:00
t_bitst.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
tasn_dec.c Fix various malloc failure checks. 2017-02-17 01:11:21 +00:00
tasn_enc.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
tasn_fre.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
tasn_new.c Fix various malloc failure checks. 2017-02-17 01:11:21 +00:00
tasn_typ.c Remove spurious ';' and fix indentation for macro arguments in one file 2016-08-03 21:41:01 +00:00
tasn_utl.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
x_bignum.c OpenSSL reformat x509/, x509v3/, pem/ and asn1/. 2016-01-19 17:01:51 +00:00
x_long.c Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00