12 Commits

Author SHA1 Message Date
Christian Mauderer
dfb2144641 ipsec-tools: Fix copying fd_set prior to select
The racoon session code copies an fd_set from one variable into another
prior to calling select. That works well for simple structures.

In libbsd we have to allocate fd_sets instead of using fixed structures
to avoid a problem with file numbers bigger than FD_SETSIZE. The simple
assignment didn't work in that case.

This patch makes sure that a memcpy is used instead.

Update #4913
2023-05-31 08:21:12 +02:00
Sebastian Huber
691575801c ipsec-tools: Do not use signals 2022-06-22 17:25:57 +02:00
Sebastian Huber
8952450d88 racoon: Do not rely on <sys/types.h> 2022-06-22 17:25:57 +02:00
Christian Mauderer
0b30f38951 ipsec-tools: Reduce allocated buffer size
By default, pfkey allocates a 2MB buffer that is used for SPD entries.
This size is a good choice for a server system where a lot of clients
should be handled. But on our embedded systems, an application with that
much clients is unlikely and 2MB is a lot of space. So reduce that to
the default value of 128kB which should be enough for a small number of
ipsec connections.

See https://bugzilla.redhat.com/show_bug.cgi?id=607361 for more details
why the upstream project originally increased the size.

If someone really needs a bigger size, there is a option in the
configuration file of pfkey called `pfkey_buffer` that can overwrite
this value.

Closes #4621
2022-02-24 10:20:12 +01:00
Christian Mauderer
b45e44eabb racoon: Fix build with current toolchain
During some newlib version, the _types_fd_set has been replaced with
just fd_set.
2021-06-16 11:32:55 +02:00
Christian Mauderer
e474ada48a ipsec-tools/pfkey: Fix socket leak
setkey uses pfkey_open to open a socket. But setkey doesn't close the
socket.

The libipsec functions are used only by user space applications (setkey
and racoon). Adding the wrapper for socket makes sure that the opened
socket is registered and closes if the application exits.

Fixes #4405
2021-05-11 08:42:44 +02:00
Christian Mauderer
a7273c0704 racoon/session: Honor file descriptor maximum
Dynamically allocate a big enough file descriptor set for select(). A
better solution would be to use kqueue() instead of select().

Update #4360
2021-03-26 14:06:53 +01:00
Sebastian Huber
1ec5f5eba6 racoon: Change type due to Newlib API changes 2020-08-05 13:22:41 +02:00
Sebastian Huber
b3169c2a6a Update to FreeBSD head 2018-10-23
Git mirror commit 59f44d20be3f99d181ca742e636d45fc39ec982b.

This commit updates OpenSSL to version 1.1.1.  This required an update
of racoon which uses some internal stuff from OpenSSL and seems to be
mostly unmaintained, e.g. there is update in the FreeBSD ports to cope
with OpenSSL 1.1.1.

Update #3472.
2018-10-25 08:38:45 +02:00
Christian Mauderer
b376ae131d ipsec-tools: Port libipsec, setkey and racoon.
Note that this replaces the libipsec from FreeBSD with the one provided
by ipsec-tools.
2018-08-02 10:25:37 +02:00
Christian Mauderer
8645c9d720 ipsec-tools: Apply patches from FreeBSD ports.
Source: https://svnweb.freebsd.org/ports/head/security/ipsec-tools/files/ revision 468617.
2018-08-01 09:55:27 +02:00
Christian Mauderer
ff36f5e409 Import ipsec-tools 0.8.2.
Import unchanged ipsec-tools sources in the release version 0.8.2. The
homepage of ipsec-tools is http://ipsec-tools.sourceforge.net/. The
sources can be obtained from there.
2018-08-01 09:55:27 +02:00