Skip to content

crypto: don't expose OpenSSL internals

https://github.com/nodejs/node/pull/28335 extended RSA-OAEP support with oaepHash, which works perfectly fine for OpenSSL but unfortunately is a bespoke internal for BoringSSL, and so fails to compile in Electron as BoringSSL does not expose EVP_PKEY_OP_TYPE_CRYPT or EVP_PKEY_CTRL_RSA_OAEP_MD.

OpenSSL has a macro EVP_PKEY_CTX_set_rsa_oaep_md that accomplished the selfsame purpose as documented, and which this PR switches to in order to allow BoringSSL compilation.

Passing a bad or null digest to this new macro returns an error like ERR_OSSL_BAD_DECODE and as such the error i've added to node_errors allows for a thrown error that retains the previous context.

cc @tniessen @ryzokuken

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading