File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,8 +20,9 @@ verify_sha256() {
2020 elif command -v shasum > /dev/null; then
2121 actual=$( shasum -a 256 " $file " | awk ' {print $1}' )
2222 else
23- echo " Warning: no sha256sum or shasum available, skipping hash verification"
24- return 0
23+ echo " Error: no sha256sum or shasum found, refusing unverified $file "
24+ rm -f " $file "
25+ return 1
2526 fi
2627
2728 if [ " $actual " != " $expected " ]; then
@@ -40,6 +41,13 @@ download_bc_jars() {
4041 local lib_dir=" $LIB_DIR "
4142 local bc_url=" https://repo1.maven.org/maven2/org/bouncycastle"
4243
44+ # Require a SHA-256 tool before any download, JARs are only added to the
45+ # classpath after hash verification
46+ if ! command -v sha256sum > /dev/null && ! command -v shasum > /dev/null; then
47+ echo " failed (no sha256sum or shasum for hash verification)"
48+ return 1
49+ fi
50+
4351 echo -n " Downloading Bouncy Castle JARs (version $bc_version )... "
4452 mkdir -p " $lib_dir " || {
4553 echo " failed (cannot create $lib_dir )"
You can’t perform that action at this time.
0 commit comments