PR-URL: https://github.com/nodejs/node/pull/55155
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Declare buf as an unsigned char to get rid of the reinterpret_cast and
do not ignore the return value of ASN1_STRING_TO_UTF8. This also removes
the need to call strlen() on the result.
PR-URL: https://github.com/nodejs/node/pull/44002
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Add ByteSource::Builder to replace the common MallocOpenSSL() +
ByteSource::Allocated() pattern.
Remove ByteSource::reset() that is unused.
Remove ByteSource::Resize() to make ByteSource truly immutable (until
moved away). Instead, ByteSource::Builder::release() takes an optional
size argument that truncates the resulting ByteSource.
Fix occurrences of MallocOpenSSL() that do not always free the allocated
memory by using the new ByteSource::Builder class instead.
Remove ByteSource::get() and replace uses with ByteSource::data().
Remove ReallocOpenSSL() because it likely only saves us a few bytes
whenever we use it.
PR-URL: https://github.com/nodejs/node/pull/43202
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/35509
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>