mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 12:47:36 +03:00
rename cryptoSetup.DropHandshakeKeys() to SetHandshakeConfirmed()
This commit is contained in:
parent
b4636469fa
commit
b9090d71ae
5 changed files with 23 additions and 22 deletions
|
@ -652,7 +652,8 @@ func (h *cryptoSetup) dropInitialKeys() {
|
||||||
h.logger.Debugf("Dropping Initial keys.")
|
h.logger.Debugf("Dropping Initial keys.")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *cryptoSetup) DropHandshakeKeys() {
|
func (h *cryptoSetup) SetHandshakeConfirmed() {
|
||||||
|
// drop Handshake keys
|
||||||
var dropped bool
|
var dropped bool
|
||||||
h.mutex.Lock()
|
h.mutex.Lock()
|
||||||
if h.handshakeOpener != nil {
|
if h.handshakeOpener != nil {
|
||||||
|
|
|
@ -77,7 +77,7 @@ type CryptoSetup interface {
|
||||||
|
|
||||||
HandleMessage([]byte, protocol.EncryptionLevel) bool
|
HandleMessage([]byte, protocol.EncryptionLevel) bool
|
||||||
SetLargest1RTTAcked(protocol.PacketNumber) error
|
SetLargest1RTTAcked(protocol.PacketNumber) error
|
||||||
DropHandshakeKeys()
|
SetHandshakeConfirmed()
|
||||||
ConnectionState() ConnectionState
|
ConnectionState() ConnectionState
|
||||||
|
|
||||||
GetInitialOpener() (LongHeaderOpener, error)
|
GetInitialOpener() (LongHeaderOpener, error)
|
||||||
|
|
|
@ -76,18 +76,6 @@ func (mr *MockCryptoSetupMockRecorder) ConnectionState() *gomock.Call {
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionState", reflect.TypeOf((*MockCryptoSetup)(nil).ConnectionState))
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ConnectionState", reflect.TypeOf((*MockCryptoSetup)(nil).ConnectionState))
|
||||||
}
|
}
|
||||||
|
|
||||||
// DropHandshakeKeys mocks base method
|
|
||||||
func (m *MockCryptoSetup) DropHandshakeKeys() {
|
|
||||||
m.ctrl.T.Helper()
|
|
||||||
m.ctrl.Call(m, "DropHandshakeKeys")
|
|
||||||
}
|
|
||||||
|
|
||||||
// DropHandshakeKeys indicates an expected call of DropHandshakeKeys
|
|
||||||
func (mr *MockCryptoSetupMockRecorder) DropHandshakeKeys() *gomock.Call {
|
|
||||||
mr.mock.ctrl.T.Helper()
|
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DropHandshakeKeys", reflect.TypeOf((*MockCryptoSetup)(nil).DropHandshakeKeys))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get0RTTOpener mocks base method
|
// Get0RTTOpener mocks base method
|
||||||
func (m *MockCryptoSetup) Get0RTTOpener() (handshake.LongHeaderOpener, error) {
|
func (m *MockCryptoSetup) Get0RTTOpener() (handshake.LongHeaderOpener, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
@ -249,6 +237,18 @@ func (mr *MockCryptoSetupMockRecorder) RunHandshake() *gomock.Call {
|
||||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunHandshake", reflect.TypeOf((*MockCryptoSetup)(nil).RunHandshake))
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RunHandshake", reflect.TypeOf((*MockCryptoSetup)(nil).RunHandshake))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetHandshakeConfirmed mocks base method
|
||||||
|
func (m *MockCryptoSetup) SetHandshakeConfirmed() {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
m.ctrl.Call(m, "SetHandshakeConfirmed")
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetHandshakeConfirmed indicates an expected call of SetHandshakeConfirmed
|
||||||
|
func (mr *MockCryptoSetupMockRecorder) SetHandshakeConfirmed() *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetHandshakeConfirmed", reflect.TypeOf((*MockCryptoSetup)(nil).SetHandshakeConfirmed))
|
||||||
|
}
|
||||||
|
|
||||||
// SetLargest1RTTAcked mocks base method
|
// SetLargest1RTTAcked mocks base method
|
||||||
func (m *MockCryptoSetup) SetLargest1RTTAcked(arg0 protocol.PacketNumber) error {
|
func (m *MockCryptoSetup) SetLargest1RTTAcked(arg0 protocol.PacketNumber) error {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
|
|
|
@ -52,7 +52,7 @@ type cryptoStreamHandler interface {
|
||||||
RunHandshake()
|
RunHandshake()
|
||||||
ChangeConnectionID(protocol.ConnectionID)
|
ChangeConnectionID(protocol.ConnectionID)
|
||||||
SetLargest1RTTAcked(protocol.PacketNumber) error
|
SetLargest1RTTAcked(protocol.PacketNumber) error
|
||||||
DropHandshakeKeys()
|
SetHandshakeConfirmed()
|
||||||
GetSessionTicket() ([]byte, error)
|
GetSessionTicket() ([]byte, error)
|
||||||
io.Closer
|
io.Closer
|
||||||
ConnectionState() handshake.ConnectionState
|
ConnectionState() handshake.ConnectionState
|
||||||
|
@ -705,7 +705,7 @@ func (s *session) handleHandshakeComplete() {
|
||||||
s.closeLocal(err)
|
s.closeLocal(err)
|
||||||
}
|
}
|
||||||
s.queueControlFrame(&wire.NewTokenFrame{Token: token})
|
s.queueControlFrame(&wire.NewTokenFrame{Token: token})
|
||||||
s.cryptoStreamHandler.DropHandshakeKeys()
|
s.cryptoStreamHandler.SetHandshakeConfirmed()
|
||||||
s.queueControlFrame(&wire.HandshakeDoneFrame{})
|
s.queueControlFrame(&wire.HandshakeDoneFrame{})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1242,7 +1242,7 @@ func (s *session) handleHandshakeDoneFrame() error {
|
||||||
}
|
}
|
||||||
s.handshakeConfirmed = true
|
s.handshakeConfirmed = true
|
||||||
s.sentPacketHandler.SetHandshakeConfirmed()
|
s.sentPacketHandler.SetHandshakeConfirmed()
|
||||||
s.cryptoStreamHandler.DropHandshakeKeys()
|
s.cryptoStreamHandler.SetHandshakeConfirmed()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1640,7 +1640,7 @@ var _ = Describe("Session", func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
<-finishHandshake
|
<-finishHandshake
|
||||||
cryptoSetup.EXPECT().RunHandshake()
|
cryptoSetup.EXPECT().RunHandshake()
|
||||||
cryptoSetup.EXPECT().DropHandshakeKeys()
|
cryptoSetup.EXPECT().SetHandshakeConfirmed()
|
||||||
cryptoSetup.EXPECT().GetSessionTicket()
|
cryptoSetup.EXPECT().GetSessionTicket()
|
||||||
close(sess.handshakeCompleteChan)
|
close(sess.handshakeCompleteChan)
|
||||||
sess.run()
|
sess.run()
|
||||||
|
@ -1670,7 +1670,7 @@ var _ = Describe("Session", func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
<-finishHandshake
|
<-finishHandshake
|
||||||
cryptoSetup.EXPECT().RunHandshake()
|
cryptoSetup.EXPECT().RunHandshake()
|
||||||
cryptoSetup.EXPECT().DropHandshakeKeys()
|
cryptoSetup.EXPECT().SetHandshakeConfirmed()
|
||||||
cryptoSetup.EXPECT().GetSessionTicket().Return(make([]byte, size), nil)
|
cryptoSetup.EXPECT().GetSessionTicket().Return(make([]byte, size), nil)
|
||||||
close(sess.handshakeCompleteChan)
|
close(sess.handshakeCompleteChan)
|
||||||
sess.run()
|
sess.run()
|
||||||
|
@ -1756,7 +1756,7 @@ var _ = Describe("Session", func() {
|
||||||
go func() {
|
go func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
cryptoSetup.EXPECT().RunHandshake()
|
cryptoSetup.EXPECT().RunHandshake()
|
||||||
cryptoSetup.EXPECT().DropHandshakeKeys()
|
cryptoSetup.EXPECT().SetHandshakeConfirmed()
|
||||||
cryptoSetup.EXPECT().GetSessionTicket()
|
cryptoSetup.EXPECT().GetSessionTicket()
|
||||||
mconn.EXPECT().Write(gomock.Any())
|
mconn.EXPECT().Write(gomock.Any())
|
||||||
close(sess.handshakeCompleteChan)
|
close(sess.handshakeCompleteChan)
|
||||||
|
@ -2030,7 +2030,7 @@ var _ = Describe("Session", func() {
|
||||||
defer GinkgoRecover()
|
defer GinkgoRecover()
|
||||||
cryptoSetup.EXPECT().RunHandshake().MaxTimes(1)
|
cryptoSetup.EXPECT().RunHandshake().MaxTimes(1)
|
||||||
cryptoSetup.EXPECT().GetSessionTicket().MaxTimes(1)
|
cryptoSetup.EXPECT().GetSessionTicket().MaxTimes(1)
|
||||||
cryptoSetup.EXPECT().DropHandshakeKeys().MaxTimes(1)
|
cryptoSetup.EXPECT().SetHandshakeConfirmed().MaxTimes(1)
|
||||||
close(sess.handshakeCompleteChan)
|
close(sess.handshakeCompleteChan)
|
||||||
err := sess.run()
|
err := sess.run()
|
||||||
nerr, ok := err.(net.Error)
|
nerr, ok := err.(net.Error)
|
||||||
|
@ -2277,7 +2277,7 @@ var _ = Describe("Client Session", func() {
|
||||||
sph := mockackhandler.NewMockSentPacketHandler(mockCtrl)
|
sph := mockackhandler.NewMockSentPacketHandler(mockCtrl)
|
||||||
sess.sentPacketHandler = sph
|
sess.sentPacketHandler = sph
|
||||||
sph.EXPECT().SetHandshakeConfirmed()
|
sph.EXPECT().SetHandshakeConfirmed()
|
||||||
cryptoSetup.EXPECT().DropHandshakeKeys()
|
cryptoSetup.EXPECT().SetHandshakeConfirmed()
|
||||||
Expect(sess.handleHandshakeDoneFrame()).To(Succeed())
|
Expect(sess.handleHandshakeDoneFrame()).To(Succeed())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue