-
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/rsa: add rand initialization for rsa.SignPSS #39870
base: master
Are you sure you want to change the base?
Conversation
Hi, |
This PR (HEAD: c240625) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/240008 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/240008. |
The nil pointer dereference happens here: Line 283 in c240625
A possible stacktrace for it looks like this:
|
Message from Christian Rebischke: Patch Set 1: Hi, The nil pointer dereference happens here: Line 283 in c240625
A possible stacktrace for it looks like this:
Please don’t reply on this GitHub thread. Visit golang.org/cl/240008. |
c240625
to
27d5802
Compare
This PR (HEAD: 27d5802) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/240008 to see it. Tip: You can toggle comments from me using the |
Message from Christian Rebischke: Patch Set 2: Initialising rand with a secure random source should also increase protection against side-channel-attacks, because of using blinding for the decryption. I am aware that these are just a few rare cases, but it is definitely better than allowing a user using nil. Please don’t reply on this GitHub thread. Visit golang.org/cl/240008. |
Message from Christian Rebischke: Patch Set 2: What do you think about adding a secure random source for other functions in crypto/rsa, too? Shall I initialize with rand.Reader for the other functions, as well? Please don’t reply on this GitHub thread. Visit golang.org/cl/240008. |
If nil as random source is being passed to rsa.SignPSS this is going to lead to a nil pointer dereference and invalid memory access. This commit intents to this fix via initializing a secure random source with crypto/rand.Reader
27d5802
to
18de9fc
Compare
This PR (HEAD: 18de9fc) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/240008 to see it. Tip: You can toggle comments from me using the |
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/240008. |
@heschi can you provide some information why this has been closed? I still think that throwing panics is bad practice and initializing the random as fallback is a good way. |
I closed old PRs to reduce load on the Gerrit importer (#50197), sorry for the trouble. I'll reopen the CL and PR. |
@heschi no worries :) @FiloSottile I don't know if discussions around this should happen in gerrit or github, but can I get an answer on my latest comment or a final decision? I am not sad, if you reject this commit. I would just like to know if I should invest more time into this. |
If nil as random source is being passed to rsa.SignPSS
this is going to lead to a nil pointer dereference and invalid memory
access. This commit intents to this fix via initializing
a secure random source with crypto/rand.Reader