aboutsummaryrefslogtreecommitdiffstats
path: root/src/_cffi_src/build_openssl.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-05-30 20:56:15 -0500
committerAlex Gaynor <alex.gaynor@gmail.com>2017-05-30 21:56:15 -0400
commitb637aec1624e558b0e158064264a2523a4dcba31 (patch)
tree02709cf3c87c29375e1fc52100648709a7625abf /src/_cffi_src/build_openssl.py
parent5ca7eb75069883bc5be9a078ee85207461fb5d55 (diff)
downloadcryptography-b637aec1624e558b0e158064264a2523a4dcba31.tar.gz
cryptography-b637aec1624e558b0e158064264a2523a4dcba31.tar.bz2
cryptography-b637aec1624e558b0e158064264a2523a4dcba31.zip
runtime detection of getentropy for macOS via weak-linking (#3650)
* runtime detection of getentropy for macOS via weak-linking In the before time, in the long long ago, there was a desire to use getentropy on macOS. So some code was written and it detected getentropy support by seeing if SYS_getentropy was available in the headers. But lo, it turns out Apple ships headers for different SDK versions and users on < 10.12 were getting headers that had SYS_getentropy even though their OS did not support it. There was much wailing and gnashing of teeth, but the frustrated developers remembered that Apple wants their developers to use weak linking. With weak linking the mighty developer can specify a minimum version and any symbol that was added after that version will be weakly linked. Then, at runtime, the dynamic linker will make unavailable symbols thus marked into NULLs. So, the developer need only alter their code to do runtime detection of weakly linked symbols and then a single binary may be compiled that will correctly select getentropy or /dev/urandom at runtime. Hallelujah! * oops * separate the enum * okay just apple
Diffstat (limited to 'src/_cffi_src/build_openssl.py')
0 files changed, 0 insertions, 0 deletions