Skip to content

[v8.x backport] crypto: do not reach into OpenSSL internals for ThrowCryptoError - #18327

Closed
yhwang wants to merge 1 commit into
nodejs:v8.x-stagingfrom
yhwang:backport-16701-to-v8.x-staging
Closed

[v8.x backport] crypto: do not reach into OpenSSL internals for ThrowCryptoError#18327
yhwang wants to merge 1 commit into
nodejs:v8.x-stagingfrom
yhwang:backport-16701-to-v8.x-staging

Conversation

@yhwang

@yhwang yhwang commented Jan 23, 2018

Copy link
Copy Markdown
Member

There is a perfectly serviceable ERR_get_error function which avoids
having to sniff through the OpenSSL ring buffer like that. It does
return the errors in the opposite order, but that's easily fixed with
std::reverse.

Note this behavior is slightly different in that an ERR_get_error loop
will ultimately clear the error queue, but this is desirable. Leaving
the error queue uncleared means errors in subsequent operations may get
mixed up and cause issues.

Original PR-URL: #16701
Reviewed-By: Ben Noordhuis info@bnoordhuis.nl

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants