Skip to content

Commit ad49c5b

Browse files
committed
Validating contents of resources fetched via insecure channels
1 parent ceb39e2 commit ad49c5b

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

fetch.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,14 @@ Set -Ddest=LOCATION on the command line
359359
<target name="netrexx"
360360
description="load NetRexx compiler"
361361
depends="init-no-m2,-setup-temp-cache,-fetch-netrexx,-fetch-netrexx-no-commons-net">
362+
<checksum file="${temp.dir}/NetRexx.zip" algorithm="SHA-256" property="${netrexx.sha256}" verifyProperty="netrexx.hash.matches"/>
363+
<fail message="NetRexx.zip fetched via ftp has an unexpected SHA-256 checksum, the file may have been tampered with">
364+
<condition>
365+
<not>
366+
<istrue value="${netrexx.hash.matches}"/>
367+
</not>
368+
</condition>
369+
</fail>
362370
<copy todir="${dest.dir}" flatten="true">
363371
<zipfileset src="${temp.dir}/NetRexx.zip">
364372
<include name="NetRexx\lib\NetRexxC.jar"/>

lib/libraries.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ m2.sha1.checksum=b09be554228d66d208e5fef5266844aacf443abc
2828
# Repository to use by default for fetching dependencies.
2929
m2.repo=https://repo1.maven.org/maven2/
3030

31+
# hashes of libraries loaded over insecure connections
32+
netrexx.sha256=1f99f054e9b1e412d29823088f3fa7cfce90a7af25d907a60a6d7908a6b97ea4
33+
3134
# Versions of different libraries. Please keep in alphabetical order, except
3235
# when a specific dependency forces them to be out-of-order
3336
ivy.version=2.4.0

0 commit comments

Comments
 (0)