Use SecRandomCopyBytes on MacOS#322
Conversation
|
I know very little about Macs but at least Travis seems happy enough. According to the API this has been available since 10.7 which apparently was released in July 2011, so I guess that's good enough (otherwise it could potentially try falling back to /dev/random or urandom — though with an extern fn it would probably just fail at link time). |
|
Ah, you did find the minimum version. I promise I did a thorough search, but that was half a year ago 😄. With 10.7 as minimum version we are good to go, as that is also the minimum version supported by Rust. |
| not(target_os = "freebsd"), | ||
| not(target_os = "fuchsia"), | ||
| not(target_os = "ios"), | ||
| not(target_os = "nacl"), |
There was a problem hiding this comment.
This is removed because nacl is dead? Seems reasonable to me, but it is not mentioned in the commit message.
There was a problem hiding this comment.
Sure, my only point was that this is not mentioned in the commit message.
There was a problem hiding this comment.
Then you have a good point 😄. But the actual commit that removed nacl was two months ago (this is just one line that was forgotten), so not much to do here.
|
Is this ok to be merged? |
Use SecRandomCopyBytes on MacOS
I am cleaning up some old branches, and this is a change from October...
Using the syscall interface if available seems always better than reading from
/dev/random. I can't find any data on which version of OS X was the first to ship the interface, but it seems to be have been around for a long time. It is also the interface used byring.