1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-18 10:07:02 +00:00

fix(pop3): Prevent STLS cmd triggered crashes (#516)

* fix(pop3): Prevent STLS cmd triggered crashes

Signed-off-by: James Hillyerd <james@hillyerd.com>

* err lint fix

Signed-off-by: James Hillyerd <james@hillyerd.com>

---------

Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
James Hillyerd
2024-06-13 12:38:07 -07:00
committed by GitHub
parent 0df07fc1be
commit b16764a65d
2 changed files with 128 additions and 8 deletions

View File

@@ -218,13 +218,13 @@ func (s *Session) authorizationHandler(cmd string, args []string) {
// Invalid command since TLS unconfigured.
s.logger.Debug().Msgf("-ERR TLS unavailable on the server")
s.send("-ERR TLS unavailable on the server")
s.ooSeq(cmd)
return
}
if s.tlsState != nil {
// TLS state previously valid.
s.logger.Debug().Msg("-ERR A TLS session already agreed upon.")
s.send("-ERR A TLS session already agreed upon.")
s.ooSeq(cmd)
return
}
s.logger.Debug().Msg("Initiating TLS context.")