Blame SOURCES/sign-modules

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