int i;
if ((addr = sk_IPAddressFamily_new(IPAddressFamily_cmp)) == NULL) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
return NULL;
}
afi = IANA_AFI_IPV6;
safi = &safi_;
} else {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_NAME_ERROR);
+ X509V3error(X509V3_R_EXTENSION_NAME_ERROR);
X509V3_conf_err(val);
goto err;
}
*safi = strtoul(val->value, &t, 0);
t += strspn(t, " \t");
if (*safi > 0xFF || *t++ != ':') {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_SAFI);
+ X509V3error(X509V3_R_INVALID_SAFI);
X509V3_conf_err(val);
goto err;
}
s = OPENSSL_strdup(val->value);
}
if (s == NULL) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
goto err;
}
*/
if (strcmp(s, "inherit") == 0) {
if (!X509v3_addr_add_inherit(addr, afi, safi)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_INVALID_INHERITANCE);
+ X509V3error(X509V3_R_INVALID_INHERITANCE);
X509V3_conf_err(val);
goto err;
}
s[i1] = '\0';
if (a2i_ipadd(min, s) != length) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, X509V3_R_INVALID_IPADDRESS);
+ X509V3error(X509V3_R_INVALID_IPADDRESS);
X509V3_conf_err(val);
goto err;
}
case '/':
prefixlen = (int)strtoul(s + i2, &t, 10);
if (t == s + i2 || *t != '\0') {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ X509V3error(X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_err(val);
goto err;
}
if (!X509v3_addr_add_prefix(addr, afi, safi, min, prefixlen)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
goto err;
}
break;
i1 = i2 + strspn(s + i2, " \t");
i2 = i1 + strspn(s + i1, addr_chars);
if (i1 == i2 || s[i2] != '\0') {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ X509V3error(X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_err(val);
goto err;
}
if (a2i_ipadd(max, s + i1) != length) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_INVALID_IPADDRESS);
+ X509V3error(X509V3_R_INVALID_IPADDRESS);
X509V3_conf_err(val);
goto err;
}
if (memcmp(min, max, length_from_afi(afi)) > 0) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ X509V3error(X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_err(val);
goto err;
}
if (!X509v3_addr_add_range(addr, afi, safi, min, max)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
goto err;
}
break;
case '\0':
if (!X509v3_addr_add_prefix(addr, afi, safi, min, length * 8)) {
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS, ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
goto err;
}
break;
default:
- X509V3err(X509V3_F_V2I_IPADDRBLOCKS,
- X509V3_R_EXTENSION_VALUE_ERROR);
+ X509V3error(X509V3_R_EXTENSION_VALUE_ERROR);
X509V3_conf_err(val);
goto err;
}
validation_err(X509_V_ERR_INVALID_EXTENSION);
(void)sk_IPAddressFamily_set_cmp_func(ext, IPAddressFamily_cmp);
if ((child = sk_IPAddressFamily_dup(ext)) == NULL) {
- X509V3err(X509V3_F_ADDR_VALIDATE_PATH_INTERNAL,
- ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
if (ctx != NULL)
ctx->error = X509_V_ERR_OUT_OF_MEM;
ret = 0;
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;
}
*/
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;
}
* 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;
}
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;
}
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;
int i;
if ((asid = ASIdentifiers_new()) == NULL) {
- X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE);
+ X509V3error(ERR_R_MALLOC_FAILURE);
return NULL;
}
} 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;
}
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;
}
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;
}
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;
}
*/
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';
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;