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

Method handlePostHandshakeMessage

conn.go:1464–1489  ·  view source on GitHub ↗

handlePostHandshakeMessage processes a handshake message arrived after the handshake is complete. Up to TLS 1.2, it indicates the start of a renegotiation.

()

Source from the content-addressed store, hash-verified

1462// handlePostHandshakeMessage processes a handshake message arrived after the
1463// handshake is complete. Up to TLS 1.2, it indicates the start of a renegotiation.
1464func (c *Conn) handlePostHandshakeMessage() error {
1465 if c.vers != VersionTLS13 {
1466 return c.handleRenegotiation()
1467 }
1468
1469 msg, err := c.readHandshake()
1470 if err != nil {
1471 return err
1472 }
1473
1474 c.retryCount++
1475 if c.retryCount > maxUselessRecords {
1476 c.sendAlert(alertUnexpectedMessage)
1477 return c.in.setErrorLocked(errors.New("tls: too many non-advancing records"))
1478 }
1479
1480 switch msg := msg.(type) {
1481 case *newSessionTicketMsgTLS13:
1482 return c.handleNewSessionTicket(msg)
1483 case *keyUpdateMsg:
1484 return c.handleKeyUpdate(msg)
1485 default:
1486 c.sendAlert(alertUnexpectedMessage)
1487 return fmt.Errorf("tls: received unexpected handshake message of type %T", msg)
1488 }
1489}
1490
1491func (c *Conn) handleKeyUpdate(keyUpdate *keyUpdateMsg) error {
1492 cipherSuite := cipherSuiteTLS13ByID(c.cipherSuite)

Callers 1

ReadMethod · 0.95

Calls 6

handleRenegotiationMethod · 0.95
readHandshakeMethod · 0.95
sendAlertMethod · 0.95
handleKeyUpdateMethod · 0.95
setErrorLockedMethod · 0.80

Tested by

no test coverage detected