|
|
|
|
@@ -217,15 +217,15 @@ _conn_apply_settings(const char* const jid, const char* const passwd, const char
|
|
|
|
|
|
|
|
|
|
if (flags & XMPP_CONN_FLAG_DISABLE_TLS) {
|
|
|
|
|
log_warning("[SECURITY] TLS is disabled for this connection: traffic and credentials are sent in the clear");
|
|
|
|
|
cons_show_warning("TLS is disabled, this connection is unencrypted.");
|
|
|
|
|
cons_show_error("Security warning: TLS is disabled, this connection is unencrypted.");
|
|
|
|
|
}
|
|
|
|
|
if (flags & XMPP_CONN_FLAG_TRUST_TLS) {
|
|
|
|
|
log_warning("[SECURITY] TLS certificate verification is disabled for this connection");
|
|
|
|
|
cons_show_warning("TLS certificates are not verified for this connection.");
|
|
|
|
|
cons_show_error("Security warning: TLS certificates are not verified for this connection.");
|
|
|
|
|
}
|
|
|
|
|
if (flags & XMPP_CONN_FLAG_LEGACY_AUTH) {
|
|
|
|
|
log_warning("[SECURITY] Legacy (XEP-0078) authentication enabled: the password is sent without SASL");
|
|
|
|
|
cons_show_warning("Legacy authentication is enabled for this connection.");
|
|
|
|
|
cons_show_error("Security warning: legacy authentication is enabled for this connection.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (xmpp_conn_set_flags(conn.xmpp_conn, flags)) {
|
|
|
|
|
@@ -381,7 +381,7 @@ _register_handle_proceedtls_default(xmpp_conn_t* xmpp_conn,
|
|
|
|
|
xmpp_conn_open_stream_default(xmpp_conn);
|
|
|
|
|
} else {
|
|
|
|
|
log_warning("[SECURITY] TLS handshake failed during registration, aborting");
|
|
|
|
|
cons_show_warning("TLS handshake failed, registration aborted.");
|
|
|
|
|
cons_show_error("Security warning: TLS handshake failed, registration aborted.");
|
|
|
|
|
/* failed tls spoils the connection, so disconnect */
|
|
|
|
|
xmpp_disconnect(xmpp_conn);
|
|
|
|
|
}
|
|
|
|
|
@@ -985,7 +985,7 @@ _connection_handler(xmpp_conn_t* const xmpp_conn, const xmpp_conn_event_t status
|
|
|
|
|
// tls.policy=allow negotiates opportunistically, so an unrequested downgrade must not pass silently
|
|
|
|
|
if (!connection_is_secured() && !conn.tls_disabled_by_user) {
|
|
|
|
|
log_warning("[SECURITY] Logged in over an unencrypted connection to %s: the server offered no usable TLS", conn.domain);
|
|
|
|
|
cons_show_warning("This session is NOT encrypted, the server did not provide TLS. Use '/account set <account> tls force' to require it.");
|
|
|
|
|
cons_show_error("Security warning: this session is NOT encrypted, the server did not provide TLS. Use '/account set <account> tls force' to require it.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
session_login_success(connection_is_secured());
|
|
|
|
|
@@ -1055,7 +1055,7 @@ _connection_handler(xmpp_conn_t* const xmpp_conn, const xmpp_conn_event_t status
|
|
|
|
|
if (stream_error && stream_error->stanza && _get_other_host(stream_error->stanza, &host, &port)) {
|
|
|
|
|
g_assert(port >= 0 && port <= UINT16_MAX);
|
|
|
|
|
log_warning("[SECURITY] Server redirected the connection (see-other-host) to \"%s\":%d", host, port);
|
|
|
|
|
cons_show_warning("The server redirected this connection to %s:%d.", host, port);
|
|
|
|
|
cons_show_error("Security notice: the server redirected this connection to %s:%d.", host, port);
|
|
|
|
|
session_reconnect(host, (unsigned short)port);
|
|
|
|
|
conn.conn_status = JABBER_RECONNECT;
|
|
|
|
|
return;
|
|
|
|
|
|