-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
@@ -186,7 +186,7 @@ impl ReadRng { | |||
not(target_os = "freebsd"), | |||
not(target_os = "fuchsia"), | |||
not(target_os = "ios"), | |||
not(target_os = "nacl"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, my only point was that this is not mentioned in the commit message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.