1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 15:34:47 +02:00
Commit Graph

184 Commits

Author SHA1 Message Date
Bram Matthys b96c1d2d1e Add autoconf/m4/pkg.m4 for now because otherwise my Ubuntu 26.04
uses their pkg.m4 which made pkg-config a hard requirement.
Such a hard requirement is probably fine later, but.. i don't want
to suddenly require that of users during UnrealIRCd 6 series.
2026-05-02 19:14:10 +02:00
Bram Matthys bd0dea4a0e Compile fixes for OpenSSL 4.0.0
This does two things:
* We now only compile src/openssl_hostname_validation.c on
  really old OpenSSL's. This was already unused/dead code
  for most OpenSSL's but we always compiled it in until now.
* Added 'const' to please OpenSSL 4.0.0 while not breaking
  OpenSSL 1.0.x. And yeah i'm happy to drop OpenSSL 1.0.x
  support real soon... but not this month yet.
2026-04-15 15:12:34 +02:00
Bram Matthys ba3fa1d7b6 Update GeoIP question in ./Config and use some magic to support both
geoip_classic and geoip_mmdb in modules.default.conf with Conditional
Config, a dynamic loadmodule line, and auto-updates.

Somewhere in a later version, probably 6.2.5, we will default to mmdb
for all cases.
2026-03-22 17:52:57 +01:00
Bram Matthys 172ace9750 geoip_maxmind: use our own mmdb implementation
This is mainly due to licensing. The libmaxminddb library uses the
Apache license, which meant if we would compile it in by default it
would effectively transform our "GPLv2 or later" to "GPLv3 or later".
Our implementation is ISC licensed, so we can include and enable it
by default and keep things at "GPLv2 or later". This is also why we
used geoip_classic in the first place as default and compiled in,
and not the mmdb variant.

The mmdb.c is based on the specification, using the Go implementation
as a reference during development (ISC licensed), initially implemented
with the help of Claude Opus 4.6. After that substantial changes were
made to make it match UnrealIRCd's style and to make things less error
prone: C style changes, allocation and zero termination of strings in
the library, auto-NULL in variadic functions so the caller cannot
forget NULL there (similar to our unreal_log/do_unreal_log), using
enums as the return type instead of int (similar to curl), adding
doxygen docs, etc.

This also means the old mmdb library dependency has been dropped,
including from configure/autoconf.

At the moment we still use the geoip classic library by default,
including those DB files. The idea is we will switch over sometime
later after this current new MMDB stuff has received more testing.

This also makes us more flexible, since .mmdb files have become the
de-facto standard for pretty much all geoip vendors.
2026-03-22 12:10:18 +01:00
Bram Matthys c4c082d0b7 And restore this LDFLAGS as well
This completes the fix from e1211adb3b
2026-03-04 11:01:05 +01:00
Bram Matthys 3e9ce77dc6 Hardening: build the last 2 remaining libs with hardening flags too
Library argon2 uses a makefile without configure, so works a bit different
And GeoIP i forgot because it was in a different autoconf file.
2026-02-23 07:17:02 +01:00
Bram Matthys 507061af46 Add tls-options::signature-algorithms for those who want to override the default.
We don't set it in UnrealIRCd at the moment, so this is just to override
the OpenSSL defaults at the moment. It is good to have this exposed, in
case some vulnerability is discovered or you need some flexibility in
tweaking this.
2025-09-21 13:55:24 +02:00
Bram Matthys d146da4a07 Change the cipherinfo, such as in [secure: TLSv1.3...] and in WHOIS.
Previously this was like:
TLSv1.3-TLS_CHACHA20_POLY1305_SHA256
It is now changed to be like:
TLSv1.3/X25519/TLS_CHACHA20_POLY1305_SHA256

So:
* Changed from '-' to '/' because sometimes the cipher(suite)
  contains a hyphen (TLSv1.2 and earlier)
* Show the key exchange "group" in the middle, such as X25519
  for the usual non-PQC case and X25519MLKEM768 for hybrid group
  with PQC.
* The group is shown in OpenSSL 3.0.0+ (and obviously you need
  OpenSSL 3.5.0 to ever see X25519MLKEM768 there, but that is
  something different)
2025-07-24 15:32:00 +02:00
Bram Matthys 0729382ba2 Rename ::ecdh-curves to groups and add X25519MLKEM768 to group list.
Post-quantum cryptography (PQC). Release notes will follow later.
2025-07-24 14:47:49 +02:00
Bram Matthys 17e2a17e81 Remove library before 'make install'. Possibly fix a bug.
Actually I presume 'make install' properly removes the file first
before installing a new one, but.. not entirely sure. Better safe
than sorry.

We have had new reports of someone who had the original UnrealIRCd
crash while building the new UnrealIRCd. Similar to what we had
a few years ago, which was caused by a 'cp' instead of an rm+cp.
This because with simple cp the existing file contents is changed
and the processes holding the .so file open (usually mmapped)
suddenly have the new .so file loaded in effect, which causes a
crash whenever next function is called in that library.
We now rm explicit before 'make install' so running processes
simply have that fd point to a deleted file, which is fine.
2023-04-19 18:52:59 +02:00
Bram Matthys 748f381d81 Use X509_check_host() in OpenSSL 1.1.0 and later and don't use it
for OpenSSL 1.0.2 anymore, 1.0.2 will use the fallback version.
This changes the include file.

(OpenSSL 1.0.2 is out of support since Jan 1 2020 so one may wonder
 why care at all, but i'm trying not to break that during minor
 UnrealIRCd releases)
2023-03-25 12:18:44 +01:00
Bram Matthys 83d2498ec8 Add configure check for and use X509_check_host() instead of
always using our own implementation (that is not really ours,
by the way).
2023-03-25 08:31:25 +01:00
Bram Matthys bb0a50d839 ** UnrealIRCd 6.0.5-rc1 ** 2022-12-07 08:53:44 +01:00
Bram Matthys a71e205185 Lower library version requirement if you choose to use libmaxminddb,
from 1.6.0 to 1.4.3. Suggested by robert-scheck in
https://github.com/unrealircd/unrealircd/pull/183
2021-11-28 08:03:10 +01:00
k4be f665206c4f Don't build libmaxminddb by default, and fail when it's enabled but not present 2021-11-06 19:11:57 +01:00
Bram Matthys 0b6336c5f9 Update config.guess and config.sub from 2015-03-04 to 2021-06-03 2021-09-24 18:20:13 +02:00
Bram Matthys 7d75b38c26 OpenSSL: Check for lib64
Mostly due to openssl 3 beta if you custom build to a specific dir.
2021-09-03 07:54:25 +02:00
k4be 84527768ce Add missing libmaxminddb remark in configure output 2021-08-29 11:20:33 +02:00
k4be 9c3d5dffb0 Add libmaxminddb support 2021-08-27 14:49:13 +02:00
k4be b15ddd760a Fix geoip library build and geoip_classic loading 2021-08-26 11:25:26 +02:00
Bram Matthys 2c7d2c8f86 Split url.c into url_curl.c (curl implementation) and url_unreal
(the new fallback https-only implementation).

./configure will set URL= to either url_curl.o or url_unreal.o
depending on whether curl is enabled or not.

The 3 functions that both implementations had in common are now in
src/misc.c: url_is_valid(), displayurl() and url_getfilename().
2021-08-21 08:47:38 +02:00
Bram Matthys 685e0ee073 In ConfigItem_include include->url now always exists, and src/url.c is now
always compiled in, both regardless of cURL support or not.
Obviously the cURL functions are not available without cURL and there
are now some #ifdef USE_LIBCURL in url.c

This also fixes the current build to work without cURL
2021-08-18 12:27:13 +02:00
Bram Matthys 8cdbc3ae86 Don't build geoip_classic without --enable-geoip-classic=yes.
([I... hate... M4!])
2021-08-17 14:37:48 +02:00
Bram Matthys ed7bf1daf5 Bundle with GeoIP classic library and add geoip_classic placeholder.
This library we can safely bundle because it is GPLv2.
2021-08-17 14:11:36 +02:00
Bram Matthys 75efe02040 And add config check for X509_get0_notAfter().
For our Ubuntu 16 friends.
2020-10-11 15:56:06 +02:00
Bram Matthys b3510c5da8 Fix for previous commit with OpenSSL <1.1.0 (Debian 8, Ubuntu 16, ..)
Thank you BuildBot.

This means on older OpenSSL's we are not going to have certificate
expiry checks. Those OpenSSL versions were deprecated by the OpenSSL
team itself, so yeah then you will miss out a few things.
2020-10-11 15:39:27 +02:00
Bram Matthys f419a61f94 Ubuntu 20.04 needs this change in order to still allow you to enable
TLSv1.0 or TLSv1.1. Otherwise it is impossible to enable by the application.

We are still going to turn off TLSv1.0 and TLSv1.1 by the end of this year
by default. Ubuntu 20.04 is just a couple of months too early. See also
the various browsers who postponed disabling TLSv1.0/TLSv1.1.

Also, regardless of the above, we want the admins running the IRC server
be able to control this and not having such a breaking change be dependant
on some distro default settings.
2020-04-18 12:40:45 +02:00
i 876758b73e Fix Custom OpenSSL binary path was ignored. 2019-07-11 14:20:01 +03:00
i a601f565e1 Do not override all libs. 2019-07-11 03:06:28 +03:00
i 4feba3edd5 Check whether linking with OpenSSL functions requires -ldl or -lpthread or both 2019-07-11 02:33:11 +03:00
Bram Matthys 79bd78c0f3 Make it so UnrealIRCd has full control over the SSL/TLS versions in use
and not just the operating system.
This makes us use SSL_CTX_set_min_proto_version(), which unfortunately is
a less fine-grained control for disabling specific SSL/TLS versions.
However, after that we use SSL_CTX_set_options with SSL_OP_NO_xxx.
The latter is deprecated though. Will revisit this change before U5 release..
2019-07-07 10:22:29 +02:00
Bram Matthys 81e2099f7b We already checked for the openssl library but if the openssl binary was
not found then this was not treated as a fatal error. Now it is, since
you will fail later in the installation process when a certificate file
is being made (resulting in mysterious 'req: command not found' errors).
Also, improve the error message both for the missing openssl library
and openssl binary case.
2019-04-15 18:56:11 +02:00
Bram Matthys fa9bdcd7df Move detection of SSL_CTX_set1_curves_list to autoconf (CHECK_SSL_CTX_SET1_CURVES_LIST) 2018-04-27 19:27:19 +02:00
Bram Matthys c342b432d1 OpenSSL detection: also check /usr/local/opt/openssl 2018-04-22 20:01:50 +02:00
Bram Matthys 21d0af6e88 Fix protection for system curl without system cares. Was kicking in for local
curl due to use of an old path. At least the new autobuild notified me *just*
in time before I put 4.0.8.4 online.
2016-11-18 15:31:24 +01:00
Bram Matthys eabf436c2a Use has_system_cares (=reliable result) rather than with_system_cares (=merely requested). 2016-10-21 18:13:04 +02:00
Bram Matthys 8859cca6b2 Remove old cares/curl hack. 2016-10-21 17:51:08 +02:00
Bram Matthys 770bb6ac98 Forgot to commit these files, they belong to the hardening patch. 2016-10-21 17:24:13 +02:00
Bram Matthys d51d23e5cb Until now we refused a build with system-curl without --with-system-cares,
this on the basis that cURL may be using one c-ares version and UnrealIRCd
another c-ares version, something which obviously can lead to failure due
to ABI differences..
Many years have passed since then and cURL is now frequently build with
AsynchDNS support but without the help of c-ares (eg: on Debian). We can
support this configuration without requiring --with-system-cares since
c-ares is not used by cURL and there's no conflict.
2016-10-21 17:15:37 +02:00
Bram Matthys bb56b6acf2 config.sub & config.guess moved to autoconf/ in previous commit.
Now actually update them (from 2001-06-08 to 2015-03-08, hmm!)
2015-06-01 21:18:23 +02:00
Bram Matthys f81d22076c Add configure check and compile with pthreads 2015-06-01 21:16:44 +02:00
Bram Matthys 547b2d69d0 Build with PCRE2 (not used yet). Enhance SSL build error (may need more fixing). 2015-05-31 21:47:11 +02:00
William Pitcock c41ca43145 - Remove ziplinks support, patch from FalconKirtaran. (#4189) 2013-05-16 06:36:13 +00:00
Nathan Phillip Brink 0ff0b04a56 - Fix compilation issues with bundled tre and ./curlinstall-ed curl caused by over-generic regexes. Reported by warg. 2011-11-12 06:58:34 +00:00
Nathan Phillip Brink 1157b77e5e Add .hgignore, removing replaced .cvsignore files. 2011-07-13 13:11:57 -04:00
binki df37d83f8b - Fix invalid use of 'wc -l' when detecting the AsynchDNS feature of
libcurl which breaks compilation on FreeBSD; instead use 'grep
  -q'. Reported by Jobe (#3981), solution proposed by satmd.
2010-12-22 16:02:39 +00:00
Bram Matthys 85904c2277 - Fix the detection for curl-without-c-ares a little (#0003940). ** fun.. autoconf 2.61** 2010-07-22 09:59:36 +00:00
binki 7a3bf15558 - Now define _SOLARIS, USE_LIBCURL, and ZIP_LINKS in setup.h instead of the Makefiles. This means better automatic rebuilds if the latter settings change. 2010-07-20 16:09:10 +00:00
binki b2e4cf82f8 - Support compiling with a bundled c-ares again, the hacky way. (#3931) 2010-07-16 13:14:44 +00:00
binki 7dbf154d04 - Move configure.ac to the project's root.
- Separate m4 macros into *.m4 files (it is much easier to run aclocal now).
- Remove unused DOMAINNAME macro and --with-hostname= options as the DOMAINNAME macro isn't used anywheres and its use shouldn't be encouraged.
- autogen.sh to bootstrap the buildsystem. We now maintain setup.h with autoheader.
- --disable-blah now does the opposite of --enable-blah. The same for --with-blah and --without-blah. (This makes Gentoo users happier).
2010-07-08 02:51:43 +00:00