-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
crypto/rand: use BCryptGenRandom instead of CryptGenRandom on Windows #38938
crypto/rand: use BCryptGenRandom instead of CryptGenRandom on Windows #38938
Conversation
This PR (HEAD: 7c840d4) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/232860 to see it. Tip: You can toggle comments from me using the |
Message from Gobot Gobot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Lubomir I. Ivanov: Patch Set 1: hi, this is the opposite proposal to https://go-review.googlesource.com/c/go/+/210057 xref https://docs.microsoft.com/en-us/windows/win32/api/ntsecapi/nf-ntsecapi-rtlgenrandom with that particular backend, we do not know:
this change on the other hand uses BCryptGenRandom which is the new recommended API by Microsoft and as the issue #33542 mentions is compliant with NIST SP800-90: https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom#remarks
Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
7c840d4
to
88f6563
Compare
This PR (HEAD: 88f6563) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/232860 to see it. Tip: You can toggle comments from me using the |
88f6563
to
ddc7dea
Compare
This PR (HEAD: ddc7dea) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/232860 to see it. Tip: You can toggle comments from me using the |
Message from Alex Brainman: Patch Set 3: (4 comments) Thank you for doing this, but I am not convinced it is worth changing. But let's decide what to do first before continuing with this CL. Alex Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Lubomir I. Ivanov: Patch Set 3: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
ddc7dea
to
2919c3f
Compare
This PR (HEAD: 2919c3f) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/232860 to see it. Tip: You can toggle comments from me using the |
Message from Lubomir I. Ivanov: Patch Set 4: (4 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Lubomir I. Ivanov: Patch Set 4: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Alex Brainman: Patch Set 4: (8 comments) Lets wait for decision here before we proceed with this CL. Alex Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Lubomir I. Ivanov: Patch Set 4: (5 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
2919c3f
to
e70e214
Compare
This PR (HEAD: e70e214) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/232860 to see it. Tip: You can toggle comments from me using the |
Message from Lubomir I. Ivanov: Patch Set 5: (3 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Alex Brainman: Patch Set 5: (1 comment) I will wait for decision on the issue, before proceeding here. Thank you. Alex Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
The existing function that is used is CryptGenRandom. This function and the whole underling API is deprecated. Use the function BCryptGenRandom from the new recommended API called "Cryptography API: Next Generation (CNG)". Preload and use the BCRYPT_RNG_ALGORITHM provider. It follows the standards: FIPS 186-2, FIPS 140-2, NIST SP 800-90 Fixes golang#33542
e70e214
to
c7fb621
Compare
This PR (HEAD: c7fb621) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/232860 to see it. Tip: You can toggle comments from me using the |
Message from Alex Brainman: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/232860. |
The existing function that is used is CryptGenRandom. This function
and the whole underling API is deprecated.
Use the function BCryptGenRandom from the new recommended
API called "Cryptography API: Next Generation (CNG)".
Fixes #33542