From: Alan T. DeKok Date: Sat, 13 Dec 2025 20:56:53 +0000 (-0500) Subject: don't mangle type to octets if the DA is already unknown X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d14f7392d86b19eb656670a2f585f1255a8314b0;p=thirdparty%2Ffreeradius-server.git don't mangle type to octets if the DA is already unknown --- diff --git a/src/lib/util/dict_unknown.c b/src/lib/util/dict_unknown.c index 98351278da1..b3f8fe232c9 100644 --- a/src/lib/util/dict_unknown.c +++ b/src/lib/util/dict_unknown.c @@ -350,7 +350,7 @@ fr_dict_attr_t *fr_dict_attr_unknown_afrom_da(TALLOC_CTX *ctx, fr_dict_attr_t co * OCTETS. Similarly, if a GROUP is malformed, then we * have no idea what's inside of it, and we make it OCTETS. */ - switch (type) { + if (!da->flags.is_unknown) switch (type) { case FR_TYPE_VENDOR: fr_assert(da->flags.type_size != 0); break; diff --git a/src/tests/unit/protocols/cbor/base.txt b/src/tests/unit/protocols/cbor/base.txt index 6bf08d8b579..09766a4e5f8 100644 --- a/src/tests/unit/protocols/cbor/base.txt +++ b/src/tests/unit/protocols/cbor/base.txt @@ -72,7 +72,10 @@ match Vendor-Specific = { Nokia-SR = { raw.255 = (time_delta) 3600.5 } } # Otherwise the "3600.5" is interpreted as a bare word / string. # encode-pair Vendor-Specific = { Nokia-SR = { raw.255 = (time_delta) 3600.5 } } -match 9f a1 18 1a 81 a1 19 19 7f 81 a1 18 ff 46 33 36 30 30 2e 35 ff +match 9f a1 18 1a 81 a1 19 19 7f 81 a1 18 ff d9 03 ea a2 01 19 0e 10 28 1a 1d cd 65 00 ff + +decode-pair - +match Vendor-Specific = { Nokia-SR = { raw.255 = (time_delta) 3600.5 } } # # Zero-length strings and octets @@ -136,4 +139,4 @@ decode-pair 9f a1 1a 19 a1 82 00 da 00 00 03 ea a2 01 1a be 00 00 00 28 1b 70 a1 match Invalid attribute number '430014976' - it must be no more than 8 bits in size count -match 61 +match 63