mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
log when old 1-RTT keys are dropped
This commit is contained in:
parent
dbaacd49bd
commit
074f5a202e
2 changed files with 4 additions and 0 deletions
|
@ -150,6 +150,9 @@ func (a *updatableAEAD) Open(dst, src []byte, rcvTime time.Time, pn protocol.Pac
|
||||||
if a.prevRcvAEAD != nil && rcvTime.After(a.prevRcvAEADExpiry) {
|
if a.prevRcvAEAD != nil && rcvTime.After(a.prevRcvAEADExpiry) {
|
||||||
a.prevRcvAEAD = nil
|
a.prevRcvAEAD = nil
|
||||||
a.prevRcvAEADExpiry = time.Time{}
|
a.prevRcvAEADExpiry = time.Time{}
|
||||||
|
if a.tracer != nil {
|
||||||
|
a.tracer.DroppedKey(a.keyPhase - 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
binary.BigEndian.PutUint64(a.nonceBuf[len(a.nonceBuf)-8:], uint64(pn))
|
binary.BigEndian.PutUint64(a.nonceBuf[len(a.nonceBuf)-8:], uint64(pn))
|
||||||
if kp != a.keyPhase.Bit() {
|
if kp != a.keyPhase.Bit() {
|
||||||
|
|
|
@ -195,6 +195,7 @@ var _ = Describe("Updatable AEAD", func() {
|
||||||
encrypted1 := client.Seal(nil, msg, 0x44, ad)
|
encrypted1 := client.Seal(nil, msg, 0x44, ad)
|
||||||
Expect(server.KeyPhase()).To(Equal(protocol.KeyPhaseZero))
|
Expect(server.KeyPhase()).To(Equal(protocol.KeyPhaseZero))
|
||||||
serverTracer.EXPECT().UpdatedKey(protocol.KeyPhase(1), true)
|
serverTracer.EXPECT().UpdatedKey(protocol.KeyPhase(1), true)
|
||||||
|
serverTracer.EXPECT().DroppedKey(protocol.KeyPhase(0))
|
||||||
_, err = server.Open(nil, encrypted1, now, 0x44, protocol.KeyPhaseOne, ad)
|
_, err = server.Open(nil, encrypted1, now, 0x44, protocol.KeyPhaseOne, ad)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
Expect(server.KeyPhase()).To(Equal(protocol.KeyPhaseOne))
|
Expect(server.KeyPhase()).To(Equal(protocol.KeyPhaseOne))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue