home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 05_common.mo / usr / bin / openssl_fips_fingerprint < prev    next >
Encoding:
Text File  |  2005-06-13  |  876 b   |  31 lines

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