🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87944

INN 2.6.3 with Debian 10 "Buster"

#87944
From: Michael Bäuerle
Date: Fri, 26 Apr 2019 15:42
60 lines
3725 bytes
There is another TLS related issue with INN 2.6.3 if the "security
level" feature of OpenSSL 1.1 is used: Negotiations for ciphersuites
using DHE key exchange fail if the security level is set to something
beyond 1. The upcoming Debian 10 seems to do this by default:
<https://wiki.debian.org/ContinuousIntegration/TriagingTips/openssl-1.1.1>

I have tested this with Emil Schuster. His server responded like this:
| 
| $ openssl s_client -connect wieslauf.sub.de:nntps -cipher "DHE-RSA-AES256-GCM-SHA384"
| [...]
| 4157901080:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:s3_pkt.c:1498:SSL alert number 40

Looking at the handshake with wireshark showed the server accepting the
ciphersuite (Code 0x00, 0x9F) as expected in its "Server Hello" Message.
But then there is no "Server Key exchange" Message and instead the fatal
error above.

We tracked down the problem to the function tmp_dh_cb() defined in
"inn-2.6.3/nnrpd/tlc.c". This function is installed as callback for
OpenSSL via SSL_CTX_set_tmp_dh_callback(CTX, tmp_dh_cb) to obtain the
FFDHE group for the key exchange. OpenSSL calls this function with
keylength==1024, but for the security level 2 this is too weak:
<https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_security_level.html>
(At least 2048 would be required)

Because INN doesn't allow to configure the FFDHE group manually, we have
patched the function tmp_dh_cb() to always return the 4096 Bit group
that is compiled into INN:
------------------------------------------------------------------------ 
static DH *
tmp_dh_cb(SSL *s UNUSED, int export UNUSED, int keylength UNUSED)
{
	static DH *dh4096 = NULL;

	if (dh4096 == NULL)
		dh4096 = load_dh_buffer(file_dh4096, sizeof file_dh4096);

	return dh4096;
}
------------------------------------------------------------------------
Such behaviour is allowed and recommended by OpenSSL in the man page:
<https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_tmp_dh_callback.html>
| 
| Previous versions of the callback used is_export and keylength
| parameters to control parameter generation for export and non-export
| cipher suites. Modern servers that do not support export cipher suites
| are advised to either use SSL_CTX_set_tmp_dh() or alternatively, use
| the callback but ignore keylength and is_export and simply supply at
| least 2048-bit parameters in the callback.

With the patch above things are now working again.
A comment of the current INN code says:
| 
| **  FIXME:  support user-specified files, to eliminate risk of
| **  "small group" attacks.

This would be another way to provide a FFDHE group that is strong enough
for a desired security level beyond 1.

Technical Details
Message-ID: <AABcwybztOoAAACo.A1.flnews@WStation5.stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <AABcwybztOoAAACo.A1.flnews@WStation5.stz-e.de>
Subject: INN 2.6.3 with Debian 10 "Buster"
Date: Fri, 26 Apr 2019 15:42:43 +0000
From: Michael Bäuerle <michael.baeuerle@stz-e.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Lines: 58
Reply-To: Michael Bäuerle <michael.baeuerle@gmx.net>
Mime-Version: 1.0
X-Trace: individual.net RNg2FLMZVPcNXBr/OiNCfgiAQSD43MxQhITNUGwTcNaHNA61P4
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:KXRbVAB70sYiOFV5dICndjmjVq8= sha256:y3ICFUk8m9gIfHWyxI1t7QckUkMFIGIiwhX7Blyuzbk= sha1:Fh5EO30hljTomOM25mTVhbMYcyM=
Injection-Date: Fri, 26 Apr 2019 15:42:43 -0000
User-Agent: flnews/0.17pre3 (for NetBSD)
X-Received-Bytes: 3623
X-Received-Body-CRC: 1570293791