summaryrefslogtreecommitdiffstats
path: root/security/nss/automation/taskcluster/scripts/run_hacl.sh
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/automation/taskcluster/scripts/run_hacl.sh')
-rwxr-xr-xsecurity/nss/automation/taskcluster/scripts/run_hacl.sh62
1 files changed, 61 insertions, 1 deletions
diff --git a/security/nss/automation/taskcluster/scripts/run_hacl.sh b/security/nss/automation/taskcluster/scripts/run_hacl.sh
index f9831d24fd..f2c20a0ae3 100755
--- a/security/nss/automation/taskcluster/scripts/run_hacl.sh
+++ b/security/nss/automation/taskcluster/scripts/run_hacl.sh
@@ -12,7 +12,7 @@ set -e -x -v
# Get the HACL* source, containing a snapshot of the C code, extracted on the
# HACL CI.
git clone -q "https://github.com/hacl-star/hacl-star" ~/hacl-star
-git -C ~/hacl-star checkout -q 72f9d0c783cb716add714344604d591106dfbf7f
+git -C ~/hacl-star checkout -q 0f136f28935822579c244f287e1d2a1908a7e552
# Format the C snapshot.
cd ~/hacl-star/dist/mozilla
@@ -33,6 +33,11 @@ files=($(find ~/nss/lib/freebl/verified/internal -type f -name '*.[ch]'))
for f in "${files[@]}"; do
file_name=$(basename "$f")
hacl_file=($(find ~/hacl-star/dist/mozilla/internal/ -type f -name $file_name))
+ if [ $file_name == "Hacl_Ed25519.h" \
+ -o $file_name == "Hacl_Ed25519_PrecompTable.h" ]
+ then
+ continue;
+ fi
diff $hacl_file $f
done
@@ -49,5 +54,60 @@ for f in "${files[@]}"; do
then
continue;
fi
+
+ if [ $file_name == "Hacl_Ed25519.h" \
+ -o $file_name == "Hacl_Ed25519.c" ]
+ then
+ continue;
+ fi
diff $hacl_file $f
done
+
+# Here we process the code that's not located in /hacl-star/dist/mozilla/ but
+# /hacl-star/dist/gcc-compatible.
+
+cd ~/hacl-star/dist/gcc-compatible
+cp ~/nss/.clang-format .
+find . -type f -name '*.[ch]' -exec clang-format -i {} \+
+
+patches=($(find ~/nss/automation/taskcluster/scripts/patches/ -type f -name '*.patch'))
+for f in "${patches[@]}"; do
+ file_name=$(basename "$f")
+ file_name="${file_name%.*}"
+ if_internal="${file_name##*.}"
+ if [ $if_internal == "internal" ]
+ then
+ file_name="${file_name%.*}"
+ patch_file=($(find ~/hacl-star/dist/gcc-compatible/internal/ -type f -name $file_name))
+ else
+ patch_file=($(find ~/hacl-star/dist/gcc-compatible/ -type f -name $file_name -not -path "*/hacl-star/dist/gcc-compatible/internal/*"))
+ fi
+ if [ ! -z "$patch_file" ]
+ then
+ patch $patch_file $f
+ fi
+done
+
+files=($(find ~/nss/lib/freebl/verified/internal -type f -name '*.[ch]'))
+for f in "${files[@]}"; do
+ file_name=$(basename "$f")
+ hacl_file=($(find ~/hacl-star/dist/gcc-compatible/internal/ -type f -name $file_name))
+ if [ $file_name != "Hacl_Ed25519.h" \
+ -a $file_name != "Hacl_Ed25519_PrecompTable.h" ]
+ then
+ continue;
+ fi
+ diff $hacl_file $f
+done
+
+files=($(find ~/nss/lib/freebl/verified/ -type f -name '*.[ch]' -not -path "*/freebl/verified/internal/*"))
+for f in "${files[@]}"; do
+ file_name=$(basename "$f")
+ hacl_file=($(find ~/hacl-star/dist/gcc-compatible/ -type f -name $file_name -not -path "*/hacl-star/dist/gcc-compatible/internal/*"))
+ if [ $file_name != "Hacl_Ed25519.h" \
+ -a $file_name != "Hacl_Ed25519.c" ]
+ then
+ continue;
+ fi
+ diff $hacl_file $f
+done \ No newline at end of file