tls: Add PSK support
Basically https://github.com/nodejs/node/pull/14978.
Wanted to push to that branch but started with a rebase which resulted in github closing the PR and disallowing me to push there.
Add the pskCallback
client/server option, which resolves an identity
or identity hint to a pre-shared key.
Add the pskIdentityHint
server option to set the identity hint for the
ServerKeyExchange message.
Co-authored-by: Chris Osborn chris.osborn@sitelier.com Co-authored-by: stephank gh@stephank.nl Co-authored-by: Taylor Zane Glaeser tzglaeser@gmail.com
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Additional changes:
- removed ifdef check for openssl < 1.0.0 as we don't support that
- hardened args/return value checks in client/server psk callbacks
- small style refactorings in
_tsl_common.js
- updated docs according to new styles/linting
Edit: note for all reviewers, thanks for reviewing, though this is currently waiting on @taylorzane, I'm not sure if he will have time to finish this.
* If he does have time then we will either float those comments and changes to https://github.com/nodejs/node/pull/14978 or I'll just give him push access to this branch.
* If he doesn't have time for this then I'll pick it up and address comments/review more thoroughly.
Initially, I've only just rebased this on master and did simple cleanups without changing much.
Adding 'In Progress' to be verbose.
I'll proceed with this now.
Addressed review comments and updated PR description.