fix logging of dropped 0-RTT keys

Client and server only possess write or read 0-RTT keys, respectively.
We should therefore only emit a single event when those are dropped.
This commit is contained in:
Marten Seemann
2021-03-01 10:30:59 +08:00
parent 9b627ac93d
commit ab46df5071
2 changed files with 18 additions and 2 deletions

View File

@@ -402,8 +402,12 @@ func (t *connectionTracer) UpdatedKey(generation protocol.KeyPhase, remote bool)
func (t *connectionTracer) DroppedEncryptionLevel(encLevel protocol.EncryptionLevel) {
t.mutex.Lock()
now := time.Now()
t.recordEvent(now, &eventKeyRetired{KeyType: encLevelToKeyType(encLevel, protocol.PerspectiveServer)})
t.recordEvent(now, &eventKeyRetired{KeyType: encLevelToKeyType(encLevel, protocol.PerspectiveClient)})
if encLevel == protocol.Encryption0RTT {
t.recordEvent(now, &eventKeyRetired{KeyType: encLevelToKeyType(encLevel, t.perspective)})
} else {
t.recordEvent(now, &eventKeyRetired{KeyType: encLevelToKeyType(encLevel, protocol.PerspectiveServer)})
t.recordEvent(now, &eventKeyRetired{KeyType: encLevelToKeyType(encLevel, protocol.PerspectiveClient)})
}
t.mutex.Unlock()
}