From 005310ddb0707b98cc5c7bd390044346a3f70808 Mon Sep 17 00:00:00 2001 From: Mike Ounsworth Date: Mon, 22 Jul 2024 12:24:31 +1000 Subject: [PATCH] Making the python tolerant of multiple submissions of the same alg --- src/test_certs_r3.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/test_certs_r3.sh b/src/test_certs_r3.sh index 22a77d3..806e6b8 100755 --- a/src/test_certs_r3.sh +++ b/src/test_certs_r3.sh @@ -30,7 +30,17 @@ test_ta () { tafileBasename=$(basename $tafile) - oid=${tafileBasename%_ta.pem} # remove the suffix "_ta.pem" + + # strip off the file suffix to get the OID name + if [[ $(expr match "$tafileBasename" ".*_ta.pem") != 0 ]]; then + oid=${tafileBasename%_ta.pem} + elif [[ $(expr match "$tafileBasename" ".*_ta.der") != 0 ]]; then + oid=${tafileBasename%_ta.der} + elif [[ $(expr match "$tafileBasename" ".*_ta.der.pem") != 0 ]]; then + oid=${tafileBasename%_ta.der.pem} + else # It's some other filename + printf "ERROR: file name is not in the expected format: %s\n" $tafileBasename + return # some artifacts submit multiple copies of the same cert as .pem, .der, etc. Just skip the second one if [[ $(expr match "$alreadyTestedOIDs" ".*$oid.*") != 0 ]]; then