boringssl/crypto/x509
David Benjamin aa58513f40 Reserve ex_data index zero for app_data.
In the ancient times, before ex_data and OpenSSL, SSLeay supported a
single app_data slot in various types. Later app_data begat ex_data, and
app_data was replaced by compatibility macros to ex_data index zero.

Today, app_data is still in use, but ex_data never reserved index zero
for app_data. This causes some danger where, if the first ex_data
registration did not use NULL callbacks, the registration's callbacks
would collide with app_data.

Instead, add an option to the types with app_data to reserve index zero.
Also switch SSL_get_ex_data_X509_STORE_CTX_idx to always return zero
rather than allocate a new one. It used to be that you used
X509_STORE_CTX_get_app_data. I only found one consumer that we probably
don't care about, but, to be safe and since it's easy, go with the
conservative option. (Although SSL_get_ex_data_X509_STORE_CTX_idx wasn't
guaranteed to alias app_data, in practice it always did. No consumer
ever calls X509_STORE_CTX_get_ex_new_index.)

Change-Id: Ie75b279d60aefd003ffef103f99021c5d696a5e9
Reviewed-on: https://boringssl-review.googlesource.com/5313
Reviewed-by: Adam Langley <agl@google.com>
2015-07-20 16:56:34 +00:00
..
a_digest.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
a_sign.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
a_strex.c Remove string.h from base.h. 2015-02-02 19:14:15 +00:00
a_verify.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
asn1_gen.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
by_dir.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
by_file.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
charmap.h
CMakeLists.txt Restore |X509_REQ_print| and friends, from OpenSSL at ce7e647b. 2015-06-23 22:36:52 +00:00
i2d_pr.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
pkcs7_test.c Eliminate unnecessary includes from low-level crypto modules. 2015-04-13 20:49:18 +00:00
pkcs7.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
t_crl.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
t_req.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
t_x509.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
t_x509a.c
vpm_int.h Update API to use (char *) for email addresses and hostnames. 2015-02-13 11:00:48 -08:00
x509_att.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_cmp.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_d2.c
x509_def.c
x509_ext.c
x509_lu.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_obj.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_r2x.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_req.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_set.c Omit version for v1 certificates. 2014-11-10 13:45:32 -08:00
x509_trs.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_txt.c
x509_v3.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509_vfy.c Reserve ex_data index zero for app_data. 2015-07-20 16:56:34 +00:00
x509_vpm.c Require that FOO_free functions do nothing on NULL. 2015-05-04 22:58:13 +00:00
x509.c
x509cset.c
x509name.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509rset.c
x509spki.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x509type.c
x_algor.c Fix various certificate fingerprint issues. 2015-01-09 19:41:59 +00:00
x_all.c Parse RSAPrivateKey with CBS. 2015-07-07 22:50:53 +00:00
x_attrib.c
x_crl.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x_exten.c
x_info.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x_name.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x_pkey.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x_pubkey.c Remove the func parameter to OPENSSL_PUT_ERROR. 2015-07-16 02:02:37 +00:00
x_req.c Remove last references to named locks. 2015-05-20 19:18:30 +00:00
x_sig.c
x_spki.c
x_val.c
x_x509.c Remove last references to named locks. 2015-05-20 19:18:30 +00:00
x_x509a.c