Skip to content

Commit

Permalink
stream-ssl: Use DEFAULT:@SECLEVEL=2 cipher list by default.
Browse files Browse the repository at this point in the history
'DEFAULT' enables default cipher list that was compiled in the OpenSSL
library.  That allows distributions to provide their defaults for the
running OVS process.  It also normally doesn't include any ciphers
that provide no encryption (eNULL) or no authentication (aNULL).
Using this option also makes it harder to mess up the configuration.

Turning on the SECLEVEL to 2 enables requirement for at least 112 bits
of security strength.  Doing that we ensure compatibility with keys
previously generated by older versions of ovs-pki.  It also takes care
of disabling MD5 and RC4.

This should provide better security by default and allow distributions
to turn off ciphers system-wide easier by re-configuring OpenSSL.

These cipher list macros were introduced in OpenSSL 1.1.0.

If necessary, users can override this configuration with --ssl-ciphers
or via corresponding database column.

Signed-off-by: Ilya Maximets <[email protected]>
  • Loading branch information
igsilya committed Dec 9, 2024
1 parent c1448e9 commit 9d0e552
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/ssl-connect.man
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ omitted is \fBTLSv1.2\fR or later.
.IP "\fB\-\-ssl\-ciphers=\fIciphers\fR"
Specifies, in OpenSSL cipher string format, the ciphers \fB\*(PN\fR will
support for SSL/TLS connections. The default when this option is omitted is
\fBHIGH:!aNULL:!MD5\fR.
\fBDEFAULT:@SECLEVEL=2\fR.
4 changes: 2 additions & 2 deletions lib/stream-ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static struct ssl_config_file private_key;
static struct ssl_config_file certificate;
static struct ssl_config_file ca_cert;
static char *ssl_protocols = "TLSv1.2+";
static char *ssl_ciphers = "HIGH:!aNULL:!MD5";
static char *ssl_ciphers = "DEFAULT:@SECLEVEL=2";

/* Ordinarily, the SSL client and server verify each other's certificates using
* a CA certificate. Setting this to false disables this behavior. (This is a
Expand Down Expand Up @@ -1073,7 +1073,7 @@ do_ssl_init(void)
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT,
NULL);
SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF);
SSL_CTX_set_cipher_list(ctx, "HIGH:!aNULL:!MD5");
SSL_CTX_set_cipher_list(ctx, "DEFAULT:@SECLEVEL=2");

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ovsdb-server.at
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ AT_CHECK(
"certificate": "'"$PKIDIR/testpki-cert2.pem"'",
"ca_cert": "'"$PKIDIR/testpki-cacert.pem"'",
"ssl_protocols": "'"TLSv1.2,TLSv1.1"'",
"ssl_ciphers": "'"HIGH:!aNULL:!MD5:!ECDHE-ECDSA-AES256-GCM-SHA384"'"}}]']],
"ssl_ciphers": "'"DEFAULT:@SECLEVEL=2:!ECDHE-ECDSA-AES256-GCM-SHA384"'"}}]']],
[0], [ignore], [ignore])
on_exit 'kill `cat *.pid`'
AT_CHECK(
Expand Down

0 comments on commit 9d0e552

Please sign in to comment.