DEFCON 4 and lower should require SASL from Tor users

This commit is contained in:
Shivaram Lingamneni 2020-12-11 05:04:56 -05:00
parent 9cf854405d
commit 534939c342
2 changed files with 3 additions and 2 deletions

View file

@ -596,7 +596,7 @@ func (client *Client) isAuthorized(server *Server, config *Config, session *Sess
return authFailPass
}
// Tor connections may be required to authenticate with SASL
if session.isTor && config.Server.TorListeners.RequireSasl && !saslSent {
if session.isTor && !saslSent && (config.Server.TorListeners.RequireSasl || server.Defcon() <= 4) {
return authFailTorSaslRequired
}
// finally, enforce require-sasl