Skip to content

fix: timestamping#478

Merged
7 commits merged intomainfrom
unknown repository
Nov 15, 2024
Merged

fix: timestamping#478
7 commits merged intomainfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Nov 12, 2024

This PR adds a sanity check on timstamp value against the signing time: timestamp value should always be bounded after the signing time.
This is to say, one cannot timestamp a signature before the signature itself been created. If it happens, fail the verification.

Patrick Zheng added 6 commits November 5, 2024 15:58
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
@codecov
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.34%. Comparing base (7b9636e) to head (9c53750).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #478      +/-   ##
==========================================
+ Coverage   80.33%   80.34%   +0.01%     
==========================================
  Files          34       34              
  Lines        3320     3323       +3     
==========================================
+ Hits         2667     2670       +3     
  Misses        508      508              
  Partials      145      145              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@shizhMSFT shizhMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@JeyJeyGao JeyJeyGao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@priteshbandi
Copy link
Contributor

Do we need to account for clock skew such as when the local system clock runs faster than the timestamp server??

@ghost
Copy link
Author

ghost commented Nov 15, 2024

Do we need to account for clock skew such as when the local system clock runs faster than the timestamp server??

This change has been tested with several public tsa servers, such as digicert and globalsign.
Since we cannot tell the difference between a clock skew and an intentionally manipulated local system clock, we should fail the verification on both cases following the secure by default practice.

In addition, this check also covers the scenario where the signer generates a Notary Project compliant signature using another tool and send it to tsa for timestamping later on, then attach the signature themselves. When verifying such signature envelopes in Notation, we expect the tsa timestamp to be later than the signing time as well. (given the timestamp being an unsigned attribute)

My suggestion is to follow the secure by default practice for now. If users do meet this issue, we could find a way to relax this validation in the future.
@priteshbandi

Copy link
Contributor

@priteshbandi priteshbandi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost ghost merged commit 5a32333 into notaryproject:main Nov 15, 2024
@ghost ghost deleted the timestamp branch November 15, 2024 08:09
@ghost ghost mentioned this pull request Dec 12, 2024
6 tasks
This pull request was closed.
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.

3 participants