build(userspace): avoid openssl dep for engine fields verification

Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
Leonardo Grasso 2020-08-24 16:11:21 +02:00 committed by poiana
parent 68f937f5e8
commit b7e75095e6
2 changed files with 2 additions and 8 deletions

View File

@ -154,7 +154,7 @@ configure_file(config_falco.h.in config_falco.h)
add_custom_command(
TARGET falco
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/verify_engine_fields.sh ${CMAKE_SOURCE_DIR} ${OPENSSL_BINARY}
COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/verify_engine_fields.sh ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Comparing engine fields checksum in falco_engine.h to actual fields")

View File

@ -3,14 +3,8 @@
set -euo pipefail
SOURCE_DIR=$1
OPENSSL=$2
if ! command -v "${OPENSSL}" version > /dev/null 2>&1; then
echo "No openssl command at ${OPENSSL}"
exit 1
fi
NEW_CHECKSUM=$(./falco --list -N | ${OPENSSL} dgst -sha256 | awk '{print $2}')
NEW_CHECKSUM=$(./falco --list -N | sha256sum | awk '{print $1}')
CUR_CHECKSUM=$(grep FALCO_FIELDS_CHECKSUM "${SOURCE_DIR}/userspace/engine/falco_engine_version.h" | awk '{print $3}' | sed -e 's/"//g')