Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crypto:cleanup includes,ignore NODE_WANT_INTERNALS
  • Loading branch information
Christopher J. Brody committed Dec 6, 2016
commit 9ac4063a426a74a4d80ab67f48d220380da6425d
12 changes: 5 additions & 7 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "node.h"
#include "node_buffer.h"
#include "node_crypto.h"

#include "node_crypto_bio.h"
#include "node_crypto_groups.h"

#include "tls_wrap.h" // TLSWrap

#include "async-wrap.h"
Expand All @@ -12,17 +12,15 @@
#include "string_bytes.h"
#include "util.h"
#include "util-inl.h"
#include "v8.h"

#include "node_buffer.h"

// CNNIC Hash WhiteList is taken from
// https://hg.mozilla.org/mozilla-central/raw-file/98820360ab66/security/
// certverifier/CNNICHashWhitelist.inc
#include "CNNICHashWhitelist.inc"

#include <errno.h>
#include <limits.h> // INT_MAX
#include <math.h>
#include <stdlib.h>
#include <string.h>

#define THROW_AND_RETURN_IF_NOT_STRING_OR_BUFFER(val, prefix) \
do { \
Expand Down
12 changes: 1 addition & 11 deletions src/node_crypto.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
#ifndef SRC_NODE_CRYPTO_H_
#define SRC_NODE_CRYPTO_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

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

#include "node_buffer.h"

#include "env.h"
#include "async-wrap.h"
#include "async-wrap-inl.h"
#include "base-object.h"
#include "base-object-inl.h"

#include "v8.h"

#include <openssl/ssl.h>
#include <openssl/ec.h>
#include <openssl/ecdh.h>
Expand Down Expand Up @@ -727,8 +718,7 @@ void SetEngine(const v8::FunctionCallbackInfo<v8::Value>& args);
void InitCrypto(v8::Local<v8::Object> target);

} // namespace crypto
} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
} // namespace node

#endif // SRC_NODE_CRYPTO_H_
3 changes: 3 additions & 0 deletions src/node_crypto_bio.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include "node_crypto_bio.h"

#include "openssl/bio.h"

#include "util.h"
#include "util-inl.h"

#include <limits.h>
#include <string.h>

Expand Down
8 changes: 1 addition & 7 deletions src/node_crypto_bio.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#ifndef SRC_NODE_CRYPTO_BIO_H_
#define SRC_NODE_CRYPTO_BIO_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "openssl/bio.h"

#include "env.h"
#include "env-inl.h"
#include "util.h"
#include "util-inl.h"
#include "v8.h"

namespace node {

Expand Down Expand Up @@ -137,6 +133,4 @@ class NodeBIO {

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_CRYPTO_BIO_H_
4 changes: 0 additions & 4 deletions src/node_crypto_clienthello-inl.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef SRC_NODE_CRYPTO_CLIENTHELLO_INL_H_
#define SRC_NODE_CRYPTO_CLIENTHELLO_INL_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "util.h"
#include "util-inl.h"

Expand Down Expand Up @@ -55,6 +53,4 @@ inline bool ClientHelloParser::IsPaused() const {

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_CRYPTO_CLIENTHELLO_INL_H_
4 changes: 0 additions & 4 deletions src/node_crypto_clienthello.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef SRC_NODE_CRYPTO_CLIENTHELLO_H_
#define SRC_NODE_CRYPTO_CLIENTHELLO_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node.h"

#include <stddef.h> // size_t
Expand Down Expand Up @@ -114,6 +112,4 @@ class ClientHelloParser {

} // namespace node

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_CRYPTO_CLIENTHELLO_H_
4 changes: 0 additions & 4 deletions src/node_crypto_groups.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef SRC_NODE_CRYPTO_GROUPS_H_
#define SRC_NODE_CRYPTO_GROUPS_H_

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

/*
These modular groups were literally taken from:
* RFC 2412 (groups 1 and 2)
Expand Down Expand Up @@ -390,6 +388,4 @@ static const modp_group modp_groups[] = {
#undef V
};

#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#endif // SRC_NODE_CRYPTO_GROUPS_H_