Browse Source

src: make root_cert_vector function scoped

root_cert_vector currently has file scope and external linkage, but is
only used in the NewRootCertsStore function. If this is not required to
be externally linked perhaps it can be changed to be static and function
scoped instead.

PR-URL: https://github.com/nodejs/node/pull/12788
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
v6.x
Daniel Bevenius 8 years ago
committed by Myles Borins
parent
commit
9ca67e0147
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 2
      src/node_crypto.cc

2
src/node_crypto.cc

@ -127,7 +127,6 @@ const char* const root_certs[] = {
std::string extra_root_certs_file; // NOLINT(runtime/string)
X509_STORE* root_cert_store;
std::vector<X509*> root_certs_vector;
// Just to generate static methods
template class SSLWrap<TLSWrap>;
@ -710,6 +709,7 @@ static int X509_up_ref(X509* cert) {
static X509_STORE* NewRootCertStore() {
static std::vector<X509*> root_certs_vector;
if (root_certs_vector.empty()) {
for (size_t i = 0; i < arraysize(root_certs); i++) {
BIO* bp = NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i]));

Loading…
Cancel
Save