make it possible to get the PTO with and without max_ack_delay

This commit is contained in:
Marten Seemann
2019-11-03 12:48:57 +07:00
parent c5b76e4f86
commit d00828b762
5 changed files with 14 additions and 7 deletions

View File

@@ -99,7 +99,7 @@ func (a *updatableAEAD) rollKeys(now time.Time) {
a.numRcvdWithCurrentKey = 0
a.numSentWithCurrentKey = 0
a.prevRcvAEAD = a.rcvAEAD
a.prevRcvAEADExpiry = now.Add(3 * a.rttStats.PTO())
a.prevRcvAEADExpiry = now.Add(3 * a.rttStats.PTO(true))
a.rcvAEAD = a.nextRcvAEAD
a.sendAEAD = a.nextSendAEAD

View File

@@ -151,7 +151,7 @@ var _ = Describe("Updatable AEAD", func() {
It("drops keys 3 PTOs after a key update", func() {
now := time.Now()
rttStats.UpdateRTT(10*time.Millisecond, 0, now)
pto := rttStats.PTO()
pto := rttStats.PTO(true)
encrypted01 := client.Seal(nil, msg, 0x42, ad)
encrypted02 := client.Seal(nil, msg, 0x43, ad)
// receive the first packet with key phase 0