File tree 1 file changed +2
-8
lines changed
1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace node {
13
13
14
- using v8::ArrayBuffer;
15
14
using v8::ConstructorBehavior;
16
15
using v8::DontDelete;
17
16
using v8::FunctionCallback;
@@ -604,13 +603,8 @@ void DiffieHellman::Stateless(const FunctionCallbackInfo<Value>& args) {
604
603
ManagedEVPPKey our_key = our_key_object->Data ()->GetAsymmetricKey ();
605
604
ManagedEVPPKey their_key = their_key_object->Data ()->GetAsymmetricKey ();
606
605
607
- Local<Value> out;
608
- {
609
- Local<ArrayBuffer> ab = StatelessDiffieHellmanThreadsafe (our_key, their_key)
610
- .ToArrayBuffer (env);
611
- out = Buffer::New (env, ab, 0 , ab->ByteLength ())
612
- .FromMaybe (Local<Uint8Array>());
613
- }
606
+ Local<Value> out = StatelessDiffieHellmanThreadsafe (our_key, their_key)
607
+ .ToBuffer (env).FromMaybe (Local<Uint8Array>());
614
608
615
609
if (Buffer::Length (out) == 0 )
616
610
return ThrowCryptoError (env, ERR_get_error (), " diffieHellman failed" );
You can’t perform that action at this time.
0 commit comments