]>
git.ipfire.org Git - thirdparty/freeradius-server.git/log
Arran Cudbard-Bell [Thu, 14 Oct 2021 15:48:38 +0000 (10:48 -0500)]
ldap: Expand arguments passed to custom result parser
Rework trunk type discovery to be a bit more efficient
Arran Cudbard-Bell [Thu, 14 Oct 2021 15:46:14 +0000 (10:46 -0500)]
ldap: Add thread local dummy handles to pass to functions which don't really need a handle
Arran Cudbard-Bell [Thu, 14 Oct 2021 15:44:27 +0000 (10:44 -0500)]
ldap: Remove redundant typedef for fr_ldap_query_t
Arran Cudbard-Bell [Thu, 14 Oct 2021 15:43:56 +0000 (10:43 -0500)]
ldap: Make fr_ldap_parse_url_extensions a little more generic and friendly
Arran Cudbard-Bell [Wed, 13 Oct 2021 20:50:22 +0000 (15:50 -0500)]
ldap: Add specialised query alloc functions
Arran Cudbard-Bell [Wed, 13 Oct 2021 20:42:27 +0000 (15:42 -0500)]
ldap: Validate the preq
Arran Cudbard-Bell [Wed, 13 Oct 2021 19:54:36 +0000 (14:54 -0500)]
ldap: Add default hombrew paths for libldap
Alan T. DeKok [Thu, 14 Oct 2021 20:18:49 +0000 (16:18 -0400)]
add fr_time_scale() and use it when parsing times.
so that we can clamp the times at min/max values, if the user
gives us something which is out of bounds.
we still need to fix value_box_from_network for DATE, as those
values are unsigned. And also fix the various casting functions
to clamp the relevant values.
Alan T. DeKok [Thu, 14 Oct 2021 20:06:54 +0000 (16:06 -0400)]
ensure that input buffer is zero-terminated
Alan T. DeKok [Thu, 14 Oct 2021 18:15:26 +0000 (14:15 -0400)]
most instance things use "type" instead of "name"
so change this for consistency
James Jones [Thu, 14 Oct 2021 14:14:30 +0000 (09:14 -0500)]
Rewrite lst_validate() as fr_lst_verify(), with FR_LST_VERIFY() macro (#4263)
Using the foo_verify() parameter convention had the nice side effect
of bringing useful const qualifications to some function parameters
in some functions.
Alan T. DeKok [Thu, 14 Oct 2021 14:07:04 +0000 (10:07 -0400)]
add fuzzer for string parsers
we know things will likely crash because some string parsers
don't respect "end". But it already caught some issues.
Alan T. DeKok [Thu, 14 Oct 2021 14:02:59 +0000 (10:02 -0400)]
more checks
Alan T. DeKok [Thu, 14 Oct 2021 13:42:33 +0000 (09:42 -0400)]
check for bounds before accessing memory
Alan T. DeKok [Thu, 14 Oct 2021 13:23:57 +0000 (09:23 -0400)]
initialize only as much as necessary
Nick Porter [Wed, 13 Oct 2021 19:35:26 +0000 (20:35 +0100)]
v4: Move rlm_ldap to use trunk connections in place of connection pool (#4265)
* Amend fr_ldap_map_do to take LDAP handle instead of fr_ldap_connection_t
* Amend rlm_ldap_find_user() to use trunk connection
* Amend rlm_ldap_check_access() to take LDAP handle
* Amend rlm_ldap_check_reply() to take trunk connection
* Amend rlm_ldap_group_name2dn() to take fr_ldap_thread_trunk_t
* Amend rlm_ldap_group_dn2name() to take fr_ldap_thread_trunk_t
* Amend rlm_ldap_cacheable_userobj() to take fr_ldap_thread_trunk_t
* Amend rlm_ldap_cacheable_groupobj() to take fr_ldap_thread_trunk_t
* Amend rlm_ldap_check_groupobj_dynamic() to take fr_ldap_thread_trunk_t
* Amend rlm_ldap_check_userobj_dynamic() to take fr_ldap_thread_trunk_t
* Amend LDAP mod_map_proc() to use fr_ldap_thread_trunk_t connections
* Amend rlm_ldap_groupcmp to use fr_ldap_thread_trunk_t connections
* Amend mod_authenticate to use fr_ldap_thread_trunk_t connections
* Amend rlm_ldap_map_profile to take fr_ldap_thread_trunk_t
* Amend user_modify to use fr_ldap_thread_trunk_t connections
* Amend mod_authorize to use fr_ldap_thread_trunk_t connections
* Amend mod_authenticate() to use async bind in place of fr_ldap_bind()
* Amend mod_authorize to use async LDAP bind in place of fr_ldap_bind()
* rlm_ldap no longer uses a connection pool
* Parse trunk config for LDAP trunks
Nick Porter [Wed, 13 Oct 2021 19:24:41 +0000 (20:24 +0100)]
v4: Protect LDAP connections from being freed when there are outstanding queries... (#4267)
* Use correct DN string in debug message
* Use query type to identify LDAP searches
* Protect fr_ldap_connection_t from being freed if there are pending queries
* Add watcher checking for outstanding queries when an LDAP connection closes
* Alter _ldap_query_free() to free the associated connection if it is closed ...
... and has no other queries associated with it
* Queries are removed from the pending tree by the query destructor
* Improve handling of un-expected results retrieved from libldap
* Don't free LDAP results just because an LDAP error was returned ...
... if the caller wants the results, it may want to query them
regardless of success or failure.
* Add debug message for auth bind reject
* Free the bind_auth_ctx when we've finished with it
* Improved version of _ldap_bind_auth_io_read()
- handle fr_ldap_result() returning no result
- handle LDAP_PROC_REJECT
- use a normal while loop
Alan T. DeKok [Wed, 13 Oct 2021 15:39:10 +0000 (11:39 -0400)]
don't use talloc if we're not using talloc
Alan T. DeKok [Wed, 13 Oct 2021 14:53:24 +0000 (10:53 -0400)]
just make them thread-local
if the atexit stuff crashes, then we don't use it
Alan T. DeKok [Wed, 13 Oct 2021 13:23:54 +0000 (09:23 -0400)]
initialize as needed, not globally
Alan T. DeKok [Wed, 13 Oct 2021 13:00:17 +0000 (09:00 -0400)]
minor rearrangement for speed
comparing pointers is faster than a function call, so let's
do that first
Alan T. DeKok [Wed, 13 Oct 2021 12:39:22 +0000 (08:39 -0400)]
remove unused function
Arran Cudbard-Bell [Wed, 13 Oct 2021 14:06:38 +0000 (09:06 -0500)]
Gcc doesn't support handle markup
Arran Cudbard-Bell [Wed, 13 Oct 2021 13:19:54 +0000 (08:19 -0500)]
Mark up functions/apis with explicit acquire/release semantics
Matthew Newton [Wed, 13 Oct 2021 12:59:37 +0000 (13:59 +0100)]
docker: debian sid needs NR extras repo for up-to-date libkqueue
Alan T. DeKok [Wed, 13 Oct 2021 12:33:42 +0000 (08:33 -0400)]
move dns_labels to thread-local variable
because we don't yield when decoding the DNS packet.
Arran Cudbard-Bell [Wed, 13 Oct 2021 01:37:59 +0000 (20:37 -0500)]
Dedup const code
Alan T. DeKok [Wed, 13 Oct 2021 00:50:35 +0000 (20:50 -0400)]
when we read a fake packet, mark the pairs as tainted
which should help the rlm_rest test cases
Matthew Newton [Tue, 12 Oct 2021 19:39:23 +0000 (20:39 +0100)]
json: skip raw attributes
They tend to have binary stuff that gets incorrectly encoded and
breaks the json output
Alan T. DeKok [Tue, 12 Oct 2021 20:12:43 +0000 (16:12 -0400)]
push markup buffer to proto_dns, too
Alan T. DeKok [Tue, 12 Oct 2021 19:52:27 +0000 (15:52 -0400)]
add marker array for tracking where labels can point to
Alan T. DeKok [Tue, 12 Oct 2021 17:57:11 +0000 (13:57 -0400)]
pass require_ma to fr_radius_verify()
Alan T. DeKok [Tue, 12 Oct 2021 17:54:16 +0000 (13:54 -0400)]
add require_ma flag to fr_radius_verify()
Alan T. DeKok [Tue, 12 Oct 2021 14:57:50 +0000 (10:57 -0400)]
things from config files are not tainted by default
exec_legacy already calls fr_pair_list_tainted(), as the output
of exec is rather less trusted than the config files.
Update the internal tests to remove the tainted flag.
Alan T. DeKok [Tue, 12 Oct 2021 14:26:36 +0000 (10:26 -0400)]
don't convert octets from hex, and don't unescape strings
Alan T. DeKok [Tue, 12 Oct 2021 14:02:51 +0000 (10:02 -0400)]
nope
Alan T. DeKok [Tue, 12 Oct 2021 12:51:54 +0000 (08:51 -0400)]
let's add one more check
Arran Cudbard-Bell [Tue, 12 Oct 2021 03:48:42 +0000 (22:48 -0500)]
Return the correct type on error
Arran Cudbard-Bell [Tue, 12 Oct 2021 02:24:03 +0000 (21:24 -0500)]
Add fr_pair_list_dcursor_init and fr_pair_list_dcursor_talloc_init
Use pair list specific iterators for initialising pair dcursors
Arran Cudbard-Bell [Mon, 11 Oct 2021 23:15:13 +0000 (18:15 -0500)]
Remove one instance of dcursors
Arran Cudbard-Bell [Mon, 11 Oct 2021 21:39:10 +0000 (16:39 -0500)]
Remove commented out code
Arran Cudbard-Bell [Mon, 11 Oct 2021 21:24:14 +0000 (16:24 -0500)]
Implement dcursor insert and remove callbacks
Matthew Newton [Mon, 11 Oct 2021 19:30:45 +0000 (20:30 +0100)]
CI: temporarily remove rawhide due to docker clone3 bug
as per https://github.com/actions/virtual-environments/issues/3812
Arran Cudbard-Bell [Mon, 11 Oct 2021 20:40:51 +0000 (15:40 -0500)]
Use up to date function
Arran Cudbard-Bell [Mon, 11 Oct 2021 20:26:37 +0000 (15:26 -0500)]
Possibly fix overflow?
Arran Cudbard-Bell [Mon, 11 Oct 2021 20:19:42 +0000 (15:19 -0500)]
Enforce is_const in the dcursor API
Abort or return if a modification attempt is made on a const list
Arran Cudbard-Bell [Mon, 11 Oct 2021 19:46:52 +0000 (14:46 -0500)]
Quiet clang scan
Arran Cudbard-Bell [Mon, 11 Oct 2021 19:38:21 +0000 (14:38 -0500)]
Produce the same return type as the normal assertion macros
Arran Cudbard-Bell [Mon, 11 Oct 2021 19:37:57 +0000 (14:37 -0500)]
Don't call iterator if next is NULL
Matthew Newton [Mon, 11 Oct 2021 18:35:27 +0000 (19:35 +0100)]
CI: update freebsd VM packages
Arran Cudbard-Bell [Mon, 11 Oct 2021 17:53:17 +0000 (12:53 -0500)]
Add pair pool allocator
Can save two mallocs for unknown attributes
Arran Cudbard-Bell [Mon, 11 Oct 2021 17:51:36 +0000 (12:51 -0500)]
Remove assert in fr_dns_label_to_value_box
Nick Porter [Mon, 11 Oct 2021 17:46:52 +0000 (18:46 +0100)]
v4: Final set of background changes to LDAP code (#4264)
* s/LDAP_OPT_ERROR_NUMBER/LDAP_OPT_RESULT_CODE/
LDAP_OPT_RESULT_CODE is the current name for this option.
* Define custom LDAP results parser
Used where LDAP queries are not part of processing a request, e.g.
querying the rootDSE after a connection comes up to establish which type
of directory server is connected to.
* Define async method to retrieve LDAP directory type
For use with trunk connections
* Queue a query to discover LDAP directory type for trunk connections
* Launch LDAP trunk connections for module default server
* We handle referral chasing so always set libldap option to off
* No need to re-bind since the trunk is only ever bound as admin user
* Move definition of fr_ldap_bind_ctx_t to base.h
* Define fr_ldap_bind_auth_ctx_t for holding details of bind auth requests
* Define fr_ldap_bind_auth_cmp for comparing two bind requests
* Define callbacks for handling LDAP bind responses
* Define watcher to add handlers to LDAP connection being used for bind auths
* Initialise a thread specific LDAP connection for bind auths
* Old referral rebind callback no longer needed
* Define callbacks to support use of async LDAP binds in place of sync ones
A temporary set of wrapper functions before fully rewriting rlm_ldap to
be fully async
* Define fr_ldap_bind_auth_async()
Arran Cudbard-Bell [Mon, 11 Oct 2021 17:08:48 +0000 (12:08 -0500)]
s/VP_VERIFY/PAIR_VERIFY/ s/LIST_VERIFY/PAIR_LIST_VERIFY/
Alan T. DeKok [Mon, 11 Oct 2021 16:41:23 +0000 (12:41 -0400)]
move timestr_match() to better API
Alan T. DeKok [Mon, 11 Oct 2021 15:19:23 +0000 (11:19 -0400)]
check for more corner cases
Arran Cudbard-Bell [Mon, 11 Oct 2021 17:01:51 +0000 (12:01 -0500)]
Populat attr_chap_challenge
Arran Cudbard-Bell [Mon, 11 Oct 2021 16:43:40 +0000 (11:43 -0500)]
Typo
Arran Cudbard-Bell [Mon, 11 Oct 2021 16:38:16 +0000 (11:38 -0500)]
Fix various issues...
Arran Cudbard-Bell [Mon, 11 Oct 2021 16:36:57 +0000 (11:36 -0500)]
Add const...
Arran Cudbard-Bell [Mon, 11 Oct 2021 16:32:26 +0000 (11:32 -0500)]
From should be const everywhere
Arran Cudbard-Bell [Mon, 11 Oct 2021 16:29:17 +0000 (11:29 -0500)]
Deal with WITH_VERIFY_PTR later in pair.h
Arran Cudbard-Bell [Mon, 11 Oct 2021 16:06:15 +0000 (11:06 -0500)]
Try and quiet GCC
Matthew Newton [Mon, 11 Oct 2021 14:49:37 +0000 (15:49 +0100)]
CI: install nr-extras on all debian builds
kqueue in sid is now too old
Arran Cudbard-Bell [Mon, 11 Oct 2021 14:41:30 +0000 (09:41 -0500)]
Quiet pedantic compiler
Arran Cudbard-Bell [Mon, 11 Oct 2021 03:45:31 +0000 (22:45 -0500)]
Remove manual NULL checks
Arran Cudbard-Bell [Mon, 11 Oct 2021 01:14:02 +0000 (20:14 -0500)]
Decorate functions in pair.c with nonnull
Arran Cudbard-Bell [Sun, 10 Oct 2021 19:03:51 +0000 (14:03 -0500)]
Load attr_state correctly in proto_radius
Arran Cudbard-Bell [Sun, 10 Oct 2021 17:10:10 +0000 (12:10 -0500)]
Mark up functions in util/pair.c with nonnull and add count param to fr_pair_sublist_copy
Arran Cudbard-Bell [Sun, 10 Oct 2021 16:59:35 +0000 (11:59 -0500)]
Add tain to fr_pair_value_strdup
Arran Cudbard-Bell [Sat, 9 Oct 2021 17:50:06 +0000 (12:50 -0500)]
Minor tweaks to eap config
Alan T. DeKok [Sun, 10 Oct 2021 12:19:51 +0000 (08:19 -0400)]
decode TLVs as nested, and update tests to match
Alan T. DeKok [Sun, 10 Oct 2021 11:55:46 +0000 (07:55 -0400)]
let's encode TLVs, too
Alan T. DeKok [Sun, 10 Oct 2021 11:54:40 +0000 (07:54 -0400)]
more / better errors
Jorge Pereira [Sun, 10 Oct 2021 11:18:51 +0000 (08:18 -0300)]
Fix unit_test_attribute to print out the entire path/file when failed (#4259)
Alan T. DeKok [Sat, 9 Oct 2021 17:33:17 +0000 (13:33 -0400)]
decode TLVs in OPT 41, too
the struct encoder does not yet accept the VPs returned by the decoder.
it's not clear if the decoder is wrong, or if the struct encoder
has issues. More debugging later.
Alan T. DeKok [Sat, 9 Oct 2021 17:33:04 +0000 (13:33 -0400)]
add more options
Alan T. DeKok [Sat, 9 Oct 2021 17:32:38 +0000 (13:32 -0400)]
return only as much as we decoded
which lets TLVs work after structures
Arran Cudbard-Bell [Sat, 9 Oct 2021 16:58:36 +0000 (11:58 -0500)]
Use the correct field in dcursor tests
Arran Cudbard-Bell [Sat, 9 Oct 2021 17:00:06 +0000 (12:00 -0500)]
Record const state of input list
Arran Cudbard-Bell [Fri, 8 Oct 2021 22:22:04 +0000 (17:22 -0500)]
Move "type" into the legacy stuff area
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:21:27 +0000 (16:21 -0500)]
Whitespace
Arran Cudbard-Bell [Fri, 8 Oct 2021 22:02:27 +0000 (17:02 -0500)]
Nope that was correct
Arran Cudbard-Bell [Fri, 8 Oct 2021 22:01:17 +0000 (17:01 -0500)]
Test was fine
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:59:48 +0000 (16:59 -0500)]
We should only call virtual server for depth 0
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:57:50 +0000 (16:57 -0500)]
Sync up code with docs
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:41:17 +0000 (16:41 -0500)]
Extra quoting
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:40:14 +0000 (16:40 -0500)]
We really only want to verify the client by default
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:38:37 +0000 (16:38 -0500)]
Fix spurious error
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:23:23 +0000 (16:23 -0500)]
Add fr_pair_reinit_from_da
This automatically converts existing values, and performs all the necessary checks and modifications to keep the fr_pair_list_t correct.
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:06:55 +0000 (16:06 -0500)]
Access the order dlist from fr_pair_list_t explicitly
Originally fr_pair_list_t was the same as fr_dlist_head_t, but no longer.
Arran Cudbard-Bell [Fri, 8 Oct 2021 21:18:35 +0000 (16:18 -0500)]
Build private version of pair header
Arran Cudbard-Bell [Fri, 8 Oct 2021 19:42:43 +0000 (14:42 -0500)]
Disable auto_chain entirely
It just causes confusion and annoyance
Arran Cudbard-Bell [Fri, 8 Oct 2021 19:31:35 +0000 (14:31 -0500)]
Always use a separate vertificate store, and print out the certs in it when we fail to validate a client cert
Nick Porter [Fri, 8 Oct 2021 17:09:07 +0000 (18:09 +0100)]
v4: Move LDAP xlat to use trunks and to the new API (#4262)
* When escaping vbs in a URI, remove them from the list and re-insert afterwards
Escaping functions may re-initialise the vb which destroys the list
pointers. Removing and re-inserting is much safer.
* Update rlm_rest's uri_part_escape to match new behaviour or fr_uri_escape()
* Define ldap_xlat_thread_inst_t to hold thread specific xlat data
* Define mod_xlat_thread_instantiate for LDAP xlats
* Define uri_part_escape for LDAP URIs
* Define xlat resume function for ldap xlat
* Define ldap_xlat_signal for signalling async ldap xlat
* Define ldap_query_timeout() callback for query timeouts
* Define parts of LDAP uri
* Convert %{ldap: } to new xlat api
* Add trunk_conf to ldap_inst_s
* Give thread instance access to trunk config
Arran Cudbard-Bell [Fri, 8 Oct 2021 16:21:36 +0000 (11:21 -0500)]
Protect buffers from direct manpiulation
Arran Cudbard-Bell [Fri, 8 Oct 2021 16:21:24 +0000 (11:21 -0500)]
Fix direct manipulation of boxes in unit_test_module.c
Arran Cudbard-Bell [Fri, 8 Oct 2021 16:21:07 +0000 (11:21 -0500)]
Fix direct manipulation of boxes in xlat_builtin.c
Arran Cudbard-Bell [Fri, 8 Oct 2021 16:15:31 +0000 (11:15 -0500)]
Fix direct manipulation of boxes in radclient.c
Arran Cudbard-Bell [Fri, 8 Oct 2021 16:14:59 +0000 (11:14 -0500)]
Fix direct manipulation of boxes in compose.c