diff options
author | Bodo Möller <bodo@openssl.org> | 2005-04-26 18:53:22 +0000 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2005-04-26 18:53:22 +0000 |
commit | aa4ce7315f65fdf8940d5bc9e562aa478f0335d3 (patch) | |
tree | 204f2143da41bd1cdff17503baeab94ea58d4e89 /crypto/ec | |
parent | c741b83762a9f318d515f32624caab6aedf8d2c5 (diff) |
Fix various incorrect error function codes.
("perl util/ck_errf.pl */*.c */*/*.c" still reports many more.)
Diffstat (limited to 'crypto/ec')
-rw-r--r-- | crypto/ec/ec.h | 11 | ||||
-rw-r--r-- | crypto/ec/ec2_mult.c | 2 | ||||
-rw-r--r-- | crypto/ec/ec_asn1.c | 4 | ||||
-rw-r--r-- | crypto/ec/ec_err.c | 11 | ||||
-rw-r--r-- | crypto/ec/ec_key.c | 2 | ||||
-rw-r--r-- | crypto/ec/ec_lib.c | 4 | ||||
-rw-r--r-- | crypto/ec/ecp_mont.c | 4 | ||||
-rw-r--r-- | crypto/ec/ecp_nist.c | 8 |
8 files changed, 26 insertions, 20 deletions
diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h index 52bce1b4f0..2813b374b1 100644 --- a/crypto/ec/ec.h +++ b/crypto/ec/ec.h @@ -383,6 +383,7 @@ void ERR_load_EC_strings(void); #define EC_F_EC_ASN1_GROUP2PKPARAMETERS 156 #define EC_F_EC_ASN1_PARAMETERS2GROUP 157 #define EC_F_EC_ASN1_PKPARAMETERS2GROUP 158 +#define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 #define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 #define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 #define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 @@ -393,10 +394,13 @@ void ERR_load_EC_strings(void); #define EC_F_EC_GFP_MONT_FIELD_DECODE 133 #define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 #define EC_F_EC_GFP_MONT_FIELD_MUL 131 +#define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 #define EC_F_EC_GFP_MONT_FIELD_SQR 132 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE 189 +#define EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP 135 #define EC_F_EC_GFP_NIST_FIELD_MUL 200 #define EC_F_EC_GFP_NIST_FIELD_SQR 201 -#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE_GFP 202 +#define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 #define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 #define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 #define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP 100 @@ -434,9 +438,9 @@ void ERR_load_EC_strings(void); #define EC_F_EC_KEY_CHECK_KEY 177 #define EC_F_EC_KEY_COPY 178 #define EC_F_EC_KEY_GENERATE_KEY 179 +#define EC_F_EC_KEY_NEW 182 #define EC_F_EC_KEY_PRINT 180 #define EC_F_EC_KEY_PRINT_FP 181 -#define EC_F_EC_NEW 182 #define EC_F_EC_POINTS_MAKE_AFFINE 136 #define EC_F_EC_POINTS_MUL 138 #define EC_F_EC_POINT_ADD 112 @@ -446,6 +450,7 @@ void ERR_load_EC_strings(void); #define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M 183 #define EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP 116 #define EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP 117 +#define EC_F_EC_POINT_INVERT 210 #define EC_F_EC_POINT_IS_AT_INFINITY 118 #define EC_F_EC_POINT_IS_ON_CURVE 119 #define EC_F_EC_POINT_MAKE_AFFINE 120 @@ -462,8 +467,6 @@ void ERR_load_EC_strings(void); #define EC_F_EC_PRE_COMP_DUP 207 #define EC_F_EC_WNAF_MUL 187 #define EC_F_EC_WNAF_PRECOMPUTE_MULT 188 -#define EC_F_GFP_MONT_GROUP_SET_CURVE 189 -#define EC_F_GFP_MONT_GROUP_SET_CURVE_GFP 135 #define EC_F_I2D_ECPARAMETERS 190 #define EC_F_I2D_ECPKPARAMETERS 191 #define EC_F_I2D_ECPRIVATEKEY 192 diff --git a/crypto/ec/ec2_mult.c b/crypto/ec/ec2_mult.c index 3431671444..ff368fd7d7 100644 --- a/crypto/ec/ec2_mult.c +++ b/crypto/ec/ec2_mult.c @@ -221,7 +221,7 @@ static int ec_GF2m_montgomery_point_multiply(const EC_GROUP *group, EC_POINT *r, if (r == point) { - ECerr(EC_F_EC_POINT_MUL, EC_R_INVALID_ARGUMENT); + ECerr(EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY, EC_R_INVALID_ARGUMENT); return 0; } diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c index bfb6f3c9cc..d43ca49ec7 100644 --- a/crypto/ec/ec_asn1.c +++ b/crypto/ec/ec_asn1.c @@ -384,7 +384,7 @@ static int ec_asn1_group2fieldid(const EC_GROUP *group, X9_62_FIELDID *field) } if (!ASN1_INTEGER_set(char_two->p.tpBasis, (long)k)) { - ECerr(EC_F_EC_ASN1_GROUP2PARAMETERS, + ECerr(EC_F_EC_ASN1_GROUP2FIELDID, ERR_R_ASN1_LIB); goto err; } @@ -992,7 +992,7 @@ EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *params) } else { - ECerr(EC_F_EC_ASN1_PARAMETERS2GROUP, EC_R_ASN1_ERROR); + ECerr(EC_F_EC_ASN1_PKPARAMETERS2GROUP, EC_R_ASN1_ERROR); return NULL; } diff --git a/crypto/ec/ec_err.c b/crypto/ec/ec_err.c index 2cdd40c200..4885f56901 100644 --- a/crypto/ec/ec_err.c +++ b/crypto/ec/ec_err.c @@ -88,6 +88,7 @@ static ERR_STRING_DATA EC_str_functs[]= {ERR_FUNC(EC_F_EC_ASN1_GROUP2PKPARAMETERS), "EC_ASN1_GROUP2PKPARAMETERS"}, {ERR_FUNC(EC_F_EC_ASN1_PARAMETERS2GROUP), "EC_ASN1_PARAMETERS2GROUP"}, {ERR_FUNC(EC_F_EC_ASN1_PKPARAMETERS2GROUP), "EC_ASN1_PKPARAMETERS2GROUP"}, +{ERR_FUNC(EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY), "EC_GF2M_MONTGOMERY_POINT_MULTIPLY"}, {ERR_FUNC(EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT), "ec_GF2m_simple_group_check_discriminant"}, {ERR_FUNC(EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE), "ec_GF2m_simple_group_set_curve"}, {ERR_FUNC(EC_F_EC_GF2M_SIMPLE_OCT2POINT), "ec_GF2m_simple_oct2point"}, @@ -98,10 +99,13 @@ static ERR_STRING_DATA EC_str_functs[]= {ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_DECODE), "ec_GFp_mont_field_decode"}, {ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_ENCODE), "ec_GFp_mont_field_encode"}, {ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_MUL), "ec_GFp_mont_field_mul"}, +{ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE), "ec_GFp_mont_field_set_to_one"}, {ERR_FUNC(EC_F_EC_GFP_MONT_FIELD_SQR), "ec_GFp_mont_field_sqr"}, +{ERR_FUNC(EC_F_EC_GFP_MONT_GROUP_SET_CURVE), "ec_GFp_mont_group_set_curve"}, +{ERR_FUNC(EC_F_EC_GFP_MONT_GROUP_SET_CURVE_GFP), "EC_GFP_MONT_GROUP_SET_CURVE_GFP"}, {ERR_FUNC(EC_F_EC_GFP_NIST_FIELD_MUL), "ec_GFp_nist_field_mul"}, {ERR_FUNC(EC_F_EC_GFP_NIST_FIELD_SQR), "ec_GFp_nist_field_sqr"}, -{ERR_FUNC(EC_F_EC_GFP_NIST_GROUP_SET_CURVE_GFP), "EC_GFP_NIST_GROUP_SET_CURVE_GFP"}, +{ERR_FUNC(EC_F_EC_GFP_NIST_GROUP_SET_CURVE), "ec_GFp_nist_group_set_curve"}, {ERR_FUNC(EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT), "ec_GFp_simple_group_check_discriminant"}, {ERR_FUNC(EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE), "ec_GFp_simple_group_set_curve"}, {ERR_FUNC(EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP), "EC_GFP_SIMPLE_GROUP_SET_CURVE_GFP"}, @@ -139,9 +143,9 @@ static ERR_STRING_DATA EC_str_functs[]= {ERR_FUNC(EC_F_EC_KEY_CHECK_KEY), "EC_KEY_check_key"}, {ERR_FUNC(EC_F_EC_KEY_COPY), "EC_KEY_copy"}, {ERR_FUNC(EC_F_EC_KEY_GENERATE_KEY), "EC_KEY_generate_key"}, +{ERR_FUNC(EC_F_EC_KEY_NEW), "EC_KEY_new"}, {ERR_FUNC(EC_F_EC_KEY_PRINT), "EC_KEY_print"}, {ERR_FUNC(EC_F_EC_KEY_PRINT_FP), "EC_KEY_print_fp"}, -{ERR_FUNC(EC_F_EC_NEW), "EC_NEW"}, {ERR_FUNC(EC_F_EC_POINTS_MAKE_AFFINE), "EC_POINTs_make_affine"}, {ERR_FUNC(EC_F_EC_POINTS_MUL), "EC_POINTs_mul"}, {ERR_FUNC(EC_F_EC_POINT_ADD), "EC_POINT_add"}, @@ -151,6 +155,7 @@ static ERR_STRING_DATA EC_str_functs[]= {ERR_FUNC(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GF2M), "EC_POINT_get_affine_coordinates_GF2m"}, {ERR_FUNC(EC_F_EC_POINT_GET_AFFINE_COORDINATES_GFP), "EC_POINT_get_affine_coordinates_GFp"}, {ERR_FUNC(EC_F_EC_POINT_GET_JPROJECTIVE_COORDINATES_GFP), "EC_POINT_get_Jprojective_coordinates_GFp"}, +{ERR_FUNC(EC_F_EC_POINT_INVERT), "EC_POINT_invert"}, {ERR_FUNC(EC_F_EC_POINT_IS_AT_INFINITY), "EC_POINT_is_at_infinity"}, {ERR_FUNC(EC_F_EC_POINT_IS_ON_CURVE), "EC_POINT_is_on_curve"}, {ERR_FUNC(EC_F_EC_POINT_MAKE_AFFINE), "EC_POINT_make_affine"}, @@ -167,8 +172,6 @@ static ERR_STRING_DATA EC_str_functs[]= {ERR_FUNC(EC_F_EC_PRE_COMP_DUP), "EC_PRE_COMP_DUP"}, {ERR_FUNC(EC_F_EC_WNAF_MUL), "ec_wNAF_mul"}, {ERR_FUNC(EC_F_EC_WNAF_PRECOMPUTE_MULT), "ec_wNAF_precompute_mult"}, -{ERR_FUNC(EC_F_GFP_MONT_GROUP_SET_CURVE), "GFP_MONT_GROUP_SET_CURVE"}, -{ERR_FUNC(EC_F_GFP_MONT_GROUP_SET_CURVE_GFP), "GFP_MONT_GROUP_SET_CURVE_GFP"}, {ERR_FUNC(EC_F_I2D_ECPARAMETERS), "i2d_ECParameters"}, {ERR_FUNC(EC_F_I2D_ECPKPARAMETERS), "i2d_ECPKParameters"}, {ERR_FUNC(EC_F_I2D_ECPRIVATEKEY), "i2d_ECPrivateKey"}, diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index aef3934c17..68aba4348b 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -73,7 +73,7 @@ EC_KEY *EC_KEY_new(void) ret=(EC_KEY *)OPENSSL_malloc(sizeof(EC_KEY)); if (ret == NULL) { - ECerr(EC_F_EC_NEW, ERR_R_MALLOC_FAILURE); + ECerr(EC_F_EC_KEY_NEW, ERR_R_MALLOC_FAILURE); return(NULL); } diff --git a/crypto/ec/ec_lib.c b/crypto/ec/ec_lib.c index 6abda2d448..98c2edc611 100644 --- a/crypto/ec/ec_lib.c +++ b/crypto/ec/ec_lib.c @@ -1015,12 +1015,12 @@ int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { if (group->meth->dbl == 0) { - ECerr(EC_F_EC_POINT_DBL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + ECerr(EC_F_EC_POINT_INVERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } if (group->meth != a->meth) { - ECerr(EC_F_EC_POINT_DBL, EC_R_INCOMPATIBLE_OBJECTS); + ECerr(EC_F_EC_POINT_INVERT, EC_R_INCOMPATIBLE_OBJECTS); return 0; } return group->meth->invert(group, a, ctx); diff --git a/crypto/ec/ecp_mont.c b/crypto/ec/ecp_mont.c index b64fa68b56..9fc4a466a5 100644 --- a/crypto/ec/ecp_mont.c +++ b/crypto/ec/ecp_mont.c @@ -223,7 +223,7 @@ int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM * if (mont == NULL) goto err; if (!BN_MONT_CTX_set(mont, p, ctx)) { - ECerr(EC_F_GFP_MONT_GROUP_SET_CURVE, ERR_R_BN_LIB); + ECerr(EC_F_EC_GFP_MONT_GROUP_SET_CURVE, ERR_R_BN_LIB); goto err; } one = BN_new(); @@ -306,7 +306,7 @@ int ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx) { if (group->field_data2 == NULL) { - ECerr(EC_F_EC_GFP_MONT_FIELD_DECODE, EC_R_NOT_INITIALIZED); + ECerr(EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE, EC_R_NOT_INITIALIZED); return 0; } diff --git a/crypto/ec/ecp_nist.c b/crypto/ec/ecp_nist.c index f9521c8044..ef2dc47f83 100644 --- a/crypto/ec/ecp_nist.c +++ b/crypto/ec/ecp_nist.c @@ -143,7 +143,7 @@ int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, #if !defined(NO_32_BIT_TYPE) || defined(OPENSSL_NO_ASM) group->field_mod_func = BN_nist_mod_224; #else - ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE_GFP, EC_R_NOT_A_SUPPORTED_NIST_PRIME); + ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE, EC_R_NOT_A_SUPPORTED_NIST_PRIME); goto err; #endif } @@ -152,7 +152,7 @@ int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, #if !defined(NO_32_BIT_TYPE) || defined(OPENSSL_NO_ASM) group->field_mod_func = BN_nist_mod_256; #else - ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE_GFP, EC_R_NOT_A_SUPPORTED_NIST_PRIME); + ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE, EC_R_NOT_A_SUPPORTED_NIST_PRIME); goto err; #endif } @@ -161,7 +161,7 @@ int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, #if !defined(NO_32_BIT_TYPE) || defined(OPENSSL_NO_ASM) group->field_mod_func = BN_nist_mod_384; #else - ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE_GFP, EC_R_NOT_A_SUPPORTED_NIST_PRIME); + ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE, EC_R_NOT_A_SUPPORTED_NIST_PRIME); goto err; #endif } @@ -170,7 +170,7 @@ int ec_GFp_nist_group_set_curve(EC_GROUP *group, const BIGNUM *p, group->field_mod_func = BN_nist_mod_521; else { - ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE_GFP, EC_R_NOT_A_NIST_PRIME); + ECerr(EC_F_EC_GFP_NIST_GROUP_SET_CURVE, EC_R_NOT_A_NIST_PRIME); goto err; } |