| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0c54f36 commit 970483f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,6 @@ using v8::ReadOnly; | |||
| 32 | 32 | using v8::SideEffectType; | |
| 33 | 33 | using v8::Signature; | |
| 34 | 34 | using v8::String; | |
| 35 | - using v8::Uint8Array; | ||
| 36 | 35 | using v8::Value; | |
| 37 | 36 | ||
| 38 | 37 | namespace crypto { | |
@@ -637,8 +636,10 @@ void DiffieHellman::Stateless(const FunctionCallbackInfo<Value>& args) { | |||
| 637 | 636 | ManagedEVPPKey our_key = our_key_object->Data()->GetAsymmetricKey(); | |
| 638 | 637 | ManagedEVPPKey their_key = their_key_object->Data()->GetAsymmetricKey(); | |
| 639 | 638 | ||
| 640 | - Local<Value> out = StatelessDiffieHellmanThreadsafe(our_key, their_key) | ||
| 641 | - .ToBuffer(env).FromMaybe(Local<Uint8Array>()); | ||
| 639 | + Local<Value> out; | ||
| 640 | + if (!StatelessDiffieHellmanThreadsafe(our_key, their_key) | ||
| 641 | + .ToBuffer(env) | ||
| 642 | + .ToLocal(&out)) return; | ||
| 642 | 643 | ||
| 643 | 644 | if (Buffer::Length(out) == 0) | |
| 644 | 645 | return ThrowCryptoError(env, ERR_get_error(), "diffieHellman failed"); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments