From 8e596c4e15f64b53d66e91079ed733821fb3e88d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 29 Aug 2013 14:05:42 +0200 Subject: [PATCH] crypto: make root_cert_store variable extern Before this commit it was declared static (in a header file!), meaning it got duplicated in every file that includes it. A few duplicated pointers is not the end of the world but it introduces a lot of potential for confusion because root_cert_store in file A is not the root_cert_store in file B. Moral of the story: don't declare static variables in header files. --- src/node_crypto.cc | 2 ++ src/node_crypto.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 531afdc..81ba447 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -118,6 +118,8 @@ static Persistent secure_context_constructor; static uv_rwlock_t* locks; +X509_STORE* root_cert_store; + // Just to generate static methods template class SSLWrap; template void SSLWrap::AddMethods(Handle t); diff --git a/src/node_crypto.h b/src/node_crypto.h index d9063a5..98e0f58 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -51,7 +51,7 @@ namespace crypto { extern int VerifyCallback(int preverify_ok, X509_STORE_CTX* ctx); -static X509_STORE* root_cert_store; +extern X509_STORE* root_cert_store; // Forward declaration class Connection; -- 2.7.4