-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
crypto: add outputLength option to crypto.createHash #28805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -585,7 +585,7 @@ class Hash : public BaseObject { | |
| SET_MEMORY_INFO_NAME(Hash) | ||
| SET_SELF_SIZE(Hash) | ||
|
|
||
| bool HashInit(const char* hash_type); | ||
| bool HashInit(const char* hash_type, v8::Maybe<unsigned int> xof_md_len); | ||
| bool HashUpdate(const char* data, int len); | ||
|
|
||
| protected: | ||
|
|
@@ -596,18 +596,21 @@ class Hash : public BaseObject { | |
| Hash(Environment* env, v8::Local<v8::Object> wrap) | ||
| : BaseObject(env, wrap), | ||
| mdctx_(nullptr), | ||
| md_len_(0) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you intend to remove this line? Now md_len_ will have an undefined value, probably non-zero.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It shouldn't matter, it will be set in the JS constructor before any other calls are made. |
||
| has_md_(false), | ||
| md_value_(nullptr) { | ||
| MakeWeak(); | ||
| } | ||
|
|
||
| ~Hash() override { | ||
| OPENSSL_cleanse(md_value_, md_len_); | ||
| if (md_value_ != nullptr) | ||
| OPENSSL_clear_free(md_value_, md_len_); | ||
| } | ||
|
|
||
| private: | ||
| EVPMDPointer mdctx_; | ||
| unsigned char md_value_[EVP_MAX_MD_SIZE]; | ||
| bool has_md_; | ||
| unsigned int md_len_; | ||
| unsigned char* md_value_; | ||
| }; | ||
|
|
||
| class SignBase : public BaseObject { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.