]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
6 months agostring / octets can have length=0 and no pointer
Alan T. DeKok [Wed, 10 Dec 2025 14:42:07 +0000 (09:42 -0500)] 
string / octets can have length=0 and no pointer

in which case there isn't a need for the actual data.  The printing
and encoding routines already ignore the pointer when length=i=0

But we may want to re-visit that decision.

Also add a commented-out assertion that the pointer is NULL when
length==0.  This could perhaps be relaxed to check that the pointer
points to a NUL byte (string), or is a zero-length memory region
(octets)

6 months agoadd checks that attribute numbers are OK
Alan T. DeKok [Tue, 9 Dec 2025 22:05:32 +0000 (17:05 -0500)] 
add checks that attribute numbers are OK

otherwise bad things might happen during encoding

For now, not assertions. Because CI is insistent that line numbers
don't exist.

and set the internal flag appropriately for internal attributes

6 months agodocs-v4: Reorganize the Howto/Upgrade section into smaller pages (HIVE-4049)
nolade [Thu, 4 Dec 2025 22:11:10 +0000 (17:11 -0500)] 
docs-v4: Reorganize the Howto/Upgrade section into smaller pages (HIVE-4049)

6 months agoallow raw attributes in structs
Alan T. DeKok [Mon, 8 Dec 2025 20:13:51 +0000 (15:13 -0500)] 
allow raw attributes in structs

but enforce that the length is correct, so that the parent struct
is not malformed.

Only encode a struct member once, even if the admin specifies it
multiple times.

update tests to match

6 months agoallow bare oids only if a new flag is set
Alan T. DeKok [Mon, 8 Dec 2025 16:49:17 +0000 (11:49 -0500)] 
allow bare oids only if a new flag is set

the code also sets that flag when the "raw" prefix is used.

The tests are updated for this new syntax.

Adding a flag is useful not just for "raw", but also for protocols
wuch as DER or SNMP which might want to always allow numerical OID
strings.

6 months agowe know how big IP addresses are in DNS
Alan T. DeKok [Tue, 9 Dec 2025 19:52:24 +0000 (14:52 -0500)] 
we know how big IP addresses are in DNS

6 months agodon't create "raw" attributes with invalid numbers
Alan T. DeKok [Tue, 9 Dec 2025 14:59:39 +0000 (09:59 -0500)] 
don't create "raw" attributes with invalid numbers

they should be limited by the protocol type_size.

Update cbor tests to match.

6 months agoTLVs can have STRUCTs for parents, too.
Alan T. DeKok [Tue, 9 Dec 2025 18:50:01 +0000 (13:50 -0500)] 
TLVs can have STRUCTs for parents, too.

and convert assertion to run-time check.  Because the fuzzers don't
produce helpful stack traces.

6 months agoensure that CUI has a value.
Alan T. DeKok [Tue, 9 Dec 2025 18:45:28 +0000 (13:45 -0500)] 
ensure that CUI has a value.

6 months agofix assertion to be correct
Alan T. DeKok [Tue, 9 Dec 2025 18:25:17 +0000 (13:25 -0500)] 
fix assertion to be correct

6 months agoreturn error instead of zero on decode error
Alan T. DeKok [Tue, 9 Dec 2025 18:24:52 +0000 (13:24 -0500)] 
return error instead of zero on decode error

6 months agodon't do -O2 for fuzzers
Alan T. DeKok [Tue, 9 Dec 2025 17:45:35 +0000 (12:45 -0500)] 
don't do -O2 for fuzzers

hopefully this gives us stack traces instead of hex pointers

6 months agoLook for Message-Authenticator in the correct list
Nick Porter [Tue, 9 Dec 2025 15:57:20 +0000 (15:57 +0000)] 
Look for Message-Authenticator in the correct list

This check is for Message-Authenticator in the reply from a home server
- so look in the list the response has been decoded into.

6 months agohoist checks for attribute size to next_encodable
Alan T. DeKok [Tue, 9 Dec 2025 14:27:59 +0000 (09:27 -0500)] 
hoist checks for attribute size to next_encodable

so that we don't hit assertions with unknown attributes.  The
longer term fix is to allow raw attributes under VSAs, even if
they do break the hierarchy.

Also update the encoder so that when it switches over types, the
"default" case is the error one.  This ensures that the functions
only get called with data types that they support.

6 months agocatch more corner cases
Alan T. DeKok [Mon, 8 Dec 2025 21:26:42 +0000 (16:26 -0500)] 
catch more corner cases

6 months agoupdate attribute references
Alan T. DeKok [Mon, 8 Dec 2025 20:14:19 +0000 (15:14 -0500)] 
update attribute references

6 months agoadd Homebrew / OSX magic for fuzzer builds
Alan T. DeKok [Mon, 8 Dec 2025 20:42:43 +0000 (15:42 -0500)] 
add Homebrew / OSX magic for fuzzer builds

6 months agotypo
Alan T. DeKok [Mon, 8 Dec 2025 20:19:20 +0000 (15:19 -0500)] 
typo

6 months agoremove old file which doesn't work
Alan T. DeKok [Mon, 8 Dec 2025 18:08:56 +0000 (13:08 -0500)] 
remove old file which doesn't work

6 months agoCID 1675662
Alan T. DeKok [Mon, 8 Dec 2025 17:06:01 +0000 (12:06 -0500)] 
CID 1675662

6 months agoCID 1675661
Alan T. DeKok [Mon, 8 Dec 2025 17:05:51 +0000 (12:05 -0500)] 
CID 1675661

6 months agoclean up unknown attributes
Alan T. DeKok [Sun, 7 Dec 2025 13:52:05 +0000 (08:52 -0500)] 
clean up unknown attributes

print union + child if the child is raw

update the struct encoder/decoder to create raw UNION members
as children of the union, instead of as children of the struct

add and use dict_attr_unknown_init(), which unifies the creation
and checking of unknown attributes.  So that we can enforce
common rules and restrictions.

6 months agoadd more "\n"
Alan T. DeKok [Sun, 7 Dec 2025 01:38:07 +0000 (20:38 -0500)] 
add more "\n"

6 months agoattribute names cannot be solely numerical
Alan T. DeKok [Sun, 7 Dec 2025 00:48:17 +0000 (19:48 -0500)] 
attribute names cannot be solely numerical

6 months agoclean up set type and length
Alan T. DeKok [Sat, 6 Dec 2025 20:10:19 +0000 (15:10 -0500)] 
clean up set type and length

so that it's done in the dict_attr_parent_init() function

6 months agono need to check the number when parsing the OID
Alan T. DeKok [Sat, 6 Dec 2025 18:47:53 +0000 (13:47 -0500)] 
no need to check the number when parsing the OID

we just look it up in the dictionary.  If it's not found, then we
return a "not found" error.

There's no need to return a more descriptive error.

6 months agoremove last vestiges of "keys can have children"
Alan T. DeKok [Sat, 6 Dec 2025 17:02:36 +0000 (12:02 -0500)] 
remove last vestiges of "keys can have children"

6 months agomove "set type_size and length" to separate function
Alan T. DeKok [Sat, 6 Dec 2025 16:26:53 +0000 (11:26 -0500)] 
move "set type_size and length" to separate function

and fix its logic so that it's correct for all protocols, and for
the different kinds of VSAs we have in RADIUS.

Previously, if anyone had defined USR VSAs inside of the
Extended-Vendor-Specific-Attribute space, they would have been
encoded in the USR TLV format, and not the standard RADIUS 1/1
format.

While RFC 8044 allows for "vsa" to have any format, it also recommends
that they use the "tlv" format.

RFC 8044 doesn't recommend that the "evs" data type use the "tlv"
format, but it should.  If vendors use different formats for
attributes under the "evs" data type, then we will need to extend
the dictionary parser to allow attributes of type 'vendor' to
specify their own data type and length.

6 months agoset the default type size for a dictionary
Alan T. DeKok [Sat, 6 Dec 2025 16:24:30 +0000 (11:24 -0500)] 
set the default type size for a dictionary

from the protocol library which we loaded.

6 months agoVSA type size depends on the VENDOR type size, but only for RADIUS
Alan T. DeKok [Sat, 6 Dec 2025 15:40:30 +0000 (10:40 -0500)] 
VSA type size depends on the VENDOR type size, but only for RADIUS

the other protocols are a bit better here.

6 months agoenforce correct mapping between protocol name and number
Alan T. DeKok [Sat, 6 Dec 2025 15:33:27 +0000 (10:33 -0500)] 
enforce correct mapping between protocol name and number

This is necessary because we want to have some protocol-specific
behavior in the core.  It doesn't make sense to allow the
administrator to change protocol numbers.

6 months agofr_dict_attr_unknown_afrom_da() can return NULL
Alan T. DeKok [Sat, 6 Dec 2025 14:34:05 +0000 (09:34 -0500)] 
fr_dict_attr_unknown_afrom_da() can return NULL

6 months agofix: Corrected the return values for when a default value is used when parsing config...
Ethan Thompson [Sat, 6 Dec 2025 01:44:43 +0000 (20:44 -0500)] 
fix: Corrected the return values for when a default value is used when parsing configs. (#5691)

Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
6 months agoadd a "pair-compare" function
Alan T. DeKok [Thu, 4 Dec 2025 19:29:41 +0000 (14:29 -0500)] 
add a "pair-compare" function

which allows for comparison operators

6 months agocache the root protocol dictionary, and the internal dictionary
Alan T. DeKok [Thu, 4 Dec 2025 15:27:44 +0000 (10:27 -0500)] 
cache the root protocol dictionary, and the internal dictionary

when parsing strings, so that we can swap back and forth between
internal dictionaries, and protocol ones

6 months agohandle the case of internal attributes in protocol structures
Alan T. DeKok [Thu, 4 Dec 2025 15:12:50 +0000 (10:12 -0500)] 
handle the case of internal attributes in protocol structures

6 months agodo not allow leaf types to be in the middle of an OID string
Alan T. DeKok [Wed, 3 Dec 2025 13:46:07 +0000 (08:46 -0500)] 
do not allow leaf types to be in the middle of an OID string

specifically, key fields.  But the parser actually allowed
anything to be used.  The results were accidental, and therefore
wrong.

Update map-xlat-struct input to match.  The test actually doesn't
use the input Client-ID, so the value doesn't matter.  But the
old input relied on assigning hex values to attributes of type
"group".

And when updated to use UUID inputs, the resulting output created
attributes with incorrect parentage.  The issue seems to be the
DHCPv6 protocol decoder (or more likely the struct decoder).  But
for now, we avoid the problem and move on.

i.e. input

Client-ID.UUID.Value = 0xabcdef

gives output

Debug :     Client-ID {
Debug :       Value.UUID {
Debug :         Value = 0xabcdef
Debug :       }
Debug :     }

which is wrong.  This output shows that the UUID pair is being
created as a child of Client-ID.  Instead, there should be an
intermediate Value created, and then the UUID should be a child
of that.

6 months agoremove "key as structural element" from tests
Alan T. DeKok [Tue, 2 Dec 2025 20:46:07 +0000 (15:46 -0500)] 
remove "key as structural element" from tests

6 months agoit's OK to not be given an attribute
Alan T. DeKok [Sun, 30 Nov 2025 16:28:02 +0000 (11:28 -0500)] 
it's OK to not be given an attribute

just load all of the dictionaries, and then exit.

6 months agoexpose API to create one unknown attribute from a numbered OID
Alan T. DeKok [Mon, 1 Dec 2025 21:33:26 +0000 (16:33 -0500)] 
expose API to create one unknown attribute from a numbered OID

6 months agomake the error a little but clearer
Alan T. DeKok [Tue, 2 Dec 2025 17:48:01 +0000 (12:48 -0500)] 
make the error a little but clearer

6 months agoadd and use FR_DBUFF_ERROR_OFFSET
Alan T. DeKok [Tue, 2 Dec 2025 17:35:30 +0000 (12:35 -0500)] 
add and use FR_DBUFF_ERROR_OFFSET

so that we don't have int64 underflow when subtracting offsets
from error slen

arguably we should instead have an error pointer like is done in
the sbuffs, and with fr_sbuff_error()

6 months agouse fr_dbuff_used()
Alan T. DeKok [Tue, 2 Dec 2025 17:24:54 +0000 (12:24 -0500)] 
use fr_dbuff_used()

6 months agoupdate comment
Alan T. DeKok [Mon, 1 Dec 2025 20:37:25 +0000 (15:37 -0500)] 
update comment

6 months agocheck limits on the data.
Alan T. DeKok [Tue, 2 Dec 2025 17:25:29 +0000 (12:25 -0500)] 
check limits on the data.

to catch the corner case of the encoder returning unrealistic
amounts of data

6 months agotweak output to be a bit clearer
Alan T. DeKok [Sun, 30 Nov 2025 19:24:31 +0000 (14:24 -0500)] 
tweak output to be a bit clearer

6 months agoInclude Genexis DHCPv4 dictionary
Nick Porter [Mon, 1 Dec 2025 12:11:44 +0000 (12:11 +0000)] 
Include Genexis DHCPv4 dictionary

6 months agoexport fr_dict_attr_unknown_alloc()
Alan T. DeKok [Sun, 30 Nov 2025 15:02:50 +0000 (10:02 -0500)] 
export fr_dict_attr_unknown_alloc()

and limit the types of unknown attributes which can be created

6 months agoaliases can only be to siblings, and children of siblings
Alan T. DeKok [Sun, 30 Nov 2025 15:16:05 +0000 (10:16 -0500)] 
aliases can only be to siblings, and children of siblings

otherwise the attribute tree either has loops, or else it has
cross-branch references, which will really confuse things.

ALIASes are there to shorten the tree.  If you need cross-branch
references, you should use groups instead.

6 months agoadd -F <format> in preparation for printing as dictionaries
Alan T. DeKok [Sat, 29 Nov 2025 15:16:17 +0000 (10:16 -0500)] 
add -F <format> in preparation for printing as dictionaries

6 months agomark up where pairs were allocated from
Alan T. DeKok [Fri, 28 Nov 2025 17:18:59 +0000 (12:18 -0500)] 
mark up where pairs were allocated from

we don't need to do this everywhere, but it's useful to do it for
common cases.

6 months agotrack where a #fr_pair_t was allocated from
Alan T. DeKok [Fri, 28 Nov 2025 17:13:55 +0000 (12:13 -0500)] 
track where a #fr_pair_t was allocated from

6 months agoadd parent DA to fr_pair_verify()
Alan T. DeKok [Fri, 28 Nov 2025 16:48:25 +0000 (11:48 -0500)] 
add parent DA to fr_pair_verify()

and some associated helper functions.  This allows us to do
better checks of parentage.

6 months agoinitialize buffer to quiet compiler
Alan T. DeKok [Fri, 28 Nov 2025 14:41:45 +0000 (09:41 -0500)] 
initialize buffer to quiet compiler

6 months agoadd more dict functions, and run more dict tests for unit tests
Alan T. DeKok [Thu, 27 Nov 2025 20:56:33 +0000 (15:56 -0500)] 
add more dict functions, and run more dict tests for unit tests

6 months agoupdate with notes for the test that is still failing
Alan T. DeKok [Thu, 27 Nov 2025 20:53:10 +0000 (15:53 -0500)] 
update with notes for the test that is still failing

6 months agomove fixup of attr ref to place where it is called more often
Alan T. DeKok [Thu, 27 Nov 2025 20:43:36 +0000 (15:43 -0500)] 
move fixup of attr ref to place where it is called more often

which results in better tmpl attribute references when there are
aliases

@todo - maybe the check for parent needs to check for FR_TYPE_GROUP,
too?

6 months agocorrect the name
Alan T. DeKok [Thu, 27 Nov 2025 20:20:07 +0000 (15:20 -0500)] 
correct the name

6 months agoadd missing CR/LF
Alan T. DeKok [Thu, 27 Nov 2025 18:16:48 +0000 (13:16 -0500)] 
add missing CR/LF

6 months agocorrect error message
Alan T. DeKok [Thu, 27 Nov 2025 18:02:22 +0000 (13:02 -0500)] 
correct error message

6 months agonote why unions have a key ref
Alan T. DeKok [Thu, 27 Nov 2025 17:52:02 +0000 (12:52 -0500)] 
note why unions have a key ref

arguably this could be replaced by more caching on the stack
during the dictionary parse phase.  But that wouldn't work if new
union members were defined in a different file

6 months agotypo
Alan T. DeKok [Wed, 26 Nov 2025 21:40:20 +0000 (16:40 -0500)] 
typo

6 months agoadd functions to print information about attributes
Alan T. DeKok [Wed, 26 Nov 2025 21:39:17 +0000 (16:39 -0500)] 
add functions to print information about attributes

6 months agoprint out more flags
Alan T. DeKok [Wed, 26 Nov 2025 21:38:35 +0000 (16:38 -0500)] 
print out more flags

6 months agosuppress protocol name after the first level
Alan T. DeKok [Wed, 26 Nov 2025 21:02:17 +0000 (16:02 -0500)] 
suppress protocol name after the first level

6 months agoadd assert to quiet coverity
Alan T. DeKok [Wed, 26 Nov 2025 20:33:44 +0000 (15:33 -0500)] 
add assert to quiet coverity

6 months agoadd recursive option for printing dictionary entries
Alan T. DeKok [Wed, 26 Nov 2025 20:06:25 +0000 (15:06 -0500)] 
add recursive option for printing dictionary entries

6 months agodon't print out the entire environment, and add radict wrapper
Alan T. DeKok [Wed, 26 Nov 2025 19:40:00 +0000 (14:40 -0500)] 
don't print out the entire environment, and add radict wrapper

6 months agofix comment
Alan T. DeKok [Wed, 26 Nov 2025 19:36:27 +0000 (14:36 -0500)] 
fix comment

6 months agoaliases have no data type
Alan T. DeKok [Wed, 26 Nov 2025 19:36:12 +0000 (14:36 -0500)] 
aliases have no data type

6 months agoit helps to check for success, and to produce meaningful errors
Alan T. DeKok [Wed, 26 Nov 2025 18:59:43 +0000 (13:59 -0500)] 
it helps to check for success, and to produce meaningful errors

6 months agoadd more assertions to ensure proper parent/child order
Alan T. DeKok [Wed, 26 Nov 2025 15:08:01 +0000 (10:08 -0500)] 
add more assertions to ensure proper parent/child order

6 months agolimit where ALIASes can go.
Alan T. DeKok [Wed, 26 Nov 2025 14:05:29 +0000 (09:05 -0500)] 
limit where ALIASes can go.

because it doesn't make sense to have them in 'group', for example

6 months agoallow for copying of aliases.
Alan T. DeKok [Wed, 26 Nov 2025 13:36:24 +0000 (08:36 -0500)] 
allow for copying of aliases.

However, the copy code is not done.  Instead, it produces an error
message.  This is better than silently not copying the ALIAS

6 months agodouble-check and limit which type of attributes can have aliases
Alan T. DeKok [Tue, 25 Nov 2025 21:57:02 +0000 (16:57 -0500)] 
double-check and limit which type of attributes can have aliases

6 months agoset a flag when an attribute has an alias
Alan T. DeKok [Tue, 25 Nov 2025 21:56:03 +0000 (16:56 -0500)] 
set a flag when an attribute has an alias

6 months agoclean up and relax checks when copying ENUMs
Alan T. DeKok [Tue, 25 Nov 2025 21:43:00 +0000 (16:43 -0500)] 
clean up and relax checks when copying ENUMs

we can copy ENUMs cross protocol, so long as the fields aren't
'key=..' or FR_TYPE_ATTR

6 months agono need to create an intermediate attribute when cloning
Alan T. DeKok [Tue, 25 Nov 2025 21:42:22 +0000 (16:42 -0500)] 
no need to create an intermediate attribute when cloning

6 months agoleaf attributes no longer get cloned, so delete unused code
Alan T. DeKok [Tue, 25 Nov 2025 17:55:25 +0000 (12:55 -0500)] 
leaf attributes no longer get cloned, so delete unused code

6 months agouse new data type uint32 instead of old integer
Alan T. DeKok [Tue, 25 Nov 2025 16:41:40 +0000 (11:41 -0500)] 
use new data type uint32 instead of old integer

perl -p -i -e 's/(\s+)integer64/$1uint64/;s/(\s+)integer/$1uint32/g' share/dictionary/radius/dictionary.*

6 months agoinsert enum cloning into the correct list
Alan T. DeKok [Tue, 25 Nov 2025 15:04:43 +0000 (10:04 -0500)] 
insert enum cloning into the correct list

instead of the wrong one.

And fix the sanity checks so that they're correct

6 months agoerror out if source DA has no children
Alan T. DeKok [Tue, 25 Nov 2025 03:04:04 +0000 (22:04 -0500)] 
error out if source DA has no children

6 months agotweak sanity checks for src/dst when cloning attributes
Alan T. DeKok [Tue, 25 Nov 2025 02:43:10 +0000 (21:43 -0500)] 
tweak sanity checks for src/dst when cloning attributes

6 months agono need to call dict_attr_acopy_enumv() for enum=...
Alan T. DeKok [Tue, 25 Nov 2025 02:35:46 +0000 (21:35 -0500)] 
no need to call dict_attr_acopy_enumv() for enum=...

now that the ext copy routine for enums does the casts

6 months agoif necessary, cast the enums when copying
Alan T. DeKok [Tue, 25 Nov 2025 02:18:45 +0000 (21:18 -0500)] 
if necessary, cast the enums when copying

6 months agoremove dict_attr_acopy_dict(), and update dict_attr_acopy()
Alan T. DeKok [Mon, 24 Nov 2025 21:07:22 +0000 (16:07 -0500)] 
remove dict_attr_acopy_dict(), and update dict_attr_acopy()

The two functions had some overlap, and dict_attr_acopy() would
initialize the copy with the _sources_ parent, which was wrong.
many of the copy routines need the correct parent during the copy.

6 months agokeys can no longer have children
Alan T. DeKok [Mon, 24 Nov 2025 20:45:36 +0000 (15:45 -0500)] 
keys can no longer have children

6 months agodocs-v4: Update Concepts landing page and nav panel HIVE 4414/6
nolade [Fri, 11 Jul 2025 18:26:48 +0000 (14:26 -0400)] 
docs-v4: Update Concepts landing page and nav panel HIVE 4414/6

6 months agodocs: Reference landing page Updates PR #5678
nolade [Wed, 6 Aug 2025 16:39:10 +0000 (12:39 -0400)] 
docs: Reference landing page Updates PR #5678

6 months agodocs-v4: Build fix - added table delilmiter
nolade [Wed, 19 Nov 2025 16:32:07 +0000 (11:32 -0500)] 
docs-v4: Build fix - added table delilmiter

6 months agolet's clone the various flags, too
Alan T. DeKok [Mon, 24 Nov 2025 17:38:19 +0000 (12:38 -0500)] 
let's clone the various flags, too

6 months agotweak checks for type size
Alan T. DeKok [Mon, 24 Nov 2025 17:19:06 +0000 (12:19 -0500)] 
tweak checks for type size

6 months agoprint types and length, too
Alan T. DeKok [Mon, 24 Nov 2025 17:18:05 +0000 (12:18 -0500)] 
print types and length, too

6 months agomore checks for aliases
Alan T. DeKok [Mon, 24 Nov 2025 13:43:57 +0000 (08:43 -0500)] 
more checks for aliases

6 months agotypo
Alan T. DeKok [Mon, 24 Nov 2025 13:13:06 +0000 (08:13 -0500)] 
typo

6 months agoUpdate docs from sample raddb
Nick Porter [Mon, 24 Nov 2025 10:00:19 +0000 (10:00 +0000)] 
Update docs from sample raddb

6 months agoTypo
Nick Porter [Mon, 24 Nov 2025 09:56:25 +0000 (09:56 +0000)] 
Typo

6 months agoRemove rlm_date config info from sample rlm_cache config
Nick Porter [Mon, 24 Nov 2025 09:54:17 +0000 (09:54 +0000)] 
Remove rlm_date config info from sample rlm_cache config

6 months agoFormatting
Nick Porter [Mon, 24 Nov 2025 09:51:29 +0000 (09:51 +0000)] 
Formatting

6 months agoRemove & from comments
Nick Porter [Mon, 24 Nov 2025 09:47:29 +0000 (09:47 +0000)] 
Remove & from comments