]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
5 months agodon't do encode(parser(print(da))).
Alan T. DeKok [Mon, 3 Mar 2025 12:30:15 +0000 (07:30 -0500)] 
don't do encode(parser(print(da))).

it's more code, and is much less efficient.

5 months agothe boolean "true" encoding is fixed, and can be hard-coded
Alan T. DeKok [Mon, 3 Mar 2025 12:12:04 +0000 (07:12 -0500)] 
the boolean "true" encoding is fixed, and can be hard-coded

5 months agoparsing OID from string
Alan T. DeKok [Mon, 3 Mar 2025 12:11:53 +0000 (07:11 -0500)] 
parsing OID from string

5 months agoclean up handling of raw attributes
Alan T. DeKok [Sun, 2 Mar 2025 20:52:45 +0000 (15:52 -0500)] 
clean up handling of raw attributes

we are able to decode mand encode raw options, while keeping the
class and option number.

Pretty much everything else is a gamble. :(

foo

5 months agoover-ride "raw.Foo = { ... }"
Alan T. DeKok [Mon, 3 Mar 2025 01:23:49 +0000 (20:23 -0500)] 
over-ride "raw.Foo = { ... }"

use the original data type, and not a hard-coded TLV

the parser can't tell the difference between "raw.1 = {...}"
and "raw.Foo = {...}", so we just fix the data type after the
fact.

5 months agomake diff output easier to read
Alan T. DeKok [Mon, 3 Mar 2025 00:10:11 +0000 (19:10 -0500)] 
make diff output easier to read

5 months agoremove wrapper wrapper functions
Alan T. DeKok [Sun, 2 Mar 2025 17:32:16 +0000 (12:32 -0500)] 
remove wrapper wrapper functions

5 months agosimplify sorting of sets
Alan T. DeKok [Sun, 2 Mar 2025 16:05:51 +0000 (11:05 -0500)] 
simplify sorting of sets

so that there's less "back and forth"

Also the number of children might not be the same as the
number of _encodeable_ children, especially if the set is a group,
and there are internal attributes in the group

As a result, we set the max to the number of possible children,
and then loop until we've encoded all of the children

5 months agosimplify sorting of sets
Alan T. DeKok [Sun, 2 Mar 2025 15:49:38 +0000 (10:49 -0500)] 
simplify sorting of sets

there's no need to use markers, pointers will do.

there's no need to track marker in encode_value(), as the set
code can do that

5 months agoencode_choice() is really encode all children
Alan T. DeKok [Sun, 2 Mar 2025 14:11:14 +0000 (09:11 -0500)] 
encode_choice() is really encode all children

so we call it from multiple places to reduce code duplication

5 months agono need to loop over the children
Alan T. DeKok [Sun, 2 Mar 2025 14:05:26 +0000 (09:05 -0500)] 
no need to loop over the children

now that we've fixed fr_pair_cursor_to_network()

5 months agojust encode everything which matches the cursor
Alan T. DeKok [Sun, 2 Mar 2025 14:02:44 +0000 (09:02 -0500)] 
just encode everything which matches the cursor

the iterator is responsible for doing the right thing.

The depth checks don't work with groups which have refs

5 months agomove default to der_attr_flags_t
Alan T. DeKok [Sat, 1 Mar 2025 17:48:43 +0000 (12:48 -0500)] 
move default to der_attr_flags_t

which means that the default value is in attr_flags

5 months agoallow 'class=private' and 'class=enterprise'
Alan T. DeKok [Sat, 1 Mar 2025 12:40:09 +0000 (07:40 -0500)] 
allow 'class=private' and 'class=enterprise'

5 months agoremove duplicate
Alan T. DeKok [Sat, 1 Mar 2025 13:12:10 +0000 (08:12 -0500)] 
remove duplicate

5 months agodon't hard-code CONTEXT class.
Alan T. DeKok [Sat, 1 Mar 2025 12:27:55 +0000 (07:27 -0500)] 
don't hard-code CONTEXT class.

which allows for PRIVATE and ENTERPRISE

5 months agoenforce locations where 'option' and 'optional' are used
Alan T. DeKok [Sat, 1 Mar 2025 12:15:17 +0000 (07:15 -0500)] 
enforce locations where 'option' and 'optional' are used

They can only be used in SEQUENCE and SET, and not in any other
type of DER or FreeRADIUS data type

5 months agonote that not all docs are up to date for v4
Alan T. DeKok [Sat, 1 Mar 2025 00:47:19 +0000 (19:47 -0500)] 
note that not all docs are up to date for v4

5 months agoRearrange debugging documentation
nolade [Fri, 28 Feb 2025 22:24:20 +0000 (17:24 -0500)] 
Rearrange debugging documentation

5 months agoclean up documentation.
nolade [Fri, 28 Feb 2025 21:42:13 +0000 (16:42 -0500)] 
clean up documentation.

Add new howto pages.

5 months agoAdd best practices document
nolade [Fri, 28 Feb 2025 21:39:36 +0000 (16:39 -0500)] 
Add best practices document

5 months agoOrganize virtual servers by protocol
Alan T. DeKok [Fri, 28 Feb 2025 17:59:53 +0000 (12:59 -0500)] 
Organize virtual servers by protocol

remove many virtual servers which were old, unused, and wrong

5 months agorearrange fr_der_decode_pair_dbuff
Alan T. DeKok [Fri, 28 Feb 2025 16:14:22 +0000 (11:14 -0500)] 
rearrange fr_der_decode_pair_dbuff

to do sanity checks before doing anything else, and to remove
duplicate code around creating default values.

5 months agoadd more options
Alan T. DeKok [Fri, 28 Feb 2025 17:31:04 +0000 (12:31 -0500)] 
add more options

5 months agoStrategy only applies if there is a build matrix
Nick Porter [Fri, 28 Feb 2025 16:15:29 +0000 (16:15 +0000)] 
Strategy only applies if there is a build matrix

5 months agoAdd scheduled call to Documenation CI action
Nick Porter [Fri, 28 Feb 2025 16:08:50 +0000 (16:08 +0000)] 
Add scheduled call to Documenation CI action

Since most commits to `master` are merges from developer's branches, the
job was never running in `master` and so docs were not getting
published.

5 months agoFully update parent client when connected dynamic clients are approved
Nick Porter [Fri, 28 Feb 2025 15:50:27 +0000 (15:50 +0000)] 
Fully update parent client when connected dynamic clients are approved

Without this, subsequent clones of the parent will be missing data.

5 months agohoist checks out of the hot path
Alan T. DeKok [Fri, 28 Feb 2025 12:25:49 +0000 (07:25 -0500)] 
hoist checks out of the hot path

and use consistent names

5 months agoTerminology updates and consistency
nolade [Fri, 28 Feb 2025 12:22:45 +0000 (07:22 -0500)] 
Terminology updates and consistency

5 months agoremove accidentally committed file
Alan T. DeKok [Fri, 28 Feb 2025 12:19:25 +0000 (07:19 -0500)] 
remove accidentally committed file

5 months agothere's no need to check the restriction types at run time
Alan T. DeKok [Fri, 28 Feb 2025 01:16:33 +0000 (20:16 -0500)] 
there's no need to check the restriction types at run time

either there's one value (is_sequence_of=foo).

or it's a CHOICE, and all of the children are numbered options.
In which case we don't care what the values are.  If they exist,
we will find them, or they won't exist, and we will decode them
as raw octets

5 months agomove DEFINE ...option=N to ATTRIBUTE ... N ...option
Alan T. DeKok [Fri, 28 Feb 2025 01:15:51 +0000 (20:15 -0500)] 
move DEFINE ...option=N to ATTRIBUTE ... N ...option

which is a little more consistent

5 months agoupdate the restriction flags in more cases
Alan T. DeKok [Fri, 28 Feb 2025 01:15:18 +0000 (20:15 -0500)] 
update the restriction flags in more cases

and correct how we set them.

5 months agohoist decode_oid_and_value() to its own function
Alan T. DeKok [Fri, 28 Feb 2025 00:47:26 +0000 (19:47 -0500)] 
hoist decode_oid_and_value() to its own function

which avoids the sequence / set decoder checking for the flag.

rename the is_pair flag to is_oid_and_value, which is clearer.
rename other functions to match

5 months agotypos
Alan T. DeKok [Thu, 27 Feb 2025 23:02:40 +0000 (18:02 -0500)] 
typos

5 months agouse fr_strerror_*_push() more consistently
Alan T. DeKok [Thu, 27 Feb 2025 22:21:03 +0000 (17:21 -0500)] 
use fr_strerror_*_push() more consistently

which helps to figure out just where the error is.

The DER data is _deeply_ nested.  If we just say

failed decoding boolean

then the poor user has no idea which boolean it is.  Giving a
little bit of extra context goes a long way to having someone
figure out where the error is.

5 months agohoist expected tag into the decode_hdr() function
Alan T. DeKok [Thu, 27 Feb 2025 22:04:50 +0000 (17:04 -0500)] 
hoist expected tag into the decode_hdr() function

5 months agorearrange / redo decode x509extensions functiono
Alan T. DeKok [Thu, 27 Feb 2025 21:45:18 +0000 (16:45 -0500)] 
rearrange / redo decode x509extensions functiono

more sanity checks, and less "back and forth" decoding with
markers

5 months agoclean up extension decoding
Alan T. DeKok [Thu, 27 Feb 2025 14:58:45 +0000 (09:58 -0500)] 
clean up extension decoding

5 months agohoist "set length" to before calling any decode function
Alan T. DeKok [Thu, 27 Feb 2025 16:10:19 +0000 (11:10 -0500)] 
hoist "set length" to before calling any decode function

5 months agoclean up OID decoding
Alan T. DeKok [Thu, 27 Feb 2025 14:52:50 +0000 (09:52 -0500)] 
clean up OID decoding

5 months agomove OID decoding to wrapper function
Alan T. DeKok [Thu, 27 Feb 2025 14:42:44 +0000 (09:42 -0500)] 
move OID decoding to wrapper function

to avoid conditions in the hot path

5 months agoadd flags->is_option
Alan T. DeKok [Thu, 27 Feb 2025 13:15:48 +0000 (08:15 -0500)] 
add flags->is_option

and clean up decoding of option vs tag.  Sometimes it might not
have done the right thing

5 months agoAdd fallthrough to LDAP tests
Nick Porter [Thu, 27 Feb 2025 13:51:04 +0000 (13:51 +0000)] 
Add fallthrough to LDAP tests

5 months agoAdd fallthrough options to sample LDAP module config
Nick Porter [Thu, 27 Feb 2025 13:49:46 +0000 (13:49 +0000)] 
Add fallthrough options to sample LDAP module config

5 months agoAdd fallthrough attributes to RADIUS and TACACS profile schemas
Nick Porter [Thu, 27 Feb 2025 12:20:07 +0000 (12:20 +0000)] 
Add fallthrough attributes to RADIUS and TACACS profile schemas

5 months agoCheck and fallthrough attributes are needed for autz profile processing
Nick Porter [Thu, 27 Feb 2025 12:18:38 +0000 (12:18 +0000)] 
Check and fallthrough attributes are needed for autz profile processing

5 months agoAdd fallthrough handling to LDAP profiles
Nick Porter [Thu, 27 Feb 2025 12:17:38 +0000 (12:17 +0000)] 
Add fallthrough handling to LDAP profiles

5 months agoFree condition results early
Nick Porter [Thu, 27 Feb 2025 12:14:52 +0000 (12:14 +0000)] 
Free condition results early

5 months agoAdd fallthrough_attr to LDAP query
Nick Porter [Wed, 26 Feb 2025 20:17:43 +0000 (20:17 +0000)] 
Add fallthrough_attr to LDAP query

5 months agoAdd profile fallthrough options to rlm_ldap
Nick Porter [Wed, 26 Feb 2025 20:14:10 +0000 (20:14 +0000)] 
Add profile fallthrough options to rlm_ldap

5 months agoadd encoder, decoder, and tests for combo-ip
Alan T. DeKok [Wed, 26 Feb 2025 19:33:43 +0000 (14:33 -0500)] 
add encoder, decoder, and tests for combo-ip

5 months agooptions have to have class Context
Alan T. DeKok [Wed, 26 Feb 2025 19:33:30 +0000 (14:33 -0500)] 
options have to have class Context

5 months agodon't print timeout
Alan T. DeKok [Wed, 26 Feb 2025 19:17:36 +0000 (14:17 -0500)] 
don't print timeout

5 months agoensure that sets are only TLVs
Alan T. DeKok [Wed, 26 Feb 2025 18:46:30 +0000 (13:46 -0500)] 
ensure that sets are only TLVs

nothing in the standard dictionaries uses SETs as groups.
They're groups only in the test dictionaries.  And there is no
encoding difference between SET of tlv and SET of group.

5 months agomore checks on attributes
Alan T. DeKok [Wed, 26 Feb 2025 16:18:22 +0000 (11:18 -0500)] 
more checks on attributes

disallow duplicates for choices and sequences of choices

enforce parent set of / sequence of

set restrictions in preparation for doing less of this at run-time

5 months agohoist the attr_ref_set() to before calling attr_valid()
Alan T. DeKok [Wed, 26 Feb 2025 18:30:26 +0000 (13:30 -0500)] 
hoist the attr_ref_set() to before calling attr_valid()

so that the validation routine can check the refs

5 months agoFreeRADIUS type 'struct' is always a bit string
Alan T. DeKok [Wed, 26 Feb 2025 15:23:49 +0000 (10:23 -0500)] 
FreeRADIUS type 'struct' is always a bit string

Because (for now) all of the dictionary entries are packed bits

A struct CANNOT be a sequence or a set, as our structs are always
packed fields, without any headers.

Perhaps in the future a struct could be an octetstring, which would
then be an opaque data type which is carried within DER.

5 months agoadd assertions to check for bad dictionaries
Alan T. DeKok [Wed, 26 Feb 2025 15:09:43 +0000 (10:09 -0500)] 
add assertions to check for bad dictionaries

5 months agotypo in AF_INET6
Alan T. DeKok [Wed, 26 Feb 2025 15:09:23 +0000 (10:09 -0500)] 
typo in AF_INET6

5 months agotweak error messages
Alan T. DeKok [Wed, 26 Feb 2025 12:54:38 +0000 (07:54 -0500)] 
tweak error messages

5 months agoprint out the dictionary name, too
Alan T. DeKok [Wed, 26 Feb 2025 12:54:16 +0000 (07:54 -0500)] 
print out the dictionary name, too

5 months agoAllow status check "update" section without a list
Nick Porter [Wed, 26 Feb 2025 19:03:06 +0000 (19:03 +0000)] 
Allow status check "update" section without a list

As per the example in the sample module config

5 months agoUse a struct to contain LDAP profile options
Nick Porter [Wed, 26 Feb 2025 16:44:56 +0000 (16:44 +0000)] 
Use a struct to contain LDAP profile options

to match `user` and `group`

5 months agoClarify SQLite returns error 14 "Can't open file"
Alan T. DeKok [Wed, 26 Feb 2025 11:03:32 +0000 (06:03 -0500)] 
Clarify SQLite returns error 14 "Can't open file"

print a better message if the file exists, or is not readable

5 months agouse fr_strerror_printf() instead of immediate ERROR
Alan T. DeKok [Wed, 26 Feb 2025 10:52:58 +0000 (05:52 -0500)] 
use fr_strerror_printf() instead of immediate ERROR

5 months agotweak encode IP prefix
Alan T. DeKok [Tue, 25 Feb 2025 21:57:49 +0000 (16:57 -0500)] 
tweak encode IP prefix

5 months agoencode and decode IPv4 and IPv6 prefixes
Alan T. DeKok [Tue, 25 Feb 2025 21:25:54 +0000 (16:25 -0500)] 
encode and decode IPv4 and IPv6 prefixes

5 months agoAdd encode / decode of ipv4add and ipv6addr
Alan T. DeKok [Tue, 25 Feb 2025 20:01:06 +0000 (15:01 -0500)] 
Add encode / decode of ipv4add and ipv6addr

RFC 3779 defines a format for IP addresses, and IP prefixes

5 months agoTrack number of LDAP profiles applied
Nick Porter [Tue, 25 Feb 2025 12:28:45 +0000 (12:28 +0000)] 
Track number of LDAP profiles applied

So that %ldap.profile() only returns true if at least one is applied.

The use of check_attribute to control application of LDAP profiles can
mean that the query succeeds and returns objects, but none of them get
applied - which should be treated equivalent to the query not returning
any objects

5 months agoCorrect comment about ASCII GETDATA response
Nick Porter [Mon, 24 Feb 2025 17:38:17 +0000 (17:38 +0000)] 
Correct comment about ASCII GETDATA response

The status is driven from the FreeRADIUS packet type.

5 months agoAuthorization status is automatically set from the packet type
Nick Porter [Mon, 24 Feb 2025 17:35:10 +0000 (17:35 +0000)] 
Authorization status is automatically set from the packet type

5 months agoInstances of the same attribute should be together
Nick Porter [Mon, 24 Feb 2025 16:35:13 +0000 (16:35 +0000)] 
Instances of the same attribute should be together

5 months agoRestore accidentally deleted tacacsCommand
Nick Porter [Mon, 24 Feb 2025 15:53:11 +0000 (15:53 +0000)] 
Restore accidentally deleted tacacsCommand

5 months agoPatches care about whitespace
Nick Porter [Mon, 24 Feb 2025 15:37:02 +0000 (15:37 +0000)] 
Patches care about whitespace

5 months agoFix up Debian patch
Nick Porter [Mon, 24 Feb 2025 15:24:51 +0000 (15:24 +0000)] 
Fix up Debian patch

Until the main config gets re-named

5 months agoAdd profile priority / condition attrs to TACACS profiles in LDAP schema
Nick Porter [Mon, 24 Feb 2025 14:05:19 +0000 (14:05 +0000)] 
Add profile priority / condition attrs to TACACS profiles in LDAP schema

5 months agoallocation may fail. CID #1643157
Alan T. DeKok [Sun, 23 Feb 2025 20:43:24 +0000 (15:43 -0500)] 
allocation may fail.  CID #1643157

5 months agoupdate tests for encoding raw DER values
Alan T. DeKok [Sun, 23 Feb 2025 20:31:30 +0000 (15:31 -0500)] 
update tests for encoding raw DER values

5 months agocopy protocol extensions for unknown / raw attributes
Alan T. DeKok [Sun, 23 Feb 2025 20:29:31 +0000 (15:29 -0500)] 
copy protocol extensions for unknown / raw attributes

which lets the der encoder create "raw" fields with the
correct DER tag.

5 months agocheck child da flags for is_raw
Alan T. DeKok [Sun, 23 Feb 2025 20:27:02 +0000 (15:27 -0500)] 
check child da flags for is_raw

and rename child_vp --> child

5 months agotweak error message
Alan T. DeKok [Sun, 23 Feb 2025 19:58:21 +0000 (14:58 -0500)] 
tweak error message

5 months agocache flags
Alan T. DeKok [Sun, 23 Feb 2025 19:42:15 +0000 (14:42 -0500)] 
cache flags

so we don't get the extension multiple times for each attribute
that we encode.

5 months agoadd support for optional flag and update the dictionaries
Alan T. DeKok [Sun, 23 Feb 2025 16:22:30 +0000 (11:22 -0500)] 
add support for optional flag and update the dictionaries

5 months agomore cleanups
Alan T. DeKok [Sun, 23 Feb 2025 15:12:47 +0000 (10:12 -0500)] 
more cleanups

* use "clone=..." for more things
* use "value" instead of "value-thing"
* use "attribute" instead of "attribute-thing"
* change names to match the specs

5 months agoallow attributes named 'value'
Alan T. DeKok [Sun, 23 Feb 2025 15:04:18 +0000 (10:04 -0500)] 
allow attributes named 'value'

5 months agocleanups
Alan T. DeKok [Sun, 23 Feb 2025 14:45:13 +0000 (09:45 -0500)] 
cleanups

* lowercase most of the hex in the tests

* start documenting the DER types

* move all RelativeDistinguishedName to "clone="

  which then changes the output of the tests, as the copied
  versions differed in case, and sometimes in contents

5 months agoensure that groups have a ref extension
Alan T. DeKok [Sun, 23 Feb 2025 13:20:48 +0000 (08:20 -0500)] 
ensure that groups have a ref extension

5 months agorefs can't be NULL
Alan T. DeKok [Sun, 23 Feb 2025 12:50:47 +0000 (07:50 -0500)] 
refs can't be NULL

5 months agothe underlying "da" may have already been freed
Alan T. DeKok [Sun, 23 Feb 2025 12:49:50 +0000 (07:49 -0500)] 
the underlying "da" may have already been freed

if it was re-written

5 months agomake error message clearer
Alan T. DeKok [Sun, 23 Feb 2025 12:49:34 +0000 (07:49 -0500)] 
make error message clearer

5 months agoRequire '.' or '@' in references
Alan T. DeKok [Sun, 23 Feb 2025 11:33:42 +0000 (06:33 -0500)] 
Require '.' or '@' in references

which ends up being a lot clearer than

DEFINE foo bar clone=foo

where the DEFINE is in a child context via BEGIN/END, and the
'clone' ref is in the root context

Update all of the dictionaries to match.

As a bonus, dict_protocol_reference() can now distinguish the
cases of "error" from "reference not found"

Update the antora documentation to match.  Create a new
reference page which contains all of the documentation for
references.

5 months agoadd fr_sbuff_eof(), which is easy to remember
Alan T. DeKok [Sun, 23 Feb 2025 11:33:08 +0000 (06:33 -0500)] 
add fr_sbuff_eof(), which is easy to remember

5 months agoadd and use "has_fixup" flag.
Alan T. DeKok [Sun, 23 Feb 2025 10:46:51 +0000 (05:46 -0500)] 
add and use "has_fixup" flag.

When we copy an attribute, we need to check if it has pending
fixups.  If so, we can't copy it.  This gives the admin a
descriptive error, rather than having something go wrong later.

This situation happens when we're cloning an attribute that has
children, and those children have fixups.

A more in-depth fix would be to move the fixup lists to the
fr_dict_t.  The cloned attribute could then add itself to a
separate "clone after fixups" list.  So the clone could be applied
last, after all of the fixups have been applied.

Part of the fix is checking for pending fixups and complaining.
More of the fix is setting "ref=..." immediately, if it can be
resolved.  That way we avoid many pending fixups.

5 months agotypo
Alan T. DeKok [Sun, 23 Feb 2025 03:59:28 +0000 (22:59 -0500)] 
typo

5 months agoensure oid_and_value references OID-Tree
Alan T. DeKok [Sun, 23 Feb 2025 03:01:52 +0000 (22:01 -0500)] 
ensure oid_and_value references OID-Tree

5 months agoensure that attribute references exist
Alan T. DeKok [Sun, 23 Feb 2025 02:38:35 +0000 (21:38 -0500)] 
ensure that attribute references exist

5 months agoonly leaf types can have values defined
Alan T. DeKok [Sun, 23 Feb 2025 02:34:48 +0000 (21:34 -0500)] 
only leaf types can have values defined

5 months agodouble-check more corner cases
Alan T. DeKok [Sun, 23 Feb 2025 01:51:44 +0000 (20:51 -0500)] 
double-check more corner cases

and update dicts to match.

5 months agoadd more OIDs and update the tests
Alan T. DeKok [Sat, 22 Feb 2025 23:45:27 +0000 (18:45 -0500)] 
add more OIDs and update the tests