Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Otrishko <shishugi@gmail.com>2018-10-29 11:38:43 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2020-01-03 18:21:40 +0300
commit7b2bf20f7e2060ac9b8a6a4eaa4a760b454f7716 (patch)
tree983eb2af9777149dd26a15619b452564b0659671 /src/tls_wrap.h
parentbca23b9e16c2780070d5682d567dba1cb9107153 (diff)
tls: add PSK support
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> PR-URL: https://github.com/nodejs/node/pull/23188 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/tls_wrap.h')
-rw-r--r--src/tls_wrap.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tls_wrap.h b/src/tls_wrap.h
index 14b7327e7d8..7bb33b4a3cb 100644
--- a/src/tls_wrap.h
+++ b/src/tls_wrap.h
@@ -169,6 +169,23 @@ class TLSWrap : public AsyncWrap,
static void SetServername(const v8::FunctionCallbackInfo<v8::Value>& args);
static int SelectSNIContextCallback(SSL* s, int* ad, void* arg);
+#ifndef OPENSSL_NO_PSK
+ static void SetPskIdentityHint(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+ static void EnablePskCallback(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+ static unsigned int PskServerCallback(SSL* s,
+ const char* identity,
+ unsigned char* psk,
+ unsigned int max_psk_len);
+ static unsigned int PskClientCallback(SSL* s,
+ const char* hint,
+ char* identity,
+ unsigned int max_identity_len,
+ unsigned char* psk,
+ unsigned int max_psk_len);
+#endif
+
crypto::SecureContext* sc_;
// BIO buffers hold encrypted data.
BIO* enc_in_ = nullptr; // StreamListener fills this for SSL_read().