~ubuntu-branches/ubuntu/lucid/openssl/lucid-security

« back to all changes in this revision

Viewing changes to fips/openssl_fips_fingerprint

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-06-13 18:15:46 UTC
  • mto: (11.1.5 squeeze)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20090613181546-vbfntai3b009dl1u
Tags: upstream-0.9.8k
ImportĀ upstreamĀ versionĀ 0.9.8k

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Check the library fingerprint and generate an executable fingerprint, or
 
4
# return an error
 
5
 
 
6
lib=$1
 
7
exe=$2
 
8
ext=${HMAC_EXT:-sha1}
 
9
 
 
10
# deal with the case where we're run from within the build and OpenSSL is
 
11
# not yet installed.  Also, make sure LD_LIBRARY_PATH is properly set in
 
12
# case shared libraries are built.
 
13
if [ "X$TOP" != "X" ]
 
14
then
 
15
    if test "$OSTYPE" = msdosdjgpp; then
 
16
        PATH="$TOP/apps;$TOP;$PATH"
 
17
    else
 
18
        PATH="$TOP/apps:$TOP:$PATH"
 
19
    fi
 
20
    LD_LIBRARY_PATH=$TOP; export LD_LIBRARY_PATH
 
21
else
 
22
    LD_LIBRARY_PATH=.; export LD_LIBRARY_PATH
 
23
fi
 
24
 
 
25
echo "Checking library fingerprint for $lib"
 
26
openssl sha1 -hmac etaonrishdlcupfm $lib | sed "s/(.*\//(/" | diff -w $lib.sha1 - || { echo "$libs fingerprint mismatch"; exit 1; }
 
27
 
 
28
[ -x $exe.exe ] && exe=$exe.exe
 
29
 
 
30
echo "Making fingerprint for $exe"
 
31
openssl sha1 -hmac etaonrishdlcupfm -binary $exe > $exe.$ext || rm $exe.$ext