Skip to content

src,crypto: refactor `crypto_dh.cc`

src,crypto: remove uses of AllocatedBuffer from crypto_dh.cc

Refs: https://github.com/nodejs/node/pull/39941

src: remove unnecessary static qualifier in crypto_dh.cc

ZeroPadDiffieHellmanSecret() is in an anonymous namespace, so it has static linkage already.

src,crypto: handle empty maybe correctly in crypto_dh.cc

Buffer::Length() dereferences the passed Local, so calling it when the underlying pointer is a nullptr would lead to a crash. This fixes that by returning early instead.

Signed-off-by: Darshan Sen raisinten@gmail.com

Merge request reports

Loading