diff options
Diffstat (limited to 'lib/libcrypto/x509/x509_asid.c')
-rw-r--r-- | lib/libcrypto/x509/x509_asid.c | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/lib/libcrypto/x509/x509_asid.c b/lib/libcrypto/x509/x509_asid.c index 59c7cabb139..1672b3c7f10 100644 --- a/lib/libcrypto/x509/x509_asid.c +++ b/lib/libcrypto/x509/x509_asid.c @@ -479,16 +479,14 @@ static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice) if ((bn == NULL && (bn = BN_new()) == NULL) || ASN1_INTEGER_to_BN(a_max, bn) == NULL || !BN_add_word(bn, 1)) { - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL, - ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto done; } if ((a_max_plus_one = BN_to_ASN1_INTEGER(bn, orig = a_max_plus_one)) == NULL) { a_max_plus_one = orig; - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL, - ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto done; } @@ -552,8 +550,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) */ if (choice->type != ASIdentifierChoice_asIdsOrRanges || sk_ASIdOrRange_num(choice->u.asIdsOrRanges) == 0) { - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, - X509V3_R_EXTENSION_VALUE_ERROR); + X509V3error(X509V3_R_EXTENSION_VALUE_ERROR); return 0; } @@ -593,8 +590,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) * Check for overlaps. */ if (ASN1_INTEGER_cmp(a_max, b_min) >= 0) { - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, - X509V3_R_EXTENSION_VALUE_ERROR); + X509V3error(X509V3_R_EXTENSION_VALUE_ERROR); goto done; } @@ -604,16 +600,14 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) if ((bn == NULL && (bn = BN_new()) == NULL) || ASN1_INTEGER_to_BN(a_max, bn) == NULL || !BN_add_word(bn, 1)) { - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, - ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto done; } if ((a_max_plus_one = BN_to_ASN1_INTEGER(bn, orig = a_max_plus_one)) == NULL) { a_max_plus_one = orig; - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, - ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto done; } @@ -625,8 +619,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) switch (a->type) { case ASIdOrRange_id: if ((r = OPENSSL_malloc(sizeof(*r))) == NULL) { - X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE, - ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto done; } r->min = a_min; @@ -702,7 +695,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, int i; if ((asid = ASIdentifiers_new()) == NULL) { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); return NULL; } @@ -718,8 +711,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, } else if (!name_cmp(val->name, "RDI")) { which = V3_ASID_RDI; } else { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, - X509V3_R_EXTENSION_NAME_ERROR); + X509V3error(X509V3_R_EXTENSION_NAME_ERROR); X509V3_conf_err(val); goto err; } @@ -730,8 +722,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, if (strcmp(val->value, "inherit") == 0) { if (X509v3_asid_add_inherit(asid, which)) continue; - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, - X509V3_R_INVALID_INHERITANCE); + X509V3error(X509V3_R_INVALID_INHERITANCE); X509V3_conf_err(val); goto err; } @@ -746,8 +737,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, is_range = 1; i2 = i1 + strspn(val->value + i1, " \t"); if (val->value[i2] != '-') { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, - X509V3_R_INVALID_ASNUMBER); + X509V3error(X509V3_R_INVALID_ASNUMBER); X509V3_conf_err(val); goto err; } @@ -755,8 +745,7 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, i2 = i2 + strspn(val->value + i2, " \t"); i3 = i2 + strspn(val->value + i2, "0123456789"); if (val->value[i3] != '\0') { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, - X509V3_R_INVALID_ASRANGE); + X509V3error(X509V3_R_INVALID_ASRANGE); X509V3_conf_err(val); goto err; } @@ -767,13 +756,13 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, */ if (!is_range) { if (!X509V3_get_value_int(val, &min)) { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto err; } } else { char *s = OPENSSL_strdup(val->value); if (s == NULL) { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto err; } s[i1] = '\0'; @@ -781,17 +770,16 @@ static void *v2i_ASIdentifiers(const struct v3_ext_method *method, max = s2i_ASN1_INTEGER(NULL, s + i2); free(s); if (min == NULL || max == NULL) { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto err; } if (ASN1_INTEGER_cmp(min, max) > 0) { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, - X509V3_R_EXTENSION_VALUE_ERROR); + X509V3error(X509V3_R_EXTENSION_VALUE_ERROR); goto err; } } if (!X509v3_asid_add_id_or_range(asid, which, min, max)) { - X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE); + X509V3error(ERR_R_MALLOC_FAILURE); goto err; } min = max = NULL; |