From 30fc34625c71f4242e232e45fec53fdf267f0adf Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 14 Jun 2005 12:29:34 +0000 Subject: [PATCH] Make sure detached fingerprints are installed [as well as minor cygwin and hpux updates]. --- Makefile.org | 15 ++++++++++++--- apps/Makefile | 27 ++++++++++++++++++++------- fips/openssl_fips_fingerprint | 2 +- test/Makefile | 21 ++++++++++++--------- 4 files changed, 45 insertions(+), 20 deletions(-) diff --git a/Makefile.org b/Makefile.org index 98cb2e98bd..1900e89e8c 100644 --- a/Makefile.org +++ b/Makefile.org @@ -343,7 +343,7 @@ do_cygwin-shared: [ "$(PLATFORM)" = "mingw" ] && shlib=$${i}eay32.dll; \ [ -f apps/$$shlib ] && rm apps/$$shlib; \ [ -f test/$$shlib ] && rm test/$$shlib; \ - base=; [ $$i = "crypto" ] && base=-Wl,--image-base,0x61200000; \ + base=; [ $$i = "crypto" ] && base=-Wl,--image-base,0x63000000; \ ( set -x; ${CC} ${SHARED_LDFLAGS} \ -shared $$base -o $$shlib \ -Wl,-Bsymbolic \ @@ -518,7 +518,7 @@ do_hpux-shared: expr $(PLATFORM) : 'hpux64' > /dev/null && ALLSYMSFLAGS='-Wl,+forceload'; \ ( set -x; ${CC} ${SHARED_LDFLAGS} \ -Wl,-B,symbolic,+vnocompatwarnings,-z,+h,$$shlib \ - -o $$shlib $$ALLSYMSFLAGS lib$$i.a -ldld ) || exit 1; \ + -o $$shlib $$ALLSYMSFLAGS,lib$$i.a -ldld ) || exit 1; \ chmod a=rx $$shlib; \ done @@ -812,7 +812,16 @@ install_sw: if [ "$(PLATFORM)" != "Cygwin" ]; then \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new \ + $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ + sig="$$i.$${HMAC_EXT:-sha1}"; \ + if [ -f $$sig ]; then \ + echo installing $$sig; \ + cp $$sig $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig.new; \ + chmod 444 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig.new; \ + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig.new \ + $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$sig; \ + fi; \ else \ c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ diff --git a/apps/Makefile b/apps/Makefile index dd2f1d0af5..5ca70480e7 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -101,8 +101,17 @@ install: (echo installing $$i; \ cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ - done; + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new \ + $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i; \ + sig="$$i.$${HMAC_EXT:-sha1}"; \ + if [ -f $$sig ]; then \ + echo installing $$sig; \ + cp $$sig $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig.new; \ + chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig.new; \ + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig.new \ + $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$sig; \ + fi; \ + ) done; @for i in $(SCRIPTS); \ do \ (echo installing $$i; \ @@ -143,16 +152,20 @@ $(DLIBCRYPTO): $(EXE): progs.h $(E_OBJ) $(PROGRAM).o $(DLIBCRYPTO) $(DLIBSSL) $(RM) $(EXE) + SHARED_LIBS="$(SHARED_LIBS)"; \ if [ "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ + SHARED_LIBS=""; \ + fi; \ + if [ -z "$(SHARED_LIBS)" ]; then \ set -x; $${CC:-$(CC)} -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(DLIBSSL) $(LIBKRB5) $(DLIBCRYPTO) $(EX_LIBS) ; \ - elif [ -z "$(SHARED_LIBS)" ]; then \ - set -x; $${CC:-$(CC)} -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ else \ set -x; LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ $(CC) -o $(EXE) $(CFLAGS) $(PROGRAM).o $(E_OBJ) $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ - fi - if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(EXE); \ + fi; \ + if [ -z "$$SHARED_LIBS" ]; then \ + if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $(EXE); \ + fi; \ fi -(cd ..; \ OPENSSL="`pwd`/util/opensslwrap.sh"; export OPENSSL; \ diff --git a/fips/openssl_fips_fingerprint b/fips/openssl_fips_fingerprint index eb8c9c253d..f59a67d537 100755 --- a/fips/openssl_fips_fingerprint +++ b/fips/openssl_fips_fingerprint @@ -23,7 +23,7 @@ else fi echo "Checking library fingerprint for $lib" -openssl sha1 -hmac etaonrishdlcupfm $lib | sed "s/(.*\//(/" | diff -w $lib.$ext - || { echo "$libs fingerprint mismatch"; exit 1; } +openssl sha1 -hmac etaonrishdlcupfm $lib | sed "s/(.*\//(/" | diff -w $lib.sha1 - || { echo "$libs fingerprint mismatch"; exit 1; } [ -x $exe.exe ] && exe=$exe.exe diff --git a/test/Makefile b/test/Makefile index 9975173752..1845468824 100644 --- a/test/Makefile +++ b/test/Makefile @@ -322,18 +322,21 @@ $(DLIBSSL): $(DLIBCRYPTO): (cd ..; $(MAKE) DIRS=crypto all) -BUILD_CMD=if [ "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ +BUILD_CMD=SHARED_LIBS="$(SHARED_LIBS)"; \ + if [ "$(SHLIB_TARGET)" = "darwin-shared" ] ; then \ + SHARED_LIBS=""; \ + fi; \ + if [ -z "$$SHARED_LIBS" ]; then \ set -x; $${CC:-$(CC)} -o $$target$(EXE_EXT) $(CFLAGS) $$target.o $(PEX_LIBS) $(DLIBSSL) $(LIBKRB5) $(DLIBCRYPTO) $(EX_LIBS) ; \ - elif [ -z "$(SHARED_LIBS)" ]; then \ - set -x; $${CC:-$(CC)} -o $$target$(EXE_EXT) $(CFLAGS) $$target.o $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ - else \ - set -x; LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ + else set -x; LD_LIBRARY_PATH=..:$$LD_LIBRARY_PATH \ $(CC) -o $$target$(EXE_EXT) $(CFLAGS) $$target.o $(PEX_LIBS) $(LIBSSL) $(LIBKRB5) $(LIBCRYPTO) $(EX_LIBS) ; \ - fi; + fi -FIPS_BUILD_CMD=$(BUILD_CMD) \ - if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ - TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $$target; \ +FIPS_BUILD_CMD=$(BUILD_CMD); \ + if [ -z "$$SHARED_LIBS" ]; then \ + if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \ + TOP=$(TOP) $(TOP)/fips/openssl_fips_fingerprint $(TOP)/libcrypto.a $$target; \ + fi; \ fi $(FIPS_AESTEST)$(EXE_EXT): $(FIPS_AESTEST).o $(DLIBCRYPTO) -- 2.25.1