Go to file
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
crypto Reserve ex_data index zero for app_data. 2015-07-20 16:56:34 +00:00
decrepit Restore |DES_ede3_cfb_encrypt| and |DES_ede3_cfb64_encrypt| from OpenSSL at ce7e647b. 2015-06-24 01:33:31 +00:00
doc Inital import. 2014-06-20 13:17:32 -07:00
include/openssl Extra documentation. 2015-07-16 21:05:24 +00:00
ssl Reserve ex_data index zero for app_data. 2015-07-20 16:56:34 +00:00
tool Fix build on Unix systems without POSIX realtime extensions. 2015-07-10 01:51:16 +00:00
util Get rid of err function codes. 2015-07-16 02:02:08 +00:00
.clang-format Inital import. 2014-06-20 13:17:32 -07:00
.gitignore Add generated documentation to .gitignore 2015-01-26 18:37:55 +00:00
BUILDING Suggest building at Android API level 16. 2015-06-18 17:32:29 -07:00
CMakeLists.txt Allow compilation for armv6 2015-06-02 18:16:13 +00:00
codereview.settings Add a codereview.settings file. 2014-11-18 22:21:33 +00:00
LICENSE Add LICENSE file. 2015-05-20 17:44:57 +00:00
STYLE Require that FOO_free functions do nothing on NULL. 2015-05-04 22:58:13 +00:00