1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-12-12 01:40:27 +00:00
Commit Graph

3655 Commits

Author SHA1 Message Date
Alexander Barton
4b1eb0e3ee ngircd.service: Redirect stdout and stderr to the journal 2024-04-11 22:09:52 +02:00
Alexander Barton
ff0a9b9c2a Prepare documentation for ngIRCd 27~rc1 2024-04-06 00:13:24 +02:00
Alexander Barton
791778d7b6 Ping the service manager and set a status message
Periodically "ping" the service manager (every 3 seconds) and set a
status message showing connection statistics.

This enables using the systemd(8) watchdog functionality for the
"ngircd.service" unit.
2024-04-06 00:13:13 +02:00
Alexander Barton
e4873b4d63 Add support for the "sd_notify" protocol
This allows the "ngircd.service" systemd(8) unit to use the "notify"
service type, which allows for better status tracking by the service
manager.
2024-04-06 00:12:58 +02:00
Alexander Barton
3e535a2955 Add ".trunk" to .gitignore file 2024-04-05 23:16:07 +02:00
Alexander Barton
a8a37b681e Test suite: wait for ERROR message on QUIT
Wait for the "ERROR :Closing connection" message sent by ngIRCd when
handling the QUIT command, do not wait for "Connection closed" which is
actually output by the telnet(1) command and is implementation
dependant! For example, on Haiku OS, this is not always(!) echoed (the
command seems to hang sometimes?) which results in unpredictable
failures in the test suite ...
2024-04-05 23:16:07 +02:00
Alexander Barton
22a8744476 Test suite: simplify and enhance getpid.sh
- Try to only search for processes of the current user.
- Prefer using pgrep (in addition to pidof) when available.
- Streamline system overrides.
- Get rid of HEAD_FLAGS: all systems so far support "-1".
- Use "ps -o pid,comm" as the default, which is POSIX.1.
- Use "sort -r" to hopefully get the newest (=highest) PID, which is the
  case on older systems not using randomized PIDs at least.
2024-04-05 23:16:07 +02:00
Alexander Barton
7e78c293a9 Test suite: clean up scripts
- Reformat code.
- Cleanup some glitches, streamline scripts ...
- Enable "set -u": Error on unset variables.
- Detect "$srcdir" in prep-server3 script, too.
2024-04-05 23:16:07 +02:00
Alexander Barton
8d6f2c2820 Revert "testsuite: Pass -nameopt to openssl s_client."
Although this is a nice looking solution, it is not that portable: for
example, the "openssl s_client" command of LibreSSL 3.8.2 on OpenBSD 7.4
does not support it.

So let's revert back to the "uglier" but working variant ...

This reverts commit bdb55fb4b3.
2024-04-02 22:06:38 +02:00
Alexander Barton
ddba126307 Fix quoting in code examples in doc/Container.md 2024-03-31 11:19:48 +02:00
Alexander Barton
bbcaf628f4 Change leftover GnuTLS "slot handling" messages to debug level
This completes commit f96966a6.
2024-03-31 11:19:48 +02:00
Alexander Barton
a0d491a09f Add feature info to Debian package description 2024-03-31 11:19:48 +02:00
Alexander Barton
3497925000 Try to set file descriptor limit to its maximum and show info on startup
The number of possible parallel connections is limited by the process
file descriptor limit (among other things). Therefore try to upgrade the
current "soft" limit to its "hard" maximum (but limit it to 100000), and
show an information or even warning, wenn still less than the configured
"MaxConnections" setting.

Please note that ngIRCd and its linked libraries (like PAM) need file
descriptors not only for incoming and outgoing IRC connections, but for
reading files and inter-process communication, too! Therefore the actual
connection limit is _less_ than the file descriptor limit!

This introduces the new MAX_FD_LIMIT (100000) #define.
2024-03-31 11:19:48 +02:00
Alexander Barton
24e822cff2 ngircd.8: Update for the now always available debug-mode 2024-03-31 11:19:48 +02:00
Alexander Barton
71a2fe1895 Update and fix logcheck(8) rules 2024-03-31 11:19:48 +02:00
Christoph Biedl
b2c9049af2 S2S-SSL/GnuTLS: Enable CRL verification 2024-03-31 11:19:48 +02:00
Alexander Barton
b9d6a2f49c S2S-TLS: Fix "make check" in separate build directory 2024-03-23 20:23:32 +01:00
Alexander Barton
6b27eabf5b S2S-TLS: Add notice to INSTALL.md 2024-03-23 20:23:29 +01:00
Alexander Barton
b826fad158 S2S-TLS: Convert SSL.txt to Markdown and update information given
No longer describe creating self-signed certificates or using "stunnel",
as both is not recommended.
2024-03-23 20:19:01 +01:00
Alexander Barton
8cef3ce42c S2S-TLS/GnuTLS: Fix handling of connections without peer certificates 2024-03-23 20:19:01 +01:00
Alexander Barton
180e2ec135 S2S-TLS: Verify the TLS certificates by default
This is already mentioned as the default in the manual page and the
sample configuration file, but was actually not enabled in the code!
2024-03-23 20:19:01 +01:00
Alexander Barton
663972c88d S2S-TLS/GnuTLS: Streamline logging 2024-03-23 20:19:01 +01:00
Alexander Barton
509ff60326 S2S-TLS/GnuTLS: Fix handling of certificate information for incoming connections
Show proper certificate information for incoming connections, too, and
not "peer did not present a certificate", regardless if the client sent
a certificate or not.

This change is for GnuTLS and similar to what was implemented in commit
for OpenSSL in "S2S-TLS/OpenSSL: Fix handling of certificate information
for incoming connections".
2024-03-23 20:19:01 +01:00
Alexander Barton
0e176b5570 S2S-TLS/GnuTLS: Update SSL code for GnuTLS certificate reloading
Without this, the S2S-TLS-Patch not even compiles with GnuTLS because
of the "new" GnuTLS certificate reload support implemented in commit
eead4a63 ("x509_cred_slot").
2024-03-23 20:19:01 +01:00
Alexander Barton
c8589e9890 S2S-TLS: MAX_CERT_CHAIN_LENGTH is only used by OpenSSL 2024-03-23 20:19:01 +01:00
Alexander Barton
58ee4df2ae S2S-TLS: Fix formatting and sort new SSL options in ngircd.conf manual page 2024-03-23 20:19:01 +01:00
Alexander Barton
02bb99b024 S2S-TLS/OpenSSL: Streamline logging
This includes simplifying cb_connserver_login_ssl() a bit, we do not
have to code for invalid state which was ruled out by an assert() and
therefore can get rid of the goto altogether (and don't log the same
error twice with different messages).
2024-03-23 20:19:01 +01:00
Alexander Barton
3db3b47fc7 S2S-TLS/OpenSSL: Postpone verification of TLS session right before server handshake
The verify callback in OpenSSL is called pretty early, and at that time
it is not possible yet to check which connection it belongs to, and some
connections may have relaxed requirements.

So always return success in the Verify_openssl() callback, and postpone
validation of the TLS session until starting the server handshake in
cb_connserver_login_ssl(), when we know which server this connection
belongs to and which options (like "SSLVerify") are in effect.

The code doing this was already present in cb_connserver_login_ssl(),
but this patch adds a more prominent comment to the function.
2024-03-23 20:19:01 +01:00
Alexander Barton
679505aab9 S2S-TLS/OpenSSL: Fix handling of certificate information for incoming connections
Show proper certificate information for incoming connections, too, and
not "peer did not present a certificate", regardless if the client sent
a certificate or not.

And free the client certificate structure "peer_cert" on incoming
connections as well!
2024-03-23 20:19:01 +01:00
Alexander Barton
08647ab1e7 S2S-TLS/OpenSSL: Set the verification flags only once
Set the verification flags in the ConnSSL_SetVerifyProperties_openssl
function only, don't override them in ConnSSL_InitLibrary() afterwards.

No functional changes, now ConnSSL_SetVerifyProperties_openssl() sets
exactly the parameters which ConnSSL_InitLibrary() always overwrote ...
2024-03-23 20:19:01 +01:00
Alexander Barton
84b019b11f S2S-TLS/OpenSSL: Always setup host name verification
Setup host name verification even when the "SSLVerify" option is
disabled, because even then the peer can present a valid certificate and
validation would always(!) fail because of the missing host name
verification setup.
2024-03-23 20:19:01 +01:00
Alexander Barton
8f8bef9fae S2S-TLS: Remove leftover debug messages 2024-03-23 20:19:01 +01:00
Alexander Barton
5ca567a18c S2S-TLS: Add missing CAFile and CRLFile options to "configtest" output 2024-03-23 20:19:01 +01:00
Christoph Biedl
817937b218 Support for server certificate validation on server links [S2S-TLS]
This patch provides code to validate the server certificate in
server links, defeating nasty man-in-the-middle attacks on server
links.

Features:

- Check whether the certificate is signed by a trusted certificate
  authority (CA).
- Check the host name, including wildcard certificates and Subject
  Alternative Names.
- Optionally check against a certificate revocation list (CRL).
- Implementation for both OpenSSL and GnuTLS linkage.

Left for another day:

- Parameterize the TLS parameter of an outbound connection. Currently,
  it's hardcoded to disable all versions before TLSv1.1.
- Using certificate as CA-certificate. They work for GnuTLS only but
  perhaps this should rather raise an error there, too.
- Optional OCSP checking.
- Checking client certificates. Code is there but this first needs some
  consideration about the use cases. This could replace all other
  authentication methods, for both client-server and server-server
  connections.

This patch is based on a patch by Florian Westphal from 2009, which
implemented this for OpenSSL only:

  From: Florian Westphal <fw@strlen.de>
  Date: Mon, 18 May 2009 00:29:02 +0200
  Subject: SSL/TLS: Add initial certificate support to OpenSSL backend

Commit message modified by Alex Barton.

Closes #120, "Server links using TLS/SSL need certificate validation".
Supersedes PR #8, "Options for verifying and requiring SSL client
certificates", which had (incomplete?) code for OpenSSL, no GnuTLS.
2024-03-23 20:19:01 +01:00
Alexander Barton
339ad77b62 Streamline README.md & INSTALL.md files
- Tweak some paragraphs and bring others more in line with texts on the
  homepage ...
- Try to not duplicate information:
  - Configuration is explained in doc/QuickStart.md;
  - command line parameters are already better described in the
    ngircd(8) manual page.
- Move all pointers to documentation to the README.md file, which is
  directly shown in GitHub when browsing the repository, for example.
2024-03-23 20:15:16 +01:00
Alexander Barton
c8798fcec0 Bring manual page more in line with README.md and homepage 2024-03-23 19:58:23 +01:00
Alexander Barton
c1c0bca0e2 QuickStart.md: Tweak the text a bit ... 2024-03-17 22:42:19 +01:00
Alexander Barton
7efda4168f INSTALL.md: Add info for macOS systems 2024-03-17 22:42:19 +01:00
Alexander Barton
1118b0e77c METATADA: Fix unsetting "cloakhost"
Correctly re-generate the "cloaked hostname" when removing the
"cloakhost" using an empty string by passing down NULL instead of the
empty string, which results in protocol violations (for example on
WHOIS).
2024-03-17 22:42:19 +01:00
Alexander Barton
5fd195a2cd Update the "rpm" make target to use rpmbuild(8) 2024-03-17 22:42:19 +01:00
Alexander Barton
934f3a0d88 Add a Dockerfile and documentation to the project 2024-03-17 22:42:15 +01:00
Alexander Barton
c0b8b94550 Streamline the "testsuite" and "srcdoc" make targets 2024-02-10 00:22:33 +01:00
Alexander Barton
ea7f4e07b7 Remove outdated, unsupported and broken support for splint(1) 2024-02-10 00:22:33 +01:00
Alexander Barton
f3961ec6ab Git: Streamline and simplify .gitignore file 2024-02-10 00:22:33 +01:00
Alexander Barton
b3513ee159 Convert contrib/README to Markdown 2024-02-10 00:22:33 +01:00
Alexander Barton
39eccffa32 Doxygen: Update the footer links 2024-02-05 14:03:42 +01:00
Sebastian Andrzej Siewior
bdb55fb4b3 testsuite: Pass -nameopt to openssl s_client.
The default value for the -nameopt option changed in OpenSSL 3.2 from
`oneline' to `utf8'. The `oneline' option also included a space around
the fields which is not the case for `utf8'. This means that
	CN = my.first.domain.tld

changed to

	CN=my.first.domain.tld

and is now longer recognized, leading to test failure.
This can be fixed by either going back to `oneline' or keeping `utf8'
and adding additionally `space_eq'. Anoter way would be to teach the
expect that the space is optional.

Add explicit -nameopt option with `utf8,space_eq' which is understood by
by OpenSSL 3.2 and earlier to make explicit. Remove the wildcard.

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
2024-02-05 13:39:15 +01:00
Alexander Barton
79aefe43dd Debian package: Enable the [SSL] section
This makes sense because the package is build with SSL support enabled,
and we set and enable "CAFile" in commit ae9cfade -- which results in an
error when this is not in an enabled(!) [SSL] section ...
2024-01-23 22:42:57 +01:00
Alexander Barton
a1c2ac5d5b 2nd attempt to always show the correct config file name ...
But we are getting there!
2024-01-23 22:21:33 +01:00
Alexander Barton
951c8b84ab Testsuite: Test for the openssl command before using it
And skip the tests calling it instead of failing!
2024-01-23 14:43:06 +01:00