Replace overrides.
[openssl.git] / crypto / ec / ec_lib.c
index e45cbe3607f88b5364def3ae4f0ebbd7a47b8a59..1f487b48a071696812b98e83cf3367a24c5da81a 100644 (file)
@@ -373,11 +373,11 @@ const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group)
 
 int EC_GROUP_order_bits(const EC_GROUP *group)
 {
-    if (group->meth->group_order_bits)
-        return group->meth->group_order_bits(group);
-    if (group->order)
-        return BN_num_bits(group->order);
-    return 0;
+    if (group->meth->group_order_bits == NULL) {
+        ECerr(EC_F_EC_GROUP_ORDER_BITS, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
+        return 0;
+    }
+    return group->meth->group_order_bits(group);
 }
 
 int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor,
@@ -1030,3 +1030,10 @@ void *EC_KEY_get_ex_data(const EC_KEY *key, int idx)
 {
     return CRYPTO_get_ex_data(&key->ex_data, idx);
 }
+
+int ec_group_simple_order_bits(const EC_GROUP *group)
+{
+    if (group->order == NULL)
+        return 0;
+    return BN_num_bits(group->order);
+}