Skip to content

Commit 7b97f07

Browse files
danbevjasnell
authored andcommitted
crypto: remove root_cert_store from node_crypto.h
root_cert_store is defined as extern in node_crypto.h but only used in node_crypto.cc. It is then set using SSL_CTX_set_cert_store. The only usages of SSL_CTX_get_cert_store are in node_crypto.cc which would all be accessing the same X509_STORE through the root_cert_store pointer as far as I can tell. Am I missing something here? This commit suggests removing it from the header and making it static in node_crypto.cc. PR-URL: #13194 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sam Roberts <[email protected]>
1 parent 4030aed commit 7b97f07

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/node_crypto.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ static X509_NAME *cnnic_ev_name =
146146

147147
static Mutex* mutexes;
148148

149-
const char* const root_certs[] = {
149+
static const char* const root_certs[] = {
150150
#include "node_root_certs.h" // NOLINT(build/include_order)
151151
};
152152

153-
std::string extra_root_certs_file; // NOLINT(runtime/string)
153+
static std::string extra_root_certs_file; // NOLINT(runtime/string)
154154

155-
X509_STORE* root_cert_store;
155+
static X509_STORE* root_cert_store;
156156

157157
// Just to generate static methods
158158
template void SSLWrap<TLSWrap>::AddMethods(Environment* env,

src/node_crypto.h

-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ enum CheckResult {
8484

8585
extern int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx);
8686

87-
extern X509_STORE* root_cert_store;
88-
8987
extern void UseExtraCaCerts(const std::string& file);
9088

9189
class SecureContext : public BaseObject {

0 commit comments

Comments
 (0)