Skip to content

Commit

Permalink
DH parameters update, new values & default
Browse files Browse the repository at this point in the history
* Add three new Exim-specific DH parameter constants; state provenance,
  but no way for others to verify; this is a signed commit, which is
  about as much as we can do for the truly paranoid: provide an audit
  trail.
* Add the RFC 7919 DH primes
  + No TLS feature negotiation, per 7919, but the DH primes can be used
    if folks so choose
* Fixed broken format string in util/gen_pkcs3.c
* Tried to make gen_pkcs3.c support q values.
  + Turns out, q doesn't affect the PEM and that's not a mistake in my
    initialisation; I've checked with a cryptographer, we're losing some
    server-side optimizations but not any security properties for our
    scenario.

Fixes: 1895
  • Loading branch information
Phil Pennock committed Oct 8, 2016
1 parent ae5afa6 commit 317e40a
Show file tree
Hide file tree
Showing 7 changed files with 574 additions and 16 deletions.
38 changes: 31 additions & 7 deletions doc/doc-docbook/spec.xfpt
Original file line number Diff line number Diff line change
Expand Up @@ -17034,7 +17034,15 @@ larger prime than requested.
The value of this option is expanded and indicates the source of DH parameters
to be used by Exim.

If it is a filename starting with a &`/`&, then it names a file from which DH
.new
&*Note: The Exim Maintainers strongly recommend using a filename with site-generated
local DH parameters*&, which has been supported across all versions of Exim. The
other specific constants available are a fallback so that even when
"unconfigured", Exim can offer Perfect Forward Secrecy in older ciphersuites in TLS.
.wen

If &%tls_dhparam%& is a filename starting with a &`/`&,
then it names a file from which DH
parameters should be loaded. If the file exists, it should hold a PEM-encoded
PKCS#3 representation of the DH prime. If the file does not exist, for
OpenSSL it is an error. For GnuTLS, Exim will attempt to create the file and
Expand All @@ -17050,23 +17058,39 @@ Exim will attempt to load a file from inside the spool directory. If the file
does not exist, Exim will attempt to create it.
See section &<<SECTgnutlsparam>>& for further details.

.new
If Exim is using OpenSSL and this option is empty or unset, then Exim will load
a default DH prime; the default is the 2048 bit prime described in section
a default DH prime; the default is Exim-specific but lacks verifiable provenance.

In older versions of Exim the default was the 2048 bit prime described in section
2.2 of RFC 5114, "2048-bit MODP Group with 224-bit Prime Order Subgroup", which
in IKE is assigned number 23.

Otherwise, the option must expand to the name used by Exim for any of a number
of DH primes specified in RFC 2409, RFC 3526 and RFC 5114. As names, Exim uses
"ike" followed by the number used by IKE, or "default" which corresponds to
"ike23".
of DH primes specified in RFC 2409, RFC 3526, RFC 5114, RFC 7919, or from other
sources. As names, Exim uses a standard specified name, else "ike" followed by
the number used by IKE, or "default" which corresponds to
&`exim.dev.20160529.3`&.

The available primes are:
The available standard primes are:
&`ffdhe2048`&, &`ffdhe3072`&, &`ffdhe4096`&, &`ffdhe6144`&, &`ffdhe8192`&,
&`ike1`&, &`ike2`&, &`ike5`&,
&`ike14`&, &`ike15`&, &`ike16`&, &`ike17`&, &`ike18`&,
&`ike22`&, &`ike23`& (aka &`default`&) and &`ike24`&.
&`ike22`&, &`ike23`& and &`ike24`&.

The available additional primes are:
&`exim.dev.20160529.1`&, &`exim.dev.20160529.2`& and &`exim.dev.20160529.3`&.

Some of these will be too small to be accepted by clients.
Some may be too large to be accepted by clients.
The open cryptographic community has suspicions about the integrity of some
of the later IKE values, which led into RFC7919 providing new fixed constants
(the "ffdhe" identifiers).

At this point, all of the "ike" values should be considered obsolete;
they're still in Exim to avoid breaking unusual configurations, but are
candidates for removal the next time we have backwards-incompatible changes.
.wen

The TLS protocol does not negotiate an acceptable size for this; clients tend
to hard-drop connections if what is offered by the server is unacceptable,
Expand Down
3 changes: 3 additions & 0 deletions doc/doc-txt/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ JH/29 Fix the connection_reject log selector to apply to the connect ACL.

JH/30 Bug 1897: fix callouts connection fallback from TLS to cleartext.

PP/01 Changed default Diffie-Hellman parameters to be Exim-specific, created
by me. Added RFC7919 DH primes as an alternative.


Exim version 4.87
-----------------
Expand Down
2 changes: 2 additions & 0 deletions doc/doc-txt/NewStuff
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ Version 4.88
returns from the target back to the initiator, rather than spooling the
message.

13. New built-in constants available for tls_dhparam and default changed.


Version 4.87
------------
Expand Down
1 change: 1 addition & 0 deletions src/scripts/source_checks
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ done <<-END
globals.c header_names
globals.c log_options
expand.c item_table
std-crypto.c dh_constants
transport.c optionlist_transports
route.c optionlist_routers
transports/appendfile.c appendfile_transport_options
Expand Down
Loading

0 comments on commit 317e40a

Please sign in to comment.