-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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 test coverage - remaining blockers in crypto #17731
Comments
That It shouldn't be possible to reach that Does code coverage see a CHECK as a branch without coverage? I'm guessing no because it's a termination point. |
Re: Lines 5598 to 5607 in efffcc2
The original confusion here might come from the fact that C++ Re: Lines 4149 to 4152 in efffcc2
|
Ah, so that was changed recently in 7124b46, before that it worked the way I described.
That's not the line @Leko linked to, though. That line should be unreachable because it should never be possible to construct a Hash object that has |
Sorry, I'm just responding to the original premise of "Can't throw ERR_CRYPTO_HASH_UPDATE_FAILED" which is definitely possible. Didn't mean to disagree re: it not being possible to reach via the route presented. |
@bnoordhuis @apapirovski
I didn't know that. I'd misunderstood.
I'll try to reach this condition. |
Hi.
I try to improve test coverage of internal/crypto.
Already I submitted pull requests that I can write test.
#17555, #17458, #17449, #17447, #17426, #17418, #17728 and #17730.
I found two coverage blockers.
1.
process.binding('crypto').PBKDF2
does not returns -1Code
node/lib/internal/crypto/pbkdf2.js
Lines 82 to 87 in 7124b46
Reason
PBKDF2
returns undefined always becausePBKDF2
returns anything.See also:
node/src/node_crypto.cc
Line 5569 in efffcc2
So never match returns
-1
.2. Can't throw
ERR_CRYPTO_HASH_UPDATE_FAILED
Code
node/lib/internal/crypto/hash.js
Lines 57 to 58 in 7907534
Reason
Hash#_handle.update does not throw an Error(ERR_CRYPTO_HASH_UPDATE_FAILED).
Hash#_handle.update returns false when
mdctx_
pointed at null.But I could not reproduce mdctx_ make the null pointer.
See also:
node/src/node_crypto.cc
Lines 4131 to 4133 in efffcc2
1: I think should remove check where PBKDF2 returns -1.
2: Please teach me how to make
mdctx_
to the null pointer.The text was updated successfully, but these errors were encountered: