FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: declare int return type for set_field by danbev · Pull Request #17468 · nodejs/node · GitHub

/ node Public

crypto: declare int return type for set_field - #17468

Closed
danbev wants to merge 2 commits into
nodejs:masterfrom
danbev:crypto_dh_set0_key_void
Closed

crypto: declare int return type for set_field#17468
danbev wants to merge 2 commits into
nodejs:masterfrom
danbev:crypto_dh_set0_key_void

Conversation

danbev commented Dec 5, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

This commit updates the set_field function pointer to return an int, and
also updates the lambdas with a return statement.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. labels Dec 5, 2017

danbev commented Dec 5, 2017

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

The DH_set0_key() in src/node_crypto.cc is a backwards compatibility shim for the function of the same name in openssl 1.1.0, where it returns int.

danbev commented Dec 6, 2017

Copy link
Copy Markdown
Contributor Author

The DH_set0_key() in src/node_crypto.cc is a backwards compatibility shim for the function of the same name in openssl 1.1.0, where it returns int.

Ah I see that now, thanks for clarifying!

Is there a reason for not declaring the return type for the function pointer? I've added a commit with what I mean.

bnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with a suggestion.

Comment thread src/node_crypto.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Since you're threading through the return value, you might as well CHECK_EQ(1, set_field(dh->dh, num));.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sounds good, I'll add the check. Thanks

This commit updates the set_field function pointer to return an int, and
also updates the lambdas with a return statement.
danbev force-pushed the crypto_dh_set0_key_void branch from acbe9e6 to 0a1bfc1 Compare December 7, 2017 06:55
danbev changed the title crypto: make DH_set0_key void crypto: declare int return type for set_field Dec 7, 2017

danbev commented Dec 7, 2017

Copy link
Copy Markdown
Contributor Author

danbev commented Dec 8, 2017

Copy link
Copy Markdown
Contributor Author

Landed in abc2801

danbev closed this Dec 8, 2017
danbev added a commit that referenced this pull request Dec 8, 2017
This commit updates the set_field function pointer to return an int, and
also updates the lambdas with a return statement.

PR-URL: #17468
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
danbev deleted the crypto_dh_set0_key_void branch December 8, 2017 06:22
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
This commit updates the set_field function pointer to return an int, and
also updates the lambdas with a return statement.

PR-URL: #17468
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
This commit updates the set_field function pointer to return an int, and
also updates the lambdas with a return statement.

PR-URL: #17468
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins mentioned this pull request Dec 12, 2017

gibfahn commented Dec 20, 2017

Copy link
Copy Markdown
Member

Should this be backported to v8.x-staging? If yes please follow the guide and raise a backport PR, if no let me know or add the dont-land-on label.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL