Closed ueno closed 6 months ago
Thanks for the review!
Why is P11_KIT_CHECK_VERSION
a macro rather than a function? That kind of removes one of the reason for including this sort of API which is to check at runtime that the library linked in (either linked statically at build time or dynamically from whatever environment things are run in) matches the expectation of the calling code. This macro at most allows calling code the verify that the set of headers resolved at build time are the expected ones but doesn't, by itself, provide a way to know what version of the p11 library the code is then linked with.
Given that p11 seems to require non-static builds, it seems like being able to verify that the (unavoidable) .so
that is chosen at run time is what the calling code expects it to be (or at least having a way to know what it actually is) would be at least as desirable here as it is for other libraries that provide that sort of function:
asn1_check_version
idn2_check_version
nettle_version_major
/nettle_version_minor
curl_version_info
ev_version_major
/ev_version_mnor
lua_version
This provides P11_KITVERSION{MAJOR,MINOR,MICRO} from the <p11-kit/version.h> header, along with a helper macro P11_KIT_CHECK_VERSION(major, minor, micro) for checking the version requirement with
#if
directive.Fixes: #523