Skip to content

Commit a3bf4dd

Browse files
committed
curl-pkg.sh: run checksec on linux build results
If `checksec` tool if available. Also show per-function fortify details.
1 parent fc2f819 commit a3bf4dd

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

_build-runner.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ if [ ! -f .cw-initialized ]; then
3434
Linux*)
3535
[[ "${CW_CONFIG:-}" = *'boringssl'* ]] && extra="${extra} golang nasm"
3636
[[ "${CW_CONFIG:-}" = *'musl'* ]] && extra="${extra} musl musl-dev musl-tools"
37+
if [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
38+
extra="${extra} checksec"
39+
fi
3740
# shellcheck disable=SC2086
3841
apt-get --quiet 2 --option Dpkg::Use-Pty=0 install \
3942
curl git gpg rsync python3-pefile make cmake \

_ci-linux-debian.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extra=''
1515
[[ "${CW_CONFIG:-}" = *'win'* ]] && extra="${extra} mingw-w64 osslsigncode wine64"
1616

1717
if [[ "${CW_CONFIG:-}" = *'linux'* ]]; then
18+
extra="${extra} checksec"
1819
if [[ "${CW_CONFIG:-}" = *'musl'* ]]; then
1920
extra="${extra} musl musl-dev musl-tools"
2021
# for openssl 'secure-memory' feature

curl-pkg.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
otool -L "${f}"
7676
elif [ "${_OS}" = 'linux' ]; then
7777
"${_READELF}" --file-header --dynamic "${f}"
78+
if command -v checksec >/dev/null 2>&1; then
79+
checksec --format=json --file="${f}" | jq
80+
checksec --format=xml --fortify-file="${f}" # duplicate keys in json, cannot apply jq
81+
fi
7882
# Show linked GLIBC versions
7983
# https://en.wikipedia.org/wiki/Glibc#Version_history
8084
if [ "${_CPU}" = 'a64' ]; then

0 commit comments

Comments
 (0)