openssl/fips/openssl_fips_fingerprint

31 lines
876 B
Plaintext
Raw Normal View History

2004-05-11 12:46:24 +00:00
#!/bin/sh
#
# Check the library fingerprint and generate an executable fingerprint, or
# return an error
lib=$1
exe=$2
# deal with the case where we're run from within the build and OpenSSL is
# not yet installed. Also, make sure LD_LIBRARY_PATH is properly set in
# case shared libraries are built.
if [ "X$TOP" != "X" ]
then
if test "$OSTYPE" = msdosdjgpp; then
PATH="$TOP/apps;$TOP;$PATH"
else
PATH="$TOP/apps:$TOP:$PATH"
fi
2004-05-11 12:46:24 +00:00
LD_LIBRARY_PATH=$TOP; export LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH
fi
echo "Checking library fingerprint for $lib"
2004-12-10 16:30:34 +00:00
openssl sha1 -hmac etaonrishdlcupfm $lib | sed "s/(.*\//(/" | diff -w $lib.sha1 - || { echo "$libs fingerprint mismatch"; exit 1; }
2004-05-11 12:46:24 +00:00
2004-12-09 18:13:46 +00:00
[ -x $exe.exe ] && exe=$exe.exe
2004-05-11 12:46:24 +00:00
echo "Making fingerprint for $exe"
2004-12-09 18:13:46 +00:00
openssl sha1 -hmac etaonrishdlcupfm -binary $exe > $exe.sha1 || rm $exe.sha1