solanum-vs-hackint-and-char.../ircd
jailbird777 8e9a741832 OpenSSL 3.0 compatibility
Edited by @aaronmdjones:

- Correct some data types and casts

- Minor style fixups (e.g. we put * on the variable name not the type)

- librb/src/openssl.c:

  - Defer call of BIO_free(3ssl) to the end of the conditional block
    to avoid having calls to it in multiple paths

  - Check the return value of SSL_CTX_set0_tmp_dh_pkey(3ssl) because if
    it fails then we must use EVP_PKEY_free(3ssl) to avoid a memory leak

    This could fail if, for example, the user supplied DSA parameters
    in the DH parameters file instead.

- ircd/newconf.c:

  - Check whether OSSL_DECODER_CTX_new_for_pkey(3ssl) was able to parse
    the given CHALLANGE public key as a valid RSA public key, and then
    check whether OSSL_DECODER_from_bio(3ssl) actually loads it
    successfully

- ircd/s_newconf.c:

  - Use EVP_PKEY_free(3ssl) instead of OPENSSL_free(3ssl) on EVP_PKEY
    pointers; this will avoid inadvertent memory leaks if the EVP_PKEY
    structure contains any dynamically-allocated child members

- modules/m_challenge.c:

  - Unconditionally use EVP(3ssl) to generate the SHA-1 digest of the
    random challenge; this API has been around for a very long time and
    is available in all supported versions of OpenSSL

  - Add lots of error checking to all steps of the process

Tested against 1.1.1 and 3.0; both with missing and provided DH parameters
(which works as you'd expect; the server will not negotiate a DHE cipher
without them), and CHALLENGE, including missing keys or keys of the wrong
type (e.g. when you supply an EdDSA key instead of an RSA key).

This does break compatibility with OpenSSL 1.1.0 and below, which are now
all end-of-life and unsupported anyway.

Closes #357
2022-08-25 00:36:47 +00:00
..
authproc.c Remove Windows support 2021-07-30 14:17:47 -04:00
bandbi.c Remove Windows support 2021-07-30 14:17:47 -04:00
cache.c Remove Windows support 2021-07-30 14:17:47 -04:00
capability.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
channel.c channel: always send chm_hidden modes to servers 2021-12-04 20:27:59 +00:00
chmode.c EBMASK capab, to burst BMASK metadata (#354) 2022-08-20 01:35:54 +01:00
class.c class: remove unused macros 2016-06-01 20:54:12 +00:00
client.c Cast time_t to long long when printing 2022-07-01 03:43:36 -04:00
dns.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
extban.c Innovation by sed 2020-10-15 15:52:41 +01:00
getopt.c YESNO options are of type bool, not int 2018-03-23 16:46:38 +00:00
hash.c make more snotes L_NETWIDE 2020-11-08 14:30:41 -05:00
hook.c Track and inform modules of privset changes 2021-03-01 15:45:03 +00:00
hostmask.c Add description parameter to auth blocks (#327) 2022-04-14 14:39:45 -07:00
ircd.c Illumos fixes 2022-06-29 20:28:11 -04:00
ircd_lexer.l Remove Windows support 2021-07-30 14:17:47 -04:00
ircd_parser.y Resolve shfit/reduce conflict in timespec production (#54) 2020-11-07 19:54:25 -08:00
ircd_signal.c Remove Windows support 2021-07-30 14:17:47 -04:00
listener.c ircd/listener: return a TLS record layer alert to D-Lined TLS clients 2022-06-30 18:55:41 -04:00
logger.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
main.c Innovation by sed 2020-10-15 15:52:41 +01:00
Makefile.am Remove Windows support 2021-07-30 14:17:47 -04:00
match.c matchset_for_client: fix off-by-one error 2021-06-08 22:16:41 +01:00
modules.c Remove Windows support 2021-07-30 14:17:47 -04:00
monitor.c ircd: send tags on every message 2017-08-06 16:21:29 +01:00
msgbuf.c msgbuf: use only relevant caps for the cache key 2021-06-13 00:47:01 +01:00
newconf.c OpenSSL 3.0 compatibility 2022-08-25 00:36:47 +00:00
operhash.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
packet.c ircd/packet.c: make function definition consistent with declaration (#301) 2021-11-30 11:50:30 -08:00
parse.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
privilege.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
ratelimit.c Innovation by sed 2020-10-15 15:52:41 +01:00
reject.c Normalize snprintf size to use sizeof where possible 2022-06-24 01:42:08 -04:00
restart.c Remove Windows support 2021-07-30 14:17:47 -04:00
s_conf.c Add description parameter to auth blocks (#327) 2022-04-14 14:39:45 -07:00
s_newconf.c OpenSSL 3.0 compatibility 2022-08-25 00:36:47 +00:00
s_serv.c EBMASK capab, to burst BMASK metadata (#354) 2022-08-20 01:35:54 +01:00
s_user.c Normalize snprintf size to use sizeof where possible 2022-06-24 01:42:08 -04:00
scache.c A missing colon to RPL_MAP recently split (#131) 2021-03-16 17:51:42 -07:00
send.c send: fix infinite recursion in _send_linebuf 2020-11-28 20:08:46 -05:00
snomask.c add SNO_BANNED, snote for it on client k/x-line rejection (#242) 2021-08-11 17:08:31 +01:00
sslproc.c Remove Windows support 2021-07-30 14:17:47 -04:00
substitution.c Mailmap and copyright update for Ariadne 2021-06-01 12:40:02 -04:00
supported.c Remove the CLIENTVER 005 token. (#161) 2021-05-25 11:08:59 +01:00
tgchange.c Refactor common channel iteration 2020-10-19 20:15:26 +01:00
version.c.SH Normalize generation for reproducible builds 2022-05-29 10:16:00 +01:00
whowas.c whowas.c: store account name in whowas (#323) 2022-04-01 14:58:43 -07:00
wsproc.c Remove Windows support 2021-07-30 14:17:47 -04:00