File tree 1 file changed +10
-5
lines changed
1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,25 @@ printf "Build time: %s\n\n" "$(date)" > $logfile
13
13
14
14
alreadyTestedOIDs=" ;"
15
15
16
+ _FILENAME_REGEX = re.compile(r' ^(?P<friendlyName>.*)-(?P<oid>[^\.0-9]+)_ta.der$' , re.IGNORECASE)
17
+
16
18
# Requires an input: the TA file to test
17
19
test_ta () {
18
20
tafile=$1
19
21
resultsfile=$2
20
22
21
23
tafileBasename=$( basename $tafile )
22
24
25
+ # strip off the friendly name
26
+ tafileBasename=$( echo $tafileBasename | egrep -o ' [^-]+_ta.der$' )
27
+
28
+
23
29
# strip off the file suffix to get the OID name
24
- if [[ $( expr match " $tafileBasename " " .*_ta\.pem$" ) != 0 ]]; then
25
- oid=${tafileBasename% _ta.pem}
26
- elif [[ $( expr match " $tafileBasename " " .*_ta\.der$" ) != 0 ]]; then
30
+ if [[ $( expr match " $tafileBasename " " .*_ta\.der$" ) != 0 ]]; then
27
31
oid=${tafileBasename% _ta.der}
28
- elif [[ $( expr match " $tafileBasename " " .*_ta\.der\.pem$" ) != 0 ]]; then
29
- oid=${tafileBasename% _ta.der.pem}
32
+
33
+ printf " DEBUG: filename: $tafileBasename , OID: $oid \n"
34
+
30
35
else # It's some other filename
31
36
printf " ERROR: file name is not in the expected format: %s\n" $tafileBasename
32
37
printf " ERROR: file name is not in the expected format: %s\n" $tafileBasename >> $logfile
You can’t perform that action at this time.
0 commit comments