node/deps/ncrypto
Nora Dossche 4f780905c5
crypto: fix potential null pointer dereference when BIO_meth_new() fails
This function can return null, which will make the calls to
BIO_meth_set_* trigger a null deref.
Even after fixing this, there is an issue with the
`BIOPointer::New(GetMethod())` call in `NodeBIO::New` because the
`New` method cannot handle a null pointer despite other code already
guarding for this
(e.g. the `NodeBIO::New` function already checks `bio`).
This patch solves the issues by adding more null checks.

PR-URL: https://github.com/nodejs/node/pull/61788
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2026-05-11 16:10:16 +02:00
..
BUILD.gn
engine.cc build: apply cpp linting and formatting to ncrypto 2024-11-27 11:03:34 -05:00
ncrypto.cc crypto: fix potential null pointer dereference when BIO_meth_new() fails 2026-05-11 16:10:16 +02:00
ncrypto.gyp src: move more crypto_dh.cc code to ncrypto 2024-08-30 15:52:14 -03:00
ncrypto.h src: update ECKeyPointer in ncrypto 2025-02-03 20:10:01 +01:00
README.md
unofficial.gni build: use variable for crypto dep path 2025-01-05 12:57:24 -05:00

Node.js crypto (ncrypto) library

The ncrypto library extracts the base internal implementation of Node.js crypto operations that support both node:crypto and Web Crypto implementations and makes them available for use in other projects that need to emulate Node.js' behavior.