From: Alan T. DeKok Date: Wed, 31 Dec 2025 12:29:28 +0000 (-0500) Subject: tweaks and fixes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=448ec4bf08edf67753db3316190d45eba6980139;p=thirdparty%2Ffreeradius-server.git tweaks and fixes --- diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 9dd9014d421..4b453bf0dcc 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -5324,6 +5324,8 @@ int fr_dict_attr_set_group(fr_dict_attr_t **da_p, fr_dict_attr_t const *ref) } (*da_p)->type = FR_TYPE_GROUP; + (*da_p)->flags.type_size = 0; + (*da_p)->flags.length = 0; fr_assert(fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_REF) == NULL); diff --git a/src/protocols/der/base.c b/src/protocols/der/base.c index 4d341c28b04..c8db8942a1f 100644 --- a/src/protocols/der/base.c +++ b/src/protocols/der/base.c @@ -779,7 +779,6 @@ static bool type_parse(fr_type_t *type_p,fr_dict_attr_t **da_p, char const *name if (der_type == FR_DER_TAG_OID) { fr_dict_attr_ext_ref_t *ext; - fr_dict_attr_t const *parent; fr_assert(fr_type == FR_TYPE_ATTR); @@ -789,14 +788,12 @@ static bool type_parse(fr_type_t *type_p,fr_dict_attr_t **da_p, char const *name if (unlikely(!ext)) return -1; if (!attr_oid_tree) { - parent = fr_dict_attr_by_name(NULL, fr_dict_root((*da_p)->dict), "OID-Tree"); - fr_assert(parent != NULL); - } else { - parent = attr_oid_tree; + attr_oid_tree = fr_dict_attr_by_name(NULL, fr_dict_root((*da_p)->dict), "OID-Tree"); + fr_assert(attr_oid_tree != NULL); } ext->type = FR_DICT_ATTR_REF_ROOT; - ext->ref = parent; + ext->ref = attr_oid_tree; } /* @@ -858,15 +855,6 @@ static bool attr_valid(fr_dict_attr_t *da) fr_der_attr_flags_t *flags = fr_dict_attr_ext(da, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC); fr_der_attr_flags_t *parent; - /* - * We might have created the attribute of type "tlv", and then later swapped it to "group". - * Ensure that the main validation routines are happy with the result. - */ - if (da->type == FR_TYPE_GROUP) { - da->flags.type_size = 0; - da->flags.length = 0; - } - if (flags->is_choice && unlikely(!fr_type_is_tlv(da->type))) { fr_strerror_printf("Attribute %s of type %s is not allowed represent a collection of choices.", da->name, fr_type_to_str(da->type));