From d64cdb7825aa9cd4c3726ea8ef401c71b5a1aa69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20B=C3=BChlmann?= Date: Wed, 10 Mar 2021 20:15:58 +0100 Subject: [PATCH] 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. --- hooks/post-commit | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hooks/post-commit b/hooks/post-commit index f1b5bc0..8809ae8 100644 --- a/hooks/post-commit +++ b/hooks/post-commit @@ -160,7 +160,7 @@ fi DIGEST_TO_TIMESTAMP='' -for ((i=0; i<3; i++)); do +for ((i=0;; i++)); do #add all ltv files if ls "$TMP_LTV_DIR"/*/* &> "$OUT_STREAM"; then ls "$TMP_LTV_DIR"/*/* | while read SOURCE_FILE; do @@ -180,10 +180,7 @@ for ((i=0; i<3; i++)); do break fi - #assert that this line is never reached in the second loop - assert "[ $i -lt 2 ]" "after second iteration there must be no new LTV data." - - if [ $i -eq 1 ]; then + if [ $i -gt 0 ]; then echo_info "New LTV data has been added, need to request token again." fi