Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clock lagging causes signature verification to fail #1269

Open
Priceless-P opened this issue Dec 3, 2024 · 2 comments
Open

Clock lagging causes signature verification to fail #1269

Priceless-P opened this issue Dec 3, 2024 · 2 comments

Comments

@Priceless-P
Copy link
Contributor

Priceless-P commented Dec 3, 2024

Signature verification fails when clock is lagging and it gives this error:

CodecError(NoiseSv2Error(InvalidCertificate([0, 0, 9, 224, 78, 103, 97, 226, 78, 103, ...., 222, 208, 158, 207, 123, 16])))

This happens here where the current time is checked against the message's valid time range. If the system clock is off by a bit, it fails even for valid messages.

Proposed solution
Introduce a time buffer. For example 10 secs .

if (self.valid_from <= now - 10) && (self.not_valid_after >= now + 10)

Versioning
This fix will only require bumping the patch version number

@jbesraa
Copy link
Contributor

jbesraa commented Dec 3, 2024

Interesting. In which scenarios the system clock can be off in seconds?

@Priceless-P
Copy link
Contributor Author

Interesting. In which scenarios the system clock can be off in seconds?

Can occur If the client and server are using different NTP servers for example. I have observed up to 1 sec difference.

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

No branches or pull requests

2 participants