Skip to content
This repository was archived by the owner on May 1, 2022. It is now read-only.

Commit 733a090

Browse files
committed
Always check shortest trust chain
1 parent e311785 commit 733a090

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/check.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ if [ "$(jq -r '.["validation"]["nss"]["trusted_path"]' "$1")" != "true" ]; then
2929
fi
3030

3131
base="$(dirname "$1")"
32-
certs=($(jq -r --arg pre "$base/" --arg post .der '.["validation"]["nss"]["paths"][0][0:-1]|reverse|.[]|$pre+.+$post' "$1"))
32+
certs=($(jq -r --arg pre "$base/" --arg post .der '.["validation"]["nss"]["paths"]|sort_by(.|length)[0][0:-1]|reverse|.[]|$pre+.+$post' "$1"))
3333

3434
if [ $debug = no ]; then
35-
cat "${certs[@]}" | ./bin/Debug/x509 --check "$base/cacert.der" -
35+
cat "${certs[@]}" | ./bin/Debug/x509 --check "$base/nss.der" -
3636
exit $?
3737
else
3838
for cert in "${certs[@]}"; do

0 commit comments

Comments
 (0)