Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a99bbe2

Browse files
tniessendanielleadams
authored andcommittedApr 24, 2022
src: check EC_POINT_get_affine_coordinates result
PR-URL: #42304 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent b24454b commit a99bbe2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/crypto/crypto_ec.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,11 @@ Maybe<void> ExportJWKEcKey(
733733
BignumPointer x(BN_new());
734734
BignumPointer y(BN_new());
735735

736-
EC_POINT_get_affine_coordinates(group, pub, x.get(), y.get(), nullptr);
736+
if (!EC_POINT_get_affine_coordinates(group, pub, x.get(), y.get(), nullptr)) {
737+
ThrowCryptoError(env, ERR_get_error(),
738+
"Failed to get elliptic-curve point coordinates");
739+
return Nothing<void>();
740+
}
737741

738742
if (target->Set(
739743
env->context(),

0 commit comments

Comments
 (0)
Please sign in to comment.