Created
October 29, 2019 17:52
-
-
Save Sean-Der/fc13819aca9290688f147788c8ef7d5b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/conn.go b/conn.go | |
index bf5a88e..33c805a 100644 | |
--- a/conn.go | |
+++ b/conn.go | |
@@ -500,6 +500,7 @@ func (c *Conn) handleIncomingPacket(buf []byte) (*alert, error) { | |
} | |
if h.epoch < c.getRemoteEpoch() { | |
+ c.log.Debugf("retransmitting, got message from old epoch: %v %v", h.epoch, c.getRemoteEpoch()) | |
if _, alertPtr, err := c.flightHandler(c); err != nil { | |
return alertPtr, err | |
} | |
@@ -557,12 +558,13 @@ func (c *Conn) handleIncomingPacket(buf []byte) (*alert, error) { | |
return nil, fmt.Errorf("alert: %v", content) | |
case *changeCipherSpec: | |
c.log.Trace("<- ChangeCipherSpec") | |
- c.setRemoteEpoch(c.getRemoteEpoch() + 1) | |
+ c.setRemoteEpoch(h.epoch + 1) | |
case *applicationData: | |
if h.epoch == 0 { | |
return &alert{alertLevelFatal, alertUnexpectedMessage}, fmt.Errorf("ApplicationData with epoch of 0") | |
} | |
+ c.log.Debugf("decrypted with len(%v)", len(content.data)) | |
c.decrypted <- content.data | |
default: | |
return &alert{alertLevelFatal, alertUnexpectedMessage}, fmt.Errorf("unhandled contentType %d", content.contentType()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment