node
node copied to clipboard
crypto: reject dh,x25519,x448 in {Sign,Verify}Final
Fixes: https://github.com/nodejs/node/issues/53742
In this PR we handle the return value of EVP_PKEY_{sign,verify}_init
, when it returns -2
, we throw the ERR_OSSL_EVP_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
error. This approach is future proof as we don't have to maintain a list of key types that can not be used with signing / verifying.