Skip to content

Commit f65cb75

Browse files
sam-githubBethGriggs
authored andcommitted
src: remove internal includes from node_crypto.h
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Signed-off-by: Beth Griggs <[email protected]>
1 parent d8aaf2e commit f65cb75

5 files changed

+19
-23
lines changed

src/inspector_io.cc

+2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
#include "inspector_socket_server.h"
44
#include "inspector/main_thread_interface.h"
55
#include "inspector/node_string.h"
6+
#include "base_object-inl.h"
67
#include "env-inl.h"
78
#include "debug_utils.h"
89
#include "node.h"
910
#include "node_crypto.h"
11+
#include "node_internals.h"
1012
#include "node_mutex.h"
1113
#include "v8-inspector.h"
1214
#include "util.h"

src/node_crypto.cc

+13-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
#include "node_crypto.h"
23-
#include "node.h"
2423
#include "node_buffer.h"
25-
#include "node_constants.h"
2624
#include "node_crypto_bio.h"
2725
#include "node_crypto_clienthello-inl.h"
2826
#include "node_crypto_groups.h"
@@ -32,11 +30,24 @@
3230
#include "tls_wrap.h" // TLSWrap
3331

3432
#include "async_wrap-inl.h"
33+
#include "base_object-inl.h"
3534
#include "env-inl.h"
3635
#include "string_bytes.h"
3736
#include "util-inl.h"
3837
#include "v8.h"
3938

39+
#include <openssl/ec.h>
40+
#include <openssl/ecdh.h>
41+
#ifndef OPENSSL_NO_ENGINE
42+
# include <openssl/engine.h>
43+
#endif // !OPENSSL_NO_ENGINE
44+
#include <openssl/evp.h>
45+
#include <openssl/pem.h>
46+
#include <openssl/x509v3.h>
47+
#include <openssl/hmac.h>
48+
#include <openssl/rand.h>
49+
#include <openssl/pkcs12.h>
50+
4051
#include <cerrno>
4152
#include <climits> // INT_MAX
4253
#include <cstring>

src/node_crypto.h

+3-20
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,17 @@
2424

2525
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
2626

27-
#include "node.h"
2827
// ClientHelloParser
2928
#include "node_crypto_clienthello.h"
3029

31-
#include "node_buffer.h"
32-
3330
#include "env.h"
34-
#include "async_wrap-inl.h"
35-
#include "base_object-inl.h"
31+
#include "base_object.h"
32+
#include "util.h"
3633

3734
#include "v8.h"
3835

39-
#include <openssl/ssl.h>
40-
#include <openssl/ec.h>
41-
#include <openssl/ecdh.h>
42-
#ifndef OPENSSL_NO_ENGINE
43-
# include <openssl/engine.h>
44-
#endif // !OPENSSL_NO_ENGINE
4536
#include <openssl/err.h>
46-
#include <openssl/evp.h>
47-
// TODO(shigeki) Remove this after upgrading to 1.1.1
48-
#include <openssl/obj_mac.h>
49-
#include <openssl/pem.h>
50-
#include <openssl/x509.h>
51-
#include <openssl/x509v3.h>
52-
#include <openssl/hmac.h>
53-
#include <openssl/rand.h>
54-
#include <openssl/pkcs12.h>
37+
#include <openssl/ssl.h>
5538

5639
namespace node {
5740
namespace crypto {

src/node_crypto_bio.cc

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

22+
#include "base_object-inl.h"
2223
#include "node_crypto_bio.h"
2324
#include "openssl/bio.h"
2425
#include "util-inl.h"

src/tls_wrap.h

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
2626

27-
#include "node.h"
2827
#include "node_crypto.h" // SSLWrap
2928

3029
#include "async_wrap.h"

0 commit comments

Comments
 (0)