@@ -680,10 +680,11 @@ static VALUE ossl_ec_group_eql(VALUE a, VALUE b)
680680 GetECGroup (a , group1 );
681681 GetECGroup (b , group2 );
682682
683- if (EC_GROUP_cmp (group1 , group2 , ossl_bn_ctx ) == 1 )
684- return Qfalse ;
685-
686- return Qtrue ;
683+ switch (EC_GROUP_cmp (group1 , group2 , ossl_bn_ctx )) {
684+ case 0 : return Qtrue ;
685+ case 1 : return Qfalse ;
686+ default : ossl_raise (eEC_GROUP , "EC_GROUP_cmp" );
687+ }
687688}
688689
689690/*
@@ -1244,10 +1245,13 @@ static VALUE ossl_ec_point_eql(VALUE a, VALUE b)
12441245 GetECPoint (b , point2 );
12451246 GetECGroup (group_v1 , group );
12461247
1247- if (EC_POINT_cmp (group , point1 , point2 , ossl_bn_ctx ) == 1 )
1248- return Qfalse ;
1248+ switch (EC_POINT_cmp (group , point1 , point2 , ossl_bn_ctx )) {
1249+ case 0 : return Qtrue ;
1250+ case 1 : return Qfalse ;
1251+ default : ossl_raise (eEC_POINT , "EC_POINT_cmp" );
1252+ }
12491253
1250- return Qtrue ;
1254+ UNREACHABLE ;
12511255}
12521256
12531257/*
@@ -1265,7 +1269,7 @@ static VALUE ossl_ec_point_is_at_infinity(VALUE self)
12651269 switch (EC_POINT_is_at_infinity (group , point )) {
12661270 case 1 : return Qtrue ;
12671271 case 0 : return Qfalse ;
1268- default : ossl_raise (cEC_POINT , "EC_POINT_is_at_infinity" );
1272+ default : ossl_raise (eEC_POINT , "EC_POINT_is_at_infinity" );
12691273 }
12701274
12711275 UNREACHABLE ;
@@ -1286,7 +1290,7 @@ static VALUE ossl_ec_point_is_on_curve(VALUE self)
12861290 switch (EC_POINT_is_on_curve (group , point , ossl_bn_ctx )) {
12871291 case 1 : return Qtrue ;
12881292 case 0 : return Qfalse ;
1289- default : ossl_raise (cEC_POINT , "EC_POINT_is_on_curve" );
1293+ default : ossl_raise (eEC_POINT , "EC_POINT_is_on_curve" );
12901294 }
12911295
12921296 UNREACHABLE ;
@@ -1309,7 +1313,7 @@ static VALUE ossl_ec_point_make_affine(VALUE self)
13091313 rb_warn ("OpenSSL::PKey::EC::Point#make_affine! is deprecated" );
13101314#if !OSSL_OPENSSL_PREREQ (3 , 0 , 0 )
13111315 if (EC_POINT_make_affine (group , point , ossl_bn_ctx ) != 1 )
1312- ossl_raise (cEC_POINT , "EC_POINT_make_affine" );
1316+ ossl_raise (eEC_POINT , "EC_POINT_make_affine" );
13131317#endif
13141318
13151319 return self ;
@@ -1328,7 +1332,7 @@ static VALUE ossl_ec_point_invert(VALUE self)
13281332 GetECPointGroup (self , group );
13291333
13301334 if (EC_POINT_invert (group , point , ossl_bn_ctx ) != 1 )
1331- ossl_raise (cEC_POINT , "EC_POINT_invert" );
1335+ ossl_raise (eEC_POINT , "EC_POINT_invert" );
13321336
13331337 return self ;
13341338}
@@ -1346,7 +1350,7 @@ static VALUE ossl_ec_point_set_to_infinity(VALUE self)
13461350 GetECPointGroup (self , group );
13471351
13481352 if (EC_POINT_set_to_infinity (group , point ) != 1 )
1349- ossl_raise (cEC_POINT , "EC_POINT_set_to_infinity" );
1353+ ossl_raise (eEC_POINT , "EC_POINT_set_to_infinity" );
13501354
13511355 return self ;
13521356}
0 commit comments