-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: remove useless if statement #15041
Conversation
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.
LGTM
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.
The if statement is not useless but there is a bug in the if statement below; it should have been else if
, i.e., it needs to be a chain.
In that case there should also be a test case included. |
@bnoordhuis In the docs for |
@indutny You are the author of those lines. What was the intent here? |
Passing raw number down there when needed? |
@indutny I am not sure I can follow your comment. Can you please elaborate? Right now this code path never worked because it always resulted in an error. Was this by accident and we miss a test case for this or should the if statement just be removed? |
Ping @indutny again |
@nodejs/tsc PTAL. I recommend removing this statement if we can not determine what it is meant for. |
Sorry for cryptic comment. I didn't have enough time to elaborate that day. The idea was that people may want to pass constant's raw numeric value into that function. Not sure if we want to have this API anymore, very likely we don't. It is going to be a major change, though. |
@bnoordhuis I guess it is clear now that it is fine to land this? |
Oh, you're right. LGTM then. |
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.
LGTM
Wonderful! @starkwang would you be so kind and rebase? This could land otherwise. |
Ping @starkwang |
The if statement in `ECDH.getPublicKey` is useless. This change is to remove it.
af3a221
to
12424fa
Compare
@BridgeAR Sorry for my sluggishness. I've just rebased. |
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.
Landed in 43e7e8d |
The if statement in `ECDH.getPublicKey` is useless. This change is to remove it. PR-URL: #15041 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Diffie helman isn't on 8.x afaik. Please feel free to change the labels if neccessary |
The if statement in `ECDH.getPublicKey` is useless. This change is to remove it. PR-URL: nodejs/node#15041 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
The if statement in
ECDH.getPublicKey
is useless. This change is to remove it.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
crypto