]> arthur.barton.de Git - ngircd-alex.git/commit
Optionally validate certificates on TLS server links bug120-ValidateServerCertificates
authorChristoph Biedl <ngircd.anoy@manchmal.in-ulm.de>
Wed, 5 Nov 2014 22:11:03 +0000 (23:11 +0100)
committerAlexander Barton <alex@barton.de>
Tue, 20 Jan 2015 22:36:59 +0000 (23:36 +0100)
commit41d0166ee38236f2a44bc5630cf1d561cc3c5343
tree7824e1c4f7c0d5d6d0a963966d523a5adbc6bbbb
parentc41f18e3f90512afcf38f42695c26708a1f34772
Optionally validate certificates on TLS server links

Bugzilla #120 is a *really* long-standing issue, and it's a very important
one: The peer's certificate is *not* validated on a server link, rendering
the security on such links useless since a man-in-the-middle attacker can
easily capture all the traffic and re-encode it without even being noticed.

More than five years ago, Florian Westphal wrote a patch to mitigate the
issue but it was never completed nor made it to master. So I took the
liberty to rebase the patch onto rel-22, update the configuration
variables to reflect the rel-19-ish configuration changes, and to fix a
common error in certificate validation: The certificate's CN must match
the host name the client connects to.

This is anything but ready for prime time. Please test in every
conceivable way, there are many. Especially CRL is completely untested. If
you have an SSL/TLS guru at hand, please seek his advice. There are many,
many pitfalls in this area and certainly some are still present. Host name
validation should not solely done against the CN, this is rather a last
resort [citation needed]. Also, an outgoing connection probably does not
work against SNI but certainly should.

Also to do: Minor code style cleanup, some more error checking.

Cheers,
    Christoph, beware of easter eggs

Based on
    From: Florian Westphal <fw@strlen.de>
    Date: Mon, 18 May 2009 00:29:02 +0200
    Subject: [PATCH] SSL/TLS: add initial certificate support to openssl backend
doc/sample-ngircd.conf.tmpl
man/ngircd.conf.5.tmpl
src/ngircd/conf.c
src/ngircd/conf.h
src/ngircd/conn-ssl.c
src/ngircd/conn.c
src/ngircd/conn.h
src/ngircd/irc-server.c