]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't manually skip internal attributes.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 20 Jan 2021 14:30:08 +0000 (09:30 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 20 Jan 2021 16:30:56 +0000 (11:30 -0500)
rely on the iterator for that.  And as a side effect, remove
support for Raw-Attribute

share/dictionary/freeradius/dictionary.freeradius.internal
src/protocols/radius/base.c
src/tests/unit/protocols/radius/rfc2868.txt

index f9e8b2d12dc93dc7cf5bae4e55d2809c10cdbc0b..0ad34c9c407b3d7ce52c3d590853f5473b5b4452 100644 (file)
@@ -136,7 +136,7 @@ ATTRIBUTE   Expiration                              1010    date
 
 ATTRIBUTE      Client-Shortname                        1011    string virtual
 
-ATTRIBUTE      Raw-Attribute                           1012    octets
+# Was Raw-Attribute.  No longer supported
 ATTRIBUTE      User-Category                           1013    string
 
 ATTRIBUTE      Pam-Auth                                1014    string
index 7f452d77e76b04b3b1c99789c379c2c2abc89dc6..7e0b4b661b05014ad9188257dcd4b1ab9799ce8d 100644 (file)
@@ -65,7 +65,6 @@ extern fr_dict_attr_autoload_t libfreeradius_radius_dict_attr[];
 fr_dict_attr_autoload_t libfreeradius_radius_dict_attr[] = {
        { .out = &attr_packet_type, .name = "Packet-Type", .type = FR_TYPE_UINT32, .dict = &dict_radius },
        { .out = &attr_packet_authentication_vector, .name = "Packet-Authentication-Vector", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
-       { .out = &attr_raw_attribute, .name = "Raw-Attribute", .type = FR_TYPE_OCTETS, .dict = &dict_freeradius },
        { .out = &attr_chap_challenge, .name = "CHAP-Challenge", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
        { .out = &attr_chargeable_user_identity, .name = "Chargeable-User-Identity", .type = FR_TYPE_OCTETS, .dict = &dict_radius },
 
@@ -982,39 +981,6 @@ ssize_t fr_radius_encode_dbuff(fr_dbuff_t *dbuff, uint8_t const *original,
        while ((vp = fr_cursor_current(&cursor))) {
                VP_VERIFY(vp);
 
-               /*
-                *      Ignore non-wire attributes, but allow extended
-                *      attributes.
-                */
-               if (vp->da->flags.internal) {
-#ifndef NDEBUG
-                       /*
-                        *      Permit the admin to send BADLY formatted
-                        *      attributes with a debug build.
-                        */
-                       if (vp->da == attr_raw_attribute) {
-                               CHECK_FREESPACE(vp->vp_length, vp->vp_length);
-
-                               /*
-                                *      Skip really badly formatted attributes
-                                */
-                               if (vp->vp_length > (RADIUS_MAX_STRING_LENGTH + 2)) {
-                                       fr_cursor_next(&cursor);
-                                       continue;
-                               }
-
-                               FR_DBUFF_IN_MEMCPY_RETURN(&work_dbuff, vp->vp_octets, vp->vp_length);
-                               fr_cursor_next(&cursor);
-                               continue;
-                       }
-#endif
-                       /*
-                        *      Skip internal attributes...
-                        */
-                       fr_cursor_next(&cursor);
-                       continue;
-               }
-
                /*
                 *      Encode an individual VP
                 */
index 62e4a1b11bb1185635d55e0f22fa8ecc71a6afba..b694ece5f0256dd8b7181b1701ebcdec57288fb4 100644 (file)
@@ -79,10 +79,10 @@ decode-proto 01 01 00 26 00000000000000000000000000000000 40 06 01 00 00 01 40 0
 match Packet-Type = Access-Request, Packet-Authentication-Vector = 0x00000000000000000000000000000000, Tag-1 = { Tunnel-Type = PPTP, Tunnel-Medium-Type = IPv4 }, Tag-2 = { Tunnel-Type = PPTP }
 
 #
-#  This currently fails.  :(
+#  and we encode the tags in order in the packet.
 #
-#encode-proto -
-#match 01 00 00 14 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+encode-proto -
+match 01 00 00 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 06 01 00 00 01 41 06 01 00 00 01 40 06 02 00 00 01
 
 # Invalid tag on decoding
 decode-pair 40 06 20 00 00 01
@@ -108,4 +108,4 @@ decode-pair -
 match Tunnel-Client-Endpoint = "\001\002\003"
 
 count
-match 42
+match 44