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

feat: separate future and expired checks #18

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SalladinBalwer
Copy link
Member

As the RFC says that proofs signed in the future MAY be accepted, the default behavior should then be that a proof signed in the future should NOT be accepted. See section 11.1-4

This PR adds a new default value for allowed proof age, DEFAULT_ALLOWED_PROOF_AGE, that is set to a more generous 5 minutes. It also changes the existing default time window into the future to 0 seconds.

Now if a TimeWindow is not set in the ParseOptions, future proofs will all be rejected. The functionality to control how long a proof is allowed to live is controlled by the new parse option AllowedProofAge.

Checklist before requesting a review

  • I have performed a self-review of my own code
  • I have verified that the code builds perfectly fine on my local system
  • I have added tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have verified that my code follows the style already available in the repository
  • I have made corresponding changes to the documentation

As the RFC says that proofs signed in the future MAY be accepted, the default behavior should then be that a proof signed in the future should NOT be accepted. [See section 11.1-4](https://datatracker.ietf.org/doc/html/rfc9449#section-11.1-4)

This PR adds a new default value for allowed proof age, `DEFAULT_ALLOWED_PROOF_AGE`, that is set to a more generous 5 minutes. It also changes the existing default time window into the future to 0 seconds.

Now if a `TimeWindow` is not set in the `ParseOptions`, future proofs will all be rejected. The functionality to control how long a proof is allowed to live is controlled by the new parse option `AllowedProofAge`.
@SalladinBalwer SalladinBalwer added the enhancement New feature or request label Jun 25, 2024
@SalladinBalwer SalladinBalwer self-assigned this Jun 25, 2024
@SalladinBalwer SalladinBalwer requested a review from a team as a code owner June 25, 2024 13:47
@SalladinBalwer SalladinBalwer enabled auto-merge (squash) June 25, 2024 13:59
@SalladinBalwer
Copy link
Member Author

I appreciate the effort @chrlmrtnssn but I need an approval from a fellow maintainer.

@a354dpa @EmmaAndersen Can you help me out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants