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:
authorTobias Nießen <tniessen@tnie.de>2020-11-01 19:15:01 +0300
committerTobias Nießen <tniessen@tnie.de>2020-11-04 18:55:48 +0300
commit9aafda586e4adcaed0132a4d01b4e7fd5c5030a0 (patch)
tree9131991d72b16e75fbc34b0963f14954c27529c5 /src/util.h
parent5a3f43b255af6968606f13258447894f946ee3ce (diff)
crypto: pass empty passphrases to OpenSSL properly
Fixes: https://github.com/nodejs/node/issues/35898 PR-URL: https://github.com/nodejs/node/pull/35914 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 92f51baf374..1f7c7580a7e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -602,6 +602,15 @@ class NonCopyableMaybe {
return empty_;
}
+ const T* get() const {
+ return empty_ ? nullptr : &value_;
+ }
+
+ const T* operator->() const {
+ CHECK(!empty_);
+ return &value_;
+ }
+
T&& Release() {
CHECK_EQ(empty_, false);
empty_ = true;