Skip to content

Commit

Permalink
src: remove internal includes from node_crypto.h
Browse files Browse the repository at this point in the history
Remove headers used by node_crypto.cc that were included in
node_crypto.h. The header file should only include what it uses itself.

PR-URL: #26966
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
sam-github authored and BethGriggs committed Apr 9, 2019
1 parent d8aaf2e commit f65cb75
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/inspector_io.cc
Expand Up @@ -3,10 +3,12 @@
#include "inspector_socket_server.h"
#include "inspector/main_thread_interface.h"
#include "inspector/node_string.h"
#include "base_object-inl.h"
#include "env-inl.h"
#include "debug_utils.h"
#include "node.h"
#include "node_crypto.h"
#include "node_internals.h"
#include "node_mutex.h"
#include "v8-inspector.h"
#include "util.h"
Expand Down
15 changes: 13 additions & 2 deletions src/node_crypto.cc
Expand Up @@ -20,9 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "node_crypto.h"
#include "node.h"
#include "node_buffer.h"
#include "node_constants.h"
#include "node_crypto_bio.h"
#include "node_crypto_clienthello-inl.h"
#include "node_crypto_groups.h"
Expand All @@ -32,11 +30,24 @@
#include "tls_wrap.h" // TLSWrap

#include "async_wrap-inl.h"
#include "base_object-inl.h"
#include "env-inl.h"
#include "string_bytes.h"
#include "util-inl.h"
#include "v8.h"

#include <openssl/ec.h>
#include <openssl/ecdh.h>
#ifndef OPENSSL_NO_ENGINE
# include <openssl/engine.h>
#endif // !OPENSSL_NO_ENGINE
#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/x509v3.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/pkcs12.h>

#include <cerrno>
#include <climits> // INT_MAX
#include <cstring>
Expand Down
23 changes: 3 additions & 20 deletions src/node_crypto.h
Expand Up @@ -24,34 +24,17 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node.h"
// ClientHelloParser
#include "node_crypto_clienthello.h"

#include "node_buffer.h"

#include "env.h"
#include "async_wrap-inl.h"
#include "base_object-inl.h"
#include "base_object.h"
#include "util.h"

#include "v8.h"

#include <openssl/ssl.h>
#include <openssl/ec.h>
#include <openssl/ecdh.h>
#ifndef OPENSSL_NO_ENGINE
# include <openssl/engine.h>
#endif // !OPENSSL_NO_ENGINE
#include <openssl/err.h>
#include <openssl/evp.h>
// TODO(shigeki) Remove this after upgrading to 1.1.1
#include <openssl/obj_mac.h>
#include <openssl/pem.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <openssl/hmac.h>
#include <openssl/rand.h>
#include <openssl/pkcs12.h>
#include <openssl/ssl.h>

namespace node {
namespace crypto {
Expand Down
1 change: 1 addition & 0 deletions src/node_crypto_bio.cc
Expand Up @@ -19,6 +19,7 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "base_object-inl.h"
#include "node_crypto_bio.h"
#include "openssl/bio.h"
#include "util-inl.h"
Expand Down
1 change: 0 additions & 1 deletion src/tls_wrap.h
Expand Up @@ -24,7 +24,6 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node.h"
#include "node_crypto.h" // SSLWrap

#include "async_wrap.h"
Expand Down

0 comments on commit f65cb75

Please sign in to comment.