retryReadRecord recurs into readRecordOrCCS to drop a non-advancing record, like a warning alert, empty application_data, or a change_cipher_spec in TLS 1.3.
(expectChangeCipherSpec bool)
| 827 | // retryReadRecord recurs into readRecordOrCCS to drop a non-advancing record, like |
| 828 | // a warning alert, empty application_data, or a change_cipher_spec in TLS 1.3. |
| 829 | func (c *Conn) retryReadRecord(expectChangeCipherSpec bool) error { |
| 830 | c.retryCount++ |
| 831 | if c.MaxUselessRecords <= 0 { |
| 832 | c.MaxUselessRecords = maxUselessRecords |
| 833 | } |
| 834 | if c.retryCount > c.MaxUselessRecords { |
| 835 | c.sendAlert(alertUnexpectedMessage) |
| 836 | return c.in.setErrorLocked(errors.New("tls: too many ignored records")) |
| 837 | } |
| 838 | return c.readRecordOrCCS(expectChangeCipherSpec) |
| 839 | } |
| 840 | |
| 841 | // atLeastReader reads from R, stopping with EOF once at least N bytes have been |
| 842 | // read. It is different from an io.LimitedReader in that it doesn't cut short |
no test coverage detected