| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7d3a843 commit 49402b1
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5115,7 +5115,7 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo<Value>& args) { | |||
| 5115 | 5115 | } | |
| 5116 | 5116 | ||
| 5117 | 5117 | void DiffieHellman::SetKey(const v8::FunctionCallbackInfo<v8::Value>& args, | |
| 5118 | - void (*set_field)(DH*, BIGNUM*), const char* what) { | ||
| 5118 | + int (*set_field)(DH*, BIGNUM*), const char* what) { | ||
| 5119 | 5119 | Environment* env = Environment::GetCurrent(args); | |
| 5120 | 5120 | ||
| 5121 | 5121 | DiffieHellman* dh; | |
@@ -5138,12 +5138,13 @@ void DiffieHellman::SetKey(const v8::FunctionCallbackInfo<v8::Value>& args, | |||
| 5138 | 5138 | BN_bin2bn(reinterpret_cast<unsigned char*>(Buffer::Data(args[0])), | |
| 5139 | 5139 | Buffer::Length(args[0]), nullptr); | |
| 5140 | 5140 | CHECK_NE(num, nullptr); | |
| 5141 | - set_field(dh->dh, num); | ||
| 5141 | + CHECK_EQ(1, set_field(dh->dh, num)); | ||
| 5142 | 5142 | } | |
| 5143 | 5143 | ||
| 5144 | 5144 | ||
| 5145 | 5145 | void DiffieHellman::SetPublicKey(const FunctionCallbackInfo<Value>& args) { | |
| 5146 | - SetKey(args, [](DH* dh, BIGNUM* num) { DH_set0_key(dh, num, nullptr); }, | ||
| 5146 | + SetKey(args, | ||
| 5147 | + [](DH* dh, BIGNUM* num) { return DH_set0_key(dh, num, nullptr); }, | ||
| 5147 | 5148 | "Public key"); | |
| 5148 | 5149 | } | |
| 5149 | 5150 | ||
@@ -5154,7 +5155,8 @@ void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo<Value>& args) { | |||
| 5154 | 5155 | // Node. See https://github.com/openssl/openssl/pull/4384. | |
| 5155 | 5156 | #error "OpenSSL 1.1.0 revisions before 1.1.0g are not supported" | |
| 5156 | 5157 | #endif | |
| 5157 | - SetKey(args, [](DH* dh, BIGNUM* num) { DH_set0_key(dh, nullptr, num); }, | ||
| 5158 | + SetKey(args, | ||
| 5159 | + [](DH* dh, BIGNUM* num) { return DH_set0_key(dh, nullptr, num); }, | ||
| 5158 | 5160 | "Private key"); | |
| 5159 | 5161 | } | |
| 5160 | 5162 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -712,7 +712,7 @@ class DiffieHellman : public BaseObject { | |||
| 712 | 712 | const BIGNUM* (*get_field)(const DH*), | |
| 713 | 713 | const char* err_if_null); | |
| 714 | 714 | static void SetKey(const v8::FunctionCallbackInfo<v8::Value>& args, | |
| 715 | - void (*set_field)(DH*, BIGNUM*), const char* what); | ||
| 715 | + int (*set_field)(DH*, BIGNUM*), const char* what); | ||
| 716 | 716 | bool VerifyContext(); | |
| 717 | 717 | ||
| 718 | 718 | bool initialised_; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments