If dynamically-loadable ENGINEs are linked against a shared-library version
of libcrypto, then it is possible that when they are loaded they will share the same static data as the loading application/library. This means it will be too late to set memory/ERR/ex_data/[etc] callbacks, but entirely unnecessary to try. This change (and a great part of this comment) was implemented in 0.9.8-dev a long time ago, but slightly differently. In 0.9.8-dev, a specific function that just returns a pointer to some static object is used. For 0.9.7x, we couldn't do that, since the way we handle feature freezes is, among other, to not add any more non-static functions. Instead, we use the function ERR_get_implementation() and compare the returned value with fns->err_fns, a member of fns that already is there, and which therefore can safely be used in this manner. What happens is that if the loaded ENGINE's return value from this function matches the loading application/library's return value - they share static data. If they don't match, the loaded ENGINE has its own copy of libcrypto's static data and so the callbacks need to be set.
parent
d161f5a9
Please register or sign in to comment