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
Enhance crypto/hash.js coverage#17447
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
lpinca commented Dec 4, 2017
apapirovski 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.
LGTM but two small changes needed before this lands
| { | ||
| constHash=crypto.Hash; | ||
| constinstance=crypto.Hash('sha256'); | ||
| assert(instanceinstanceofHash,'Hash is expected to return a new instance'+ |
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.
needs a space either at the end of this line (after instance) or on the next line. Right now it says "instancewhen".
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.
Ah, Sorry. I'll update it soon.
| { | ||
| constHmac=crypto.Hmac; | ||
| constinstance=crypto.Hmac('sha256','Node'); | ||
| assert(instanceinstanceofHmac,'Hmac is expected to return a new instance'+ |
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.
Same as above.
Right now it says "instance when".
mhdawson 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.
LGTM once changes from @apapirovski are incorporated
maclover7 commented Dec 4, 2017
Same deal as #17458 (comment), are we able to use the |
maclover7 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.
Two quick nits, then LGTM
| { | ||
| constHmac=crypto.Hmac; | ||
| constinstance=crypto.Hmac('sha256','Node'); |
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.
createHmac
| { | ||
| constHash=crypto.Hash; | ||
| constinstance=crypto.Hash('sha256'); |
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.
createHash
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.
Same adobe #17458 (comment)
BridgeAR 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.
LGTM with @apapirovski comments addressed
apapirovski commented Dec 6, 2017
maclover7 commented Dec 7, 2017
@apapirovski Can you confirm your comments were addressed? |
apapirovski commented Dec 7, 2017
Yes and I'm currently landing this |
apapirovski commented Dec 7, 2017
crypto.Hash - Call constructor without new keyword crypto.Hmac - Call constructor without new keyword - Call constructor with typeof hmac != string - Call constructor with typeof hmac = string, typeof key != string PR-URL: #17447 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
crypto.Hash - Call constructor without new keyword crypto.Hmac - Call constructor without new keyword - Call constructor with typeof hmac != string - Call constructor with typeof hmac = string, typeof key != string PR-URL: #17447 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
crypto.Hash - Call constructor without new keyword crypto.Hmac - Call constructor without new keyword - Call constructor with typeof hmac != string - Call constructor with typeof hmac = string, typeof key != string PR-URL: #17447 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Added these case
crypto.Hash
newkeywordcrypto.Hmac
newkeywordCurrent coverage is here: https://coverage.nodejs.org/coverage-06e1b0386196f8f8/root/internal/crypto/hash.js.html
I cannot write test case:
this._handle.updatereturns false inHash#verify.Because I don't know how to make
mdctx_tonullptrin Hash::HashUpdate.See also:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test