handlePostHandshakeMessage processes a handshake message arrived after the handshake is complete. Up to TLS 1.2, it indicates the start of a renegotiation.
()
| 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. |
| 1464 | func (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 | |
| 1491 | func (c *Conn) handleKeyUpdate(keyUpdate *keyUpdateMsg) error { |
| 1492 | cipherSuite := cipherSuiteTLS13ByID(c.cipherSuite) |
no test coverage detected