Skip to content

Skip the strike register's full sweep while its queue is in expiry order - #220

Merged
Xor-el merged 1 commit into
deep-audit-fixesfrom
audit-ks-keyschedule
Oct 6, 2026
Merged

Xor-el merged 1 commit into
deep-audit-fixesfrom
audit-ks-keyschedule

Conversation

@Xor-el

@Xor-el Xor-el commented Oct 6, 2026

Copy link
Copy Markdown
Owner

With the engine's uniform window the strike register's order queue is always sorted by expiry, so after the front is pruned nothing lapsed can sit behind a live entry. It still ran an O(capacity) sweep under the lock each time it came back to capacity after a front expiry, contradicting its own comment, so a client holding a ticket could make every admission at capacity pay for a full dictionary walk.

It now tracks the newest expiry and whether the queue is still sorted, and sweeps only when it is not. Compaction and an emptied queue restore the flag; differing windows sweep as before. The new assertion in the compaction test fails if compaction reports the queue sorted when a lapsed entry sits behind a live one.

I also looked into the audit's claim that a TLS 1.2 stateful ticket is used up at ClientHello. The 1.2 server builds its ticket strategy without a store, so its ticket handling is stateless and consuming one is a no-op, and the session-id path only peeks; rustls (stateless ticketer, store.get) and OpenSSL (single-use removal only in the TLS 1.3 PSK path) behave the same, so nothing changes there. FPC x64 and i386 1427/0, Delphi Win32 build clean.

With the engine's uniform window the order queue is always sorted by expiry, so
once the front has been pruned nothing lapsed can remain behind a live entry.
The register still ran an O(capacity) sweep under the lock each time it came
back to capacity after a front expiry, which contradicted its own comment.

Track the newest expiry and whether the queue is still sorted, and sweep only
when it is not. Compaction and an emptied queue restore the flag. Differing
windows still sweep as before, and a test now covers the sweep after
compaction.
@Xor-el
Xor-el merged commit c4491a9 into deep-audit-fixes Oct 6, 2026
15 checks passed
@Xor-el
Xor-el deleted the audit-ks-keyschedule branch October 7, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant