Commit Graph
100 Commits
Author SHA1 Message Date
Tobias Brunner 0e621f60f8 sonarcloud: Update filter rules as recommended 2023-07-12 11:21:27 +02:00
Tobias Brunner 46d98bc249 testing: Fix example configure options for charon-tkm Docker build
Fixes: b1ce877236 ("charon-tkm: Use built-in plugins instead of OpenSSL")
2023-07-11 18:02:13 +02:00
Tobias Brunner 4c2747fbfc Use wolfSSL 5.6.3 for tests 2023-06-21 15:31:53 +02:00
Tobias Brunner 2e88ab0069 dhcp: Fix warning with newer compilers 2023-06-19 14:56:24 +02:00
Tobias Brunner 8238ad480a resolve: Maintain order of DNS servers also when installing in resolv.conf
This always writes the complete set of DNS servers to make modifications
simpler.
2023-06-19 14:56:24 +02:00
Tobias Brunner 6440975bb4 resolve: Try to maintain the order of DNS servers if using resolvconf
Since 17fd304e60 ("resolve: Don't install individual servers via
resolvconf"), DNS servers were sorted if getting installed via resolvconf.
In some setups the order might be important (even though relying on it
isn't a good idea in general as stub resolvers are free to use all of
the servers as they please).
2023-06-19 14:56:24 +02:00
Tobias Brunner 2d1006963e charon-svc: Add missing closing parenthesis in version output 2023-06-19 14:55:48 +02:00
Tobias Brunner 43975f33ef Use wolfSSL 5.6.2 for tests
ECC keys can now be smaller so we can't access the private key directly
anymore.
2023-06-13 10:13:29 +02:00
Tobias Brunner 285ebb24e3 NEWS: Add news for 5.9.11 2023-06-02 17:52:28 +02:00
Tobias Brunner c593443432 pki: Add --label options to --est* command synopsis
Also fixes some formatting in the man pages.
2023-06-02 12:56:03 +02:00
Tobias Brunner 03c08423dd github: Use new cache storage properties for sonarcloud 2023-06-02 11:37:06 +02:00
Tobias Brunner 89ce398c3d openssl: Fix memory leak if FIPS provider isn't available 2023-06-02 11:27:39 +02:00
Tobias Brunner ee9a663b01 Fixed some typos, courtesy of codespell 2023-06-02 10:36:47 +02:00
Tobias Brunner efdcbd13cb credential-manager: Improve selection of local certificate and trust chain
The previous code was problematic if a certificate request for a known
but unrelated CA was received and the local trust chain was incomplete.
Due to the received anchor, the incomplete trust chain was dismissed and
any intermediate CA certificates were, therefore, not sent to the peer.

This new approach doesn't dismiss an incomplete trust chain, but prefers
one that can be resolved to a received anchor.  If no such chain is found,
the first one is used.
2023-06-02 10:04:39 +02:00
Tobias Brunner 0e88b8a817 github: Use OpenSSL 3.1.1 for tests 2023-05-31 15:45:02 +02:00
Tobias Brunner e3cb756dbf Merge branch 'libipsec-raw-esp'
This adds support for sending/receiving ESP packets without UDP
encapsulation to libipsec and kernel-libipsec.  Only Linux is currently
supported and the feature is disabled by default.
2023-05-23 13:19:57 +02:00
Tobias Brunner 5db9b26e32 testing: Add libipsec scenarios that exchange raw ESP packets 2023-05-23 13:19:47 +02:00
Tobias Brunner e306fa5f73 kernel-libipsec: Add support to send/receive raw ESP packets
This is currently only supported on Linux and with the appropriate
permissions.

Since it's experimental, it's disabled by default.

The log messages for each sent and received ESP message are logged in NET
like the ones in the socket-default plugin for UDP-encapsulated messages.
2023-05-23 13:19:47 +02:00
Tobias Brunner 29e8cb3f90 libipsec: Move restrictions regarding UDP encapsulation to users 2023-05-23 13:19:47 +02:00
Tobias Brunner 8ddfaf5857 libipsec: Instruct ESP sender whether to use UDP encapsulation 2023-05-23 13:19:47 +02:00
Tobias Brunner 61f9843453 android: Use CALLBACK for libipsec-related callbacks 2023-05-23 13:19:47 +02:00
Tobias Brunner a049868d78 kernel-libipsec: Use CALLBACK for libipsec callbacks 2023-05-23 13:19:47 +02:00
Tobias Brunner dbd5707077 ipsec-sa: Store whether to use UDP encapsulation on the SA 2023-05-23 13:19:47 +02:00
Tobias Brunner 23d20bbb96 Merge branch 'libipsec-trap'
This adds support for trap policies to libipsec.
2023-05-23 13:17:19 +02:00
Tobias Brunner cb049e14c8 testing: Add libipsec/net2net-trap scenario 2023-05-23 11:53:53 +02:00
Tobias Brunner b0eb88f703 kernel-libipsec: Forward acquires from libipsec to the daemon 2023-05-23 11:53:53 +02:00
Tobias Brunner 9192ef1620 ipsec-processor: Trigger acquire if no matching outbound SA is found 2023-05-23 11:53:53 +02:00
Tobias Brunner 4e9acf98d0 ipsec-sa-mgr: Optionally keep track of acquires for outbound SAs
Currently just based on the reqid.  An acquire for the same reqid is
triggered at most every 10 seconds (gets ignored in trap_manager_t if
the SA is still getting established).

Entries are only cleaned up if an SA is eventually installed (similar to
the allocated SPIs).  Should that ever be a problem, we could probably
schedule a job that regularly flushes old entries.
2023-05-23 11:53:51 +02:00
Tobias Brunner ec503ade58 libipsec: Add possibility to relay acquire events
Keeping it simple and just forwarding the reqid.
2023-05-22 16:15:49 +02:00
Tobias Brunner 6ceb39b1da ike: Use a struct to store retransmission settings
The calculation of the timeout is also shared now and the total
timeout in seconds is corrected in case retransmit_base is <= 1.

This could make it easier in the future to apply different retransmission
settings to messages/exchanges.
2023-05-17 15:58:28 +02:00
Tobias Brunner 5f8eb09dd6 pki: Make --dn optional for certificate renewals via --scep command
When using OpenXPKI, the subject DN in the renewal request has to match
the previous DN exactly.  However, because OpenXPKI may add a bunch of
DC/O RDNs to subjects of issued certificates, running --scep with the
same --dn that was used for the original request won't work (results in
a "Client error / malformed request badRequest" error even after enabling
`renewal_via_pkcs_req`).  This simplifies renewals as --dn can just be
omitted and extracted from the original certificate to avoid this issue.

References strongswan/strongswan#1689
2023-05-17 15:56:12 +02:00
Tobias Brunner 7fa85ff379 Merge branch 'debug-level-build'
This fixes the build with DEBUG_LEVEL < 4, which was broken when building
from the repository since --enable-warnings was made the default.

Although, most issues only occurred with the level reduced to 0/-1.  And
while removing debug statements at compile time completely is probably
not useful in production, there might be use cases in certain benchmarking
scenarios.  Also, with the recent changes to the controller there should
only rarely be a listener registered at a higher log level so the overhead
for those higher-level DBG statements is minimal.

Anyway, reducing the log level at compile time is a documented feature and
at least DEBUG_LEVEL=3 could be useful to prevent leaking sensitive
information via logs from the outset.  So we should make sure compilation
doesn't fail.
2023-05-16 13:05:33 +02:00
Tobias Brunner 027ba4d12e github: Add build with DBG completely disabled 2023-05-08 17:32:18 +02:00
Tobias Brunner 21f01808ff sec-updater: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 8e78d9fcec sw-collector: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 16c2def3ae conftest: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 3804b2adf9 pki: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 72f8794d83 selinux: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 4620f43eba radattr: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 74b2628301 systime-fix: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner d0ef504614 kernel-netlink: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:18 +02:00
Tobias Brunner b0ce4ef8db ha: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 35716df9bc dhcp: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner e72ab6a818 tnc-ifmap: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:18 +02:00
Tobias Brunner 68f35b48d8 eap-peap: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner e252e1b465 eap-ttls: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner cbedbf3ef1 eap-radius: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:18 +02:00
Tobias Brunner 2d3967cb4c eap-dynamic: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner 65dc1801cf eap-mschapv2: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner e0eece0465 vici: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner 86aa454c88 forecast: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner a7ea181f0d save-keys: Fix build with DEBUG_LEVEL < 0 2023-05-08 17:32:17 +02:00
Tobias Brunner 800cef35db mode-config: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner ab919c62da keymat_v1: Fix build with DEBUG_LEVEL < 3 2023-05-08 17:32:17 +02:00
Tobias Brunner 963398c2c3 ike-init: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 5e32be1bb5 ike-config: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 7a883c4b37 child-create: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 675082114c pubkey-authenticator: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 117e13e7f1 eap-authenticator: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 5408b50160 ike-sa: Fix build with DEBUG_LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 79d49ea05b message: Fix build with DEBUG__LEVEL < 1 2023-05-08 17:32:17 +02:00
Tobias Brunner 9b9464fdcd generator: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner 36490eefa3 backend-manager: Fix build with DEBUG_LEVEL < 3 2023-05-08 17:32:17 +02:00
Tobias Brunner 0841280cdd libimcv: Fix build with DEBUG_LEVEL < 3 2023-05-08 17:32:17 +02:00
Tobias Brunner 522bd965d1 libtpmtss: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner 4a28488a7e tnccs-20: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner a0ee0cbf90 tnccs-11: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner 874562fc1c radius-client: Fix build with DEBUG_LEVEL < 3 2023-05-08 17:32:17 +02:00
Tobias Brunner 6086029056 libtls: Fix build with DEBUG_LEVEL < 3 2023-05-08 17:32:17 +02:00
Tobias Brunner bb06b7a4bb simaka-manager: Fix counter in log message when getting quintuplets
Also fixes the build with DEBUG_LEVEL < 1.
2023-05-08 17:32:17 +02:00
Tobias Brunner 777d0ef7b0 esp-packet: Fix build with DEBUG_LEVEL < 3 2023-05-08 17:32:17 +02:00
Tobias Brunner 1b58e8c386 drbg: Fix build with DEBUG_LEVEL < 4 2023-05-08 17:32:17 +02:00
Tobias Brunner 94cbd6469a bliss: Fix build with DEBUG_LEVEL < 2 2023-05-08 17:32:17 +02:00
Tobias Brunner b158c210cd sqlite: Fix build with DEBUG_LEVEL < 2 2023-05-08 14:07:18 +02:00
Tobias Brunner a9a2c040ba pkcs7: Fix build with DEBUG_LEVEL < 2 2023-05-08 14:07:18 +02:00
Tobias Brunner 7ea431cf70 constraints: Fix build with DEBUG_LEVEL < 1 2023-05-08 14:07:18 +02:00
Tobias Brunner 984f8cbcde revocation: Fix build with DEBUG_LEVEL < 1 2023-05-08 14:07:18 +02:00
Tobias Brunner c0a281472f x509: Fix build with DEBUG_LEVEL < 2 for structures that ignore unknown critical extensions 2023-05-08 14:07:18 +02:00
Tobias Brunner a551f80e4f plugin-loader: Fix build with DEBUG_LEVEL < 3 2023-05-08 14:06:43 +02:00
Tobias Brunner 1b59031cc3 auth-cfg: Fix build with DEBUG_LEVEL < 1 2023-05-08 14:06:43 +02:00
Tobias Brunner 5a98f8f4ab certificate: Fix build with DEBUG_LEVEL < 1 2023-05-08 14:06:43 +02:00
Tobias Brunner b39105b5b4 credential-factory: Fix build with DEBUG_LEVEL < 1 2023-05-08 14:06:43 +02:00
Tobias Brunner f73d8699b3 crypto-tester: Fix build with DEBUG_LEVEL < 1 2023-05-08 14:06:43 +02:00
Tobias Brunner d7750dff9b asn1: Fix build with DEBUG_LEVEL < 2 2023-05-08 14:06:43 +02:00
Tobias Brunner 2d4a98d0d3 debug: Add macro to mark variables that are only used in DBG statements
Some variables that are only assigned to be used in DBG statements
will otherwise trigger a "set but not used" warning/error if DEBUG_LEVEL
is too low.
2023-05-08 11:51:10 +02:00
Tobias Brunner 7b453ae409 doxygen: Enable JS search engine 2023-05-04 16:35:51 +02:00
Tobias Brunner 8eaddbb805 doxygen: Fix syntax for some output parameters 2023-05-04 16:35:47 +02:00
Tobias Brunner 69914a2dc5 ikev1: Migrate CHILD_SAs when IKE_SA is reset during reauthentication
When we reset the initiator SPI, we have to migrate the adopted children
again so the correct IKE_SA can later be checked out.

Closes strongswan/strongswan#1663
2023-05-01 10:19:59 +02:00
Tobias Brunner 5e46e101a6 vici: Improve log messages for terminate/rekey() in case of combined filters
As long as any `child*` selector is received, only CHILD_SAs will be
terminated or rekeyed.  Any passed `ike*` selectors will only be used to
filter the IKE_SAs when looking for matching CHILD_SAs.  However, the
previous log messages seemed to indicate that IKE_SAs will also be
terminated/rekeyed.

References strongswan/strongswan#1655
2023-05-01 10:19:29 +02:00
Tobias Brunner 00a75e332f vici: Create default TCP socket on Windows in Python bindings
This uses the same value as VICI_DEFAULT_URI.

References strongswan/strongswan#1655
2023-05-01 10:19:29 +02:00
Tobias Brunner d12e6c9e55 charon-systemd: Add a log message when the daemon is starting
While there is a status message sent to systemd (can be seen e.g. in
systemctl status), the version etc. is currently not logged to the
journal, syslog or any log files.
2023-04-27 13:52:34 +02:00
Tobias Brunner 0bf061d737 leak-detective: Add on_exit(3) to whitelist
Seems to allocate some TLS value in newer glibc versions.
2023-04-27 13:52:34 +02:00
Tobias Brunner d96d15b588 controller: Add parameter for maximum log level to initiate/terminate_*()
Previously, the logger installed by the controller always announced
LEVEL_PRIVATE(4), which produced completely useless logging calls with
the common clients (vici/stroke) whose default log level is LEVEL_CTRL(1).
This can produce quite some overhead if there are e.g. a lot of concurrent
initiate() calls.
2023-04-27 13:52:34 +02:00
Tobias Brunner 77b9f3abb0 controller: Ignore log messages unrelated to IKE_SA affected by a command
Until we know which IKE_SA is affected by an initiate() or terminate_*()
command, unrelated log messages that don't have any IKE context (i.e.
the passed `ike_sa` is NULL) would previously get logged.
2023-04-27 13:52:34 +02:00
Tobias Brunner 30803f90eb watcher: Prevent busy wait if callback is active and other FDs have events
Exiting the loop previously could cause watcher to busy wait (i.e.
rebuild the array and call poll() repeatedly) until the active callback
was done.

Assume watcher observes two FDs 15 and 22, which are in the list in that
order.  FD 15 is signaled and its callback gets triggered.  The array of
FDs is rebuilt and does not include 15 anymore.  Now FD 22 is ready for
reading.  However, when enumerating all registered FDs, the loop previously
was exited when reaching FD 15 and seeing that it's active.  FD 22 was
never checked and the array was immediately rebuilt and poll() called.
If the callback for 15 took longer, this was repeated over and over.

This basically reverts d16d5a245f ("watcher: Avoid queueing multiple
watcher callbacks at the same time"), whose goal is quite unclear to me.
If it really wanted to allow only a single callback for all FDs, it didn't
achieve that as any FD before an active one would get notified and if
multiple FDs are ready concurrently, they'd all get triggered too.
Skipping entries with active callback makes sense as it avoids a lookup
in the FD array and subsequent revents checks.  But why would we need to
rebuild the array if we see such an entry?  Once the callback is done,
the watcher is notified and the array rebuilt anyway (also if any other
FD was ready and jobs get queued).
2023-04-27 13:52:34 +02:00
Tobias Brunner 53208b0ba4 watcher: Move debug log messages out of mutex
The list of FDs is recreated quite often (e.g. due to the kernel-netlink
event sockets) and if a logger depends on watcher_t in some way this
might cause conflicts if the mutex is held.
2023-04-27 13:52:34 +02:00
Tobias Brunner 705a20619f watcher: Make sure to re-activate the correct entry after a callback
Since the same FD may be added multiple times (e.g. with separate
callbacks for WATCHER_READ and WATCHER_WRITE), the previous check
might not have found the correct entry.  As the entry can't be removed
while in a callback, the pointer comparison is fine.
2023-04-27 13:52:34 +02:00
Tobias Brunner 34e9cdbcac watcher: Log when watched FDs are added, removed or updated 2023-04-27 13:52:27 +02:00
Tobias Brunner 0a806d9717 watcher: Only log number of managed FDs
Adding the internal notify FD might be confusing.
2023-04-27 13:45:32 +02:00
Tobias Brunner 7c657e78ff watcher: Avoid logging on level 1 while holding the mutex
This could be problematic in case loggers in some way rely on watcher_t
themselves.  This particular log message should rarely occur if at all,
but still avoid holding the mutex.
2023-04-27 13:45:32 +02:00