Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
crypto: replace goto SSL_CTX_use_certificate_chain#23113
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
danbev commented Sep 27, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
nodejs-github-bot commented Sep 27, 2018
danbev commented Sep 27, 2018
Uh oh!
There was an error while loading. Please reload this page.
src/node_crypto.cc Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a potential footgun here. Someone someday might look at line 686 and see this:
ret = SSL_CTX_use_certificate_chain(...); return ret;And change that to:
return SSL_CTX_use_certificate_chain(...);Without realizing that the assignment to ret is necessary because of its side effects. Probably also easy to miss in code review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could really do a variant here that uses a smart pointer and releases it if necessary; it’s just not trivial to translate the code to that…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the late response on this. I'll take another stab at this today. Thanks
bbfee1c to 6540586CompareThis commit removes the goto statements in SSL_CTX_use_certificate_chain by using a unique_ptr.
6540586 to a46fae0Comparedanbev commented Oct 4, 2018 • edited by addaleax
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by addaleax
Uh oh!
There was an error while loading. Please reload this page.
Updated CI: https://ci.nodejs.org/job/node-test-pull-request/17623/ (:heavy_check_mark:) |
addaleax left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
danbev commented Oct 8, 2018
Landed in 8d218a9. |
This commit removes the goto statements in SSL_CTX_use_certificate_chain by using a unique_ptr. PR-URL: #23113 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit removes the goto statements in SSL_CTX_use_certificate_chain by using a unique_ptr. PR-URL: #23113 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit removes the goto statements in SSL_CTX_use_certificate_chain by using a unique_ptr. PR-URL: #23113 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
This commit removes the goto statements in SSL_CTX_use_certificate_chain
by using a unique_ptr.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes