| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5126,6 +5126,8 @@ void InitCryptoOnce() { | |||
| 5126 | 5126 | ERR_load_ENGINE_strings(); | |
| 5127 | 5127 | ENGINE_load_builtin_engines(); | |
| 5128 | 5128 | #endif // !OPENSSL_NO_ENGINE | |
| 5129 | + | ||
| 5130 | + NodeBIO::GetMethod(); | ||
| 5129 | 5131 | } | |
| 5130 | 5132 | ||
| 5131 | 5133 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -97,6 +97,8 @@ extern int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx); | |||
| 97 | 97 | ||
| 98 | 98 | extern void UseExtraCaCerts(const std::string& file); | |
| 99 | 99 | ||
| 100 | + void InitCryptoOnce(); | ||
| 101 | + | ||
| 100 | 102 | class SecureContext : public BaseObject { | |
| 101 | 103 | public: | |
| 102 | 104 | ~SecureContext() override { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -247,6 +247,8 @@ const BIO_METHOD* NodeBIO::GetMethod() { | |||
| 247 | 247 | ||
| 248 | 248 | return &method; | |
| 249 | 249 | #else | |
| 250 | + // This is called from InitCryptoOnce() to avoid race conditions during | ||
| 251 | + // initialization. | ||
| 250 | 252 | static BIO_METHOD* method = nullptr; | |
| 251 | 253 | ||
| 252 | 254 | if (method == nullptr) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -164,6 +164,8 @@ class NodeBIO : public MemoryRetainer { | |||
| 164 | 164 | int eof_return_ = -1; | |
| 165 | 165 | Buffer* read_head_ = nullptr; | |
| 166 | 166 | Buffer* write_head_ = nullptr; | |
| 167 | + | ||
| 168 | + friend void node::crypto::InitCryptoOnce(); | ||
| 167 | 169 | }; | |
| 168 | 170 | ||
| 169 | 171 | } // namespace crypto | |
| Back | FazBrowse Home | New Git URL |
0 commit comments