Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2022-03-14 22:15:17 +0300
committerGitHub <noreply@github.com>2022-03-14 22:15:17 +0300
commit4aae5364f713c9129ba90d1b0d706bcc5f1d406f (patch)
treeb963ceb30020b8d0e85220a8ec8c0f8b88bedfa7 /src
parent7a601f9cc51d9f02e6bb3ea87f4be3b05c3622a8 (diff)
src: check EC_POINT_get_affine_coordinates result
PR-URL: https://github.com/nodejs/node/pull/42304 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/crypto/crypto_ec.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/crypto/crypto_ec.cc b/src/crypto/crypto_ec.cc
index 7f1ba4dbff6..2d738bb9b62 100644
--- a/src/crypto/crypto_ec.cc
+++ b/src/crypto/crypto_ec.cc
@@ -733,7 +733,11 @@ Maybe<void> ExportJWKEcKey(
BignumPointer x(BN_new());
BignumPointer y(BN_new());
- EC_POINT_get_affine_coordinates(group, pub, x.get(), y.get(), nullptr);
+ if (!EC_POINT_get_affine_coordinates(group, pub, x.get(), y.get(), nullptr)) {
+ ThrowCryptoError(env, ERR_get_error(),
+ "Failed to get elliptic-curve point coordinates");
+ return Nothing<void>();
+ }
if (target->Set(
env->context(),