File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 1313
1414namespace node {
1515
16- using v8::ArrayBuffer;
1716using v8::ConstructorBehavior;
1817using v8::DontDelete;
1918using v8::FunctionCallback;
@@ -610,13 +609,8 @@ void DiffieHellman::Stateless(const FunctionCallbackInfo<Value>& args) {
610609 ManagedEVPPKey our_key = our_key_object->Data ()->GetAsymmetricKey ();
611610 ManagedEVPPKey their_key = their_key_object->Data ()->GetAsymmetricKey ();
612611
613- Local<Value> out;
614- {
615- Local<ArrayBuffer> ab = StatelessDiffieHellmanThreadsafe (our_key, their_key)
616- .ToArrayBuffer (env);
617- out = Buffer::New (env, ab, 0 , ab->ByteLength ())
618- .FromMaybe (Local<Uint8Array>());
619- }
612+ Local<Value> out = StatelessDiffieHellmanThreadsafe (our_key, their_key)
613+ .ToBuffer (env).FromMaybe (Local<Uint8Array>());
620614
621615 if (Buffer::Length (out) == 0 )
622616 return ThrowCryptoError (env, ERR_get_error (), " diffieHellman failed" );
You can’t perform that action at this time.
0 commit comments