Blame SOURCES/sign-modules

910dbc
#! /bin/bash
910dbc
910dbc
moddir=$1
910dbc
910dbc
modules=`find $moddir -name *.ko`
910dbc
910dbc
MODSECKEY="./signing_key.priv"
910dbc
MODPUBKEY="./signing_key.x509"
910dbc
910dbc
for mod in $modules
910dbc
do
910dbc
    dir=`dirname $mod`
910dbc
    file=`basename $mod`
910dbc
910dbc
    ./scripts/sign-file sha256 ${MODSECKEY} ${MODPUBKEY} ${dir}/${file}
910dbc
    rm -f ${dir}/${file}.{sig,dig}
910dbc
done
910dbc
910dbc
RANDOMMOD=$(find $moddir -type f -name '*.ko' | sort -R | tail -n 1)
910dbc
if [ "~Module signature appended~" != "$(tail -c 28 $RANDOMMOD)" ]; then
910dbc
	echo "*** Modules are unsigned! ***"
910dbc
	exit 1
910dbc
fi
910dbc
910dbc
exit 0