24 Commits

Author SHA1 Message Date
Phil Davis
d48097695b feature: validate commits in reverse date-time order when MAX_COMMITS_TO_CHECK is used
All checks were successful
Validate Trusted Timestamps Actions Demo / Validate (push) Successful in 28m9s
This ensures that the most recent commits are the ones that are validated.
2025-06-03 17:21:42 +05:45
Phil Davis
f712aa0822 chore: adjust comment about MAX_COMMITS_TO_CHECK
All checks were successful
Validate Trusted Timestamps Actions Demo / Validate (push) Successful in 14m39s
2025-06-02 15:32:48 +05:45
Phil Davis
8aba6e98d1 fix: stop correctly when MAX_COMMITS_TO_CHECK is reached
All checks were successful
Validate Trusted Timestamps Actions Demo / Validate (push) Successful in 11m40s
2025-06-02 14:32:23 +05:45
Phil Davis
4437b66f67 feature: default to checking all commits
All checks were successful
Validate Trusted Timestamps Actions Demo / Validate (push) Successful in 13m47s
2025-05-29 09:55:57 +05:45
Phil Davis
aabd314dde feature: limit the number of commits to be validated
All checks were successful
Validate Trusted Timestamps Actions Demo / Validate (push) Successful in 49s
Signed-off-by: Phil Davis <phil@jankaritech.com>
2025-05-28 10:56:06 +05:45
Phil Davis
2976a241af only validate each commit once
All checks were successful
Validate Trusted Timestamps Actions Demo / Validate (push) Successful in 2m8s
2025-03-18 13:47:27 +05:45
Artur Neumann
d5c7b22b53 follow redirects when downloading certificate 2025-02-13 12:09:11 +05:45
Artur Neumann
d22f203ab5 script to validate whether the hash of the trustanchors folder changed
this is useful to make sure the same set of TSA are used on different
machines and that they haven't been changed.
E.g. I want to make sure I use the same TSA on my local machine as in CI
and I want to make sure the imported certificates in CI are the same as
in my local machine, so that I can trust them.
2025-01-24 13:42:46 +05:45
Artur Neumann
f397c5f7fd set execute permission on hooks
that way one does not need to remember to set the permissions after
copieng the hooks
2025-01-24 13:34:46 +05:45
3a2668f7ad Merge pull request 'fix comparison' (#2) from fixComparison into main
Reviewed-on: #2
Reviewed-by: phil <phil@jankaritech.eu>
2025-01-24 06:55:07 +00:00
Artur Neumann
d134bc0c11 fix comparison
spaces are needed around the comparison operator.

See https://github.com/koalaman/shellcheck/wiki/SC2077

This fixes the issue that even `validate.sh` finds an issue the return
code is `0`
2025-01-10 16:24:48 +05:45
Artur Neumann
0e523bd1ee fix running validate with -v
running ./.git/hooks/validate.sh -v gives me

Assertion failed: Precondition: hash -v must have length 64.
Backtrace:
  [1]: ./.git/hooks/timestamping : extract_token_from_commit line 200
  [2]: ./.git/hooks/validate.sh : validate_commit line 97
  [3]: ./.git/hooks/validate.sh : validate_commit_and_parents line 300
  [4]: ./.git/hooks/validate.sh : main line 329

this commit fixes the issue
2025-01-10 15:52:58 +05:45
Benedikt Trefzer
596f084eff make echo_info work if no tlsa is configured
the echo_info function is defined in the timestamp file
which should be sourced before using any function from there.
2021-12-18 12:42:39 +01:00
Matthias Bühlmann
d64cdb7825 If a new TSA is added for the first time, timestamp tokens need
to be requested twice for it (once with embedded certificate chain
and once without). If such a TSA url signs tokens using multiple,
alternating certificates, more than two iterations of token requests
might be necessary.
2021-03-10 20:15:58 +01:00
Matthias Bühlmann
9e458dfba3 Fixed an issue with colliding local and global variables. 2021-02-22 21:21:01 +01:00
Matthias Bühlmann
eda9286fb1 Updated documentation & made file checks more robust. 2021-02-22 20:13:03 +01:00
Matthias Bühlmann
83c16a2f77 Changed validate.sh to only trust latest timestamp commit version
added arguments to validate.sh
--verbose to generate verbose output
--minversion to specify minimum timestamp commit version to be trust
2021-02-21 19:19:27 +01:00
Matthias Bühlmann
80034aeb78 Changed digest that is being timestamped
Changed digest that is being stamped from $parent_commit_hash, to
shaX(parent:$parent_commit_hash,tree:$tree_hash)
where shaX is the hash function used by the repository.
This change is so that the timestamp added also timestamps the
LTV data that is being added with the timestamp commit.

This LTV data now also contains CRLs for the LAST timestamp commit.
This ensures that timestamp lifetime of old timestamps gets
arbitrarily extended into the future with every new timestamp
added to the repository.

Further changes:
-Updated documentation
-updated schematics and changed from SVG to PNG
-added assertions, pre- and post-conditions
-added version number to timestamp commits as trailer
-added hashing algorithm used as trailer
-added digest being timestamped as trailer
-added the string that is hashed to get the digest as traile
-improved log messages of validate.sh
2021-02-21 18:19:05 +01:00
Matthias Bühlmann
0ed310cf9a Improved error reporting if TSA url does not reply with timestamp response.
Corrected simplified merkle-tree schematic.
2021-02-17 21:49:59 +01:00
Matthias Bühlmann
86c39dc7c4 Updated documentation.
Improved script verbosity.
Locally added second TSA so that commits in this repository will contain
two timestamps as an example.
2021-02-16 19:54:19 +01:00
Matthias Bühlmann
d6ef1a5b02 Added verification script to verify all timestamps in the repository.
Updated Documentation.
2021-02-16 10:05:26 +01:00
Matthias Bühlmann
c3a04209da Updated Documentation, fixed variable name. 2021-02-15 19:41:24 +01:00
Matthias Bühlmann
d8d4a4b506 Exit post-commit hook if no TSA is configured
instead of aborting commit.
2021-02-15 18:02:38 +01:00
Matthias Bühlmann
e96ddc7f90 Git hooks to automatically timestamp commits using RFC3161 and RFC5816 tokens 2021-02-11 09:09:39 +01:00