}
if (unlikely(current_tag != restriction_type)) {
- fr_strerror_printf("Attribute %s is a set-of type %" PRIu32 ", but found type %u",
- parent->name, restriction_type, current_tag);
+ fr_strerror_printf("Attribute %s is a set-of DER type '%s', but found DER type '%s'",
+ parent->name, fr_der_tag_to_str(restriction_type), fr_der_tag_to_str(current_tag));
ret = -1;
goto error;
}
}
if (tag_class != fr_der_flag_class(parent)) {
- bad_tag:
- fr_strerror_printf("Invalid tag %u for attribute %s. Expected %" PRIu32, *tag, parent->name,
- fr_der_flag_option(parent));
+ fr_strerror_printf("Invalid DER class %02x for attribute %s. Expected DER class %02x", *tag, parent->name,
+ tag_class, fr_der_flag_class(parent));
return -1;
}
- if (*tag != fr_der_flag_option(parent)) goto bad_tag;
+ if (*tag != fr_der_flag_option(parent)) {
+ fr_strerror_printf("Invalid tag %u for attribute %s. Expected %u", *tag, parent->name,
+ fr_der_flag_option(parent));
+ return -1;
+ }
*tag = fr_der_flag_der_type(parent);
}
* If this is not a sequence/set/structure like thing, then it does not have children that
* could have defaults.
*/
- fr_strerror_printf("Attribute %s of type %s cannot store type %u", parent->name,
- fr_type_to_str(parent->type), tag);
+ fr_strerror_printf("Attribute %s of DER type '%s' cannot store DER type '%s'", parent->name,
+ fr_der_tag_to_str(fr_der_flag_der_type(parent)),
+ fr_der_tag_to_str(tag));
return -1;
}
}