MCPcopy
hub / github.com/XTLS/REALITY / writeKeyLog

Method writeKeyLog

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

Source from the content-addressed store, hash-verified

1568)
1569
1570func (c *Config) writeKeyLog(label string, clientRandom, secret []byte) error {
1571 if c.KeyLogWriter == nil {
1572 return nil
1573 }
1574
1575 logLine := fmt.Appendf(nil, "%s %x %x\n", label, clientRandom, secret)
1576
1577 writerMutex.Lock()
1578 _, err := c.KeyLogWriter.Write(logLine)
1579 writerMutex.Unlock()
1580
1581 return err
1582}
1583
1584// writerMutex protects all KeyLogWriters globally. It is rarely enabled,
1585// 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.65

Tested by

no test coverage detected