crypto: avoid unitializing ECDH objects on error#34302
Closed
tniessen wants to merge 1 commit intonodejs:masterfrom
Closed
crypto: avoid unitializing ECDH objects on error#34302tniessen wants to merge 1 commit intonodejs:masterfrom
tniessen wants to merge 1 commit intonodejs:masterfrom
Conversation
bnoordhuis
approved these changes
Jul 11, 2020
jasnell
approved these changes
Jul 12, 2020
Collaborator
This was referenced Jul 18, 2020
addaleax
approved these changes
Jul 20, 2020
Collaborator
10 tasks
Member
|
I’m guessing this test failure is not unrelated? https://ci.nodejs.org/job/node-test-commit-linux-containered/21411/nodes=ubi81_sharedlibs_openssl111fips_x64/testReport/junit/(root)/test/parallel_test_crypto_dh/ |
This was referenced Jul 22, 2020
Member
Author
|
I ran the test about 100,000 times locally without errors, so the error seems to be platform-specific. CI stress test: https://ci.nodejs.org/job/node-stress-single-test/167/
Crash
Failed to convert Buffer to EC_POINTERR_CRYPTO_ECDH_INVALID_PUBLIC_KEYNew stress test with a few more platforms: https://ci.nodejs.org/job/node-stress-single-test/168/
Seems like a memory-related bug. Can reproduce in valgrind on Ubuntu. |
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated.
46040f1 to
a8c7d72
Compare
Collaborator
Member
Author
|
Landed in 4a9e312, thanks for reviewing. |
tniessen
added a commit
that referenced
this pull request
Aug 14, 2020
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated. PR-URL: #34302 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
AKJK-Internet-Megacorps
approved these changes
Aug 16, 2020
MylesBorins
pushed a commit
that referenced
this pull request
Aug 17, 2020
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated. PR-URL: #34302 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
BethGriggs
pushed a commit
that referenced
this pull request
Aug 20, 2020
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated. PR-URL: #34302 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax
pushed a commit
that referenced
this pull request
Sep 22, 2020
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated. PR-URL: #34302 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
addaleax
pushed a commit
that referenced
this pull request
Sep 22, 2020
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated. PR-URL: #34302 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Merged
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous code changed the private key of the ECDH object, but removed the public key if deriving it from the private key failed. Instead, if deriving the public key fails, neither the private nor the public key stored in the ECDH object should be updated.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes