Unverified Commit 845633a7 authored by Jose M. Palacios Diaz's avatar Jose M. Palacios Diaz Committed by Anna Henningsen
Browse files

crypto: better docs for cases where peer's public key is invalid

changes in c++ are in the computeSecret function, but the thrown
exception that was moved to JS land was in BufferToPoint
function, here i let the allocation error be thrown so the only value
returned is the nullptr that i use later to catch the error in
computeSecret, to then construct the exception in JS land.

an ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY error was added to errors.js
and with that, subsequent changes to docs and tests were made.

PR-URL: https://github.com/nodejs/node/pull/16849
Refs: https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf
Fixes: https://github.com/nodejs/node/issues/16625


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
parent 31e0dbc0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment