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>
This commit is contained in:
Tobias Nießen authored and Danielle Adams committed 2022-04-23 22:47:18 -04:00
1 parent 1c1061549a
commit 5b30e28eb4
1 file changed
+5 -1
+5 -1
View File
@@ -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(),