diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2019-03-13 13:46:47 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-03-18 10:35:20 +0300 |
commit | 36101558fd9f8d5079d780930d97eb44bac479c9 (patch) | |
tree | 707715a52492876672d6f329f4217e1da211c004 /src/node_crypto.h | |
parent | 0f745bf9bde4e19dd352f10299d4365a4edaf386 (diff) |
src: use EVPKeyPointer in more places
Rejoice, the code base is now free of manual EVP_PKEY_free() calls!
PR-URL: https://github.com/nodejs/node/pull/26632
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_crypto.h')
-rw-r--r-- | src/node_crypto.h | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/node_crypto.h b/src/node_crypto.h index a0551651fbe..c9ca39d3e6a 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -421,20 +421,16 @@ enum KeyType { // use. class ManagedEVPPKey { public: - ManagedEVPPKey(); - explicit ManagedEVPPKey(EVP_PKEY* pkey); - ManagedEVPPKey(const ManagedEVPPKey& key); - ManagedEVPPKey(ManagedEVPPKey&& key); - ~ManagedEVPPKey(); - - ManagedEVPPKey& operator=(const ManagedEVPPKey& key); - ManagedEVPPKey& operator=(ManagedEVPPKey&& key); + ManagedEVPPKey() = default; + explicit ManagedEVPPKey(EVPKeyPointer&& pkey); + ManagedEVPPKey(const ManagedEVPPKey& that); + ManagedEVPPKey& operator=(const ManagedEVPPKey& that); operator bool() const; EVP_PKEY* get() const; private: - EVP_PKEY* pkey_; + EVPKeyPointer pkey_; }; class KeyObject : public BaseObject { |