fix(sdk-lib-mpc): replace date:null with tolerance window in OpenPGP calls#8469
Open
zahin-mohammad wants to merge 1 commit intomasterfrom
Conversation
Logicwax
requested changes
Apr 9, 2026
Contributor
Logicwax
left a comment
There was a problem hiding this comment.
our silencelabs DKLS23 protocol should be tolerant of re-play attacks. and we had issues with this affecting customers before due to clock skew. how about we compromise in the middle and make it like 24 hours? that way it shows we considered this (for future audits), but also enough slack for customers with terrible clocks.
67f18f9 to
e4d5ef3
Compare
…calls Remove `date: null as unknown as undefined` from OpenPGP encrypt/decrypt calls (use default current-time checks) and replace it with `now + 24h` on verify calls only, to tolerate signatures from OVC devices whose clocks are up to 24 hours ahead. OpenPGP's date parameter shifts ALL temporal checks simultaneously, so a single shifted date cannot independently relax key-expiry checks without breaking self-signature validation on fresh keys. Ticket: WAL-379 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e4d5ef3 to
884d91e
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
date: null→ tolerance window migration in OpenPGP comms layer. The original change (date: now + 24h) was stricter than default, not more tolerant — it required keys to be valid for 24 more hours instead of tolerating recently-expired keys.What changed
dateoverride entirely (uses default = current time). Normal key expiry and self-signature validation.date: now + 24h. Tolerates signatures from OVC devices whose clocks are up to 24h ahead.Why not
now - 24hfor encrypt?OpenPGP's
dateparameter shifts the reference time for ALL temporal checks simultaneously. Usingnow - 24htolerates expired keys but breaks self-signature validation on any key created within the last 24h ("Signature creation time is in the future").Impact on client SDK with clock skew
Clock ahead (e.g. +4h): Signature verification on the server works fine. But when the client SDK encrypts a message to the server's HSM key, it checks key validity using its wrong clock. If the HSM key expires in 3 hours (real time), the client thinks it expired 1 hour ago → encrypt fails unnecessarily.
Clock behind (e.g. -4h): Everything works fine. Signatures appear slightly old (no problem). Keys appear to have more time left (no problem).
Failure scenarios compared to
date: nullpgp.encryptrejects it. Client cannot send messages to the server. This is the intended security improvement.pgp.encryptrejects it. Unintended collateral — previously tolerated bydate: null.pgp.verifyrejects it. Practically impossible since the server's clock is correct.Test plan
Ticket: WAL-379
🤖 Generated with Claude Code