File: openssl_fips_fingerprint

package info (click to toggle)
openssl097 0.9.7k-3.1
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 18,564 kB
  • ctags: 24,034
  • sloc: ansic: 178,335; asm: 19,384; perl: 17,782; makefile: 13,645; cpp: 4,379; sh: 2,687; lisp: 23
file content (31 lines) | stat: -rwxr-xr-x 898 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
#
# Check the library fingerprint and generate an executable fingerprint, or
# return an error

lib=$1
exe=$2
ext=${HMAC_EXT:-sha1}

# 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
    LD_LIBRARY_PATH=$TOP; export LD_LIBRARY_PATH
else
    LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH
fi

echo "Checking library fingerprint for $lib"
openssl sha1 -hmac etaonrishdlcupfm $lib | sed "s/(.*\//(/" | diff -w $lib.sha1 - || { echo "$libs fingerprint mismatch"; exit 1; }

[ -x $exe.exe ] && exe=$exe.exe

echo "Making fingerprint for $exe"
openssl sha1 -hmac etaonrishdlcupfm -binary $exe > $exe.$ext || rm $exe.$ext