We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ByteSource::ToBuffer()
crypto_dh
1 parent 1555dbd commit acbd822Copy full SHA for acbd822
1 file changed
src/crypto/crypto_dh.cc
@@ -13,7 +13,6 @@
13
14
namespace node {
15
16
-using v8::ArrayBuffer;
17
using v8::ConstructorBehavior;
18
using v8::DontDelete;
19
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
ManagedEVPPKey their_key = their_key_object->Data()->GetAsymmetricKey();
612
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
- }
+ Local<Value> out = StatelessDiffieHellmanThreadsafe(our_key, their_key)
+ .ToBuffer(env).FromMaybe(Local<Uint8Array>());
620
621
if (Buffer::Length(out) == 0)
622
return ThrowCryptoError(env, ERR_get_error(), "diffieHellman failed");
0 commit comments