]>
git.ipfire.org Git - thirdparty/freeradius-server.git/log
Alan T. DeKok [Sat, 16 Sep 2023 19:40:16 +0000 (15:40 -0400)]
manually redo commit
0c6d48394867e2d2
gettoken() parses the RHS of a CONF_PAIR, but that function only
unescapes the \", and doesn't unescape anything else. Therefore
we do the unescaping here.
Alan T. DeKok [Sat, 16 Sep 2023 17:55:57 +0000 (13:55 -0400)]
fr_asprint() takes a quotation 'char', not a fr_token_t
Alan T. DeKok [Sat, 16 Sep 2023 15:15:04 +0000 (11:15 -0400)]
allow T_HASH for edit sections. See map_afrom_cp()
James Jones [Fri, 15 Sep 2023 19:21:05 +0000 (14:21 -0500)]
Annotate fr_nbo_to_uint{16,24}() at function level
CIDs: #
1419883 , #
1520415 , #
1503954 , #
14516665 , #
1519002
This should keep coverity from tainting the pointer to data
being converted to host order.
Alan T. DeKok [Sat, 16 Sep 2023 01:25:39 +0000 (21:25 -0400)]
check return codes to quiet static analyzer
Alan T. DeKok [Fri, 15 Sep 2023 17:51:14 +0000 (13:51 -0400)]
force tmpl_tokenize_all_nested here, too
Alan T. DeKok [Fri, 15 Sep 2023 17:36:45 +0000 (13:36 -0400)]
ensure that the buffers are talloc'd
the memdup_shallow() call will just assign the ptr to the
value-box. But the added talloc_get_name() fails, because the
ptr isn't talloced.
Alan T. DeKok [Fri, 15 Sep 2023 16:41:36 +0000 (12:41 -0400)]
move legacy function to the only place which uses it
Alan T. DeKok [Fri, 15 Sep 2023 16:37:29 +0000 (12:37 -0400)]
remove legacy print nested, and old "unflatten" code
Nick Porter [Fri, 15 Sep 2023 13:20:24 +0000 (14:20 +0100)]
Attempt to ignore spurios LeakSanitizer fatal errors
James Jones [Thu, 14 Sep 2023 19:06:59 +0000 (14:06 -0500)]
Placate coverity with excessive buffer_len (CID #
1503922 , #
1503986 )
open_buffer_as_file() is a wrapper aound the fmemopen() function.
The example shown on fmemopen()'s man page passes a string as buffer
and strlen(<string>) as length, and open_buffer_as_file() calls did the
same thing--but coverity gives it an alloc_strlen defect with the
comment "allocating insufficient memory for the terminating null of
the string".
At least one other project using coverity and calling fmemopen()
in conformity with "man fmemopen" also gets this defect and ended
up passing strlen(<string>) + 1 to deal with it. Making the analogous
change here passes tests and should quiet coverity.
Alan T. DeKok [Fri, 15 Sep 2023 12:52:01 +0000 (08:52 -0400)]
start removing "update"
Alan T. DeKok [Fri, 15 Sep 2023 12:44:25 +0000 (08:44 -0400)]
note "please don't use %{expr:..}"
Alan T. DeKok [Fri, 15 Sep 2023 12:38:12 +0000 (08:38 -0400)]
add in-line expressions with add
Alan T. DeKok [Fri, 15 Sep 2023 12:33:51 +0000 (08:33 -0400)]
clean up handling of Acct-Delay-Time
use new edit expressions, and check for sane Event-Timestamp
Alan T. DeKok [Fri, 15 Sep 2023 11:01:00 +0000 (07:01 -0400)]
decode unknown extended VSAs as nested
Alan T. DeKok [Thu, 14 Sep 2023 19:25:34 +0000 (15:25 -0400)]
decode WiMAX as nested
Alan T. DeKok [Thu, 14 Sep 2023 19:11:39 +0000 (15:11 -0400)]
decode RADIUS structs as nested
Alan T. DeKok [Thu, 14 Sep 2023 19:06:08 +0000 (15:06 -0400)]
decode extended VSAs as nested
Alan T. DeKok [Thu, 14 Sep 2023 18:47:04 +0000 (14:47 -0400)]
remove migrate command
we no longer use it for anything.
Alan T. DeKok [Thu, 14 Sep 2023 13:58:54 +0000 (09:58 -0400)]
always decode RADIUS VSAs as nested
not sure why this wasn't done before. But now we're happy.
Alan T. DeKok [Thu, 14 Sep 2023 13:49:40 +0000 (09:49 -0400)]
more comments on antora and asciidoc
Alan T. DeKok [Thu, 14 Sep 2023 13:27:21 +0000 (09:27 -0400)]
no need for macro, just rename the struct fields
Alan T. DeKok [Thu, 14 Sep 2023 12:08:52 +0000 (08:08 -0400)]
allow raw.Vendor-Specific = 0xabcdef
which parses it as a Vendor-Specific, then sees the 0x..., and
converts it to type 'octets'.
Note that the attribute MUST already be marked up as "raw"
Alan T. DeKok [Thu, 14 Sep 2023 00:44:54 +0000 (20:44 -0400)]
set a default type size and length for unknown attributes
Which lets us create unknown vendors
Alan T. DeKok [Thu, 14 Sep 2023 00:44:25 +0000 (20:44 -0400)]
don't print nested if parent is key field
Alan T. DeKok [Wed, 13 Sep 2023 22:52:15 +0000 (18:52 -0400)]
make arp always decode as nested
Alan T. DeKok [Wed, 13 Sep 2023 22:49:12 +0000 (18:49 -0400)]
remove pair_legacy_nested
Jorge Pereira [Thu, 14 Sep 2023 02:18:53 +0000 (23:18 -0300)]
Fix small leak in rlm_pap load (#5176)
Alan T. DeKok [Wed, 13 Sep 2023 22:43:36 +0000 (18:43 -0400)]
remove flatten / unflatten APIs
Alan T. DeKok [Wed, 13 Sep 2023 22:40:11 +0000 (18:40 -0400)]
remove "flatten" migration flags
Alan T. DeKok [Wed, 13 Sep 2023 22:33:15 +0000 (18:33 -0400)]
always create Net attributes as nested
Alan T. DeKok [Wed, 13 Sep 2023 19:53:08 +0000 (15:53 -0400)]
force all nested
Alan T. DeKok [Wed, 13 Sep 2023 19:30:34 +0000 (15:30 -0400)]
ignore structural types
Alan T. DeKok [Wed, 13 Sep 2023 19:15:17 +0000 (15:15 -0400)]
don't print nested types to environment variables
Alan T. DeKok [Wed, 13 Sep 2023 18:08:00 +0000 (14:08 -0400)]
swap migration flag to always true
Alan T. DeKok [Wed, 13 Sep 2023 16:49:16 +0000 (12:49 -0400)]
add fr_pair_delete_by_da_nested()
and use it in server macros. This change allows the uses of
pair_delete_request() etc. to work properly with nested attributes
Alan T. DeKok [Wed, 13 Sep 2023 16:47:21 +0000 (12:47 -0400)]
minor cleanups for EAP attributes and rearrangements
Alan T. DeKok [Wed, 13 Sep 2023 14:03:02 +0000 (10:03 -0400)]
make EAP decode nested pairs
Alan T. DeKok [Wed, 13 Sep 2023 14:02:06 +0000 (10:02 -0400)]
Handle empty lists.
Don't recurse, as that drops a literal \0 in the middle of the
output. And also adds two spaces between the brackets.
Alan T. DeKok [Wed, 13 Sep 2023 12:09:46 +0000 (08:09 -0400)]
the EAP tests depend on libfreeradius-eap-aka-sim
not libfreeradius-eap
Alan T. DeKok [Tue, 12 Sep 2023 21:11:40 +0000 (17:11 -0400)]
explicitly encode all of the suboptions
We may want to revisit the behavior of &foo.[*]. Does it mean
only that level, or all children?
Alan T. DeKok [Tue, 12 Sep 2023 20:57:48 +0000 (16:57 -0400)]
allow EAP-AKA-SIM to encode nested pairs.
The decoder is still not done. That's next.
Alan T. DeKok [Tue, 12 Sep 2023 20:38:04 +0000 (16:38 -0400)]
fix error.
It would be nice if OSX decided to rebuild things when code changed.
Alan T. DeKok [Tue, 12 Sep 2023 20:28:36 +0000 (16:28 -0400)]
remove unused assignment
Alan T. DeKok [Tue, 12 Sep 2023 18:21:06 +0000 (14:21 -0400)]
just look at the dict, instead of calling common ancestor
because if we check for a common ancestor between a da and the
dict root, we're just checking if the da is in the dict.
Alan T. DeKok [Tue, 12 Sep 2023 18:14:21 +0000 (14:14 -0400)]
minor tweaks, and link into the main nav bar
James Jones [Fri, 8 Sep 2023 19:25:55 +0000 (14:25 -0500)]
Add coverity overview to developer documentation
James Jones [Tue, 12 Sep 2023 15:23:10 +0000 (10:23 -0500)]
Set pair list verified on initialization (true) and append (false)
CIDs: #
1544620 through #
1544624
Alan T. DeKok [Tue, 12 Sep 2023 18:02:26 +0000 (14:02 -0400)]
add and use fr_pair_dcursor_child_iter_init()
all of the encoders previously just called fr_pair_dcursor_init()
for child cursors. Which meant that the iterator could return
internal attributes.
The child cursor now uses the same iterator as the parent cursor.
This ensures that it only returns the correct encodable attributes
for this protocol.
Alan T. DeKok [Tue, 12 Sep 2023 15:00:46 +0000 (11:00 -0400)]
NDEBUG...
Alan T. DeKok [Tue, 12 Sep 2023 14:57:32 +0000 (10:57 -0400)]
add UNUSED
Alan T. DeKok [Tue, 12 Sep 2023 12:53:03 +0000 (08:53 -0400)]
fix RADIUS for nested attribute encoding
the main difference is that we fix encode_extended() to correctly
handle nesting, and update the tests. As a side effect, the
encode_extended() function now always requires nesting, and if
passed flat extended attributes, will return an encoding error.
We also fix up the fr_pair_cursor_to_network() function to remove
the flat vs nested hacks. It now always expects nesting.
We also fix up fr_struct_to_network() to always expect nesting
for the trailing TLV in a struct.
Alan T. DeKok [Mon, 11 Sep 2023 18:59:14 +0000 (14:59 -0400)]
hoist encode_cursor() function to common API
Alan T. DeKok [Mon, 11 Sep 2023 18:38:48 +0000 (14:38 -0400)]
unify function prototypes
Alan T. DeKok [Mon, 11 Sep 2023 10:31:56 +0000 (06:31 -0400)]
add RFC 7710
Alan T. DeKok [Mon, 11 Sep 2023 10:23:21 +0000 (06:23 -0400)]
trust the dcursor, and don't check for flags.internal
Alan T. DeKok [Mon, 11 Sep 2023 10:11:45 +0000 (06:11 -0400)]
allow for raw members of a struct
which can only occur when the raw VP is a direct child of the
parent struct.
Alan T. DeKok [Mon, 11 Sep 2023 09:37:09 +0000 (05:37 -0400)]
reformat
Alan T. DeKok [Mon, 11 Sep 2023 09:36:47 +0000 (05:36 -0400)]
just use tabs function instead of hand-rolling things
Alan T. DeKok [Mon, 11 Sep 2023 00:20:57 +0000 (20:20 -0400)]
comment out assertion check
because it fails for update sections, where the vp being deleted
isn't parented from the list!
If we add the migration flags
-S rewrite_update=yes -S tmpl_tokenize_all_nested=yes
then the test passes. We'll leave these checks disabled until
we either find and fix the issue (if we care) or until we enable
everything nested.
Alan T. DeKok [Sun, 10 Sep 2023 23:59:35 +0000 (19:59 -0400)]
add / clear verified flag to pair lists
so that we avoid slowdowns with repeated recursion
Alan T. DeKok [Sun, 10 Sep 2023 14:07:05 +0000 (10:07 -0400)]
return OOM on oom
Alan T. DeKok [Sun, 10 Sep 2023 13:02:01 +0000 (09:02 -0400)]
we have talloc_const_free(), so just use that
Alan T. DeKok [Sun, 10 Sep 2023 12:48:37 +0000 (08:48 -0400)]
clarify code so that we can find uses of a variable
Alan T. DeKok [Sun, 10 Sep 2023 12:43:21 +0000 (08:43 -0400)]
remove unused function
Alan T. DeKok [Sun, 10 Sep 2023 12:40:54 +0000 (08:40 -0400)]
pair_afrom_da() already copies the unknown da
Alan T. DeKok [Sat, 9 Sep 2023 20:58:16 +0000 (16:58 -0400)]
try to quiet static analyzers
Alan T. DeKok [Sat, 9 Sep 2023 15:43:56 +0000 (11:43 -0400)]
clean up in preparation for further raw cleanups
fr_dict_unknown_afrom_oid_substr() now continues from where the
previous parser left off. The raw handling is now essentially
all out of the dictionaries
Alan T. DeKok [Sat, 9 Sep 2023 11:50:02 +0000 (07:50 -0400)]
allow unknown attributes to be relative, too.
As part of a general cleanup and rearrangement, fix the code,
have less code, and make it more functional
Alan T. DeKok [Sat, 9 Sep 2023 11:29:19 +0000 (07:29 -0400)]
switch encoders to use vp->vp_type
because vp_type could be different from da->type in some cases
Alan T. DeKok [Fri, 8 Sep 2023 20:15:54 +0000 (16:15 -0400)]
fr_pair_to_unknown() -> fr_pair_raw_from_pair()
because all of the callers are creating a raw pair from malformed
data, and aren't creating an unknown pair.
Alan T. DeKok [Fri, 8 Sep 2023 20:15:25 +0000 (16:15 -0400)]
more debugging, and return OOM on OOM
Alan T. DeKok [Fri, 8 Sep 2023 20:12:55 +0000 (16:12 -0400)]
only free the the vp on the error path
if the first byte is non-zero, then the result is non-zero,
and we don't need to check it on all paths
Alan T. DeKok [Fri, 8 Sep 2023 17:25:46 +0000 (13:25 -0400)]
don't bother checking chaddr size during decode
fr_dhcpv4_ok() checks if htype==1 && hlen==6, and fails if that
isn't true.
So either that test passed, or the caller didn't call fr_dhcpv4_ok()
to verify the packet. In either case, there's no reason to do
additional validation here.
Alan T. DeKok [Fri, 8 Sep 2023 19:42:17 +0000 (15:42 -0400)]
clear the value, to be consistent with other uses of free_value
Alan T. DeKok [Fri, 8 Sep 2023 19:42:02 +0000 (15:42 -0400)]
don't clear the box, clear only the value.
Alan T. DeKok [Fri, 8 Sep 2023 19:01:47 +0000 (15:01 -0400)]
hoist TLV checks to before creating the VP
because there's no point in creating the VP and then freeing it.
Alan T. DeKok [Fri, 8 Sep 2023 14:59:48 +0000 (10:59 -0400)]
use fr_pair_raw_from_network() instead of hand-rolling it
Alan T. DeKok [Fri, 8 Sep 2023 14:24:54 +0000 (10:24 -0400)]
define and use fr_dict_unknown_copy()
because we want to get rid of fr_pair_to_unknown(). The caller
should instead have created a raw attribute
Alan T. DeKok [Fri, 8 Sep 2023 14:09:41 +0000 (10:09 -0400)]
don't need to check is_raw flag
because we now always set is_raw for unknowns, so it's enough to
check the is_unknown flag
Alan T. DeKok [Fri, 8 Sep 2023 14:06:43 +0000 (10:06 -0400)]
hoist setting of "is raw" out of protocol decoders
and into the dictionary code so it's more centralized.
Another side effect is that unknown attributes are now always
"raw". Which is likely what we should always have done anyways
Alan T. DeKok [Fri, 8 Sep 2023 13:01:19 +0000 (09:01 -0400)]
hoist "is_raw" to be more public
There was already an "is_raw" field in the unresolved sub-structure
so just hoist it out, and use it instead of da->flags.is_raw
Alan T. DeKok [Fri, 8 Sep 2023 12:59:32 +0000 (08:59 -0400)]
fix unused
Alan T. DeKok [Fri, 8 Sep 2023 12:53:24 +0000 (08:53 -0400)]
use macros / functions instead of accessing fields directly
Alan T. DeKok [Fri, 8 Sep 2023 11:47:52 +0000 (07:47 -0400)]
define and use vp_raw
In preparation for moving the "raw" flag out of the dictionaries
Alan T. DeKok [Thu, 7 Sep 2023 21:41:40 +0000 (17:41 -0400)]
fix corner case CID
1544258
Alan T. DeKok [Thu, 7 Sep 2023 20:19:27 +0000 (16:19 -0400)]
use the correct name for the parnt type
Nick Porter [Fri, 8 Sep 2023 12:24:49 +0000 (13:24 +0100)]
Simplify fr_ldap_edir_get_password
Nick Porter [Fri, 8 Sep 2023 11:25:45 +0000 (12:25 +0100)]
Return an unlang_action_t from ldap bind auth functions
Nick Porter [Thu, 7 Sep 2023 18:13:59 +0000 (19:13 +0100)]
Ensure we free memory on errors
Nick Porter [Fri, 8 Sep 2023 10:01:08 +0000 (11:01 +0100)]
Handle rcode from previous async call
Nick Porter [Fri, 8 Sep 2023 09:37:14 +0000 (10:37 +0100)]
No need for p_result in async LDAP functions
It was only set on failure, and that is handled by the
UNLANG_ACTION_FAIL return code
Nick Porter [Thu, 7 Sep 2023 17:09:55 +0000 (18:09 +0100)]
Add max_request_time timer to unit_test_module
Nick Porter [Thu, 7 Sep 2023 14:42:20 +0000 (15:42 +0100)]
Typos
Nick Porter [Thu, 7 Sep 2023 13:25:22 +0000 (14:25 +0100)]
Ensure auth bind resume functions clear up after failed requests
Nick Porter [Thu, 7 Sep 2023 13:20:10 +0000 (14:20 +0100)]
Add callback for failed ldap auth binds
Nick Porter [Thu, 7 Sep 2023 12:59:27 +0000 (13:59 +0100)]
No need for request_free callback
bind_auth_ctx is parented of the trunk request so is freed automatically
Nick Porter [Fri, 8 Sep 2023 06:59:44 +0000 (07:59 +0100)]
Typo
Alan T. DeKok [Thu, 7 Sep 2023 19:24:29 +0000 (15:24 -0400)]
always decode tacacs as nested