From f14c7504d15e60ee31f49bd48dbb4de76e6b8ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 20 Jun 2022 09:51:04 +0200 Subject: [PATCH] src: remove CopyBuffer CopyBuffer was used by the PBKDF2 implementation prior to the big refactor, which removed those call sites. PR-URL: https://github.com/nodejs/node/pull/43463 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen --- src/crypto/crypto_util.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h index 7a795fe5e81f94..07ea8e44da3e54 100644 --- a/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h @@ -752,20 +752,6 @@ class ArrayBufferOrViewContents { std::shared_ptr store_; }; -template -std::vector CopyBuffer(const ArrayBufferOrViewContents& buf) { - std::vector vec; - vec->resize(buf.size()); - if (vec->size() > 0 && buf.data() != nullptr) - memcpy(vec->data(), buf.data(), vec->size()); - return vec; -} - -template -std::vector CopyBuffer(v8::Local buf) { - return CopyBuffer(ArrayBufferOrViewContents(buf)); -} - v8::MaybeLocal EncodeBignum( Environment* env, const BIGNUM* bn,