2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

stream-ssl: Remove unsafe 1024 bit dh params

Using 1024 bit params for DH is considered unsafe [1]. Additionally,
from [2]:

"Modern servers that do not support export ciphersuites 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."

Additionally, using 1024 bit dh params may block clients running on
recent openssl version from connecting given the stricter default
security requirements of those new openssl versions. The error message
for these clients looks like:

error:141A318A:SSL routines:tls_process_ske_dhe:dh key too small:ssl/statem/statem_clnt.c:2150

As a workaround, this error can be suppressed tweaking the cipher list
(--ssl-ciphers) to either 'HIGH:!aNULL:!MD5:@SECLEVEL=1' to reduce
security requirements or 'HIGH:!aNULL:!MD5:!DH' to avoid using fixed
param DH based ciphers. The first option is recommended though as it
likely a fixed param DH cipher is the best possible option in that
situation.

[1] https://weakdh.org/
[2] https://www.openssl.org/docs/man1.1.1/man3/SSL_CTX_set_tmp_dh_callback.html

Signed-off-by: Jaime Caamaño Ruiz <jcaamano@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Jaime Caamaño Ruiz
2021-06-16 20:32:28 +00:00
committed by Ben Pfaff
parent 4e948b86c7
commit 0c09952382
7 changed files with 18 additions and 78 deletions

View File

@@ -1087,7 +1087,6 @@ tmp_dh_callback(SSL *ssl OVS_UNUSED, int is_export OVS_UNUSED, int keylength)
};
static struct dh dh_table[] = {
{1024, NULL, get_dh1024},
{2048, NULL, get_dh2048},
{4096, NULL, get_dh4096},
};
@@ -1095,7 +1094,7 @@ tmp_dh_callback(SSL *ssl OVS_UNUSED, int is_export OVS_UNUSED, int keylength)
struct dh *dh;
for (dh = dh_table; dh < &dh_table[ARRAY_SIZE(dh_table)]; dh++) {
if (dh->keylength == keylength) {
if (dh->keylength >= keylength) {
if (!dh->dh) {
dh->dh = dh->constructor();
if (!dh->dh) {