-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
CPython uses deprecated randomness API #88777
Comments
CPython 3.9 uses CryptGenRandom(), which has been deprecated by Microsoft. I'm told the randomness produced by CryptGenRandom() is fine, but Microsoft has introduced a newer API for getting randomness. For these reasons, Python/bootstrap_hash.c should be updated to use https://docs.microsoft.com/en-us/windows/win32/seccng/cng-por , but it is not urgent, and is not needed in older versions of CPython. Also the documentation that references CryptGenRandom() should be updated, EG: https://docs.python.org/3/library/os.html#os.urandom |
Dan, the Microsoft URL in your message gives a 404 for me. Did you perhaps mean to end it with "cng-portal" (instead of "cng-por")? |
Yes, cng-portal. On Mon, Jul 12, 2021 at 3:24 PM Thomas Grainger <report@bugs.python.org>
-- Dan Stromberg | Senior Software Engineer Mobile +1.949.342.6502 <https://keepersecurity.com/\> ** This email is confidential and is intended for the recipient(s) |
@tim.peters Can you please take a look at #71355? |
Would it be possible to document in os.urandom() documentation that the BCryptGenRandom() function is used on Windows with the "system-preferred random number generator algorithm"? (I don't think that we should mention the BCRYPT_USE_SYSTEM_PREFERRED_RNG constant.) |
Thanks for this change, I like the fact that hCryptProv variable could be removed! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: