-
-
Couldn't load subscription status.
- Fork 33.6k
Description
The src/node_crypto.cc file is currently 6k+ lines of code that provides process.binding('crypto'). This one internal binding provides an array of crypto functions include Signing, Verification, Hash, limited key-generation, SecureContext for TLS connections, etc. As such, this one file has a LOT of code in it and it is quite difficult from a maintenance perspective.
Looking it over, I'd like to refactor both the source files and the process.binding() for crypto such that each individual subcomponent of node_crypto.cc is moved to it's own src/node_crypto_nnnn.cc file with it's own distinct process.binding('crypto-nnnn'). This will make it easier for us to maintain and update individual pieces of the code.
This would be a fairly large and time consuming refactoring so I wanted to make sure that folks are on board with it before I started down that path.
FWIW, there are two efforts prompting this:
- The migration to internal/errors and the pain involved with digging through this file to do so
- The investigation of promises support for the crypto module