-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
macOS use SecRandomCopyBytes instead of getentropy #20466
Conversation
…available on macOS 10.12+)
Ooo, nice side benefit: I can now compile |
@ringabout I just realized that this change I'm proposing is pretty much the same as what you did in ringabout@c467017 Any reason why you didn't end up merging that change in? |
CI is only failing for the unrelated problem fixed by #20495. Can this be merged? |
Ping @ringabout |
Because I don't want to introduce dependency |
FWIW, some people have experienced Apple not allowing apps that use What's the reason for not wanting to pull in the Security framework? I think it's available on all macOS machines. If it's really undesirable to pull in the Security framework, this post makes me think it might be possible to use |
See also rust-random/getrandom#38 (comment) |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
…21389) * On macOS use SecRandomCopyBytes instead of getentropy (which is only available on macOS 10.12+) * Change passL to passl --------- Co-authored-by: Clay Sweetser <[email protected]> Co-authored-by: ringabout <[email protected]>
* On macOS use SecRandomCopyBytes instead of getentropy (which is only available on macOS 10.12+) * Change passL to passl
This changes the
urandom
proc to useSecRandomCopyBytes
on macOS instead ofgetentropy
because:SecRandomCopyBytes
is available on iOS 2.0+ and macOS 10.7+ https://developer.apple.com/documentation/security/1399291-secrandomcopybytes?language=objcgetentropy
is only available on macOS 10.12+This fixes my application that I currently build for a macOS 10.10 machine after upgrading to Nim 1.6 from Nim 1.4. This supersedes and closes #20460