-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
src: add HAVE_OPENSSL guard to crypto providers #12967
Conversation
When configured --without-ssl node_crypto.h will not be included but async-wrap.h includes providers that are defined in node_crypto.h, node_crypto.cc, and tls_wrap.cc: AsyncWrap::PROVIDER_CONNECTION AsyncWrap::PROVIDER_PBKDF2REQUEST AsyncWrap::PROVIDER_RANDOMBYTESREQUEST AsyncWrap::PROVIDER_TLSWRAP These will be included as providers which will cause test-async-wrap-getasyncid.js to fail. This commit suggest adding a guard and exclude the providers that are not available when configured --without-ssl
src/async-wrap.h
Outdated
@@ -34,34 +34,44 @@ namespace node { | |||
|
|||
#define NODE_ASYNC_ID_OFFSET 0xA1C | |||
|
|||
#define NODE_ASYNC_PROVIDER_TYPES(V) \ | |||
#define NODE_ASYNC_NONE_CRYPTO_PROVIDER_TYPES(V) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: could we use NO_CRYPTO
instead of NONE_CRYPTO
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll change that. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, although I'd like someone with more experience here to confirm.
just-in-case cc/ @trevnorris @bnoordhuis (although I think they're both pretty busy recently). |
I'm running the test on windows locally to see if I can reproduce the windows-fanned error reported which does look related: ok 1 parallel/test-assert-fail
---
duration_ms: 0.145
...
not ok 2 parallel/test-async-wrap-getasyncid
---
duration_ms: 0.262
severity: fail
stack: |-
Mismatched <anonymous> function calls. Expected 1, actual 0.
at Object.<anonymous> (c:\workspace\node-test-binary-windows\RUN_SUBSET\3\VS_VERSION\vs2015\label\win2008r2\test\parallel\test-async-wrap-getasyncid.js:155:42)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:144:16)
at bootstrap_node.js:561:3
(node:2036) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead. The test/osx I'm not sure about: not ok 589 parallel/test-http-res-write-after-end
---
duration_ms: 7.7
severity: crashed
stack: |-
oh no!
exit code: CRASHED (Signal: 9)
...
not ok 590 parallel/test-http-request-methods
---
duration_ms: 7.61
severity: crashed
stack: |-
oh no!
exit code: CRASHED (Signal: 9) I don't see this locally but lately I do get test failures now and again. |
V(TTYWRAP) \ | ||
V(UDPSENDWRAP) \ | ||
V(UDPWRAP) \ | ||
V(WRITEWRAP) \ | ||
V(ZLIB) | ||
|
||
#if HAVE_OPENSSL | ||
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \ | ||
V(CONNECTION) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not in this PR, but we should probably rename this to SSLCONNECTION
or something like that?
cc/ @nodejs/platform-windows for the above CI failure |
Looking into it, did the test fail with or without ssl? |
src/async-wrap.h
Outdated
@@ -34,34 +34,44 @@ namespace node { | |||
|
|||
#define NODE_ASYNC_ID_OFFSET 0xA1C | |||
|
|||
#define NODE_ASYNC_PROVIDER_TYPES(V) \ | |||
#define NODE_ASYNC_NO_CRYPTO_PROVIDER_TYPES(V) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be ASYNC_NON_CRYPTO
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's for when you build with no crypto, so for me NO_CRYPTO
sounds better.
I retract that, these are the non-crypto provider types aren't they, in which case I think you're right, NON_CRYPTO
makes more sense.
sorry for the churn @danbev!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problems, I'll update.
No repro when built with SSL. |
No repro when built without SSL. |
I've rerun CI: https://ci.nodejs.org/job/node-test-commit/9820/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name churn, sorry...
No problems, I'll update this. |
When configured --without-ssl node_crypto.h will not be included but async-wrap.h includes providers that are defined in node_crypto.h, node_crypto.cc, and tls_wrap.cc: AsyncWrap::PROVIDER_CONNECTION AsyncWrap::PROVIDER_PBKDF2REQUEST AsyncWrap::PROVIDER_RANDOMBYTESREQUEST AsyncWrap::PROVIDER_TLSWRAP These will be included as providers which will cause test-async-wrap-getasyncid.js to fail. This commit suggest adding a guard and exclude the providers that are not available when configured --without-ssl PR-URL: nodejs#12967 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Landed in 1541079 |
Currently the async provider type CONNECTION is used in node_crypto.h and it might be clearer if it was named SSLCONNECTION as suggested by addaleax. This commit renames only the provider type as I was not sure if it was alright to change the class Connection as well. Refs: nodejs#12967 (comment)
@danbev generally good to leave PRs open for at least 48/72 hours to make sure everyone gets a chance to see and review them (unless there's a reason to land sooner). No big deal in this case, just a reminder 😄 . |
@gibfahn Sorry about that, for some reason I though this had been open 48 hour, but it has only been open half that time 😞 . Thanks for the heads up and I'll be more careful in the future. |
If anyone sees |
Currently the async provider type CONNECTION is used in node_crypto.h and it might be clearer if it was named SSLCONNECTION as suggested by addaleax. This commit renames only the provider type as I was not sure if it was alright to change the class Connection as well. Refs: nodejs#12967 (comment) PR-URL: nodejs#12989 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
When configured --without-ssl node_crypto.h will not be included but async-wrap.h includes providers that are defined in node_crypto.h, node_crypto.cc, and tls_wrap.cc: AsyncWrap::PROVIDER_CONNECTION AsyncWrap::PROVIDER_PBKDF2REQUEST AsyncWrap::PROVIDER_RANDOMBYTESREQUEST AsyncWrap::PROVIDER_TLSWRAP These will be included as providers which will cause test-async-wrap-getasyncid.js to fail. This commit suggest adding a guard and exclude the providers that are not available when configured --without-ssl PR-URL: nodejs#12967 Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Currently the async provider type CONNECTION is used in node_crypto.h and it might be clearer if it was named SSLCONNECTION as suggested by addaleax. This commit renames only the provider type as I was not sure if it was alright to change the class Connection as well. Refs: nodejs#12967 (comment) PR-URL: nodejs#12989 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
I'm assuming this doesn't make sense for v6.x unless we backport all of async_hooks... please add don't land label if appropriate |
When configured --without-ssl node_crypto.h will not be included but
async-wrap.h includes providers that are defined in node_crypto.h,
node_crypto.cc, and tls_wrap.cc:
AsyncWrap::PROVIDER_CONNECTION
AsyncWrap::PROVIDER_PBKDF2REQUEST
AsyncWrap::PROVIDER_RANDOMBYTESREQUEST
AsyncWrap::PROVIDER_TLSWRAP
These will be included as providers which will cause
test-async-wrap-getasyncid.js to fail.
This commit suggest adding a guard and exclude the providers that are
not available when configured --without-ssl
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
src