1
0
mirror of https://github.com/golang/go synced 2024-11-21 11:24:39 -07:00

crypto/tls: add missing RUnlock in ticketKeys

If GetConfigForClient returns a tls.Config that has
SessionTicketsDisabled set, the TLS server handshake currently leaves
the Config's internal RWMutex read locked after calculating the
ticketKeys to use for the handshake.
This commit is contained in:
Edoardo Spadolini 2024-07-26 15:31:55 +02:00 committed by Edoardo Spadolini
parent 9b4b4ae585
commit 693d7acf95

View File

@ -962,6 +962,7 @@ func (c *Config) ticketKeys(configForClient *Config) []ticketKey {
if configForClient != nil {
configForClient.mutex.RLock()
if configForClient.SessionTicketsDisabled {
configForClient.mutex.RUnlock()
return nil
}
configForClient.initLegacySessionTicketKeyRLocked()