diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2022-03-03 21:18:56 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2022-03-11 20:15:13 +0300 |
commit | 457567f72ca73ef000b56d30f1f6b60e251cc15a (patch) | |
tree | 43df1621716c42785b08f5fa0c36bbbea7edfbce /src/node_main_instance.cc | |
parent | de163d5db671fcad4ff6f98029c4de90ab4ff873 (diff) |
src: include crypto in the bootstrap snapshot
To lazy load the run time options, the following properties
are updated from value properties to accessor properties
whose getter would turn them back to a value properties
upon the initial access.
- crypto.constants.defaultCipherList
- crypto.pseudoRandomBytes
- crypto.prng
- crypto.rng
PR-URL: https://github.com/nodejs/node/pull/42203
Refs: https://github.com/nodejs/node/issues/37476
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'src/node_main_instance.cc')
-rw-r--r-- | src/node_main_instance.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/node_main_instance.cc b/src/node_main_instance.cc index ce319cca3ed..fdda0253932 100644 --- a/src/node_main_instance.cc +++ b/src/node_main_instance.cc @@ -1,5 +1,8 @@ #include "node_main_instance.h" #include <memory> +#if HAVE_OPENSSL +#include "crypto/crypto_util.h" +#endif // HAVE_OPENSSL #include "debug_utils-inl.h" #include "node_external_reference.h" #include "node_internals.h" @@ -205,6 +208,10 @@ NodeMainInstance::CreateMainEnvironment(int* exit_code, env->InitializeInspector({}); #endif env->DoneBootstrapping(); + +#if HAVE_OPENSSL + crypto::InitCryptoOnce(isolate_); +#endif // HAVE_OPENSSL } else { context = NewContext(isolate_); CHECK(!context.IsEmpty()); |