Skip to content
Permalink
Browse files

src: add node_crypto_common and refactor

Two things in one on this commit:

(a) For the QUIC implementation, we need to separate out various bits
    from node_crypto.cc to allow them to be reused. That's where this
    commit starts.

(b) Quite a bit of the node_crypto.cc code was just messy in terms of
    it's organization and lack of error handling and use of Local vs.
    MaybeLocal. This cleans that up a bit and hopefully makes certain
    parts a bit more manageable also.

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #32016
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
  • Loading branch information
jasnell authored and MylesBorins committed Feb 29, 2020
1 parent 1539928 commit 755da035ceff4fd3f347efba1d731fce0038f968
Showing with 1,313 additions and 611 deletions.
  1. +2 −0 node.gyp
  2. +2 −0 src/env.h
  3. +27 −610 src/node_crypto.cc
  4. +13 −0 src/node_crypto.h
  5. +1,110 −0 src/node_crypto_common.cc
  6. +139 −0 src/node_crypto_common.h
  7. +11 −1 src/string_bytes.cc
  8. +9 −0 src/string_bytes.h
@@ -822,9 +822,11 @@
[ 'node_use_openssl=="true"', {
'sources': [
'src/node_crypto.cc',
'src/node_crypto_common.cc',
'src/node_crypto_bio.cc',
'src/node_crypto_clienthello.cc',
'src/node_crypto.h',
'src/node_crypto_common.h',
'src/node_crypto_bio.h',
'src/node_crypto_clienthello.h',
'src/node_crypto_clienthello-inl.h',
@@ -206,6 +206,7 @@ constexpr size_t kFsStatsBufferLength =
V(dest_string, "dest") \
V(destroyed_string, "destroyed") \
V(detached_string, "detached") \
V(dh_string, "DH") \
V(dns_a_string, "A") \
V(dns_aaaa_string, "AAAA") \
V(dns_cname_string, "CNAME") \
@@ -219,6 +220,7 @@ constexpr size_t kFsStatsBufferLength =
V(done_string, "done") \
V(dot_string, ".") \
V(duration_string, "duration") \
V(ecdh_string, "ECDH") \
V(emit_warning_string, "emitWarning") \
V(empty_object_string, "{}") \
V(encoding_string, "encoding") \

0 comments on commit 755da03

Please sign in to comment.
You can’t perform that action at this time.