(version uint16, cipherSuite *cipherSuite)
| 141 | } |
| 142 | |
| 143 | func newFinishedHash(version uint16, cipherSuite *cipherSuite) finishedHash { |
| 144 | var buffer []byte |
| 145 | if version >= VersionTLS12 { |
| 146 | buffer = []byte{} |
| 147 | } |
| 148 | |
| 149 | prf, hash := prfAndHashForVersion(version, cipherSuite) |
| 150 | if hash != 0 { |
| 151 | return finishedHash{hash.New(), hash.New(), nil, nil, buffer, version, prf} |
| 152 | } |
| 153 | |
| 154 | return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), buffer, version, prf} |
| 155 | } |
| 156 | |
| 157 | // A finishedHash calculates the hash of a set of handshake messages suitable |
| 158 | // for including in a Finished message. |
no test coverage detected
searching dependent graphs…