summaryrefslogtreecommitdiffstats
path: root/fips/openssl_fips_fingerprint
blob: 6d86c900334115c3fc1585a2e4132d9b3e51eddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/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
if [ "X$TOP" != "X" ]
then
    PATH=$PATH:$TOP/apps
fi

elib=`echo $lib| sed 's/\//\\\\\//g'`
echo "Checking library fingerprint for $lib"
openssl sha1 $lib | sed "s/$elib/libcrypto.a/" | diff -u ${lib%.a}.sha1 - || { echo "$libs fingerprint mismatch"; exit 1; }

echo "Making fingerprint for $exe"
openssl sha1 -binary $exe > $exe.sha1