I would favor a separate --library-versions or something for this.
It should be pretty verbose: logging the compile-time and run-time versions of each library, and logging both the human-readable and the hex-encoded versions.
Trac: Component: - Select a component to Tor Client Milestone: N/Ato Tor: unspecified
Please check the below branch for a partial implementation. Currently treating it like '--versions' and will exit after printing. Also updated the versions string after regular startup to include runtime zlib version (was already printing openssl and libevent).
Haven't implemented hex-encoded versions yet, just need to clarify that we're just wanting the hexprint of the integer version number and not a hash of the actual lib or something? Is this also required for compile and runtime?
Are we supporting zlib <= 1.1 as I think the ZLIB_VERNUM is only usable after that, but we can just parse the ZLIB_VERSION to get a similar output if necessary. Do you have any additional requirements for the hex-encoded versions?
crypto_openssl_get_header_version_str leaks its output. It should probably use the static-variable trick.
I don't think the hex thing is actually needed. (I wonder why I mentioned it above?)
I hope we aren't supporting zlib <= 1.1; zlib 1.1.0 was released in 1998, and several security flaws in zlib have been fixed since then.
Other than that, it seems okay to me.
It's going to conflict with #4647 (moved), but that's not a big deal. (Don't worry about this; solving merge conflicts my thing.) I'll merge it after #4647 (moved), since it'll probably be easier that way.