crypto: fix error code handling in ParsePrivateKey()#42400
Closed
RaisinTen wants to merge 1 commit intonodejs:mainfrom
Closed
crypto: fix error code handling in ParsePrivateKey()#42400RaisinTen wants to merge 1 commit intonodejs:mainfrom
ParsePrivateKey()#42400RaisinTen wants to merge 1 commit intonodejs:mainfrom
Conversation
This changes the code to select the latest error code instead of the earliest one from the OpenSSL error stack. It helps in getting rid of the inconsistency between the empty passphrase related error codes of OpenSSL 1.1.1 and 3. Refs: nodejs#42319 (comment) Signed-off-by: Darshan Sen <raisinten@gmail.com>
Collaborator
|
Review requested:
|
Collaborator
Member
|
Is OpenSSL pushing multiple errors during a single API call? Or can we somehow prevent having multiple errors on the stack? |
36 tasks
Member
Author
Yes that's right, the errors are coming from this API call - node/src/crypto/crypto_keys.cc Lines 224 to 227 in 7fdb9d5 opensslErrorStack: [
'error:04800068:PEM routines::bad password read',
'error:07880109:common libcrypto routines::interrupted or cancelled'
]The first error is raised from and the second one is fromnode/deps/openssl/openssl/crypto/passphrase.c Line 184 in 7fdb9d5 Is it normal for OpenSSL to push multiple errors on the stack during a single API call?
I don't think that would be possible without making some changes to OpenSSL. |
This was referenced Mar 21, 2022
This was referenced Mar 28, 2022
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.
This changes the code to select the latest error code instead of the
earliest one from the OpenSSL error stack. It helps in getting rid of
the inconsistency between the empty passphrase related error codes of
OpenSSL 1.1.1 and 3.
Refs: #42319 (comment)
Signed-off-by: Darshan Sen raisinten@gmail.com