Skip to content
suit Artifact [49415f8919]
Login

Artifact [49415f8919]

Artifact 49415f8919081d5138a885006bc0a6759576d4e36c198b599a5da2ad64d8ed52:


#!/bin/sh
# The release binary has no fault-injection code: neither the SUIT_FAULT
# variable name nor the wrapper-name table may appear in it, nor may the
# variables that point install at a fake loader and a fake platform. The test build
# must, or this check proves nothing.
# usage: release_clean.sh RELEASE_BINARY TEST_BINARY
set -eu
release=${1:?usage: release_clean.sh RELEASE_BINARY TEST_BINARY}
dev=${2:?usage: release_clean.sh RELEASE_BINARY TEST_BINARY}
for needle in SUIT_FAULT self_path SUIT_LOADER SUIT_PLATFORM; do
    strings -a "$dev" | grep -q "$needle" || { echo "release_clean: test binary lacks '$needle'; the check is blind"; exit 1; }
    if strings -a "$release" | grep -q "$needle"; then
        echo "release_clean: FAIL release binary contains '$needle'"
        exit 1
    fi
done
echo "release_clean: ok, no fault-injection strings in $release"