mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
crypto: Make Hmac 1.1.0-compatible
OpenSSL 1.1.0 requries HMAC_CTX be heap-allocated. PR-URL: https://github.com/nodejs/node/pull/16130 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rod Vagg <rod@vagg.org>
This commit is contained in:
1 parent
6bc7480f12
commit
f7520ff7fb
2 files changed
+33
-17
No files matched your search
+3
-8
@@ -494,11 +494,7 @@ class CipherBase : public BaseObject {
|
||||
|
||||
class Hmac : public BaseObject {
|
||||
public:
|
||||
~Hmac() override {
|
||||
if (!initialised_)
|
||||
return;
|
||||
HMAC_CTX_cleanup(&ctx_);
|
||||
}
|
||||
~Hmac() override;
|
||||
|
||||
static void Initialize(Environment* env, v8::Local<v8::Object> target);
|
||||
|
||||
@@ -513,13 +509,12 @@ class Hmac : public BaseObject {
|
||||
|
||||
Hmac(Environment* env, v8::Local<v8::Object> wrap)
|
||||
: BaseObject(env, wrap),
|
||||
initialised_(false) {
|
||||
ctx_(nullptr) {
|
||||
MakeWeak<Hmac>(this);
|
||||
}
|
||||
|
||||
private:
|
||||
HMAC_CTX ctx_; /* coverity[member_decl] */
|
||||
bool initialised_;
|
||||
HMAC_CTX* ctx_;
|
||||
};
|
||||
|
||||
class Hash : public BaseObject {
|
||||
|
||||
Reference in new issue
Block a user