]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove "is_choice"
authorAlan T. DeKok <aland@freeradius.org>
Sat, 22 Feb 2025 14:33:55 +0000 (09:33 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 22 Feb 2025 19:29:38 +0000 (14:29 -0500)
iit's not used.  The dictionaries instead use type "choice", or
"sequence_of=choice"

src/protocols/der/base.c
src/protocols/der/decode.c

index bf884aa344a71451942fef9fc5196be0743d25b4..f0d77771a3306e7a511c76504cc3ae58948a6498 100644 (file)
@@ -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 } },
index caa00d91e88e5b978d1632e7fcacd9143c61ff96..24cb49d0b8d8bcc084a6815eafff60edcbf1caf2 100644 (file)
@@ -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;
        }