From 2e9f798a6fcee2f11f7dd87b34916d9089308190 Mon Sep 17 00:00:00 2001 From: Xinjun Ma Date: Sat, 23 Sep 2023 00:11:48 +0800 Subject: [PATCH] Export CipherSuiteID in connection State --- state.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/state.go b/state.go index cd6945573..cbc287b42 100644 --- a/state.go +++ b/state.go @@ -21,6 +21,7 @@ type State struct { localRandom, remoteRandom handshake.Random masterSecret []byte cipherSuite CipherSuite // nil if a cipherSuite hasn't been chosen + CipherSuiteID CipherSuiteID srtpProtectionProfile SRTPProtectionProfile // Negotiated SRTPProtectionProfile PeerCertificates [][]byte @@ -138,7 +139,8 @@ func (s *State) deserialize(serialized serializedState) { s.masterSecret = serialized.MasterSecret // Set cipher suite - s.cipherSuite = cipherSuiteForID(CipherSuiteID(serialized.CipherSuiteID), nil) + s.CipherSuiteID = CipherSuiteID(serialized.CipherSuiteID) + s.cipherSuite = cipherSuiteForID(s.CipherSuiteID, nil) atomic.StoreUint64(&s.localSequenceNumber[epoch], serialized.SequenceNumber) s.srtpProtectionProfile = SRTPProtectionProfile(serialized.SRTPProtectionProfile)