()
| 848 | } |
| 849 | |
| 850 | func (hs *serverHandshakeStateTLS13) readClientFinished() error { |
| 851 | c := hs.c |
| 852 | |
| 853 | msg, err := c.readHandshake() |
| 854 | if err != nil { |
| 855 | return err |
| 856 | } |
| 857 | |
| 858 | finished, ok := msg.(*finishedMsg) |
| 859 | if !ok { |
| 860 | c.sendAlert(alertUnexpectedMessage) |
| 861 | return unexpectedMessageError(finished, msg) |
| 862 | } |
| 863 | |
| 864 | if !hmac.Equal(hs.clientFinished, finished.verifyData) { |
| 865 | c.sendAlert(alertDecryptError) |
| 866 | return errors.New("tls: invalid client finished hash") |
| 867 | } |
| 868 | |
| 869 | c.in.setTrafficSecret(hs.suite, hs.trafficSecret) |
| 870 | |
| 871 | return nil |
| 872 | } |
no test coverage detected