Skip to content

Commit 1541079

Browse files
committed
src: add HAVE_OPENSSL guard to crypto providers
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: #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]>
1 parent 9f8e030 commit 1541079

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/async-wrap.h

+15-5
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,44 @@ namespace node {
3434

3535
#define NODE_ASYNC_ID_OFFSET 0xA1C
3636

37-
#define NODE_ASYNC_PROVIDER_TYPES(V) \
37+
#define NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \
3838
V(NONE) \
39-
V(CONNECTION) \
4039
V(FSEVENTWRAP) \
4140
V(FSREQWRAP) \
4241
V(GETADDRINFOREQWRAP) \
4342
V(GETNAMEINFOREQWRAP) \
4443
V(HTTPPARSER) \
4544
V(JSSTREAM) \
46-
V(PBKDF2REQUEST) \
4745
V(PIPECONNECTWRAP) \
4846
V(PIPEWRAP) \
4947
V(PROCESSWRAP) \
5048
V(QUERYWRAP) \
51-
V(RANDOMBYTESREQUEST) \
5249
V(SHUTDOWNWRAP) \
5350
V(SIGNALWRAP) \
5451
V(STATWATCHER) \
5552
V(TCPCONNECTWRAP) \
5653
V(TCPWRAP) \
5754
V(TIMERWRAP) \
58-
V(TLSWRAP) \
5955
V(TTYWRAP) \
6056
V(UDPSENDWRAP) \
6157
V(UDPWRAP) \
6258
V(WRITEWRAP) \
6359
V(ZLIB)
6460

61+
#if HAVE_OPENSSL
62+
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \
63+
V(CONNECTION) \
64+
V(PBKDF2REQUEST) \
65+
V(RANDOMBYTESREQUEST) \
66+
V(TLSWRAP)
67+
#else
68+
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V)
69+
#endif // HAVE_OPENSSL
70+
71+
#define NODE_ASYNC_PROVIDER_TYPES(V) \
72+
NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \
73+
NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V)
74+
6575
class Environment;
6676

6777
class AsyncWrap : public BaseObject {

0 commit comments

Comments
 (0)