summaryrefslogtreecommitdiff
path: root/src/node_crypto.h
diff options
context:
space:
mode:
authorAnton Gerasimov <agerasimov@twilio.com>2019-08-05 12:03:23 +0200
committerRich Trott <rtrott@gmail.com>2019-09-27 15:50:56 -0700
commitc2ce8d05474c38c503b6ac57e94366421c960762 (patch)
treedef403dc2cec32e1e689023669b23a37f9c03b68 /src/node_crypto.h
parent3de5eae6dbe503485b95bdeb8bddbd67e4613d59 (diff)
downloadandroid-node-v8-c2ce8d05474c38c503b6ac57e94366421c960762.tar.gz
android-node-v8-c2ce8d05474c38c503b6ac57e94366421c960762.tar.bz2
android-node-v8-c2ce8d05474c38c503b6ac57e94366421c960762.zip
tls: add option for private keys for OpenSSL engines
Add `privateKeyIdentifier` and `privateKeyEngine` options to get private key from an OpenSSL engine in tls.createSecureContext(). PR-URL: https://github.com/nodejs/node/pull/28973 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r--src/node_crypto.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h
index 91586563f4..206a19119a 100644
--- a/src/node_crypto.h
+++ b/src/node_crypto.h
@@ -97,6 +97,7 @@ class SecureContext : public BaseObject {
X509Pointer issuer_;
#ifndef OPENSSL_NO_ENGINE
bool client_cert_engine_provided_ = false;
+ std::unique_ptr<ENGINE, std::function<void(ENGINE*)>> private_key_engine_;
#endif // !OPENSSL_NO_ENGINE
static const int kMaxSessionSize = 10 * 1024;
@@ -119,6 +120,9 @@ class SecureContext : public BaseObject {
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
static void Init(const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetKey(const v8::FunctionCallbackInfo<v8::Value>& args);
+#ifndef OPENSSL_NO_ENGINE
+ static void SetEngineKey(const v8::FunctionCallbackInfo<v8::Value>& args);
+#endif // !OPENSSL_NO_ENGINE
static void SetCert(const v8::FunctionCallbackInfo<v8::Value>& args);
static void AddCACert(const v8::FunctionCallbackInfo<v8::Value>& args);
static void AddCRL(const v8::FunctionCallbackInfo<v8::Value>& args);