MCPcopy Create free account
hub / github.com/XTLS/REALITY / changeCipherSpec

Method changeCipherSpec

conn.go:222–234  ·  view source on GitHub ↗

changeCipherSpec changes the encryption and MAC states to the ones previously passed to prepareCipherSpec.

()

Source from the content-addressed store, hash-verified

220// changeCipherSpec changes the encryption and MAC states
221// to the ones previously passed to prepareCipherSpec.
222func (hc *halfConn) changeCipherSpec() error {
223 if hc.nextCipher == nil || hc.version == VersionTLS13 {
224 return alertInternalError
225 }
226 hc.cipher = hc.nextCipher
227 hc.mac = hc.nextMac
228 hc.nextCipher = nil
229 hc.nextMac = nil
230 for i := range hc.seq {
231 hc.seq[i] = 0
232 }
233 return nil
234}
235
236func (hc *halfConn) setTrafficSecret(suite *cipherSuiteTLS13, level QUICEncryptionLevel, secret []byte) {
237 hc.trafficSecret = secret

Callers 2

readRecordOrCCSMethod · 0.80
writeRecordLockedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected