MCPcopy Create free account
hub / github.com/XTLS/Go / writeKeyLog

Method writeKeyLog

common.go:1327–1339  ·  view source on GitHub ↗
(label string, clientRandom, secret []byte)

Source from the content-addressed store, hash-verified

1325)
1326
1327func (c *Config) writeKeyLog(label string, clientRandom, secret []byte) error {
1328 if c.KeyLogWriter == nil {
1329 return nil
1330 }
1331
1332 logLine := []byte(fmt.Sprintf("%s %x %x\n", label, clientRandom, secret))
1333
1334 writerMutex.Lock()
1335 _, err := c.KeyLogWriter.Write(logLine)
1336 writerMutex.Unlock()
1337
1338 return err
1339}
1340
1341// writerMutex protects all KeyLogWriters globally. It is rarely enabled,
1342// and is only for debugging, so a global mutex saves space.

Callers 6

doFullHandshakeMethod · 0.80
readServerFinishedMethod · 0.80
sendServerParametersMethod · 0.80
sendServerFinishedMethod · 0.80
doFullHandshakeMethod · 0.80

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected