drop Handshake keys as soon as the handshake completes (as a server)

This commit is contained in:
Marten Seemann 2019-11-22 10:58:16 +08:00
parent 08ec2f69fc
commit f7fd5d2848
5 changed files with 27 additions and 0 deletions

View file

@ -1204,6 +1204,7 @@ var _ = Describe("Session", func() {
defer GinkgoRecover()
<-finishHandshake
cryptoSetup.EXPECT().RunHandshake()
cryptoSetup.EXPECT().DropHandshakeKeys()
close(sess.handshakeCompleteChan)
sess.run()
}()
@ -1256,6 +1257,7 @@ var _ = Describe("Session", func() {
go func() {
defer GinkgoRecover()
cryptoSetup.EXPECT().RunHandshake()
cryptoSetup.EXPECT().DropHandshakeKeys()
close(sess.handshakeCompleteChan)
sess.run()
}()
@ -1506,6 +1508,7 @@ var _ = Describe("Session", func() {
go func() {
defer GinkgoRecover()
cryptoSetup.EXPECT().RunHandshake().MaxTimes(1)
cryptoSetup.EXPECT().DropHandshakeKeys().MaxTimes(1)
close(sess.handshakeCompleteChan)
err := sess.run()
nerr, ok := err.(net.Error)