From 47fac2706f4228c135bdc60cd1d20752f7032adc Mon Sep 17 00:00:00 2001 From: youtous Date: Wed, 22 Apr 2020 11:06:03 +0200 Subject: [PATCH] use ffdhe4096 for DHE params use by default ffdhe4096 for DHE params use by default ffdhe4096 for DHE params --- Dockerfile | 3 ++ target/dovecot/10-ssl.conf | 5 ++- target/start-mailserver.sh | 48 ++++++++++++++++----------- test/config/dhparams.pem | 8 ----- test/config/dovecot-lmtp/dh.pem | 8 ----- test/config/relay-hosts/dhparams.pem | 8 ----- test/mail_manual_dhparams.bats | 49 ++++++++++++++++++++++++++++ test/test-files/ssl/ffdhe2048.pem | 8 +++++ test/tests.bats | 17 +++++++--- 9 files changed, 103 insertions(+), 51 deletions(-) delete mode 100644 test/config/dhparams.pem delete mode 100644 test/config/dovecot-lmtp/dh.pem delete mode 100644 test/config/relay-hosts/dhparams.pem create mode 100644 test/mail_manual_dhparams.bats create mode 100644 test/test-files/ssl/ffdhe2048.pem diff --git a/Dockerfile b/Dockerfile index af6c4151..bbb90ea3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -163,6 +163,9 @@ RUN chmod 755 /etc/init.d/postgrey && \ # Copy PostSRSd Config COPY target/postsrsd/postsrsd /etc/default/postsrsd +# Copy shared ffdhe params +COPY target/shared/ffdhe4096.pem /etc/postfix/shared/ffdhe4096.pem + # Enables Amavis COPY target/amavis/conf.d/* /etc/amavis/conf.d/ RUN sed -i -r 's/#(@| \\%)bypass/\1bypass/g' /etc/amavis/conf.d/15-content_filter_mode && \ diff --git a/target/dovecot/10-ssl.conf b/target/dovecot/10-ssl.conf index 25213a90..7b4c4ec7 100644 --- a/target/dovecot/10-ssl.conf +++ b/target/dovecot/10-ssl.conf @@ -43,9 +43,8 @@ ssl_key = SET WARNING IN LOGS - # todo : remove dhe generation + # check ffdhe params are inchanged + repo_checksum=$(sha512sum "$(pwd)/target/shared/ffdhe4096.pem" | awk '{print $1}') + mozilla_checksum=$(curl https://ssl-config.mozilla.org/ffdhe4096.txt -s | sha512sum | awk '{print $1}') + assert_equal "$repo_checksum" "$mozilla_checksum" + run echo "$repo_checksum" + refute_output '' # checksum must not be empty + + # by default, ffdhe4096 should be used + docker_dovecot_checksum=$(docker exec mail sha512sum /etc/dovecot/dh.pem | awk '{print $1}') + docker_postfix_checksum=$(docker exec mail sha512sum /etc/postfix/dhparams.pem | awk '{print $1}') + assert_equal "$docker_dovecot_checksum" "$repo_checksum" + assert_equal "$docker_postfix_checksum" "$repo_checksum" } #