Skip to content

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

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: https://github.com/nodejs/node/pull/16701 Reviewed-By: Ben Noordhuis info@bnoordhuis.nl

Merge request reports

Loading