X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=fips%2Ffipsld;h=6184e2064e409f73bfa2541c7b4f8378ac9aaef1;hp=34b6e01bc0ca8e97a471ff299cc7f89ae502c49c;hb=e3fed9f41e47cd859d25a8aa87dcb515f47d30db;hpb=ed0a35f222b3bd23d887205e7fef37a55045c0d1 diff --git a/fips/fipsld b/fips/fipsld index 34b6e01bc0..6184e2064e 100755 --- a/fips/fipsld +++ b/fips/fipsld @@ -88,7 +88,14 @@ case `basename "${TARGET}"` in lib*|*.dll) # must be linking a shared lib... # Shared lib creation can be taking place in the source # directory only, but fipscanister.o can reside elsewhere... - FINGERTYPE="${THERE}/fips/fips_standalone_sha1" + + if [ -x "${THERE}/fips/fips_standalone_sha1" ]; then + FINGERTYPE="${THERE}/fips/fips_standalone_sha1" + PREMAIN_DSO="${THERE}/fips/fips_premain_dso" + elif [ -x "${THERE}/bin/fips_standalone_sha1" ]; then + FINGERTYPE="${THERE}/bin/fips_standalone_sha1" + PREMAIN_DSO="./fips_premain_dso" + fi # verify fipspremain.c against its detached signature... ${FINGERTYPE} "${PREMAIN_C}" | sed "s/(.*\//(/" | \ @@ -99,13 +106,17 @@ lib*|*.dll) # must be linking a shared lib... diff -w "${CANISTER_O}.sha1" - || \ { echo "${CANISTER_O} fingerprint mismatch"; exit 1; } + [ -z "${FIPSLD_LIBCRYPTO}" -a -f "${THERE}/libcrypto.a" ] && \ + FIPSLD_LIBCRYPTO="${THERE}/libcrypto.a" + + # Temporarily remove fipscanister.o from libcrypto.a! # We are required to use the standalone copy... - if [ -f "${THERE}/libcrypto.a" ]; then - if ar d "${THERE}/libcrypto.a" fipscanister.o; then - (ranlib "${THERE}/libcrypto.a") 2>/dev/null || : - trap 'ar r "${THERE}/libcrypto.a" "${CANISTER_O}"; - (ranlib "${THERE}/libcrypto.a") 2>/dev/null || :; + if [ -n "${FIPSLD_LIBCRYPTO}" ]; then + if ar d "${FIPSLD_LIBCRYPTO}" fipscanister.o; then + (ranlib "${FIPSLD_LIBCRYPTO}") 2>/dev/null || : + trap 'ar r "${FIPSLD_LIBCRYPTO}" "${CANISTER_O}"; + (ranlib "${FIPSLD_LIBCRYPTO}") 2>/dev/null || :; sleep 1; touch -c "${TARGET}"' 0 fi @@ -118,7 +129,7 @@ lib*|*.dll) # must be linking a shared lib... # generate signature... if [ -z "${FIPS_SIG}" ]; then - SIG=`"${THERE}/fips/fips_premain_dso" "${TARGET}"` + SIG=`"${PREMAIN_DSO}" "${TARGET}"` else SIG=`"${FIPS_SIG}" -dso "${TARGET}"` fi