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
..
2015-02-02 19:14:15 +00:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-11-10 13:45:32 -08:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2015-07-07 22:50:53 +00:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2015-05-20 19:18:30 +00:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00
2014-06-20 13:17:32 -07:00