Skip to content

Commit

Permalink
src: add node_crypto_common and refactor
Browse files Browse the repository at this point in the history
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 Mar 4, 2020
1 parent 1539928 commit 755da03
Show file tree
Hide file tree
Showing 8 changed files with 1,313 additions and 611 deletions.
2 changes: 2 additions & 0 deletions node.gyp
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions src/env.h
Expand Up @@ -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") \
Expand All @@ -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") \
Expand Down

0 comments on commit 755da03

Please sign in to comment.