]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove "concat" flag from Digest-Attributes
authorAlan T. DeKok <aland@freeradius.org>
Tue, 19 Apr 2022 15:31:15 +0000 (11:31 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Apr 2022 13:18:08 +0000 (09:18 -0400)
it's not really "concat" in the same way that EAP-Message is,
as we can't split it in the middle of sub TLVs.

share/dictionary/radius/dictionary.iana
src/protocols/radius/base.c
src/protocols/radius/decode.c

index 3b22bfb932293ce5e215cd1f3a35ef65df1001e5..07de35baa59d53c0b51a65459adbd7240298d94c 100644 (file)
@@ -14,7 +14,7 @@
 #      This is bad... at some point the IETF will allocate these.
 #
 ATTRIBUTE      Digest-Response                         206     string
-ATTRIBUTE      Digest-Attributes                       207     tlv concat
+ATTRIBUTE      Digest-Attributes                       207     tlv
 ATTRIBUTE      Realm                                   .1      string
 ATTRIBUTE      Nonce                                   .2      string
 ATTRIBUTE      Method                                  .3      string
index 65b3e782ba39dea0aff14aca67db62feb0d7fa39..d4e5a3bd7a6bb666ee04229f91003b96518e9e99 100644 (file)
@@ -1118,8 +1118,8 @@ static bool attr_valid(UNUSED fr_dict_t *dict, fr_dict_attr_t const *parent,
                        return false;
                }
 
-               if ((type != FR_TYPE_OCTETS) && (type != FR_TYPE_TLV)) {
-                       fr_strerror_const("Attributes with the 'concat' flag MUST be of data type 'octets' or 'tlv'");
+               if (type != FR_TYPE_OCTETS) {
+                       fr_strerror_const("Attributes with the 'concat' flag MUST be of data type 'octets'");
                        return false;
                }
 
index 73ca5fb2e118316c6e153bea60150cfd9cae0030..5bc454138693e1e204ebc9b8bf201a20eb5ea515 100644 (file)
@@ -654,7 +654,6 @@ ssize_t fr_radius_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *out,
        fr_pair_list_t          head;
        fr_pair_list_t          tlv_tmp;
        fr_pair_t               *vp;
-       bool                    concat;
 
        fr_pair_list_init(&head);
        if (data_len < 3) return -1; /* type, length, value */
@@ -670,20 +669,6 @@ ssize_t fr_radius_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *out,
        vp = fr_pair_afrom_da(ctx, parent);
        if (!vp) return PAIR_DECODE_OOM;
 
-       /*
-        *      We don't have a "pair find in out"
-        */
-       if (flag_concat(&parent->flags)) {
-               vp = fr_pair_find_by_da_idx(out, parent, 0);
-               concat = (vp != NULL);
-       } else {
-               vp = NULL;
-               concat = false;
-       }
-
-       if (!vp) vp = fr_pair_afrom_da(ctx, parent);
-       if (!vp) return PAIR_DECODE_OOM;
-
        /*
         *  Record where we were in the list when this function was called
         *       Create a temporary sub-list, so decode errors don't
@@ -703,7 +688,7 @@ ssize_t fr_radius_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *out,
                        child = fr_dict_unknown_attr_afrom_num(packet_ctx->tmp_ctx, parent, p[0]);
                        if (!child) {
                        error:
-                               if (!concat) talloc_free(vp);
+                               talloc_free(vp);
                                return -1;
                        }
                }
@@ -717,7 +702,7 @@ ssize_t fr_radius_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *out,
        }
 
        fr_pair_list_append(&vp->vp_group, &tlv_tmp);
-       if (!concat) fr_pair_append(out, vp);
+       fr_pair_append(out, vp);
 
        return data_len;
 }
@@ -2007,7 +1992,7 @@ ssize_t fr_radius_decode_pair(TALLOC_CTX *ctx, fr_pair_list_t *out,
                /*
                 *      Concatenate consecutive top-level attributes together.
                 */
-               if (flag_concat(&da->flags) && (da->type == FR_TYPE_OCTETS)) {
+               if (flag_concat(&da->flags)) {
                        FR_PROTO_TRACE("Concat attribute");
                        return decode_concat(ctx, out, da, data, packet_ctx->end);
                }