Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCrypto add opensslerror stack #15518
Conversation
@@ -193,7 +193,7 @@ detailing the point in the code at which the `Error` was instantiated, and may | |||
provide a text description of the error. |
This comment has been minimized.
This comment has been minimized.
gla5001
Sep 21, 2017
•
Author
Contributor
This commit has the latest review comment fixes.
@bnoordhuis, i believe i've addressed all of your comments. Thanks for the review.
if (es->bottom != es->top) { | ||
Local<Array> error_stack = Array::New(env->isolate()); | ||
int top = es->top; | ||
|
This comment has been minimized.
This comment has been minimized.
// arithmetic to loop back around in the case where bottom is after top. | ||
// Using ERR_NUM_ERRORS macro defined in openssl. | ||
es->top = (((es->top - 1) % ERR_NUM_ERRORS) + ERR_NUM_ERRORS) % | ||
ERR_NUM_ERRORS; | ||
} |
This comment has been minimized.
This comment has been minimized.
@@ -4326,8 +4339,6 @@ SignBase::Error Verify::VerifyFinal(const char* key_pem, | |||
int r = 0; | |||
EVP_PKEY_CTX* pkctx = nullptr; | |||
|
|||
ERR_set_mark(); | |||
|
|||
bp = BIO_new_mem_buf(const_cast<char*>(key_pem), key_pem_len); |
This comment has been minimized.
This comment has been minimized.
err.openSSLErrorStack !== undefined && | ||
Array.isArray(err.openSSLErrorStack) && | ||
err.openSSLErrorStack.length === 0) { | ||
err.openSSLErrorStack === undefined) { | ||
return true; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ping @nodejs/crypto |
@@ -193,7 +193,7 @@ detailing the point in the code at which the `Error` was instantiated, and may | |||
provide a text description of the error. | |||
|
|||
For crypto only, `Error` objects will include the OpenSSL error stack in a | |||
separate property called `openSSLErrorStack` if it is available when the error is thrown. |
This comment has been minimized.
This comment has been minimized.
LGTM |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@gla5001 when trying to rebase this on the CI it gets a conflict. I am a bit surprised that this is not shown here but would you be so kind and rebase this nevertheless? |
This comment has been minimized.
This comment has been minimized.
@BridgeAR sure thing |
537284e
to
2ad7440
This comment has been minimized.
This comment has been minimized.
@BridgeAR rebased and pushed. Could you let me know if this resolves the issue? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Landed in ccfcd88 |
Add openSSL error stack to the exception object thrown from crypto. The new exception property is only added to the object if the error stack has not cleared out prior to calling ThrowCryptoError. PR-URL: #15518 Refs: #5444 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Add openSSL error stack to the exception object thrown from crypto. The new exception property is only added to the object if the error stack has not cleared out prior to calling ThrowCryptoError. PR-URL: nodejs#15518 Refs: nodejs#5444 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
This comment has been minimized.
This comment has been minimized.
The commit log could have had a link to #14725, that's where 95% of the review took place. This comment will have to do. |
Add openSSL error stack to the exception object thrown from crypto. The new exception property is only added to the object if the error stack has not cleared out prior to calling ThrowCryptoError. PR-URL: #15518 Refs: #5444 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Add openSSL error stack to the exception object thrown from crypto. The new exception property is only added to the object if the error stack has not cleared out prior to calling ThrowCryptoError. PR-URL: nodejs/node#15518 Refs: nodejs/node#5444 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Add openSSL error stack to the exception object thrown from crypto. The new exception property is only added to the object if the error stack has not cleared out prior to calling ThrowCryptoError. PR-URL: #15518 Refs: #5444 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Add openSSL error stack to the exception object thrown from crypto. The new exception property is only added to the object if the error stack has not cleared out prior to calling ThrowCryptoError. PR-URL: #15518 Refs: #5444 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
This comment has been minimized.
This comment has been minimized.
Should this be backported to edit: this likely shouldn'y be backported if it is changing error messages prior to error codes... but I wanted to confirm |
This comment has been minimized.
This comment has been minimized.
@MylesBorins I believe it should not be backported. |
gla5001 commentedSep 21, 2017
•
edited
Feature request to add openSSL error stack to the exception object
thrown from crypto. New exception property only added to object
if the error stack has not cleared out prior to calling
ThrowCryptoError.
I did something very wrong when trying to rebase, so i just created a new branch and a new PR. This PR has all the changes requested from #14725. I will close the other one.
Refs: #5444
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
crypto