From: Alan T. DeKok Date: Sat, 22 Feb 2025 14:33:55 +0000 (-0500) Subject: remove "is_choice" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0234f670ae0b758e58cc98b969fc8bd1f146137;p=thirdparty%2Ffreeradius-server.git remove "is_choice" iit's not used. The dictionaries instead use type "choice", or "sequence_of=choice" --- diff --git a/src/protocols/der/base.c b/src/protocols/der/base.c index bf884aa344a..f0d77771a33 100644 --- a/src/protocols/der/base.c +++ b/src/protocols/der/base.c @@ -319,15 +319,6 @@ static int dict_flag_is_oid_leaf(fr_dict_attr_t **da_p, UNUSED char const *value return 0; } -static int dict_flag_is_choice(fr_dict_attr_t **da_p, UNUSED char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules) -{ - fr_der_attr_flags_t *flags = fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC); - - flags->is_choice = true; - - return 0; -} - static int dict_flag_max(fr_dict_attr_t **da_p, char const *value, UNUSED fr_dict_flag_parser_rule_t const *rules) { fr_der_attr_flags_t *flags = fr_dict_attr_ext(*da_p, FR_DICT_ATTR_EXT_PROTOCOL_SPECIFIC); @@ -388,7 +379,6 @@ static const fr_dict_flag_parser_t der_flags[] = { // { L("class"), { .func = dict_flag_class } }, { L("der_type"), { .func = dict_flag_der_type, .needs_value = true } }, { L("has_default"), { .func = dict_flag_has_default } }, - { L("is_choice"), { .func = dict_flag_is_choice } }, { L("is_extensions"), { .func = dict_flag_is_extensions } }, { L("is_oid_leaf"), { .func = dict_flag_is_oid_leaf } }, { L("max"), { .func = dict_flag_max, .needs_value = true } }, diff --git a/src/protocols/der/decode.c b/src/protocols/der/decode.c index caa00d91e88..24cb49d0b8d 100644 --- a/src/protocols/der/decode.c +++ b/src/protocols/der/decode.c @@ -2144,12 +2144,12 @@ static ssize_t fr_der_decode_pair_dbuff(TALLOC_CTX *ctx, fr_pair_list_t *out, fr if (unlikely(fr_der_flag_is_choice(parent))) { slen = fr_der_decode_choice(ctx, out, parent, &our_in, decode_ctx); - if (unlikely(slen < 0)) return slen; + if (unlikely(slen <= 0)) return slen; return fr_dbuff_set(in, &our_in); } - if (unlikely(fr_der_decode_hdr(parent, &our_in, &tag, &len) < 0)) { + if (unlikely(fr_der_decode_hdr(parent, &our_in, &tag, &len) <= 0)) { fr_strerror_const_push("Failed decoding header"); return -1; }