summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2022-03-14 20:15:17 +0100
committerDanielle Adams <adamzdanielle@gmail.com>2022-04-23 22:47:18 -0400
commit5b30e28eb45cb707afe73fa3d06d2ed9b56ff04f (patch)
tree5f4ef25de6a565e6966a7f292b4502756de292d4
parent1c1061549a78d3d932f5750489e10964f32500fd (diff)
downloadnode-new-5b30e28eb45cb707afe73fa3d06d2ed9b56ff04f.tar.gz
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>
-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 7f1ba4dbff..2d738bb9b6 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(),