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 13
13
14
14
namespace node {
15
15
16
- using v8::ArrayBuffer;
17
16
using v8::ConstructorBehavior;
18
17
using v8::DontDelete;
19
18
using v8::FunctionCallback;
@@ -610,13 +609,8 @@ void DiffieHellman::Stateless(const FunctionCallbackInfo<Value>& args) {
610
609
ManagedEVPPKey our_key = our_key_object->Data ()->GetAsymmetricKey ();
611
610
ManagedEVPPKey their_key = their_key_object->Data ()->GetAsymmetricKey ();
612
611
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>());
620
614
621
615
if (Buffer::Length (out) == 0 )
622
616
return ThrowCryptoError (env, ERR_get_error (), " diffieHellman failed" );
You can’t perform that action at this time.
0 commit comments