(version uint16, cipherSuite *cipherSuite)
| 154 | } |
| 155 | |
| 156 | func newFinishedHash(version uint16, cipherSuite *cipherSuite) finishedHash { |
| 157 | var buffer []byte |
| 158 | if version >= VersionTLS12 { |
| 159 | buffer = []byte{} |
| 160 | } |
| 161 | |
| 162 | prf, hash := prfAndHashForVersion(version, cipherSuite) |
| 163 | if hash != 0 { |
| 164 | return finishedHash{hash.New(), hash.New(), nil, nil, buffer, version, prf} |
| 165 | } |
| 166 | |
| 167 | return finishedHash{sha1.New(), sha1.New(), md5.New(), md5.New(), buffer, version, prf} |
| 168 | } |
| 169 | |
| 170 | // A finishedHash calculates the hash of a set of handshake messages suitable |
| 171 | // for including in a Finished message. |
no test coverage detected
searching dependent graphs…