-
Notifications
You must be signed in to change notification settings - Fork 211
Consider using getrandom() or getentropy() for NetBSD 10.0 #274
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
Comments
Please don't change the status quo at least until NetBSD 10.0 is finalized. The NetBSD community is still divided over the API contracts we want to provide, and the behavior and availability of getrandom might change at a moment's notice. |
@alarixnia I would assume if FreeBSD provides a
We don't really care about the semantics of the flags as we never use a non-zero flags value (except on Linux). Am I mistaken about something here? |
Rest assured, we would not make this change until the API of 10.0 was finalized. However, it should be noted that OpenSSL already has code using the EDIT: This was added in openssl/openssl@ef2a44e by @devnexen |
Also, it seems like the |
The devil is in the details, right? There isn't a way to check if the RNG is initialized from userspace (it will be initialized by the boot loader or init system). There is only a way to check the state of the entropy estimator... which has been removed in 10.0, so simply reports whether an HWRNG is present or not. Which results in the application hanging forever waiting for an estimation that will never arrive on systems without one. Checking the state of the entropy estimator is something that's only reasonable to do during NetBSD setup, not during regular Rust application usage. |
The OpenSSL code to call getrandom under NetBSD is unreachable (an earlier |
Thanks @riastradh, I missed that. I've also updated this issue to make it clear this is about if we should call one of these methods once NetBSD 10.0 is out, rather than my ealier phrasing which made it sound like we would definitly call |
Implemented in #331 |
One of the things pointed out in #273 was that NetBSD 10.0 is set to introduce
getrandom()
andgetentropy()
compatibility functions in its libc. Similar to what we already do on DragonFly BSD, FreeBSD, and OpenBSD, we should consider if we want to use one of these functions as our randomness source.As we still want to support NetBSD 9.2 and lower, we will need to check if this function exists, and only then call it. Otherwise, we should fall back to using the existing implementation. An example of this sort of functionality is our NetBSD implementation.
Note that we will not make any changes to our implementation until the NetBSD 10.0 API has been finalized.
Links
Mailing List discussion
Draft manpage
The text was updated successfully, but these errors were encountered: