Alan T. DeKok [Thu, 25 Dec 2025 13:05:04 +0000 (08:05 -0500)]
limit the "name2" for update sections in modules
since we no longer support full-featured "update" sections, there
is no point in supporting full paths (outer, parent, etc.) in
update sections. Plus, none of the modules use them.
So rather than either confusing the admin, or allowing them to do
something which might not work, we just return a compile-time
error.
The deleted code was also the only code (other then tests) that
called tmpl_request_ref_list_afrom_substr(). This cleanup will
allow us to fix the tmpl code for ""flat" groups
Alan T. DeKok [Sun, 14 Dec 2025 16:02:24 +0000 (11:02 -0500)]
clean up OSX and DSYMUTIL rules so that they work
for now, we just define "DSYMTUL=touch" on platforms which don't
have it. There isn't enough time right now to fight with GNU make
and inline "if" checks in evaluated rules
Alan T. DeKok [Sun, 14 Dec 2025 13:14:23 +0000 (08:14 -0500)]
disable encoder tests again
they're still showing random failures in CI. It's difficult to
track down the issues when CI stubbornly refuses to show useful
stack traces, and we can't reproduce the issues locally.
Alan T. DeKok [Thu, 11 Dec 2025 01:41:07 +0000 (20:41 -0500)]
Rewrite fr_pair_list_afrom_substr()
and update tests to match.
It now properly handles aliases, groups, etc. The parsing has
been significantly re-worked. All of the old-style strings should
still be allowed, except for ones which had never made sense.
And since aliases, groups, etc. are now handled properly, the
fr_pair_t parenting is also correct. So we can start enabling the
checks on parenting.
Which should help us remove the last vestiges of "flat" attributes
Alan T. DeKok [Wed, 10 Dec 2025 04:14:25 +0000 (23:14 -0500)]
enable encoder in fuzzers
now that we've fixed many (most?) issues with the code, we can
start to automatically test the encoders.
Instead of having a separate fuzzer test for the encoders, we just
use the fuzzer input to decode attributes, and then call the encoder
with the attributes we just found. This should be a reasonable
test of all kinds of odd behavior
Alan T. DeKok [Wed, 10 Dec 2025 19:21:52 +0000 (14:21 -0500)]
manually switch to local / openssl versions of MD4 and MD5.
The fuzzer doesn't call all of the OpenSSL initialization functions,
so if it calls any MD5 routines in RADIUS, it crashes. If we try to
call fr_openssl_fips_mode(), we need to link to libfreeradius-tls,
libfreeradius-server, libfreeradius-unlang, and then call
fr_openssl_init(), which does a ton of other things.
The solution is to manually swap the functions to their local
versions, OR the OpenSSL versions. This is done in fr_openssl_init()
and in fr_openssl_free(). And for good measure, in then also in
fr_openssl_fips_mode().
The previous code could boot with FIPS disabled, set the MD5
pointers, and then at some later point FIPS would be disabled.
The MD5 pointers wouldn't be updated, and bad things could happen.
That case deosn't happen now, because the current code only changes
the FIPs status once at boot. But it's better to fix the APIs to
be more correct.
Alan T. DeKok [Wed, 10 Dec 2025 15:10:32 +0000 (10:10 -0500)]
update fr_pair_verify() with argument to verify the values
so that we can check more often for invalid values. The default
is "true" for the PAIR_VERIFY() and REQUEST_VERIFY() macros.
Update the various parsers to pass "false" if they add a VP to a
list before setting the value. This lets the tests continue to
pass, but also ensures that at normal run-time, we do the full
checks.
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)