]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
5 years agosbuff: Add function to de-escape strings when copying them out of an sbuff
Arran Cudbard-Bell [Sat, 25 Jul 2020 22:09:57 +0000 (18:09 -0400)] 
sbuff: Add function to de-escape strings when copying them out of an sbuff

This makes dealing with config strings easier

5 years agosbuff: Protect against errant copies
Arran Cudbard-Bell [Sat, 25 Jul 2020 22:09:23 +0000 (18:09 -0400)] 
sbuff: Protect against errant copies

5 years agosbuff: Verify length constrained functions terminate output on zero length input
Arran Cudbard-Bell [Sat, 25 Jul 2020 21:34:31 +0000 (17:34 -0400)] 
sbuff: Verify length constrained functions terminate output on zero length input

5 years agosbuff: Add a char class for hex chars
Arran Cudbard-Bell [Sat, 25 Jul 2020 21:32:06 +0000 (17:32 -0400)] 
sbuff: Add a char class for hex chars

5 years agosbuff: no_trailing should only fail if the trailing char is a digit...
Arran Cudbard-Bell [Sat, 25 Jul 2020 04:09:40 +0000 (00:09 -0400)] 
sbuff: no_trailing should only fail if the trailing char is a digit...

5 years agosbuff: Avoid useless loop iteration in fr_sbuff_out_*
Arran Cudbard-Bell [Sat, 25 Jul 2020 04:05:25 +0000 (00:05 -0400)] 
sbuff: Avoid useless loop iteration in fr_sbuff_out_*

5 years agosbuff: Fix trailing char detection and uint8_t parsing
Arran Cudbard-Bell [Sat, 25 Jul 2020 04:05:07 +0000 (00:05 -0400)] 
sbuff: Fix trailing char detection and uint8_t parsing

5 years agosbuff: Add escapes to fr_sbuff_out_bstrncpy_until
Arran Cudbard-Bell [Sat, 25 Jul 2020 01:14:05 +0000 (21:14 -0400)] 
sbuff: Add escapes to fr_sbuff_out_bstrncpy_until

5 years agosbuff: Add some standard char classes
Arran Cudbard-Bell [Sat, 25 Jul 2020 00:42:43 +0000 (20:42 -0400)] 
sbuff: Add some standard char classes

add support for escapes in fr_sbuff_adv_until

5 years agosbuff: Add length constraints to search functions
Arran Cudbard-Bell [Fri, 24 Jul 2020 21:48:31 +0000 (17:48 -0400)] 
sbuff: Add length constraints to search functions

5 years agoRevert "round robin listeners among network threads"
Alan T. DeKok [Fri, 24 Jul 2020 21:29:28 +0000 (17:29 -0400)] 
Revert "round robin listeners among network threads"

This reverts commit 614d0fe5fa45476dd963bf907326f830ac2fd007.

until we can get travis to build again

5 years agosbuff: fr_sbuff_adv_past should really return how many chars they advanced by
Arran Cudbard-Bell [Fri, 24 Jul 2020 17:44:23 +0000 (13:44 -0400)] 
sbuff: fr_sbuff_adv_past should really return how many chars they advanced by

5 years agodebug logging fixes
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:45:17 +0000 (12:45 -0400)] 
debug logging fixes

6 years agocond_eval: typo
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:39:49 +0000 (12:39 -0400)] 
cond_eval: typo

6 years agofix doxygen header
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:39:37 +0000 (12:39 -0400)] 
fix doxygen header

6 years agoregex: Add flag buffer size
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:38:20 +0000 (12:38 -0400)] 
regex: Add flag buffer size

6 years agotmpl: Move rules struct def higher
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:33:36 +0000 (12:33 -0400)] 
tmpl: Move rules struct def higher

6 years agos/VP_ATTR_REF_/TMPL_ATTR_REF_/g
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:32:18 +0000 (12:32 -0400)] 
s/VP_ATTR_REF_/TMPL_ATTR_REF_/g

6 years agos/tmpl_define_undefined_attr/tmpl_unparsed_attr_add/g
Arran Cudbard-Bell [Fri, 24 Jul 2020 16:29:28 +0000 (12:29 -0400)] 
s/tmpl_define_undefined_attr/tmpl_unparsed_attr_add/g

6 years agos/allow_undefined/allow_unparsed/
Arran Cudbard-Bell [Fri, 24 Jul 2020 15:40:40 +0000 (11:40 -0400)] 
s/allow_undefined/allow_unparsed/

6 years agoround robin listeners among network threads
Alan T. DeKok [Fri, 24 Jul 2020 15:07:40 +0000 (11:07 -0400)] 
round robin listeners among network threads

6 years agosbuff: Add fr_sbuff_adv_past_allowed && fr_sbuff_adv_until
Arran Cudbard-Bell [Fri, 24 Jul 2020 14:59:31 +0000 (10:59 -0400)] 
sbuff: Add fr_sbuff_adv_past_allowed && fr_sbuff_adv_until

6 years agosbuff: Less confusing macro name
Arran Cudbard-Bell [Fri, 24 Jul 2020 04:10:13 +0000 (00:10 -0400)] 
sbuff: Less confusing macro name

6 years agoadd each worker to all network threads
Alan T. DeKok [Fri, 24 Jul 2020 14:55:52 +0000 (10:55 -0400)] 
add each worker to all network threads

6 years agoUse new Antora UI for documentation
Matthew Newton [Fri, 24 Jul 2020 13:11:47 +0000 (14:11 +0100)] 
Use new Antora UI for documentation

6 years agosbuff: Add talloc wrapper variants of fr_sbuff_out functions
Arran Cudbard-Bell [Thu, 23 Jul 2020 23:32:08 +0000 (19:32 -0400)] 
sbuff: Add talloc wrapper variants of fr_sbuff_out functions

6 years agosbuff: Fix advancement functions to return position, and add tests
Arran Cudbard-Bell [Thu, 23 Jul 2020 22:52:38 +0000 (18:52 -0400)] 
sbuff: Fix advancement functions to return position, and add tests

6 years agoinitialize from the correct fields
Alan T. DeKok [Thu, 23 Jul 2020 22:29:41 +0000 (18:29 -0400)] 
initialize from the correct fields

There are still issues stopping networks when more than one exists.
that will need to be tracked down later.

6 years agosbuff: add fr_sbuff_adv_to_strcase and fix all functions to support streaming
Arran Cudbard-Bell [Thu, 23 Jul 2020 21:10:18 +0000 (17:10 -0400)] 
sbuff: add fr_sbuff_adv_to_strcase and fix all functions to support streaming

6 years agosbuff: Consistently subtract one from buffer len when setting the end pointer
Arran Cudbard-Bell [Thu, 23 Jul 2020 16:51:26 +0000 (12:51 -0400)] 
sbuff: Consistently subtract one from buffer len when setting the end pointer

Fix fr_sbuff_adv_past_str and fr_sbuff_adv_past_strcase to work with streaming buffers.

6 years agomanual pull of bc339a4c10
Alan T. DeKok [Thu, 23 Jul 2020 15:43:25 +0000 (11:43 -0400)] 
manual pull of bc339a4c10

6 years agosbuff: Add tests for bstrncpy_until
Arran Cudbard-Bell [Thu, 23 Jul 2020 15:22:32 +0000 (11:22 -0400)] 
sbuff: Add tests for bstrncpy_until

6 years agosbuff: Initialise temporary sbuffs with additional trailing byte when using strlen
Arran Cudbard-Bell [Thu, 23 Jul 2020 15:04:05 +0000 (11:04 -0400)] 
sbuff: Initialise temporary sbuffs with additional trailing byte when using strlen

6 years agosbuff: Ensure buffers are always terminated
Arran Cudbard-Bell [Thu, 23 Jul 2020 14:44:37 +0000 (10:44 -0400)] 
sbuff: Ensure buffers are always terminated

6 years agomake sure that Acct-Unique-Session-Id is a printable string
Alan T. DeKok [Thu, 23 Jul 2020 14:07:25 +0000 (10:07 -0400)] 
make sure that Acct-Unique-Session-Id is a printable string

and add comments explain what we're doing, and why.

6 years agosbuff: Remove talloc variants and output using sbuffs instead
Arran Cudbard-Bell [Wed, 22 Jul 2020 22:30:36 +0000 (18:30 -0400)] 
sbuff: Remove talloc variants and output using sbuffs instead

6 years agotypo
Alan T. DeKok [Wed, 22 Jul 2020 21:40:14 +0000 (17:40 -0400)] 
typo

6 years agoupdate as per module config
Alan T. DeKok [Wed, 22 Jul 2020 13:56:59 +0000 (09:56 -0400)] 
update as per module config

6 years agouse the ID for calculating CHAP.
Alan T. DeKok [Wed, 22 Jul 2020 13:10:56 +0000 (09:10 -0400)] 
use the ID for calculating CHAP.

We do NOT want to skip that.  It's BAD!

Add test cases so that this doesn't happen again.

6 years agosbuff: Quiet clang scan
Arran Cudbard-Bell [Tue, 21 Jul 2020 22:27:27 +0000 (18:27 -0400)] 
sbuff: Quiet clang scan

6 years agoclarify and use English words
Alan T. DeKok [Tue, 21 Jul 2020 21:28:07 +0000 (17:28 -0400)] 
clarify and use English words

6 years agoenforce non-zero cleanup delay when tracking duplicates
Alan T. DeKok [Tue, 21 Jul 2020 19:23:33 +0000 (15:23 -0400)] 
enforce non-zero cleanup delay when tracking duplicates

6 years agoSmall docs change ("blacklist" -> "blocklist") (#3531)
Carl Tashian [Tue, 21 Jul 2020 20:49:57 +0000 (15:49 -0500)] 
Small docs change ("blacklist" -> "blocklist") (#3531)

Per best current practice in https://tools.ietf.org/id/draft-knodel-terminology-01.html

6 years agosbuff: Allow dynamic re-allocation of sbuffs
Arran Cudbard-Bell [Tue, 21 Jul 2020 20:32:02 +0000 (16:32 -0400)] 
sbuff: Allow dynamic re-allocation of sbuffs

6 years agocerts: Documentation fixes and Makefile tweaks (#3530)
Terry Burton [Tue, 21 Jul 2020 19:33:37 +0000 (20:33 +0100)] 
certs: Documentation fixes and Makefile tweaks (#3530)

* certs: Refer to correct Makefile targets and file locations for RSA vs ECC

* certs: Don't clobber a user's RSA cert with their ECC cert

* certs: Reorder the deps for the Makefile targets

Makes the output of running `make` more logical: First the all the CA
certs steps, then the server cert steps, then the client cert steps.

6 years agopush duplicate replies into the "replies" heap
Alan T. DeKok [Tue, 21 Jul 2020 19:15:54 +0000 (15:15 -0400)] 
push duplicate replies into the "replies" heap

instead of the waiting heap.  Which lets them be written as soon
as the network event loop is serviced.

Also set their priority to PRIORITY_NOW, so that they are sent
out before replies to later packets.

6 years agoremove "todo" which has been done
Alan T. DeKok [Tue, 21 Jul 2020 19:15:34 +0000 (15:15 -0400)] 
remove "todo" which has been done

6 years agosplit off sent and received
Alan T. DeKok [Tue, 21 Jul 2020 16:19:49 +0000 (12:19 -0400)] 
split off sent and received

in order to see retransmissions

6 years agoprint out actual count, not just expected count
Alan T. DeKok [Tue, 21 Jul 2020 15:36:40 +0000 (11:36 -0400)] 
print out actual count, not just expected count

6 years agoactually set that it's in the dedup tree...
Alan T. DeKok [Tue, 21 Jul 2020 14:51:36 +0000 (10:51 -0400)] 
actually set that it's in the dedup tree...

6 years agofree request if we receive erroneous duplicate
Alan T. DeKok [Tue, 21 Jul 2020 14:13:21 +0000 (10:13 -0400)] 
free request if we receive erroneous duplicate

6 years agocheck length of tracking structure, too
Alan T. DeKok [Tue, 21 Jul 2020 13:37:34 +0000 (09:37 -0400)] 
check length of tracking structure, too

and ignore duplicates while the client is pending

6 years agouse strdup instead of bstrdup_buffer. Fixes #3528
Alan T. DeKok [Tue, 21 Jul 2020 13:26:13 +0000 (09:26 -0400)] 
use strdup instead of bstrdup_buffer.  Fixes #3528

as the second function expects the string to be talloc'd,
and it isn't.

6 years agowhitespace
Alan T. DeKok [Tue, 21 Jul 2020 13:25:51 +0000 (09:25 -0400)] 
whitespace

becausemanglingthingstogethermakesithardtoread

6 years agopacket_len is unused
Alan T. DeKok [Tue, 21 Jul 2020 03:04:48 +0000 (23:04 -0400)] 
packet_len is unused

if we get RADIUS packets of less than 20 bytes, then everything
else is broken

6 years agomake C compiler happy
Alan T. DeKok [Tue, 21 Jul 2020 02:27:41 +0000 (22:27 -0400)] 
make C compiler happy

6 years agoselect network from connection or thread
Alan T. DeKok [Tue, 21 Jul 2020 02:27:23 +0000 (22:27 -0400)] 
select network from connection or thread

6 years agoadd tracking table for DHCPv6
Alan T. DeKok [Tue, 21 Jul 2020 02:21:05 +0000 (22:21 -0400)] 
add tracking table for DHCPv6

by packet code, transaction ID, and (if available) client id

note that we don't care what the client ID is, we just compare
it as an opaque binary blob.  Which isn't perfect, but should be
good enough for our intents and purposes

6 years agotypo
Alan T. DeKok [Tue, 21 Jul 2020 01:53:29 +0000 (21:53 -0400)] 
typo

6 years agoloop over s->waiting, even if there is not a pending packet
Alan T. DeKok [Tue, 21 Jul 2020 00:10:29 +0000 (20:10 -0400)] 
loop over s->waiting, even if there is not a pending packet

6 years agoimplement dedup.
Alan T. DeKok [Mon, 20 Jul 2020 23:08:29 +0000 (19:08 -0400)] 
implement dedup.

the old master.c never called rbtree_insert().  Oops.

The new code does that, and also abstracts the dedup parameters.
There is now a new function which creates a dedup tracking structure.
For RADIUS this is the first 20 bytes of the packet.  For DHCPv4
it is the XID, CHADDR, and message type code.  Having a separate
structure means that we don't have to search through the entire
packet every time we do rbtree comparisons.

6 years agosbuff/dbuff: Add marker advance/set poistion functions
Arran Cudbard-Bell [Mon, 20 Jul 2020 16:00:43 +0000 (12:00 -0400)] 
sbuff/dbuff: Add marker advance/set poistion functions

6 years agotalloc: Print useful error if we fail to append a string
Arran Cudbard-Bell [Mon, 20 Jul 2020 15:59:21 +0000 (11:59 -0400)] 
talloc: Print useful error if we fail to append a string

6 years agodedup dhcpv4 packets
Alan T. DeKok [Mon, 20 Jul 2020 15:02:18 +0000 (11:02 -0400)] 
dedup dhcpv4 packets

6 years agoallow duplicates of auto-numbered attributes
Alan T. DeKok [Mon, 20 Jul 2020 14:30:51 +0000 (10:30 -0400)] 
allow duplicates of auto-numbered attributes

only if the fields, names, and types are the same

6 years agoinstance name is in the parent section
Alan T. DeKok [Mon, 20 Jul 2020 12:46:41 +0000 (08:46 -0400)] 
instance name is in the parent section

now that we've put the "group" config items into their own
sub-section

6 years agosbuff/dbuff: Use compound literals as initialisers
Arran Cudbard-Bell [Mon, 20 Jul 2020 02:26:56 +0000 (22:26 -0400)] 
sbuff/dbuff: Use compound literals as initialisers

6 years agosbuff: Start of stream parsing and extensible buffers
Arran Cudbard-Bell [Mon, 20 Jul 2020 02:07:24 +0000 (22:07 -0400)] 
sbuff: Start of stream parsing and extensible buffers

6 years agocheck return code so we don't encode negative numbers
Alan T. DeKok [Sun, 19 Jul 2020 12:19:56 +0000 (08:19 -0400)] 
check return code so we don't encode negative numbers

6 years agoformat to 72 characters as infinite line lenths are deprecated
Alan T. DeKok [Sun, 19 Jul 2020 10:49:54 +0000 (06:49 -0400)] 
format to 72 characters as infinite line lenths are deprecated

and do minor word smithing

6 years agowhitespace
Alan T. DeKok [Fri, 17 Jul 2020 12:36:12 +0000 (08:36 -0400)] 
whitespace

6 years agofix typo
Alan T. DeKok [Fri, 17 Jul 2020 12:12:29 +0000 (08:12 -0400)] 
fix typo

6 years agosbuff/dbuff: Reduce the number of arguments needed for markers
Arran Cudbard-Bell [Sun, 19 Jul 2020 03:50:15 +0000 (23:50 -0400)] 
sbuff/dbuff: Reduce the number of arguments needed for markers

6 years agosbuff/dbuff: Formatting
Arran Cudbard-Bell [Sat, 18 Jul 2020 20:20:05 +0000 (16:20 -0400)] 
sbuff/dbuff: Formatting

6 years agodbuff: Add uint8_t/int8_t to fr_dbuff_in
Arran Cudbard-Bell [Sat, 18 Jul 2020 20:15:10 +0000 (16:15 -0400)] 
dbuff: Add uint8_t/int8_t to fr_dbuff_in

6 years agodbuff: Switch to using fr_dbuff_set where we're not using relative offsets
Arran Cudbard-Bell [Sat, 18 Jul 2020 20:11:26 +0000 (16:11 -0400)] 
dbuff: Switch to using fr_dbuff_set where we're not using relative offsets

6 years agodbuff/sbuff: Shuffle functions so they're in the same order
Arran Cudbard-Bell [Sat, 18 Jul 2020 20:06:20 +0000 (16:06 -0400)] 
dbuff/sbuff: Shuffle functions so they're in the same order

6 years agodbuff: Add fr_dbuff_set
Arran Cudbard-Bell [Sat, 18 Jul 2020 19:26:23 +0000 (15:26 -0400)] 
dbuff: Add fr_dbuff_set

6 years agosbuff: Use the same marker code as dbuffs
Arran Cudbard-Bell [Sat, 18 Jul 2020 19:25:38 +0000 (15:25 -0400)] 
sbuff: Use the same marker code as dbuffs

6 years agodbuff: Fix various issues with dbuff markers
Arran Cudbard-Bell [Sat, 18 Jul 2020 18:49:06 +0000 (14:49 -0400)] 
dbuff: Fix various issues with dbuff markers

6 years agodbuff: Add marker support
Arran Cudbard-Bell [Sat, 18 Jul 2020 18:08:06 +0000 (14:08 -0400)] 
dbuff: Add marker support

6 years agosbuff: Formatting
Arran Cudbard-Bell [Sat, 18 Jul 2020 18:07:54 +0000 (14:07 -0400)] 
sbuff: Formatting

6 years agosbuff: General tidying
Arran Cudbard-Bell [Fri, 17 Jul 2020 21:53:34 +0000 (17:53 -0400)] 
sbuff: General tidying

6 years agosbuff: Add additional sbuff functions
Arran Cudbard-Bell [Fri, 17 Jul 2020 19:25:02 +0000 (15:25 -0400)] 
sbuff: Add additional sbuff functions

6 years agodbuff: Allow dbuffs to wrap string buffers
Arran Cudbard-Bell [Fri, 17 Jul 2020 19:23:55 +0000 (15:23 -0400)] 
dbuff: Allow dbuffs to wrap string buffers

6 years agoNeed room for the CIDR separator in FR_IPADDR_PREFIX_STRLEN
Arran Cudbard-Bell [Fri, 17 Jul 2020 18:24:41 +0000 (14:24 -0400)] 
Need room for the CIDR separator in FR_IPADDR_PREFIX_STRLEN

6 years agoAdd dbuff.adoc (#3524)
James Jones [Fri, 17 Jul 2020 18:17:18 +0000 (13:17 -0500)] 
Add dbuff.adoc (#3524)

* Add dbuff.adoc

* Formatting and restructuring

Co-authored-by: Arran Cudbard-Bell <a.cudbardb@freeradius.org>
6 years agoport fixes from v3
Alan T. DeKok [Fri, 17 Jul 2020 12:03:19 +0000 (08:03 -0400)] 
port fixes from v3

6 years agoword smithing
Alan T. DeKok [Fri, 17 Jul 2020 12:03:10 +0000 (08:03 -0400)] 
word smithing

6 years agoConvert dhcpv4 encoding to use dbuff (#3492)
James Jones [Thu, 16 Jul 2020 21:56:46 +0000 (16:56 -0500)] 
Convert dhcpv4 encoding to use dbuff (#3492)

6 years agodbuff: Cast narrower width sizes to size_t
Arran Cudbard-Bell [Thu, 16 Jul 2020 18:35:31 +0000 (11:35 -0700)] 
dbuff: Cast narrower width sizes to size_t

6 years agoConvert DHCPv6 encoding to use dbuff (#3493)
James Jones [Wed, 15 Jul 2020 22:51:46 +0000 (17:51 -0500)] 
Convert DHCPv6 encoding to use dbuff (#3493)

Note: the conversion is not complete; fr_struct_to_network() expects a ptr/len value
encoder, which means one can't write a simple dbuff layer around it, and ARP,
DHCPv4, and DHCPv6 all use it. encode_value() thus remains as is for now, with a
dbuff-flavored wrapper.

6 years agoConvert radius encode functions to use dbuff (#3463)
James Jones [Wed, 15 Jul 2020 22:44:42 +0000 (17:44 -0500)] 
Convert radius encode functions to use dbuff (#3463)

The conversion is not complete; encode_value() must wait until
fr_struct_to_network(), which radius, dhcpv6, and arp use, can be
converted to use dbuff.

6 years agotime: Should be seconds since the epoch
Arran Cudbard-Bell [Wed, 15 Jul 2020 18:26:51 +0000 (11:26 -0700)] 
time: Should be seconds since the epoch

6 years agofix typo
Alan T. DeKok [Wed, 15 Jul 2020 17:31:44 +0000 (13:31 -0400)] 
fix typo

6 years agoread filenames in sorted order
Alan T. DeKok [Wed, 15 Jul 2020 16:38:17 +0000 (12:38 -0400)] 
read filenames in sorted order

instead of the in-directory order, which may be almost random.

There's no particular reason to choose alphabetical order, other
than it's a fixed sort, and easy to explain.

Note that we do NOT use scanddir(), as it returns duplicate
filenames on OSX.

6 years agoMore compiler quietening
Arran Cudbard-Bell [Tue, 14 Jul 2020 02:22:27 +0000 (19:22 -0700)] 
More compiler quietening

6 years agomark up function strftime args
Arran Cudbard-Bell [Tue, 14 Jul 2020 01:56:46 +0000 (18:56 -0700)] 
mark up function strftime args

6 years agotime: Add strftime wrappers
Arran Cudbard-Bell [Tue, 14 Jul 2020 01:25:37 +0000 (18:25 -0700)] 
time: Add strftime wrappers

6 years agodbuff: Don't allow copying off the end of the input dbuff
Arran Cudbard-Bell [Mon, 13 Jul 2020 19:45:24 +0000 (12:45 -0700)] 
dbuff: Don't allow copying off the end of the input dbuff