crypto: reject public keys properly
If the underlying operation requires a private key, isPublic
must be set to false
instead of undefined
. (The latter means that both public and private keys are accepted.)
Fixes: https://github.com/nodejs/node/issues/29904
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines