Skip to content

Commit a781b84

Browse files
committed
Drop SSL authentication mode NONE and use DENY as default
Drop the mode NONE, since NO, DENY, WARN and ALLOW should cover all cases. Use DENY as default as its the most secure one, and users might expect applications to be secure by default. Failures are reported in the logs and can then be exempted by choosing a different option.
1 parent 85b79c4 commit a781b84

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

src/netlog/netlog-dtls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int dtls_connect(DTLSManager *m, SocketAddress *address) {
118118
bio = NULL;
119119

120120
/* Certification verification */
121-
if (m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_NONE && m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_INVALID) {
121+
if (m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_NONE) {
122122
log_debug("DTLS: enable certificate verification");
123123

124124
SSL_set_ex_data(ssl, EX_DATA_TLSMANAGER, m);

src/netlog/netlog-manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ int manager_new(const char *state_file, const char *cursor, Manager **ret) {
634634
.state_file = strdup(state_file),
635635
.protocol = SYSLOG_TRANSMISSION_PROTOCOL_UDP,
636636
.log_format = SYSLOG_TRANSMISSION_LOG_FORMAT_RFC_5424,
637-
.auth_mode = OPEN_SSL_CERTIFICATE_AUTH_MODE_INVALID,
637+
.auth_mode = OPEN_SSL_CERTIFICATE_AUTH_MODE_DENY,
638638
.connection_retry_usec = DEFAULT_CONNECTION_RETRY_USEC,
639639
.ratelimit = (const RateLimit) {
640640
RATELIMIT_INTERVAL_USEC,

src/netlog/netlog-tls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ int tls_connect(TLSManager *m, SocketAddress *address) {
117117
"TLS: Failed to SSL_set_fd: %s",
118118
ERR_error_string(ERR_get_error(), NULL));
119119
/* Certification verification */
120-
if (m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_NONE && m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_INVALID) {
121-
log_debug("TLS: enable certificate verification");
120+
if (m->auth_mode != OPEN_SSL_CERTIFICATE_AUTH_MODE_NONE) {
121+
log_debug("TLS: enable certificate verification with mode %s", certificate_auth_mode_to_string(m->auth_mode));
122122

123123
SSL_set_ex_data(ssl, EX_DATA_TLSMANAGER, m);
124124
SSL_set_ex_data(ssl, EX_DATA_PRETTYADDRESS, pretty);

src/netlog/netlog-tls.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ typedef enum OpenSSLCertificateAuthMode {
1313
OPEN_SSL_CERTIFICATE_AUTH_MODE_DENY = 1 << 2,
1414
OPEN_SSL_CERTIFICATE_AUTH_MODE_WARN = 1 << 3,
1515
OPEN_SSL_CERTIFICATE_AUTH_MODE_MAX = 1 << 4,
16-
OPEN_SSL_CERTIFICATE_AUTH_MODE_INVALID = -1,
1716
} OpenSSLCertificateAuthMode;
1817

1918
typedef struct TLSManager TLSManager;

0 commit comments

Comments
 (0)