Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

raise when EC_POINT_cmp or EC_GROUP_cmp error instead of returning true #564

Merged
merged 1 commit into from
Dec 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions ext/openssl/ossl_pkey_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,11 @@ static VALUE ossl_ec_group_eql(VALUE a, VALUE b)
GetECGroup(a, group1);
GetECGroup(b, group2);

if (EC_GROUP_cmp(group1, group2, ossl_bn_ctx) == 1)
return Qfalse;

return Qtrue;
switch (EC_GROUP_cmp(group1, group2, ossl_bn_ctx)) {
case 0: return Qtrue;
case 1: return Qfalse;
default: ossl_raise(eEC_GROUP, "EC_GROUP_cmp");
}
}

/*
Expand Down Expand Up @@ -1424,10 +1425,13 @@ static VALUE ossl_ec_point_eql(VALUE a, VALUE b)
GetECPoint(b, point2);
GetECGroup(group_v1, group);

if (EC_POINT_cmp(group, point1, point2, ossl_bn_ctx) == 1)
return Qfalse;
switch (EC_POINT_cmp(group, point1, point2, ossl_bn_ctx)) {
case 0: return Qtrue;
case 1: return Qfalse;
default: ossl_raise(eEC_POINT, "EC_POINT_cmp");
}

return Qtrue;
UNREACHABLE;
}

/*
Expand Down