some attributes can be encoded in multiple ways, but will all
decode to the same FreeRADIUS data type. Adding a function
allows us to be more flexible about the input data.
return fr_table_str_by_value(tag_name_to_number, tag, "???");
}
+static const uint64_t der_tags_compatible[FR_DER_TAG_MAX] = {
+ [FR_DER_TAG_UTC_TIME] = (1 << FR_DER_TAG_GENERALIZED_TIME),
+ [FR_DER_TAG_GENERALIZED_TIME] = (1 << FR_DER_TAG_UTC_TIME),
+};
+
+bool fr_der_tags_compatible(fr_der_tag_t tag1, fr_der_tag_t tag2)
+{
+ return (der_tags_compatible[tag1] & (1 << (uint64_t) tag2)) != 0;
+}
+
/*
* Create a mapping between FR_TYPE_* and valid FR_DER_TAG_*'s
*/
*/
fr_der_tag_t fr_type_to_der_tag_default(fr_type_t type);
bool fr_type_to_der_tag_valid(fr_type_t type, fr_der_tag_t tag);
+bool fr_der_tags_compatible(fr_der_tag_t tag1, fr_der_tag_t tag2);
char const *fr_der_tag_to_str(fr_der_tag_t tag);
int fr_der_global_init(void);